NoMachine NX Desktop on Ubuntu 12.04 Precise Pangolin – No menus?

NoMachine NX is a perfect solution to connect to your remote Ubuntu desktop. But ever since Canonical introduced Unity, NoMachine doesn’t seem so perfect anymore: client successfully connects to the NX server, but the menus never show up, and there’s no Unity side bar.

Here’s what works in 12.04 Precise Pangolin:

On the remote machine open up this file: /usr/NX/etc/node.cfg and edit it as a superuser:

sudo vim /usr/NX/etc/node.cfg

Towards the end of the file, look for CommandStartGnome and change it to

CommandStartGnome = "/usr/bin/gnome-session --session=ubuntu-2d"

Save the file, and Unity should now work in 2D mode the next time you connect and the menus and the sidebar will show up.

Sync your passwords between your phone and computers using Dropbox and KeePass

If you use passwords like 12345 for anything else than maybe your luggage, you probably don’t need to read this post. If you’re smarter than that and you use proper passwords, you might be interested to learn how to store them safely while having them handy at all times.

KeePass is a very popular cross-platform solution that stores your passwords to a local encrypted file. To have a look inside the database you need to provide the master password. Once inside, all your passwords, PINs and credit cards are at your disposal.

Storing passwords exclusively to a local file generally isn’t a very good idea. To keep your passwords mobile and safe from data loss (disk crashes, cell phone drownings, stolen laptops…) I recommend you use a cloud store, like Dropbox.

Dropbox is a neat free service that syncs files between all your devices, portable or otherwise. I use it between my desktop, my workplace desktop and my HTC Desire. Syncing happens automatically in the background, so your password safe will be up to date, wherever you are.

1. To get started, you need to download and install a Dropbox client (Mac, Linux, Windows) and set up an account if you don’t have one already. Once installed, your computer (or mobile device) will feature a new folder, called Dropbox, which is shared between all your devices.

2. Inside your DropBox folder create a new subfolder named MyKeys or something similar, and make sure you keep this folder private.

3. Now install a KeePass client to all your devices:

4. I suggest you use the desktop client to set up your key file** password database file. Just fire up KeePassX, create a new database, set up a master password, and store the database file into your DropBox folder you created in step 2. You can populate the database with your passwords now, or at any time later.

5. Your password database file should now be synced between all your devices. To open it on Android, simply open DropBox and look for the file you created in the previous step. If KeePassDroid is properly installed, it will pop up and ask you for your master password. Once typed in, your secure passwords will happily reveal themselves.

* In Linux just look for KeePassX in your package repository (Software Center in Ubuntu)
**  See Jason’s comment below

Run IE9 in Virtualbox for free

Update, 31. march 2013: this article is now out of date. Microsoft now offers free virtual machines and hosted virtualised solutions for cross browser testing at: http://www.modern.ie/en-us/virtualization-tools  (thanks to Graham Ashton for the update).

Like many, I ditched Windows for other operating systems a long time ago and never looked back. But being a web developer I need to be able to test web sites in Internet Explorer. I had briefly considered buying a licence from Microsoft, just to be able to run a virtual copy of Windows 7 with IE9, but luckily Microsoft doesn’t want my money. What’s that, you say? Let me explain.

Microsoft provides “Windows Virtual PC VHDs for testing websites with different Internet Explorer versions” for free on their download page. I downloaded the Windows7 IE9 version, which is quite handy, since IE9 can emulate IE8 and IE7 too.

Once downloaded, I extracted rar files with Ubuntu’s Archive Manager. Then I fired up VirtualBox, created a new WIN7 machine and skipped creating a hard drive. I added the extracted VHD file afterwards, as an IDE drive. This step is important, because running it as  SATA would cause BSOD headaches.

Once it booted, I had no problems getting inside using the “Password1” password. Windows asked me to activate, but Microsoft advises you skip this step, and extend the testing period by running slmgr –rearm as administrator in the command prompt. This will extend the testing period for 30 days. That’s more than enough: once you’re happy with your virtual image, take a host snapshot and just use it as a starting point if the trial period expires (Microsoft actually encourages that). Don’t forget to install VirtualBox guest additions to enable screen resizing and what not.

References: I found this blog entry very useful (albeit outdated): http://danielmcormond.com/2011/02/21/how-to-use-microsoft-ie-vpc-images-with-virtualbox-on-mac-os-x/

Logwatch: once a week is enough

If you administer Linux systems, it’s a pretty good idea to keep an eye on the logs. A handy tool that parses your system’s logs and sends you an email report is well known logwatch. By default it sends daily log reports. But to me this is too often. I want weekly reports.

This is how I achieved this on Centos 5.

If they’re not already installed, install logwatch and perl-DateManip

sudo su -
yum install logwatch perl-DateManip

Add a few options to logwatch.conf (I also like my output formatted in html)

echo "Range = between -7 days and -1 days" >> /etc/logwatch/conf/logwatch.conf
echo "Output = html" >> /etc/logwatch/conf/logwatch.conf

By default logwatch installs itself in /etc/cron.daily, you should move it to /etc/cron.weekly

mv /etc/cron.daily/0logwatch /etc/cron.weekly

You can now run a test logwatch and check if it arrives:

/etc/cron.weekly/0logwatch