commonpy released

I’ve released version 1.0 of commonpy today. commonpy is a collection of libraries that would prove useful in any Python project. Currently it contains a base-class similar to the .NET CollectionBase class. You can use it to make your Python objects behave like super powerful arrays. It also comes with a useful unit testing framework called Tester.

I’ve enjoyed using these base classes in my other projects and have achieved a high degree of reusability and terseness from them. In future posts, I will provide demonstrations on how to use them.

How to install WICD without a network connection

On one of my older laptops, I can boot into a LiveCD session and obtain a wireless network connection. However, after I install and boot into Ubuntu, the Ubuntu NetworkManager doesn’t notice my wireless network card, so I can’t connect to my router. I know that the Wicd network manager will work but it is not distribute with Ubuntu by default.

To get around this problem, one can first boot into a LiveCD session. Then I download the Wicd package and its dependent packages.

sudo apt-get install aptitude
aptitude clean
aptitude --download-only install wicd
cp /var/cache/apt/archives/*.deb /media/ubuntu/<UUID>/home/jhogan

Above, aptitude is used to download the Wicd packages into APT’s archives directory. Then we just copy all those *.deb files to the hard drive that Ubuntu has been installed on. /media/ubuntu/<UUID> is the mount to the hard drive. Ubuntu will automatically mount it under /media/ubuntu. If it’s not there, run nautilus or mount it manually.

With the packages on the hard drive, we can now reboot into the our standard Ubuntu installation. Once there, we can use dpkg to install the packages in the following order.

sudo dpkg -i python-urwid_1.1.1-1build2_amd64.deb
sudo dpkg -i python-wicd_1.7.2.4-4.1ubuntu1_all.deb
sudo dpkg -i wicd-curses_1.7.2.4-4.1ubuntu1_all.deb
sudo dpkg -i wicd-daemon_1.7.2.4-4.1ubuntu1_all.deb

You should now be able to run wicd-curses and connect to your wireless router. If you receive an error, make sure the WICD daemon is running by issuing the following:

sudo service wicd start

Then rerun wicd-curses.

Finally, we want to get rid of NetworkManager:

sudo dpkg --purge network-manager-gnome network-manager

See WICD: Installing WICD for some useful tips on safely removing NetworkManager.

Connect (RDP) to an Azure VM from a Linux client

So you’ve set up a Windows virtual machine in Azure and you would like to connect to it from your Linux desktop.

First, download the Remmina RDP client. On Debian systems, such as Ubuntu, this can be accomplished using the following command.

sudo apt-get install remmina

Remmina manages RDP connections through a GUI interface making connecting to the RDP server very intuitive. Simply use the Azure web interface to discover you VM’s public IP address, and use the server’s user name and password to make the connection thorough Remina. In a moment, your computer’s display will look like the Windows machine to which you just connected. You can use alt-tab to shift between the VM window and your local Linux programs.