A Means To An End

Posted on 15th October 2008

Recently I was pointed at a blog post, entitled "8 Unix Tricks You Didn't Know". Although 7 I did know, there were 2 entries that I felt I could extend. I sent the author of the blog a mail, so hopefully he may add them (I don't have a Moveable Type, Live Journal or Vox account ... I know, I'm so unhip! ... so cannot add a comment). In the meantime, I thought I'd add them here, and include a couple of extra tips that I use regularly.

Firstly, for entry 6, an addition to the '+' syntax, you can also write something like 'vi +' (without any number after the '+'). vi then will open the file and immediately start on the last line of the file. This is extremely handy when editing a large file that you wish to edit from the end.

Secondly, for entry 8, while the method described works when you only editing one file, and in fact will work with any control character (change Ctrl-M to Ctrl-I and it will remove tabs), but if you have several it can be a bit labourious. An alternative is to install the 'sysutils' package and use 'dos2unix' command line program. I use this all the time to ensure that any file that could potentially have been edited in a Windows environment is sanitised for Linux.

So those were the ones that were already listed, but there another couple of tips that I use, that I am occasionally surprised to discover that others don't. So I thought I share them here. These two are specifically aimed at monitoring:

'tail -f filename'

'tail' lists the last few lines of a file (you can specify how many or use the default of 10). By adding the '-f' option the tail will continue to display lines from the file, that are freshly written by other applications. This is especially useful when watching output files, such as log files.

'watch "command"'

I only came across 'watch' in the last year or so, and now use it all the time. It takes a command line argument and repeats the command every 2 seconds. Instead of repeatedly typing the command you want (or Up-Arrow/Return if you use your command line history), 'watch' will do that for you. A common one I use is 'watch "ls -altr | tail"', particularly in my apache web logs folder, so I can see which websites are being looked at most recently, and more importantly, quickly spot when something has been written to an error.log file.

Speaking of the history file, you might not be aware of the Ctrl-R history search feature in bash. On the command line enter Ctrl-R and then type a sequence of characters. bash will then attempt to auto-complete the command you have previously used. I particularly use this when trying to remember what the IP address is of the server I waht to SSH to.

So these are just a few of mine. I'm sure there are plenty of others that other people use too. It's reminded me that I really ought to add Linux Server Hacks and Linux Server Hacks, Volume Two to my Christmas wishlist :)

File Under: computers / linux

Killing The Bland

Posted on 3rd July 2008

For those that have suffered with accessing my sites over the past month, I have to apologise. In the first instance it appears that a TLS library wasn't playing well with XEN, the virtual server management system, which runs my server on a physical machine in Amsterdam. Having sorted that one out, with some library upgrades, I noticed that the perl applications running my sites were occasionally going into overload and failing to end, due to what appeared to be hanging I/O requests. I'm still not certain why, but have put some measures in place to reduce the I/O requests.

However, while investigating the server process and open files, etc, I noticed that there were rather a large number of cronjobs running, including several that had nothing to do with anything I'd set up manually. The most resource hogging ones appeared to be PHP related, both for php4 and php5. Seeing as I don't run any PHP on the server, I looked to getting rid of them. It took a while to trace, but it appears that the mod-php4 and mod-php5 had got installed with apache2, possibly following an upgrade I did recently, but the associated packages had all been installed too. I have now removed about 20 packages and several thousand files from the server, which has freed up a bit of disc space, but also stopped several cronjobs, thus reducing the load on the server. I'm hoping this solves the recent overload issues, but if it doesn't at least it might last a bit longer before keeling over!

I've been monitoring the box for the last couple of days and everything looks to be running fine again. If you suffer anything similar, I suggest looking in /etc/cron.d and related directories for things that you really don't expect to be running.

File Under: computers / website

Father Ruler King Computer

Posted on 11th May 2008

A few weeks ago I was approached by Talk Toshiba to review one of their laptops. As I had already been thinking about getting a new laptop for myself, and have previously liked the Toshiba laptops, I took them up on their offer. However, the Toshiba Qosmio G40 that arrived wasn't anything like what I was expecting. The problem with my expectations was that I was hoping to use it like a regular laptop. The Qosmio is a big beast both in its dimensions (440mm x 230mm x 45mm) and its weight (4.4 kg), and wouldn't fit in any laptop bag I had, or my rucksack. I came to the conclusion that looking at it as a laptop is perhaps misleading. Anyone using it as a portable computer, which is effectively what the term "laptop" is used to imply, is going to have problems. Using it as a replacement high-end desktop in the home or office, or as a media centre is more likely to get the best use out of the computer.

Before receiving the Qosmio for review, I investigated a few sites to get a feel for what the machine was about. The specifications on Toshiba's own site give the basics and an idea of the hardware inside, but I wanted to see what tests and trials it had been through, as I wouldn't be able to do any like for like comparison tests, but look at it more as a working machine. Several of the web pages I found referenced various games, including Quake 4, so I decided I would dust off my copies of Quake 3 Arena, Rollcage and Revolt, plus a few other racing games, to see how it faired. I also wanted to see how well it worked as a replacement development machine, and planned to install a LAMP stack and set up a local dynamic website. Lastly, or more acurately firstly, I wanted to see how it faired installing Linux on it. What follows is both my experience of these attempts and some further aesthetic observations.

On its arrival, aside from its size and weight, the first thing about the look of the machine was the keyboard half of the computer. The bottom half has a glaringly shiny white surface, with bright blue LEDs inlayed into the side controls, as well as along the front edge and back panel to illuminate what features (Caps Lock, Wifi, Bluetooth, etc) were active. When you first look at all the white and LEDs, I get the sense that its meant to look flashy and impressive, and it does until you start to use it. The LEDs end up being far too distracting, and while the edge and back panel illuminations are needed, the brightness isn't. My current laptop uses a lower light (and probably wattage) green LED, that can be easily ignored. The LEDs around the controls is purely cosmetic and becomes irritating.

The screen looks like it would be about 20" widescreen from the case size, but with the speakers inlayed either side, we get a 17" widescreen, which is still big compared to many laptops. I've been used to standard screens for so long, widescreen does still seem a bit odd, even though it is pretty much the standard these days, especially for watching movies and the like. The quality of the screen is fantastic, and if you don't want to buy a new HD ready TV, this is definitely a suitable alternative. Both for movies and games the quality was extremely impressive.

Looking at this machine for it's Media Centre qualities, the LEDs and the white keyboard top are a really bad idea. One of the first try outs for machine was to watch a DVD. The reflectiveness of the white and brightness of the LEDs meant we had to use a thick black cloth over it so we could watch the screen. I'm really surprised that Toshiba haven't had any feedback about this aspect, as it would seem to be an obvious flaw. Following recent announcements, the other aspect of the Media Centre sales point for the Qosmio, is no longer the selling point it could have been. It claims to be the first laptop to have a HD-DVD player built in. Thankfully it plays regular DVDs and CDs too, so it isn't completely redundant. I don't own any HD-DVD movies, but I'm sure they play wonderfully, as the quality of regular DVDs was great. One nice aspect about the Media Centre qualities, was that the laptop comes with a remote control. It was quite handy to sit back and watch DVDs and use the remote to click through the menus or adjust the volume without having to reach over and touch the laptop itself.

I did briefly try the 2MP onboard camera, which looked to be a pretty decent webcam. Despite only being 2MP, the quality looked great on screen, and I was surprised to see that the picture looked really crisp. I don't know anyone I would use this facility with, and never got to try it over a internet connection, so I have no idea what the refresh rate would be like, although these days with all the broadband rates increasing, it's likely to be pretty good. Plus that sort of thing is down to the connection not the laptop, so if you're looking for this sort of feature, then it's definitely a plus.

A big downer for me personally though, was that it come pre-installed with Windows Vista. I did ask whether I could install a Linux distro before I got the machine for review, as any laptop I buy now must be able to run Linux. I have both Ubuntu and Fedora disks, so I was eager to see how they faired. All Linxu distros seem to suffer installation problems with brand new laptops, so I was curious to see whether where an issues here or not. As there didn't seem to be any reports on the web I was hopeful. Unfortunately both Ubuntu and Fedora suffered with TTY issues. After searching on the web for specific issues with Linux on the Qosmio, I drew a blank and reluctantly gave up. Had it been my own laptop, I would have made more of an effort to find the problem, and possibly fix it. I suspect the nVidia graphics card, as they usually are the cause of many installation issues with Linux, but I was a little disappointed with Toshiba, as normally their machines are very good at installing Linux and just working. My old Toshiba Satellite is still going strong after nearly 10 years. However, the TTY issues leads me to think that the latest nVidia graphics card inside, hasn't currently got any working Linux drivers for it, and given time this may not be a problem.

Despite not having tried Vista personally, the changes I knew of and what I'd seen on other laptops hadn't impressed me, and now having tried it, I can't find anything about the OS particularly inspiring. In fact, I really hope I never have to suffer Vista again. Vista tries too hard to out think you, fails and ends up being irritating to the maximum. The Qosmio has a big silver volume control to the left of the keyboard. If you turn the volume down you would expect, like every other volume control on every other laptop I've ever used, that ALL noises would diminish in volume, and mute if I turned it far enough. However, Vista assumes that its own annoying pips and squeaks don't count. Finding how to turn off the pips and squeaks is annoying in itself, but I shouldn't have to jump through hoops to turn the volume down for anything. If I don't want noises, I don't want noises! Admittedly this is not a fault of the Qosmio, but hopefully Toshiba will put pressure on Microsoft to make their OS work correctly with their laptop and not be a nuisance. This was just one irriating feature that could be tied to the laptop, there were several others, and I would prefer to see Toshiba invest some time working with some of the Linux vendors and see about getting them to work out of the box on it too.

As I use all my laptops as development machines, I decided I would install a small dynamic website and see how easy it would be to both set up the website and make changes, running a LAMP stack (albeit without the L (Linux) and replace it with W for Windows). I downloaded the latest copies of Apache, MySQL and Perl for Windows, and I started get really irriated with the obstructions that Vista puts in your way. One of the first things I downloaded on getting the laptop was Firefox, so using that to download and and launch the installer, already pops up a clear warning. However, Vista additionally blocks you from running any application twice further. Like once wasn't enough, because like you're using Windows so you must be really stupid. Despite the user I was running as, and installing with, is the Administrator, Vista doesn't care and insists you are stupid and really don't know what you're doing and insists on getting confirmation twice that you aren't stupid and really do know what you're doing.

So I finally get Apache, MySQL and Perl installed. The next step is to fix the configuration files. Now Apache has changed since v1, and uses a main configuration file and then separate files for specific areas, one of which is the vhosts configuration. It makes it easier to keep logical sections separate. However, initial setup means you first have to play with 2 files. Vista again, despite being the Administrator user, thinks you are too stupid and locks you out of changing the file. The ONLY way to change the file is to save it to a temporary directory then drop down to the explorer (more of THAT in a moment) window and manually copy, jumping through the two pops asking whether you really aren't stupid. This included changing the /etc/hosts file to add a local domain! All this took over an hour to sort out, and I still wasn't finished. With every other laptop this takes about 10 minutes to set up. I gave up in the end as I had better things to do.

One aspect of using a Windows machine for development is that I use both Explorer (not IE) and the command line a lot. Some are surprised to learn I used the latter almost all the time. However, Vista has seen fit to hide these away. Anyone used to using a Windows machine, particularly a less experienced user, is going to have difficulty finding them, seeing as both were immediately available from the Start button. In fact the only thing about the Start button they have got right is that it is smaller and has changed to an icon. The start menu is radically different to any other, and ends up being confusing and irritating trying to figure out how to find what you want. I wasn't planning on Vista bashing, as this should be a review about the Toshiba Qosmio, but it really spoiled my experience of the laptop and meant I wasn't able to enjoy using the laptop as much I potentially could have. It's only served to ensure that any laptop I buy in the future must NEVER have Vista on it.

An aspect of any laptop produced these days is how it's builtin wireless hardware performs. I'm pleased to say the Qosmio's networking features worked without a hitch and really quite smoothly. I noted that the builtin Wifi automatically set itself to talk 804.11g, rather than the 'b' or 'a' variants that my other laptops seem to choose. The bluetooth detected my phone as soon as I enabled it on the phone too. Although as yet there isn't any bluetooth control features available, which would have been nice, but I guess that is something that is specific to the type of phone you have.

As mentioned earlier, I dusted off some of my PC games. Unfortunately, some didn't install due to requiring Windows 98. I found this a bit of a shame, as I suspect it was only some software detection that was stopping it running, not the actual game software. Quake 3 Arena, Rollcage and Hedz all installed fine and it was great to play them all again. I used my personal USB mouse, which justed worked (as it should do in this day and age) together with the keyboard and was very pleased to see the responsiveness of the games. having a larger screen and not being restricted to sitting at a confined computer desk, meant I could play on a large table and have room to move and perhaps more importantly not have to sit so close to the screen. Again the screen quality was fantastic, with both the vibrant colours standing out and the non-reflective element making it much easier to see everything that was happening in the game. The speed of the games was much more realistic, which I guess is more due to the Dual Core CPU in use, so that the game can run uninterrupted on one core and the OS and other processes running on the other. Quake was definutely a joy to play again and I'd forgotten how much fun Rollcage was. My very first desktop was bought for gaming, and online gaming in particular, and the Qosmio is a great upgrade for both now.

All in all I wouldn't recommend this as portable laptop. As a Media Centre or a high-end games machine, then it fairs much better. However, with a price tag of over £1,600, it doesn't come cheap. For me personally I wouldn't choose this machine for a new purchase. I don't play games like Quake often enough, and we already have a new HD Ready TV and DVD player, so it isn't really a must have, plus I really want something that is portable (can I use it on the bus) and can it run Linux (preferably Ubuntu or Debian). If you're a gamer and want to be able to set up round your friends house, or just don't want to have a bulky desktop taking up room in the house, or want something that is part computer/part DVD player, then the Qosmio would be a reasonable purchase. However, I would temper that with the fact you have to have Vista on it. I really hope Toshiba invest some effort getting other OSs working on the Qosmio or getting Microsft to write a decent OS, although I doubt either will happen soon, and suspect the latter is an impossibility.

If you're interested in reading more about the laptop, check out the official Toshiba Qosmio G40 page online.

File Under: computers / laptop / review / toshiba

Legend Of Xanadu

Posted on 22nd April 2008

I should have posted this a few weeks ago, when I was too busy to post a diary entry. Maybe I should save it, but then it's always nice to be reminded of the story. I've come across this story several times over the years, and I always enjoy re-reading it.

Mario is currently working for Sun in Manchester, so next time I see Alan Burlison, I must remember to ask him if he knows him. I expect so. Anyway it's a good story and if you haven't read it, do so now. Then think whether you could ever do the same with a Windows system .....

A Legendary Unix Recovery.

File Under: computers / humour

When Space Invaders Were Big

Posted on 10th April 2008

A friend pointed this post out to the WolvesLUG a little awhile ago, and it got me thinking. Firstly it annoyed me that this guy managed to be taken to task for asking something that is often a very basic question from new recruits to the Linux way of things. When told that there are a selection of varieties, potential new users are often overwhelmed to understand what they should choose, so asking what the differences are is not an unreasonable question. The answer isn't easy and in this case the guy was asking for pros and cons of each system to best analyse what would work for him. That's something most rational Linux users understand. However, the extremists do no-one any favours. Mark-Jason Dominus once posted an article at perl.com, entitled Why I Hate Advocacy, which extremists would do well to read.

After that first reaction, I started to think about why I chose the distributions I did. I tend to use Debian for my servers and Ubuntu when I need a desktop. I also use Windows XP, as that is the default install on my work laptop (I haven't been able to get Ubuntu running on it, but that's another story). But how did I come to settle on those two, Debian and Ubuntu, as my prefered platforms?

Over the last 10 years or so I've tried a variety of flavours of Linux distributions, and they all seem to have something going for them, but there is not really one that manages to be the panacea. Personally I consider that a good thing. My knowledge of Linux came from my long standing experience of Unix System V. I began working with Unix in 1985 when I started at Coventry University (Lanchester Polytechnic as it was then), and carried on with it when I went to work for GEC Telecommunications. At the time it did the job of teaching me the command line, C, network programming among other things. But it was all command line based. In one of the modules I studied at Lanchester Polytechnic, we specifically covered Operating Systems and looked at several different ones that were available back then. We were then tasked with writing our own OS. Being a big fan of curses at the time (as I was writing games such as battleships and othello with it), I persuaded my team to look at an interactive OS, rather than a command line based version. We got marked down because we couldn't print out our results on a line-printer, unlike everyone else's command line based systems. At the time it really pissed me off that the lecturer could be so ignorant of different ways of thinking. I didn't have enough knowledge to design or write a proper desktop OS, but I could see a benefit to having one. A year or so later, I got to see a copy of Windows 1.0. It planted a seed for a number of people that the interactive desktop did have a future.

Until Windows 3.11 was released, I was still working on command line based OSs, including Unix, VMS and the OS (whose name I've long forgotten) that ran on Pyramid workstations. I started to use Windows, but found it annoying. It hid away far too much from me at the command line, when I just wanted to get the job done. That has pretty much carried on throughout every Windows release. It has got better in many respects, but sometimes the command line can get right to the heart of the problem. I still use the Windows command line virtually every day.

The benefit of the Linux desktop is that I can have the desktop, but easily drop to the command line when I want to and have the full power of the OS at my disposal. My first experience of Linux was in 1998 using Debian, however not as a desktop, just as a server. I can't remember which desktop I actually tried first but around 1999, I went through Red Hat, Slackware and Mandrake, coming back to Debian. Possibly due to familiarity. Later I was given a works laptop with Red Hat on it, and stuck with that for quite some time. The actual desktop was originally KDE, but having tried Gnome ended up sticking with that instead. I do remember trying Enlightenment at some point, but it didn't last very long. In September 2000 I installed the newly released Potato from Debian as a desktop. I have to say it was rather nice. It worked without too much hassle and looked nice. I ended up sticking with it for quite sometime.

The brick, an Toshiba Satellite, stuck with me until 2006 when work finally gave me a company laptop. Understandably they weren't too comfortable with me using a personal laptop on the company network. It did get a few comments in later years, but it travelled with me to all my early conferences. At home my 3 servers were all running Debian, 2 of which running with Gnome desktops. At the end of last year Akira finally gave up after many years of service and has now been decommisioned. I now only run one headless Debian server, with another powered off to use in emergencies.

When Ubuntu surfaced I was toying with the idea of using Red Hat, or more accurately Fedora Core. I did try Fedora Core for a few weeks, but I think the Debian way had just got too comfortable, so gave Ubuntu a try. For ease of install and use, I found it much better than Fedora Core at the time. A couple of years ago I installed SUSE 10 on my works desktop, and despite a few learning curves, it didn't seem too bad. However, as time progressed and security updates, as well as general software, were needed, the system seemed to become more and more unstable with each patch. It would occasionally lock or crash, so after a particularly annoying crash, I started with a new install of Ubuntu.

The biggest win for me with Debian/Ubuntu is the deb packaging system. It occasionally had problems with dependencies, but for the past year or so, I haven't had any issues either upgrading the basic version, or with a complete dist-upgrade. Ubuntu now has more and more restricted drivers to enable laptops to just work, and Synaptic is just one of the best repository search engines I've ever had the pleasure of using. Gnome has a nice desktop feel and the layout works for me. However, this is still all just personal preference. I can't remember anything, development wise, that didn't work on one and not the other. Paths sometimes can sometimes be a bit confusing, as all the distros have their own conventions, but on the whole you get used to them.

Maybe if I'd have started with Red Hat, SUSE or Mandrake, and really got into the mindset I would still be using that distro today. I also think the fact that there are differences is a positive part of the Open Source movement, as each distro has a unique style and identity that fits some and not others. However, that does make it difficult to provide a new user with the right information to make the right choice for them, as in the end we all have a personal slant on our view. Anyone trying to make an informed choice is probably best to try all the major distros, and see how they fair installing, configuring and using. LUGRadio recently tried this, and although it wasn't the perfect test, it did go a long way to try and understand what worked for each member of the team. If you have the time to invest I would recommend trying at least Ubuntu, OpenSUSE, Fedora and Mandriva as desktops, and include Debian if you want a server based OS. If you really want to go hardcore then Gentoo might be of interest, but it really isn't recommended for a new user.

One thing the LUGRadio boys spotted during the installation, was how often the distros can ask some very confusing questions, that even experienced users could even have problems with. This is perhaps part of the nature of Linux, that it isn't (at the moment) ready for a complete handover to the uninitiated. However, with more feedback and better refinement of the options and questions, I do think we will get there. Interest in Linux as a desktop is continuing to grow and we're going to see more and more posts (like the one that started this post) by people wanting to discover what will work for them. I'm hoping the extremists will burn themselves out, more of the LUG members will get to provide a more reasoned view, and maybe even more articles will appear in more mainstream computing press that will help to give a balanced view of the differences.

So if anyone does ask you to give them a idea of the differences between the Linux distributions, please try and give them a flavour of why you choose what you did, but not to the expense of them experiencing the right distribution for them. This thread on PerlMonks is more in keeping with that idea, and gives several general hints and tips why you might choose one platform over another.

File Under: computers / linux / opensource

Page 2 >>

Some Rights Reserved Unless otherwise expressly stated, all original material of whatever nature created by Barbie and included in the Memories Of A Roadie website and any related pages, including the website's archives, is licensed under a Creative Commons by Attribution Non-Commercial License. If you wish to use material for commercial puposes, please contact me for further assistance regarding commercial licensing.