Andy’s Blog

Just another weblog

Low cost but function laptop?

I have been considering getting a laptop however I don’t want to spend a huge amount of money on it.

Of course there are Laptops like the eeePC and the OLPC however these are rather low spec.

As this would be my only laptop it needs to be reasonably functional. At least 25-30 Gig hard drive. Enough processor to run things like Eclipse and compile programs reasonably. WiFi is a must and obviously it must be capable of running Linux (though not necessarily pre-installed). As cheap as possible would be nice, preferably under £300 (though maybe a bit more depending on the features). I do not need to run Windows on the machine, I have Windows on my dual boot PC and rarely run it any more so paying extra to get something Windows compatible would be a waste.

I am considering eeePC and using either SD cards or an external hard drive but carrying round an external drive could be tiresome and would drain the battery much faster.

Another option is using second hand refurbished laptops. Which companies sell these and waht is the best way of going about getting one? Do people think they are worth it it would it be better to buy a brand new machine (Considering I am on a budget).

Anyone here have any suggestions or advice, particularly with respect to checking whether laptops will work well with Linux?


February 18, 2008 Posted by | Uncategorized | 1 Comment

Linux Sol #1: Ejecting

Linux Solution #1

Fixing Unmounting/Ejecting Problems

This is the first in (hopefully) a series of posts about how to fix those
annoying little problems you run into but are too afraid to ask how to
fix. I am not entirely sure how I came to discover these useful tools but
now I have I thought I should write it down somewhere in the hope others
may find it useful.

I am using Ubuntu 6.06 (Dapper), a distribution of Gnu Linux. These
solutions will most likely work across other distributions of
Gnu Linux. Some commands may work on other POSIX systems but
the command line arguments may differ.

This information is supplied with ABSOLUTELY NO WARRANTY.

Please be careful when entering commands. Particularly ones you
find on the Internet. Remember that anyone can post commands on
the web so you should only run something if you know what it does. If in
doubt use the manual. This is a good idea anyway as it can help improve
your knowledge.

For more information about the commands listed use the Linux manual
pages (accessed via the man command)

The Problem

When using a USB stick you all know to unmount (or Eject) the device
before removing it. But what happens if the OS refuses to do this. I have
seen this happen on both Gnu Linux and Windows OSes. On Gnome you will
be presented with a dialog (shown below) when you attempt to eject the

Unable to eject media

Even clicking to show more details isn’t much help.

/media/usbdisk: device is busy

This just tells us that the drive could not be ejected because umount
couldn’t unmount it. It couldn’t be unmounted because it was “busy”.

So what do we do now? If we pull the USB stick out we could lose any
data waiting to be written. Read on for the solution.

The Solution

It would appear that the USB Stick is in use. Now we need to find out
precisely what is using it and put a stop to it. We can use the
fuser command to help us but first we must know either the
name of the device file for the USB stick or the location where it is

The location it is mounted at will often be a folder in /media . If
you need to find the mount location or device file type mount at
the terminal. Note: You do not need to be root (or use sudo) for
this as you are only listing the mounted filesystems not trying to alter
them. One of those lines will refer to your USB stick.

In my case this line starts with:

      /dev/sde1 on /media/usbdisk type vfat

The mount folder is /media/usbdisk the device file is /dev/sde1.

Now you invoke fuser, with the following options. -v
is used to enable verbose output and -m MOUNTFOLDER is used to
tell fuser which device we are interested in.
In my example I get:

      $ fuser -v -m /media/usbdisk/                           USER        PID ACCESS COMMAND

      /media/usbdisk/:     andy      15354 ..c.. bash

                           andy      15795 ..c.. nano

The PID column indicates the “Process ID” of the program that is using
the device. The ACCESS column indicates the type of access, in this
case the c means that the program is using the directory
(or sub directory) as it’s working directory. This happens if you have a
shell open and have used cd to move to that folder or you have
invoked a program from that location.

If you have several copies of a program running and you can’t work out
which one it is you can get the full command used to open the program by
using the ps command with -fp and the PID listed.
For example:

      $ ps -p 15795 -f

      UID        PID  PPID  C STIME TTY          TIME CMD

      andy     15795 15354  0 19:40 pts/2    00:00:00 nano ftpscript.txt

Remember that some programs reuse a previous copy of themselves. For
instance if you use Gedit to open a file on your USB disk (from the
command line) and then close the file and open another (without closing
Gedit itself) it may still have it’s working directory set to the one on
your USB disk.

Once you have identified the program causing problems you can either
close the program or change it’s working directory. fuser should
no longer list any programs. The drive should now unmount or
Eject without any problems.

There may of course be other things that cause the device to be
considered busy. For example executing a file from the device.
This is indicated by the ACCESS column in the fuser output.
For more information consult the appropriate manual page.

February 5, 2008 Posted by | Linux, Ubuntu | 3 Comments

Should the Linux community reverse enginner iPlayer and 4OD?

If you live in the UK you are probably well aware of the BBC’s iPlayer[1] and channel 4’s 4OD[2] program.

These are both pieces of (proprietary) software that allows (windows using) people to download TV programs and watch them on their PC.

Linux users have been intentionally excluded from this by Channel 4 and the BBC, despite the BBC’s obligations under it’s charter[3], requests from it’s regulator (the BBC Trust)[4], and protests from it’s license fee payers[5]. The BBC has stated in a podcast[6] that they will not use open source as open source is “insecure” (of course that could have been easily tampered with as a cracker could have broken into their servers as they run open source code[7] on many of them and therefore must be horribly insecure).

So as the BBC have admitted they will not provide us access to the content we pay for (I pay the same T.V. License fee as anyone else!) then maybe we should consider doing it ourselves

If we sit idle it will be almost impossible to introduce people to Linux as Microsoft now have a whole supply of T.V. to go with there OS that we can not compete with. Even though Microsoft never even produced the content in the first place, in fact members of the Free Software community even payed for the production of some of it.

The Open Source and Free Software communities can write good quality code. Linux seems to be more secure, faster and stable than it’s competitors, GCC is one of the most widely used C Compilers and Firefox is increasing it’s market share rapidly, not to mention the Apache webserver (which the BBC [7] and Channel4 [11] both use). So should we write a replacement for 4OD and iPlayer?

To begin writing a replacement we would need to know how to speak with the Channel4 and BBC servers. We also need to know how to read what they send us. To do this we would need to reverse engineer the current programs to determine how they communicate and re-implement it in our own application.

Are choices are few but here are some of them:

  1. Sit back and do nothing
  2. Implement and application similar to iPlayer and 4OD (including DRM) but using other formats and communication protocols
  3. As number 2 only minus the DRM.
  4. As number 2 only reverse engineer iPlayer and 4OD so we can use the same formats and protocols.
  5. Pursue Political options (write to MP’s, MEP’s, the Prime Minister etc.)
  6. Pursue Legal options, the BBC has requirements in it’s charter, we could continue fighting for the BBC Trust and Ofcom to take action or ask the E.U. to intervene in the matter.

If we go for option 1 desktop Linux will be dead (at least in the U.K.) very shortly.

If we go for option 2 we would have a useful application but there is no guarantee that either the BBC or Channel 4 would use it. After all Firefox can access webpages fine but the BBC blocked it from iPlayer.

If we go for option 3 we would have the same problem as option 2 with the added problem that the BBC is s huge fan of DRM and will refuse to consider anything that doesn’t use it (despite it being useless and the one they selected being cracked before the BBC released iPlayer[8], at least we know the BBC’s use of DRM has nothing to do with protecting content then).

If we go for option 4 there would be little that the BBC or Channel 4 could do. We wouldn’t need their help provided we can find enough people with the skills to reverse engineer binaries. There may however be legal issues, perhaps less with iPlayer as the charter imposes limits on when the BBC can actually sue people. Any lawyers out there want to comment on this option?

Option 5 seems good on the face of it, but as there is no election on the horizon any more MPs will no doubt fail to act. This was also tried before and the Prime Minister himself refused to provide any reassurance to the 16 thousand people who signed a petition to number 10[9].

Option 6, this is still a good option. But the E.U. have taken years to bring a judgment against Microsoft for actions it committed years ago and if we wait this long again then it will already be too late. Ofcom and the BBC Trust have said they consider Platform Neutrality to be important but have refused to actually do anything about the BBC’s refusal to comply. (it would appear compliance with regulators is optional).

If done correctly Options 2, 3, and 4 could all be done at the same time. After all if we place the code for protocol communication in a separate library or module then we could simply attach entries for iPlayer and 4OD once it’s been reverse engineered and the legal issues clarified. Again for the DRM code it would be in a separate module which could be removed to generate option 3, it would be present in option 2, and it would contain the reverse engineered formats for option 4.

One question remains, who should fund this venture and who provides resources? Let’s be straight reverse engineering is possible but difficult. (Although the Samba guys managed to reverse engineer Microsoft’s file sharing protocol reasonably well.) We would also need some kind of legal protection. Maybe the FSF would be willing to provide that?

Of course producing options 2 and 3 would be easier. And if we can make it run on all platforms easily we would have a strong case for forcing the BBC at least into replacing their current code (and hopefully returning the money they wasted back to us the license fee payer).

Some other questions:

  1. What programming language? Python, Java, C?
  2. What formats and protocols? Bittorrent, TV-Anytime, OpenIPMP, Java DReaM?
  3. FUNDING (again)

Why have the desktop Linux vendors done nothing? Do they consider the U.K. completely unimportant? I would have at least expected Canonical (of Ubuntu fame) to have stood up for us, does the U.K. not matter to them anymore? How about it Jono, will Canonical stand up and help?

Feel free to comment below.


(I am not responsible for the content of external links)

November 4, 2007 Posted by | Computing, Free Software, Software | 17 Comments

Open Source Licences – Hindering Open Source Development?

Before I start I should say that all going well this should appear on the Ubuntu-UK planet (cross fingers ;))

OK so we begin.

I’m sure many of you are aware of the British Broadcasting Corporation (BBC), if you aren’t they are a publicly funded broadcasting (T.V., Radio, Website etc.). If you own a T.V. in the U.K. you generally have to pay a licensing fee which is where the BBC gets some of it’s money from. The BBC developed an application they call “iPlayer” which currently only runs on “Microsoft Windows XP”, claiming that they couldn’t develop a cross platform application without it taking a long time and costing a lot. In an attempt to prove that this is completely untrue I thought I would take a look into how easy (or hard) this is.

As two of the important benchmarks are Cost (I am a poor student), and Time, I thought “How can I keep cost down and develop fast”. And then I thought “Hay this is Open Source (or Free Software if you prefer), I can borrow from other peoples code and just bolt them together.”.

So what I needed was:

  • Media Playback
  • Peer to Peer download capabilities
  • Fetching show schedules
  • DRM (A requirement of the BBC, if I am to show that it wasn’t as difficult as claimed to produce a cross platform application I at least have to meet the same requirements do I not?)

In a few hours I have got a basic GUI (thanks to the Java Swing library) so now I am looking at solving the other problems.

First Media Playback, after rejecting Jtheora (poor documentation made it unusable) I settled on JMF (Java Media Framework). Only it’s not open source, however I don’t actually need to distribute the code due to the way Java works so not a problem there.

Peer to Peer, well there is a GPL BitTorrent library called Snark, I haven’t quite worked out how to use it yet though.

Fetching the program data really depends on the format. There is a format called TV Anytime, and helpfully the BBC have written a java library for parsing it. This is licensed LGPL (that’s another different licence!).

Now DRM, I knew this was going to be a problem but luckily there is Java DReaM. Sorted right? WRONG! It is licensed under CDDL. Now as far as I can tell that means I can’t use it in my GPL application. And I can’t make my application CDDL because then I couldn’t use the GPL or LGPL code.

So is all the different licenses actually slowing down development? All I was trying to do is build a new application. It doesn’t do anything special just things that many people have done before so surely I could use their code. And then I suddenly have to switch from being a Software Engineer to a Lawyer to determine which open source code I can or cannot use in an open source application. This slows me down a lot because I am not a Lawyer. I don’t know how to read these complex legal documents. Can the Open Source and Free Software communities really afford to have such time wasted by legal complexities that we put in our own way?

Another problem is of course that I require the libraries to be in Java. Many aren’t. A single unified language would be good. It wasn’t so much a problem for platform specific applications you can compile down to binary from and from there they library sort of looks the same (OK I know there are differences but I can call a shared object file from different languages so it’s not a huge problem). Unfortunately I lose that when trying to go Platform Independant. I can not run native libraries as the entire code would then be locked to whatever platform I could port the library to.

So do we need a single unified license, or possibly a set of compatible licenses instead of the incompatible ones we have now.

Do we need a single unified format for cross platform “binaries”? I can access a library written in one language from a different language when they are natively compiled, why is there no standard for doing this with platform independant code? Is it just a standard Virtual Machine we need? Should we all just switch to Java? Should other languages compile to Java byte code the way that compile to native machine code (is this possible?).

Any way back to the drawing board with my Free iPlayer replacement.

For anyone interested I have been able to get it to playback media files, JMF have a bean that requires only a few lines of code. SO useful, pity there’s not a Free (as in speech) implementation (that I am aware of)

September 25, 2007 Posted by | Computing, Free Software, Software | Leave a comment