Uses for symbolic links

UNIX (and Linux) does a wonderful trick with its file and folder shortcuts; it effectively treats them as file and folder transporters that transfer associate a file or folder that exists in one folder hierarchy with another and it is treated as if it exists in that hierarchy too. For example, the images folder under /www/htdocs/blog can have a link under /www/htdocs/ that makes it appear that its contents exist in both places without any file duplication. For instance, the pwd command cannot tell a folder from a folder shortcut. To achieve this, I use what are called symbolic links and the following command achieves the outcome in the example:

ln -s /www/htdocs/blog/images /www/htdocs/images

The first file path is the destination for the link while the second one is that for the link itself. I had a problem with Google Reader not showing up images in its feed displays so symbolic links rode to the rescue as they did for resolve a similar conundrum that I was encountering when editing posts in my hillwalking blog.

Octals in UNIX shell scripting

I have just discovered that if you have a number with a leading zero, such as 08, it is assumed to be an octal number, that is, one of base 8. The upshot of this is that you get errors when you have numbers like 08 and 09 in your arithmetical expressions; they are illegal in octal: 08 should be 10 and 09 should be 11. Og course, as luck would have it, you get exactly these expressions when date/time processing. Luckily you can forced things to be base 10 by having something like 10#08 or, when extracting the minute from a date-time value, 10#$(date +%M). Strange as it might appear, this behaviour is all by design. It is dictated in the POSIX standard that governs UNIX. That said, I’d rather it if 08 was interpreted as an 8 and 09 as a 9 rather than triggering the errors that we see but that could have been seen as muddying the simplicity of the standard.

A perspective on Linux

I have revisited an old website that I used to have online in and around 2000 that has since been retired for while. One thing that it had in common with this blog was its focus in computer technology. I don’t remember blogging being bandied about as a term back then but a weblog would have fulfilled the site’s much better. One of the sections of this old world website was dedicated to Linux and UNIX; this was where I collected and shared experienced my experiences of these. These days, unless it is held in some cache somewhere (rather unlikely, I think), the only place that it is found is what I bundled together in a tar.gz file for transfer to Linux. Irony strikes…

Back then, my choice of Linux was SuSE 6.2, followed by 6.4 from PC Plus DVD. It was the first, and only, Linux distro that I bought after exploring a variety of distros from cover-mounted CD’s in books and magazines. While I did like it, it wasn’t enough to tempt me away from Windows. I had issues with hardware and they got in the way of a move. Apart from what some might judge to be clunkiness, there were less impediments on the software side.

I am a DIY system builder and there were issues with Linux support of my hardware, particularly my modem. Rather than being in possession of all the electronic wherewithal that a full modem would need, it got the operating system to do some of the work. The trouble was that this locked you into using Windows, hence its Winmodem moniker. Besides this, my Zip drive was vital to me and SuSE didn’t support it out of the box: a kernel recompilation was in order and could involve losing any extensions that SuSE had actually added. Another foible was non-support of a now obsolete UDMA 66 expansion card.

But improvements in hardware support were coming on the scene. Support for printing with CUPS, scanning with SANE and audio with ALSA was coming along nicely and has matured nicely. Apart from cases where vendors refuse to help the Open Source community and bleeding edge hardware that needs drivers to recoded according to the demands of GPL, things have come a long, long way.

Software-wise, the only thing holding me from migrating to Linux was my use of Microcal (now OriginLab) Origin, a scientific data visualisation and analysis package that was invaluable for my work. Even then, that could be run using WINE, the Windows API library for Linux. OpenOffice could easily have replaced MS Office for my purposes unless formula editing was a feature outstanding from the specification. GIMP, once I had ascended the learning curve, would have coped with my graphics processing needs. After committing myself to non-visual web development, Bluefish and Quanta+ would have fulfilled my web development needs. Web technologies such as Perl, PHP, Apache and SQL have always been very much at home in Linux so no issue there. At that stage, experimenting with these was very much in my future. Surprisingly, web browsing wasn’t that strong in Linux then. Mozilla was still in alpha/beta development phase and needed a lot of rough ends sorting and the dreadful Netscape 4 was in full swing with offerings like nautilus coming on stream. Typography support was another area of development at the time and this fed through into how browsers rendered web pages. Downloading and compiling xfstt did resolve the situation.

SuSE 6.4 desktop (317 kB)

These days, I have virtual machines set up for Ubuntu, Fedora Core and Mandriva while openSUSE is another option. I spent Saturday night poking around in Fedora (I know, I should have better things to be doing…) and it feels very slick, a world away from where Red Hat was a decade ago. The same applies to Ubuntu which is leagues ahead of Debian, on which it is based. With both of these, you get applications for updating the packages in the distribution; not something that you might have seen a few years ago. Support for audio and printing comes straight out of the box. I assume scanner and digital camera support are the same; they need to be.Fedora includes the virtual machine engine that is Xen. I am intrigued by this but running a VM within a VM does seem peculiar. Nevertheless, if that comes off, it might be that Fedora goes onto my spare PC with Windows loaded onto one or more virtual machines. It’s an intriguing idea and having Fedora installed on a real PC might even allow me to see workspaces changed onscreen as if they were the sides of a cube, very nice. Mandriva also offers the same visual treat but is not a distro that I have been in a lot. The desktop environment may be KDE rather than Gnome as it is in the others but all the same features are on board. The irony though is that, after starting out my Linux voyage on KDE, I am now more familiar with Gnome these days and, aesthetically speaking, it does look that little better to my eye.

So would I move to Linux these days? Well, it is supported by a more persuasive case than ever it has been and I would have to say that it is only logistics and the avoidance of upheaval that is stopping me now. If I was to move to Linux, then it would be by reversing the current situation: going from Linux running in a VM on Windows to Windows running in a VM on Linux. Having Windows around would be good for my personal education and ease the upheaval caused by the migration. Then, it would be a matter of watching what hardware gets installed.

Fedora Core desktop (972 kB)