With a little side of applesauce...

Sunday, April 15, 2007

gnome-power-manager - suspend from the command line

In a not very intuitive manner, you can send your laptop into hibernation by using the following command:

dbus-send --session --dest=org.gnome.PowerManager --type=method_call --print-reply --reply-timeout=2000 /org/gnome/PowerManager org.gnome.PowerManager.Hibernate

To suspend to RAM:

dbus-send --session --dest=org.gnome.PowerManager --type=method_call --print-reply --reply-timeout=2000 /org/gnome/PowerManager org.gnome.PowerManager.Suspend

I would put that in a shell script in /usr/local/bin/mysuspend:

#!/bin/sh

dbus-send --session --dest=org.gnome.PowerManager --type=method_call --print-reply --reply-timeout=2000 /org/gnome/PowerManager org.gnome.PowerManager.Hibernate

Then chmod it to:

chmod 755 /usr/local/bin/mysuspend

You could then run "mysuspend" from anywhere, and execute the same command above... I found this at:
http://live.gnome.org/GnomePowerManager/FAQ#head-ca9ddd6e2954f42fa6fb45b392ece499a6f8ab6f

Saturday, April 14, 2007

Firefox - migrating profiles from Windows to Linux (and back again!)

You can actually move all of your firefox settings to linux by copying your:

c:\Documents and Settings\myuser\Application Data\Mozilla\Firefox\Profiles\*.default

folder to your linux box at:

~/.mozilla/firefox

Then start close firefox, then start firefox like this:

firefox -ProfileManager

When the profile window starts up, click on create profile:

Next->Choose Folder...

and browse to the location of the *.default folder which you have copied, then give the profile a name and hit "Finish". You then highlight the new profile, click "Don't ask at startup", and then hit "Start Firefox".

All of your settings should be there now, including add-ons, and search engines.

BTW, this works going from Linux to Windows as well. Just reverse the process :)

NOTES:
1. To see the Application Data folder, you need to change Windows Explorer's options:

Tools->Folder Options...

Choose the View tab, then click on "Show hidden files and folders". Finally, click on "Apply" and "OK". You should now see all of your hidden folders in your user's "home" directory.

2. *.default - * is just a meta-character to match whatever mozilla named your folder. They are random strings, similar to "cjdphc6b.default". Just choose the folder which you would prefer to use.

Sunday, April 8, 2007

Debian Etch is now Stable

The announcement was made on April 8, 2007:
http://www.us.debian.org/News/2007/20070408

More information can be found here:
http://www.us.debian.org/releases/stable/

Great job Debian developers!!

Happy Easter!!

Saturday, April 7, 2007

WebCalendar 1.1.2 - summary HTML causing errors in IE7

I am implementing WebCalendar for posting some events, and have found that a blank summary is replaced with "font size=", which blows up IE7 popups. IE7 returns a runtime error, and then complains with:

idiv.style is null or not an object

This error occurs when you mouse-over the title on the month.php page, and blocks the user from getting into the entry to make changes. The work-around is to use Firefox to remove the "font size=" from the summary form, and re-save the entry. I'll keep you posted to let you know if it is the FCKEditor which is causing the problem.

Friday, April 6, 2007

ConfigObj - list values (single value in list)

Since Python treats strings as lists, I was caught by surprise when a for loop with only a single value, (which used to work correctly, of course), began to set the values to characters, instead of strings... Then I realized that my configuration file had the following value for the list:

myVar = 'mystring'


Since I am using ConfigObj to create the configuration object for cwsAdmin, I visited the ConfigObj documentation:
http://www.voidspace.org.uk/python/configobj.html#the-config-file-format

and realized that I needed to set lists with single values to:

myVar = 'mystring',


Not very intuitive, and prone to cause logic problems, but thanks to the great documentation, it didn't cause too much trouble :)

InnoTek VirtualBox

VirtualBox from InnoTek:
http://www.virtualbox.org/

is a great virtual machine for Windows. Ubuntu Feisty will actually bundle it in the repositories as well. I think that this will be an equal choice for VMWare Workstation in the next 6 months, once they get the clipboard working and fix some random small issues, (ie the Caps Lock key didn't always work as expected). On 1.3.8, networking and mouse integration worked straight out of the box...

VMWare - initialization error

I was having some issues with VMWare Player starting up on my windows machine with the following cryptic error:
vmware player an internal error occurred

I then ran into the following error while starting VMWare Workstation:
Application failure. hr = 0x8004010b: Failed to initialize virtual machine.

This page had the fix:
http://www.vmware.com/community/message.jspa?messageID=580335#580335

You simply need to rename the following file to preferences.ini.bak:

C:\Users\Account.domain\AppData\Roaming\VMware\preferences.ini

DHCP - set nameservers

I was having trouble with Ubuntu in VMWare and InnoTek VirtualBox giving me a working DNS server when using DHCP to configure eth0... So found that you can set your own in the /etc/dhcp3/dhclient.conf:

prepend domain-name-servers 192.168.1.1;


And, restart networking. (Setting the name servers in /etc/resolv.conf, /etc/network/interfaces, or the GNOME networking tool didn't work...)