Friday, April 22, 2011

Google docs to Excel (somethings wrong here...)

It appears that if you are using Google docs to do excel work you might run into a little trouble with dates (1/1/11) when you move to Microsoft Excel (Mac OS X).

If you create a google spreadsheet and insert the date 3/1/11, save it to your desktop and open it with Microsoft Excel (Mac OS X) everything appears to look fine, but it isn't. If you attempt to copy the date from the original spreadsheet to another spreadsheet the date will change to four years in the future, 1/1/15.

Come to find out, Google has Day 1 listed as 1/1/1900 where Microsoft has it listed as 1/1/1904, a difference of 4 years, hence the leap from 11 to 15.
(special thanks to MichaelRH, http://www.google.com/support/forum/p/Google%20Docs/thread?tid=2d848674b93637f6&hl=en)

However, as pointed out by my brother Mike if you use libre office you get the date you want and none of the funny business. So as Mike so eloquently put it, "libre office ftw".

Thursday, April 7, 2011

Xen: Duplicate MAC addresses/UUID's

I have not quite gotten to the point of using the migrate feature with virt-manager to try and get an image file from one server to another, but rather I have done an scp of the domU image and its config file.

However, if you have done this once already you will run into several problems with having a duplicate MAC address and a duplicate uuid. To solve these two issues you can do the following:

new random MAC address:
import random
mac = [ 0x00, 0x16, 0x3e,
 random.randint(0x00, 0x7f),
 random.randint(0x00, 0xff),
 random.randint(0x00, 0xff) ]
print ':'.join(map(lambda x: "%02x" % x, mac))

new uuid:
in centos you can run 'uuidgen' to get a new uuid.

Take these two pieces of information and edit the domU configuration file. Of course you will also need to make sure that you change the name of the domU as well.

Steps:
scp -p domU.img username(root?)@ip:/location(e.g. /var/lib/xen/images/domU.img)
scp -p domU username(root?)@ip:/location(e.g. /etc/xen/domU)

vim domU[config]
name = "[domU Name]"
uuid = "[new uuid]" (e.g. E793FDB1-7180-4AE8-92EC-742D48335058)
...
vif = "[ mac=[new MAC address],...]" (e.g. 00:16:3e:17:dd:0c)

save and quit, and your new domU should be ready to start.