Linux To The Rescue.

One of my common post types is a big up for Linux, but I can’t help feeling that this one is worth it.

Here at work I was presented with an old, battered laptop whose owner had schlepped around the world with it. It was refusing to start, and the request was to help extract important data before it became inoperable forever.

In the early stages I got lucky and managed to get the computer to boot successfully into Windows. However, the success was short lived, and the system froze, displaying a classic blue screen of death.

The next approach was to try and clone the data from the system using CloneZilla. I created a bootable USB stick, restarted the machine and began cloning the partitions. Unfortunately the two important partitions kept on throwing errors on particular sectors and stopping the cloning process in its tracks. And as the system discs were all using NTFS I wasn’t able to attempt any kind of on-the-fly repairs.

In the end, I got a live CD version of a low resources Ubuntu (Lubuntu, using the LXDE window manager) and booted the system with that. The boot process was seamless and the window manager started without a problem. I then used the command line and some Linux know-how to mount the Windows hard drive and an external hard drive provided by the user. Then it was just a matter of finding the data that the user wanted saved and copying it using the normal file system manager.

It has taken a while. The USB interface on the machine is slow, and data reading from the hard drive seemed sluggish, but it has worked well, and all of the users data is now safe.

It is worth noting that when I say ‘Linux know-how’ then it makes it sound simpler than it was. I realised this when the user asked whether it would be possible for me to tell her how to mount the discs if she needed to do. I started to explain the process, then realised (prompted by the way her eyes were glazing over) that while it is obvious to a long term Linux user it might as well be in a foreign language to a new user. Worse than that, when I tried some Google-Foo I wasn’t replete with good explanations that way either. I’m not sure if this is a failing of my Google-Foo or a gap in the otherwise excellent on-line documentation.

My iMac Approaches Perfection Asymptotically.

I have written several times about the learning curve of turning my 27″ iMac into the computer that I am happy to use all day every day. Much of this process has revolved around me moving away from using the Mac OS X operating system as much as possible. I run Linux, and, as I’ve noted in other entries I have a very tweaked system.

But there was one thing about the Mac that was a problem from the start, and which I hadn’t been able to sort out. I like to listen to music when I work, but as I share an office, I have to be concious of the impact of the impact of music on others around me.

After installing Linux I found that plugging in headphones cut off the sound from the speakers, just as you would expect, but the sound would resolutely refuse to flow from the headphones.

I have finally found a fix, of sorts. The forum post which explains the solution is here.

Essentially a short Python script is created which resets the headphones configuration and allows sound through the headphones. Apparently it needs re-running every time you re-start the computer, but I can live with this. I already run a couple of scripts when I log into the computer in the morning (to turn on my preferred keyboard layout, launch Dropbox, X Screensaver, Synergy and other useful functions).

So now I can listen to music when I’m at my desk and not disturb others with my choice.


How Not To Write A Website.

One of the research groups where I work has asked me to update their website for them.

It seemed like a simple request at first, and then I looked at the code. It is awful. The code has styles defined in the tags themselves rather than in a single style sheet for the site. This means that if you find a style that needs tweaking then you need to modify it in each file in turn! Yuk!

Each sub-folder has its own style sheets too, which means that even if you find the killer edit which will fix the majority of their layout woes then the edit needs to be applied correctly 10 or more times!

Nothing is commented. Anywhere.

Oh, and it appears to use some fancy Javascript which breaks if you move the files to a different server.

I won’t mention which ‘design’ package might have been used to create this website, but many of these crimes seem pretty universal these sorts of programs.

It is so bad I would be tempted, had I the time, to rebuild the site from scratch by hand, with better coding standards. The whole thing would be so light, and easy to maintain. Maybe I’ll keep it as a project to help bring myself up to speed on HTML 5 some day.

Now, back to fixing things…

Synergy – Control For More Than One Computer At A Time.

I am not, by habit or practice, a tidy person. This is strongly reflected in my work desk which is awash with stacks of papers, forms and diaries. Unfortunately, I am also someone who has two computers on my desk (see many previous comments on the subject).

The computer I use most is a 27″ screen iMac. The screen is lovely, with excellent image quality.

However, I don’t particularly like Apple keyboards, so I don’t use an Apple keyboard. Instead I have a wireless Logitech keyboard (a  K230 for the record). The previous keyboard that I had didn’t have a number pad on it, so I added a separate wireless number pad (also Logitech, a N305). I’m also not that keen on Apple mice because I need at least two buttons and the direction of scrolling is all wrong, so I have a trackball, which I like because it doesn’t need lots of desk space (M570).

The brilliant thing about the Logitech kit is that they all link using Logitech’s ‘Unity’ wireless system, and, importantly, each Unity USB connector can support up to 6 devices. That means I can have the keyboard, number pad and trackball all connecting to a single USB connection, and I don’t lose a heap of precious USB ports.

I am very happy with this setup and can type quickly, mouse around accurately and enter data in spreadsheets efficiently.

Then there is my other computer. The keyboard is stiff and not particularly pleasant to use, and the mouse is an old Apple mouse (pre touch surface, even pre-rollable nipple thing) where the whole case of the mouse is the button. Its horrible.

So how do I manage this setup, and the challenges of limited desk space, preferred hardware etc. Enter Synergy, a simple system to manage multiple computers from a single keyboard and mouse.

Setting up Synergy appears to be easiest when you are sharing multiple Windows computers as Windows is provided with a nice handy app where you can name computers and define where their monitors lie in relation to one another. Users of other systems need to create and edit a text file to define these relationships. So I chose to make the iMac the server machine and the Windows machine a client. Following instructions was simple enough, and after having a few connection issues caused by misnamings of the two systems I was suddenly up and running.

I have a similar issue in starting the Synergy server on my Linux box that I have setting the keyboard, activating the screensaver etc, so initially I was tempted to append the instructions to activate the server onto the script that sets these things up. However, the only time I’m going to use the Synergy system is at work, so it doesn’t make sense to add this overhead to all my Linux systems. Instead I created a script which launches the Synergy server. I run this after my initial login (and after the keyboard setting script).

Using Synergy is simply a matter of mousing over to the screen edge which is defined as the point at which the two computers meet. For reasons of understandability this should be the edge of the screens where the monitors abut. Pause for a moment and the mouse will flip over to the other screen, and you are in control of the other computer.

One unforeseen advantage of this has been the way that the keyboard layout on the server computer, that is the iMac is the keyboard layout used on the other computer. As I have written elsewhere, I use a non-Qwerty keyboard layout. In Linux I can choose a Dvorak keyboard layout, but with UK punctuation (a £ sign, the @ sign being on the middle row, just by the return key etc). I also have the Caps Lock key and the left hand Ctrl key swapped so that I have a Ctrl key on the home row of the keyboard. Replicating the finer points of this in Windows is difficult as the normal Dvorak options are US English, Dvorak left handed and Dvorak right handed. Customisation is possible, but it requires installation of extra programs and understanding an arcane piece of software.

However, using Synergy with Linux as the server fixes this as the Linux keyboard layout is carried over to the Windows computer as I flip over. Bonus!


Getting Your Message Over…

As part of my job I’m on a mailing list for computer officers from all over the University. By and large this isn’t a hugely busy mailing list. I would guess the biggest use is for people pimping hardware that they no longer need (its incredible how quickly a range of old servers gets snapped up!).

But sometimes (two or three times a year) a subject flares up and the list gets very busy. And today one of those subjects arrived.

One member of the list sent a teaser advert about an announcement which will be made in a months time. The teaser was in the form of a picture file attached to an otherwise blank email.

And the fact that the teaser was an image file attached to an email is what caused all the traffic.

It started off with one user complaining that, because they are using a venerable old email client (Mutt), and the original author neglected to add any ‘alt’ text to their image the user was forced to open the image file in a suitable image viewer, only to discover that the image was almost entirely information free.

The user then received several emails telling him that he could have used another email client and that it would have been fine. However, one of the things that I really enjoy about the University is that it is entirely agnostic about such things, and people are free to use whatever mail client they choose. This is the case even when the choice is both difficult to maintain and causes the user to be unable to upgrade their operating system (yes, I’m looking at you Eudora!). The Computing Service maintains Pine/Alpine available running on the mail servers and accessed via SSH.

I feel a lot of sympathy for the original poster (I’ll call him Mutt). When I first started using email ‘in anger’ I used Pine. It had a steep learning curve, but once you were used to it things got ridiculously easy, muscle memory took over the process of reading, writing and filing emails. But attachments were a problem, and you ended up saving them to some file space and then opening them as required from the file space. Because of this, I sometimes use the Pine system that is available, for that little sting of nostalgia.

I once wrote a similar email to Mutt’s to a mailing list that I was on.  Back then my net connection was ‘dial up’ and I had a bee in my bonnet about the use of html in emails. It was, I contended, a simple matter of signal to noise. Every email is intended to carry an aliquot of information, and ideally the amount of data that had to be uploaded, transmitted and downloaded is proportional to the volume of information in the email. My beef with html email was that most users wrote html emails without even noticing, so never took ‘advantage’ of the available text effects. However, irrespective of whether effects were used or not, the email would then be sent, more often than not as the ‘html’-ised version of the text, followed by the plain version immediately afterwards. The signal to noise ratio in this case was at least half of what it could have been (assuming that there were no html tags used) with the ratio falling further, given the bloat that the html more than likely contained.

So Mutt was making a valid point (the point was even more valid in his case, the data downloaded wasn’t justified by the information to be conveyed, and he needed to go through a couple of hoops to discover that fact). However, the irony in the aftermath is that there then followed a short flurry of emails where many opinions were expressed regarding the use of different email clients and value of data, and so the issue, such as it was, was compounded furiously by the responses received.

My favourite response by far though was the fellow computer officer who, understanding the need to convey the little information involved, but wanting to do so in a text friendly manner generated an ASCII art version of the original teaser poster and sent that to the list. Well played sir!

Linux vs. Windows – Another Linux Success Story.

When I was purchasing my home laptop, I chose a Dell. One of the reasons that I liked the Dell store was the way that I could choose a system and then tweak the requirements as needs be.

As I was running through the options, things like processor, memory and disc size, I remember deliberately choosing not to have a webcam at all.

The reasoning was simple. I was planning to use Linux at least part time on this new computer, and add-ons like webcams were, I thought, difficult to use, or poorly supported. If I didn’t bother having them then I wouldn’t need to fiddle to get them working.

Now, spool forward three or four years. My daughter got a book for Christmas which boasts ‘Augmented Reality’, requiring a simple program install and a webcam. So I borrowed a webcam from work (we have it for those occasions when interviewers want to Skype) and took it home.

Obviously the ‘AR’ software only runs on Windows or Mac, so we booted the laptop into Windows, plugged in the webcam and waited while Windows did its thing.

It is worth noting that Windows 7 does an excellent job of detecting the device and installing the drivers, but it took an inordinately long time to do so (more than 5 minutes, less than 10). But once it was done, it worked very well.

When I got to work this morning I decided to try an experiment by plugging the webcam into my desktop machine running Linux (its a Mac, but it dual boots into Linux because, well, I like it like that!).

I plugged it in, then started up ‘Cheese’, the webcam program where you can add weird and wonderful effects to you images. I then selected ‘Preferences’ and was able to switch between the computers built-in webcam and the USB webcam straight away (with no apparent drivers required).

Now I have a horrible feeling I will need to buy a webcam for home…

Fone Phailure!

Like many people, I have a smart phone. In my case it is a Samsung Galaxy SII which I have had for about 21 months.

It isn’t perfect. If it was up to me the changes I would make are:

  1. Give it a decent battery life, even at the expense of making it thicker and heavier.

Yep, that is about the only change I would make. Everything else about it has been fine.

Until the weekend. Then my phone died, and it is resolutely refusing to come back again.

Being of a tinkering persuasion I chose to investigate a little. I managed to find a colleague who had the same phone so I could borrow the battery. Putting the battery from his phone in mine made no difference, so the battery wasn’t the source of the problem.

I then asked another colleague who works in the electronics workshop where I work to prod a few things with a multimeter to see what he could see. He came back pretty quickly to say that when he plugged the phone in he could see a voltage, but that the voltage disappeared when he pressed the on button. He suspected a short somewhere in the body of the battery.

So there was nothing for it but to go and see the nearest Carphone Warehouse shop, which is, luckily only 5 minutes walk away.

The best news is that my phone, being a Samsung, has a two year warranty, and it was still within the warranty period. So its wending its way, who knows where. Unfortunately the store didn’t have any loan phones available, so I left the store feeling very ‘old skool’ without a phone of any kind.

I tried my old HTC phone (HTC Desire) when I got home, and, as both phones are ‘on’ Orange the old phone works with the sim card.

It did leave me with a couple of observations:

  1. The screen, which once felt perfectly acceptable, now feels tiny!
  2. When you are used to new tech, then old tech feels glacially slow.
  3. Both phones are Android, which means that all the contacts etc are available on the old phone. But many of the apps which I would like to install (Chrome, please, the stock browser is horrible) claim to be installed already.

I have a feeling I will get these teething troubles sorted out, just about the time that my proper phone returns to my grateful hands.