How to import all missing gpg keys

Now with command add-apt-repository it is possible to add a PPA with the GPG key in a single command line.
But if you use it when the Ubuntu key server is down, the GPG key will not be added. And during the instalation you get some error messages like this:

W: GPG error: lucid Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 5A9BF3BB4E5E17B5
W: GPG error: lucid Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 3B22AB97AF1CDFA9
W: You may want to run apt-get update to correct these problems

Import all missing GPG keys
To solve this problem, simply download launchpad-getkeys .deb manually:

Ubuntu 10.10 Maverick Meerkat

Ubuntu 10.04 Lucid Lynx

Ubuntu 9.10 Karmic Koala

Ubuntu 9.04 Jaunty Jackalope

Once installed, to import all the missing GPG keys for your PPAs, simply use the following command:

sudo launchpad-getkeys


Using web applications in a Ubuntu Desktop

Mozilla Prism is a tool that allows you to run your favourite web based service as if it were a standard desktop application. This article shows you the steps required to get you started.


Email, word processing, photo editing… These all used to be the domain of the desktop, but more and more these services are moving to the web. Working online does have its benefits. You can access you information from any interent enabled device (especially now that handheld devices are supporting technologies like HTML 5 and Flash), the information is easily shared, and you should have a reasonable degree of protection from data loss (assuming the host of the web service has a good backup and disaster recovery system in place).

But a lot of these web based applications don’t really fit within a browser though. Time and time again I see messages like “don’t use your browsers back button”. It can also be hard for some to switch from the desktop, shortcut, window list paradigm to a browser start page, bookmarks and tabs interface.

The Prism addon for Firefox recognises that there are situations where it is preferable to launch and run web applications like a desktop application. This gives you all of the benefits of the web, with the familiarity of the desktop. In this article we will look at the process of launching the Gmail web service from the desktop with Prism.

Step 1

The first step is to install the Prism addon for Firefox (I’ll assume you already have Firefox installed). Just go to this web site and click the Add to Firefox button to install the addon.


Step 2

With the addon installed open up Firefox and open your Gmail account. You can then click Tools -> Convert Website to Application…


Step 3

Most of the fields will be filled out for you.


In my case I wanted to modify the URL slightly (so I didn’t start in the Spam folder). You will also want to tick the option to add an icon to the desktop.


Step 4

When you click the OK button a new item will be added to the desktop called Gmail.desktop. Unfortunately this icon doesn’t work. You will probably get a secuirty warning when it is launched, and it won’t display a nice icon. The easiest way to fix this up is to copy the commands from the desktop file into a new launcher.

Before we do that though, we will need to download an icon for our launcher. Right click on the Gmail webpage and select the View Page Info option.


Then in the Media tab you can save the gmail icon as a PNG file.


Step 5

Right click on the Gmail.desktop file on the desktop and select Properties.


Copy and paste the Command string into a new Launcher. You can also use the PNG icon file you download from the Gmail website.


Step 6

Double click the new launcher. Gmail will pop up (you may need to log in) in a new window that can be used just like it was an ordinary desktop application.


The most used shell commands for Ubuntu

This is a list of Shell commands that can be very useful.


sudo command – Run a command as root (administrator)
sudo -s – Open a shell as root
sudo -s -u user – Open a shell as user
sudo -k – Use it if you forget your password
gksudo command – Run command in GUI (GNOME)
kdesudo command – Run command in GUI (KDE)
sudo visudo – Change /etc/sudoers
gksudo nautilus – Launch the file manager (GNOME)
kdesudo konqueror – Launch the file manager (KDE)
passwd – Change password


sudo /etc/init.d/gdm restart – Restart GDM (GNOME)
sudo /etc/init.d/kdm restart – Restart KDM (KDE)
sudo gedit /etc/X11/xorg.conf – Edit the configuration file Xorg
sudo dexconf – Reset xorg.conf
Ctrl+Alt+Bksp – Restart the X server when it crashes
Ctrl+Alt+FN – Switch to tty N
Ctrl+Alt+F7 – Back in the X server

System services

start service – Start a service as user
stop service – Stop a service as user
status service – Check if a service is running
/etc/init.d/service start – Start a service as root
/etc/init.d/service stop – Stop a service as root
/etc/init.d/service status – Check service
/etc/init.d/service restart – Restart a service as root
runlevel – Having the current runlevel

Package Manager

sudo apt-get update – Have updates available
sudo apt-get upgrade – Apply updates
sudo apt-get dist-upgrade – Upgrade to newer version of Ubuntu
sudo apt-get install pkg – Install a package
sudo apt-get purge pkg – Uninstall a package
sudo apt-get autoremove – Remove obsolete packages
sudo apt-get -f install – Forcing the installation of a package
sudo dpkg -i pkg.deb – Install the file package.Deb
sudo gedit /etc/apt/sources.list –  Edit the APT source file


ifconfig – View information about the network configuration of the machine
iwconfig – View information on the wireless network
sudo iwlist scan – Scan for wireless networks
sudo /etc/init.d/networking restart – Restarts the network setup
/etc/network/interfaces – The configuration file interfaces
ifup interface – Enable an interface
ifdown interface – Disable interface


ufw enable – Enable Firewall
ufw disable – Disable firewall
ufw default allow – Allow all connections by default
ufw default deny – Block all connections by default
ufw status – View the status of the firewall
ufw allow port – Allow port
ufw deny port – Block port
ufw deny from ip – Block an IP address

lsb_release -a – Show version of Ubuntu
uname -r – Show Kernel version
uname -a – Show information about the installed Kernel

If you know other commands please feel free to post a comment or email me so I can complete the list.

Practical Guide to Linux Commands, Editors, and Shell Programming, A (2nd Edition)

Encrypt USB-stick on Ubuntu in three steps

1. Install the required package:

sudo apt-get install cryptsetup

2. Create a partition on the USB-stick:

sudo cfdisk /dev/sdX

3. Encrypt the partition:

sudo luksformat -t ext2 /dev/sdX
Creating encrypted device on /dev/sdX...
Are you sure? (Type uppercase yes): YES
Enter LUKS passphrase:

Entering the USB-stick into Ubuntu will bring up the following window:

To edit the label of the USB-stick (by default it’s just ‘disk’) use e2label for ext filesystems and mtools for fat filesystems.

Vnstat – Network Traffic Monitoring Tool

vnstat is another app that can be used to monitor bandwidth usage. It is a little simpler and easier to use then the ipac-ng package. One of the benefits of vnstat is it’s not a running daemon so it takes up no memory. The process is created via a cron job which is run every 5 minutes.


The vnstat package is very easy to install from the repositories with no dependencies.

sudo apt-get install vnstat


vnstat is meant to be used by any user so it needs to be set up that way first by giving correct permission. The following gives any user permission to use this feature. If desired you can set up a group so only users in the group can use this.

sudo chmod o+x /usr/bin/vnstat

sudo chmod o+wx /var/lib/vnstat/

Now vnstat should be ready to run


To create the cron job simply run this command

vnstat -u -i ath0

Replace ath0 with the interface you want to monitor

This creates a file in /var/lib/vnstat/ that collects the data for that interface. A cron job will run every 5 minutes to update the data. Below is a sample output with no options.

Database updated: Thu Jan 12 22:20:01 2006


           received:           0.11 MB (nan%)
        transmitted:           0.01 MB (nan%)
              total:           0.12 MB

                        rx     |     tx     |  total
            today      0.11 MB |    0.01 MB |    0.12 MB
        estimated         0 MB |       0 MB |       0 MB

You can read more about options you can use to modify the output in the man page of vnstat.

Set up Gmail in Evolution, Gnome’s Mail Client and Organizer

In Gmail POP can be enabled , and here is how to set it up for Evolution.

  • Login to your gmail account and select Forwarding and POP.

Enable pop and set pop up in the way you prefer. (At least make sure pop is enabled.)

  • Open evolution:

Select Edit > Preferences > Mail Accounts
Select the Add Button > (Evolution Assistant Account starts.


If you use evolution for the first time this is where you begin.

  • Identity

Evolution Account assistant Identity

  • Receiving email:

Evolution Account Receiving Email
Server type: POP
Security > Drop-down menu > select SSL connection
Authenthication Type: password
Flag remember password if you wish
Select ok

  • Receiving Options

Evolution Account Assistant Receiving Options

Are all optional, fill in as you please.
Select Forward

  • Sending Email:

Can be done in 2 ways:

  • 1, Fill it in using The SMTP server information provided by your ISP, I think this is the best way, the send mail gets no advertising added.

screenshot-evolution-account-assistant Sending Email with your  ISP's SMTP server

  • 2, Use the SMTP server provided by Gmail:

screenshot-evolution-account-Use SMTP provided By GmailServertype: SMTP
Flag: server requires authentication
Use Secure Connection: SSL
Fill in Username: username@
Select OK

Now restart Evolution and see if it all works.

For more instructions (if needed) go to Gmail help Center