Month: June 2011
As sad as it is, I had to bring work home the other night. I had some network packet sniffing traces to work through. There’s one tool that stands head and shoulders above the rest when it comes to this type of thing, so I installed Wireshark onto my PC. It is listed in the Ubuntu Software Centre.
I only had to analyse the traces, I didn’t need to do a new capture. I did still notice that the interface list in Wireshark was empty. This usually lists the network interfaces that Wireshark has found. You can then select the interface you want to do a traffic capture on and away you go.
As I say, I didn’t need to do a new capture so it didn’t affect me, but it left me wondering how you get the interfaces to show up in Wireshark in Ubuntu. The trick is to start Wireshark as a super-user. You can do this by opening a terminal window and typing:
You will then be prompted for your password.
Wireshark will then display all of the network interfaces it can find. Business as usual.
One of the best things about open source software is the support. Most packages have active and enthusiastic communities and support forums. I had a couple of questions about luckyBackup.
One question was whether I could disable the function within luckyBackup that deletes files from the destination if they are no longer in the source. If you want to keep the source and the destination synchronised this is great, but it wasn’t what I wanted. If I accidentally deleted a file from the source and then made a backup without noticing, the same file would be deleted from the destination.
The second question was to do with a folder I have that contains video files. This was getting backed up each time I ran the backup task, even when no files had changed. Because the video files are large, it took a long time to complete the backup task so i didn’t want it to run unnecessarily.
I attempted to get answers to my questions by joining the luckyBackup Help Forum on SourceForge but for some reason it was playing up that day. I couldn’t get it to accept any of the user names I tried to register with. So, no immediate help coming from that direction.
However, back on the luckyBackup web site the author of the software had been so kind as to leave his email address and he encouraged people to contact him. His name is Loukas Avgeriou. I dropped him an email. Within a few hours he had replied and answered my two questions. Try doing that with commercial software companies!
As it turned out the remedies were embarrassingly simple. If I’d read the manual a little more closely I’d have probably found the answers myself. If I’d done that though I wouldn’t have a reason to typing this post and letting you know just how inordinately cool guys like Loukas Avgeriou are. To develop something like luckyBackup is a major undertaking. I know, I’m a developer by trade. To do it for free and then happily provide support is quite amazing. Kudos to everyone who contributes to any of the many open source projects.
The solution to my issues with luckyBackup were as follows. To stop luckyBackup deleting files from the destination that are no longer in the source, highlight the task in luckyBackup and then click the Modify button. Click the Advanced button and select the Command Options tab. Uncheck the Delete files on destination check box. Yes, it was that simple.
The issue about the files being sent to the destination even when they hadn’t changed was due to the fact that the destination drive in my case was formatted in a Windows format. The Windows file system cannot handle all of the attributes that Linux can. There is also a difference in the way timestamps are set and checked. To cope with this, luckyBackup has an option so that you can let it know that you are targeting a a Windows formatted destination. luckyBackup will then use a slightly different method of determining which files need to be backed up.
To set the option you need to highlight the task and click the Modify button. Click the Advanced button and select the Command Options tab. Make sure the the Destination is FAT/NTFS option is checked.
Something I do a lot of is printing to PDF. With LibreOffice (the OpenOffice.org variant bundled with Ubuntu 11.04) you can export to PDF very easily. There is a PDF icon right there on the toolbar. You can also access the PDF functions through the File > Export as PDF option, which allows you to have a greater degree of control over the PDF that is created – such as password-protecting it. but what about other applications that do not support the creation of PDF documents?
Back in the Windows world I had installed PrimoPDF. This appeared to Windows as though it were a printer. It was a sort of virtual printer. There was no hardware of course, but the PrimoPDF entry used to show up in the print dialogs of any application that could print. If I wanted to create a PDF instead of a hard copy I selected the PrimoPDF ‘printer’ as the output device and a PDF was created for me.
I missed this facility in Ubuntu, so I set about finding out if a similar set-up could be created. Needless to say it could, and very easily.
I should say at this point that I tried this in my Ubuntu Sandbox (a VirtualBox virtual PC running Ubuntu that I use for testing) and it behaved slightly differently than it did on my actual physical Ubuntu box. It worked in both cases, but on my real PC I had to perform a few more steps.
The first thing to do is open the Ubuntu Software Centre and search for cups-pdf. When it is located, highlight it and then click the Install button.
The PDF output from this will go into folder called PDF in your home folder. Check, and if there is no such folder go ahead and create one. You can do this at the command line with:
You could of course use Nautilus if you prefer. But make sure that you have a folder of that name (in upper-case) in your home folder – not in some sub-folder. In my Sandbox virtual PC, that was all I had to do. There was a new printer entry in the System Settings printer list. On my physical PC however I had to go into System Settings > Printing and then click the green Add a Printer button. I selected CUPS-PDF at each stage of the wizard and that was that.
It asked me if I wanted to print a test page so I chose yes. A second later a new PDF was created in the PDF folder. Double-clicking on that caused Evince, the default PDF viewer, to open it. And there was the test page in all its glory.
I find it faster to move a window by grabbing it any old where than by grabbing it in the title bar. I find it quicker to do that because you don’t have to bother aiming the mouse too carefully. Let’s face it, the body of the window is a bigger target than the narrow title bar.
To be able to move a window (as long as it isn’t opened up to full-screen size, of course) press and hold the Alt key and then left-click anywhere in the window. Drop the window by releasing the mouse button.
Sometimes programmers add hidden functions or benefits in their software. These are called easter eggs.
Heaven only knows what’s going on here, but if you type the following into a terminal window:
You’ll see the apt-get cow.
Go figure. Or go moo.
In order to get a tighter integration with the host OS you need to install the VirtualBox GuestAdditions in the VirtualBox guest OS.
This allows you to stretch the virtual computer window to an arbitrary size and have the contents scale accordingly, and it allows you to run it in a true full-screen mode. In full-screen mode the guest virtual computer takes over all of the screen. The edges of the window in which it is running are removed so that the display is exactly as if you were sitting at a (for example) Windows XP computer, instead of (for example) an Ubuntu one. You can even run the guest OS in a seamless mode, where the guest applications appear to run on the host desktop.
Installing the GuestAdditions also allows integration to shared folders on the Host OS.
To install the GuestAdditions select the Install GuestAdditions option from the Devices menu in the guest OS.
VirtualBox is free and can be obtained through the Ubuntu Software Centre. It allows you to create virtual computers by installing an operating system into a virtual guest computer. The guest PC runs just like a window on your physical computer’s desktop (known as the host). The guest operating system and any applications on it behave just like they would if they had been installed on a hardware computer, not a virtual one.
Here is my Ubuntu desktop with a Windows XP VirtualBox running. I’ve reduced the Windows virtual computer so that you can see it is running on an Ubuntu host. If I hadn’t then it would be identical to any ‘genuine’ screen shot of a Windows XP desktop, and you’d’ve had to take my word for it. But you can run the guest virtual computer full-screen too, if you wish.
VirtualBox has a facility that allows you to take snapshots of the Virtual computer. A snapshot saves the state of the guest computer completely. You can revert to a previous snapshot at any time in seconds. So if you (or some errant software) do something to your guest computer that you regret, rolling it back to a previous state is easy.
And you can do more than just roll backwards. You can choose to roll forwards to a later snapshot too. This allows you to move forwards and backwards in time, relative to the state of the guest computer, just as long as you have been making snapshots.
This solves the issue of running those few Windows applications I still need to use. I just run them in Windows! But it isn’t just Windows you can run in a virtual computer – it can be any OS.
Here is a screen shot of my desktop with three virtual computers running. I’d better point out that to do something like this you need a fast PC and plenty of RAM – the more the better – but if your PC can cope, then there is nothing to stop you running a whole bunch of different guest PCs at once.
They can be set up to be isolated and invisible to one another or they can be be bridged so that they can see one another in a virtual network. They can also be set up to have access (or not, if you prefer) to resources on the host computer such as USB devices, CD drives and shared folders.
I have an Ubuntu virtual machine that I use as a sandbox or test bed. I can install software on it and perform updates to it with impunity. If it all goes wrong then I just revert to a previous snapshot. And my physical PC is untouched.
You can also get VirtualBox for Windows and Mac computers too. So anyone can create a virtual Ubuntu computer and have a play with Ubuntu without any risk.
Ubuntu comes pre-loaded with a lot of software. A LOT of software. As of June 2011 the Ubuntu Software Centre lists 35,920 applications available for free download. Think of it as a sort of AppStore or Android Market, but instead of downloading mini-apps for your hand-held device these are fully-fledged desktop applications for your PC. All 35,920 of them are just a couple of clicks away.
This is fantastic.
But there are Windows programs for which there are no Linux equivalents – nor will there ever be. For example, software that accompanies pieces of hardware, such as the Update Manager software for my Garmin SatNav. I had downloaded and made good use of the Garmin Point of Interest Loader too, back in the Windows world. Is it even conceivable, in your wildest dreams, that these will be ported to Linux? No, not in the slightest. Deal with it.
OK, so, what to do? How do we deal with it?
There are several options. One is to make use of an on-going and mature initiative called Wine. The idea is that Wine provides a background framework for Windows applications to run in Linux. They have an impressive database of applications that they have successfully managed to run under Linux, including big-name graphics heavy games. At the time of writing it lists 16801 compatible applications. The application you want might well be sported by Wine.
Another option is the Internet. Sticking with the SatNav example, I used to use the fabulous and free Point of Interest Editor to edit POI files. I would later load these into the Garmin and my own data points would be shown on the map, and could be navigated to. Necessity being the mother of Googling, I searched and found that there are free sites that offer the same functionality as the POI desktop applications. As a bonus they store a copy of your files in the cloud, providing a safe haven for your data. So if you can’t get a Linux application to do what you want there might well be a web-based solution you can use. I found all I need (as far as POI editing goes) at the aptly named POI Editor site – and it’s free.
A third option is VirtualBox. That topic deserves a post all of its own.