Results tagged “Linux”

I’ve recently been issued with a new Macbook Pro (actually the old MacBookPro4,1 model), and decided that rather than dual boot Linux and Mac OS X as I was doing before, I’d take the plunge and run OS X with Linux under virtualization. Some thoughts:

  • My productivity has gone through the roof because
    1. I don’t need to reboot to switch OS
    2. I can use each OS to its strengths
    3. All my files shared between three operating systems making management and backup a lot simpler
  • Sharing files between the native OS and VMs is seamless. I have the same desktop and home folders in OS X, Windows XP and Linux.

  • With VMware tools in the ‘guest’ operating systems, copy ‘n’ paste of text and drag ‘n’ drop of files between operating systems ‘just works’

  • Audio, video, networking, bluetooth and the iSight ‘just work’ in all three operating systems, but don’t expect great performance. I can’t get hardware-accelerated graphics under Linux because the OS can only access VMWare’s emulation layer and not the underlying hardware. Audio is basic — forget doing any real-time or low-latency work.

  • On the positive side, I don’t need to worry about getting drivers working for new hardware, e.g. external audio devices. if it works in OS X, it works in the guest OS. For example, firwire audio devices — previously a bit tricky under Linux — work just as well (or badly) as USB devices.

  • The keyboard and touchpad basically work, but I had to add some custom xmodmap configuration. Note: this is nothing to do with VMWare per se, I get the same problem with a ‘native’ install of OS X on the MacIntel hardware.

To summarise, the switch to a heavily virtualised setup has been an epiphany in terms of productivity and convenience, but this has been at the expense of high-performance graphics and sound on the Linux side.

Every so often, someone will ask me ‘is Linux ready for the desktop?’. The implication of this is that there is some consensus that whilst GNU/Linux has established credentials in the server market, it isn’t suitable for desktop use.

But these are the wrong questions.

When someone asks ‘is Linux ready for the desktop?’, they are asking ‘can Linux do all the things my existing OS can do?’, ‘will it work well with all my existing hardware?’, ‘will it open Microsoft Office documents?’, ‘will it feel familiar to me?’…

The answer to these questions is ‘probably not’. Your GNU/Linux system will probably work with most of your hardware, but not all of it. Your Microsoft Office documents will open in OpenOffice, but maybe some functionality wont work, maybe it won’t look the same. The desktop environment will probably not work as you expect it to, it might feel different.

But these are the wrong questions.

When someone asks ‘is Linux ready for the desktop?’, they are asking ‘is Linux a usable operating system?’, ‘is it accessible?’, ‘is it visually appealing?’…

The answer to these questions is ‘probably not’. If you use the ‘right’ desktop environment, and the ‘right’ software, and have things configured properly, and the system is a good fit for how you think, then a GNU/Linux system can be a usable, accessible, delightful user experience, but it isn’t always.

But these are the wrong questions.

The point is that GNU/Linux is different. It is different to Microsoft Windows, it is different Mac OS X, it can do different things, and works in a different way. GNU/Linux will work with different hardware to your existing system, it will sometimes perform better. It will open documents that are different to Microsoft Office documents, and sometimes these documents will look better. The desktop environment will look and feel different, and sometimes it will be more usable.

When someone asks ‘is Linux ready for the desktop?’, they are really asking ‘can Linux do all the things I can already do with my existing system?’. The answer to this question will always be ‘no’. If you want to use all your existing software, with your existing hardware and keep using the same applications, then you don’t need Linux. It doesn’t matter if it is ready for the Desktop, because you don’t need it.

So is Linux ready for the desktop?

The real answer is: ‘who cares?’ There are many interesting questions to ask about Linux, and this just isn’t one of them.

I’ve recently been reading The Wisdom of Crowds by James Surowiecki. It’s an interesting book, and despite many America-centric examples the author uses (which I quickly started to skim over),I recommend it to anyone who’s interested in the notion of ‘crowd’ intelligence. As a user and writer of Free Software, I was particularly keen to read the chapter on decentralisation, which uses GNU/Linux as an example of where decentralisation has been successful. On this subject Surowiecki writes:

“Unlike Windows which is owned by Microsoft and worked on only by Microsoft employees, Linux is owned by no one. When a problem arises with the way Linux works, it only gets fixed if someone, on his own, offers a good solution.”

“Linux is clearly a decentralized system, since it has no formal organization and its contributors come from all over the world. What decentralization offers Linux is diversity.”

“There’s enough variety among [Linux] programmers, and there are enough programmers, that no matter what the bug is, someone is going to come up with a fix for it. And there’s enough diversity that someone will recognize bugs when they appear.”

However, Surowiecki, treats the general idea of decentralisation in organisations with some scepticism calling it a “capacious term, and in the past few years it’s been tossed around more freely than ever”, and pointing out “Linux’s seeming wastefulness” which could be seen as “a kind of strength that for-profit companies cannot, fortunately or unfortunately cannot rely on”.

This is a healthy scepticism, since clearly there are many situations where decentralisation is the wrong approach. However, Surowiecki seems to miss the obvious ‘open goal’ in this chapter, which is that successful free and open source software projects don’t start as decentralised efforts. Linus Torvalds didn’t start the Linux Kernel with an empty text file and make a ‘call for contributions’, he wrote a working kernel on his own, and only after this original proof-of-concept was working did the community start contributing.

A similar pattern can be observed in many other FOSS projects, where a single individual or small group has worked intensively on a project, and then released the software once it has gained a degree of maturity. If the software is accepted and useful to the community, only then will a decentralised team emerge, and this takes significant time.

In this sense decentralisation could be considered as the ideal partner to an initial very intensive centralisation. On well-working decentralised projects, centralisation and decentralisation coexist in a fragile but powerful balance. As Surowiecki writes:

”[…] striking a balance between the local and the global is essential: a decentralized system can only produce genuinely intelligent results if there’s a means of aggregating the information of everyone in the system”

“Aggregation — which could be seen as a curious form of centralization — is therefore paradoxically important to the success of decentralization.”

Key questions for a project are therefore ‘when to decentralise?’ and ‘how much to centralise by?’. I suspect that these are not decisions that can be made, but rather that decentralisation ‘just happens’ when a project reaches a certain point, and if its creators allow. However, what is clear is that the utility and substance of the project (its centre) must be fully established before decentralisation can be meaningful.

  1. Install Ubuntu 7.10 (Gutsy)
  2. Enable [Compiz Fusion][1], by right clicking the Desktop, selecting Change Desktop Background->Visual Effects->Extra
  3. Install the CompizConfig Settings Manager and customise to taste
  4. Add a pinch of [screenlets][2] following the [instructions][4] in the screenlets FAQ
  5. Setup screenlets to taste under System->Preferences->Screenlets
  6. Stir into Compiz Fusion, by enabling widget layer in CCSM, and enabling Treat as widget under each screenlet’s options (right-click the screenlet to access)
  7. Add a dash of [Avant Window Navigator][3] following the instructions [here][5]
  8. Season with the [Ubuntu studio theme][6]

…leave to cool, and serve on a bed of Python snippets!

UnRTF!

If you are a GNU/Linux user, and you have been working with a Mac user or Mac software, the chances are that you have received files in RTF format. This is because it’s the default format of the standard Mac ‘text’ editor: TextEdit. I have nothing against RTF as a format, it just annoys me when it is used for plain text documents that don’t have (or need) any formatting.

There are a number of ways to deal with RTF on your GNU/Linux system, you could open the document in a word processor such as OpenOffice writer, or AbiWord, or use the RTF editor Ted. However, if the document has no special formatting information in it or you don’t care about the formatting, you probably want to remove the RTF markup.

UnRTF

UnRTF an aptly-named GNU command-line application that will convert RTF files to a variety of useful output formats. These include HTML, plain text, text with VT100 codes, LaTeX, and PostScript. All but HTML are currently flagged as alpha, however for simple documents I have found them to be fine. To run UnRTF, you need to issue the following command from a shell prompt:

unrtf --text mydoc.rtf > mydoc.txt

This will convert the RTF file mydoc.rtf to plain text format. For complex documents one might wish to use HTML as a transitional format, and then make use of other tools. For example [htmldoc][5] could be used to convert to pdf:

unrtf mydoc.rtf |  htmldoc --webpage -f mydoc.pdf -

And maybe you could even use the wonderful [ImageMagick][6] convert utility to rasterize the data:

convert -density 196 mydoc.pdf mydoc.png

I’m not sure what the purpose of that would be, but I thought I’d throw it in for fun!

CPR for Linux

I have been using some form of GNU/Linux as my main operating system for the best part of 5 years now. In general, I am a very happy user - most of the software I use ‘just works’ and the time I need to spend doing system administration is minimal. However, very occasionally I end up succumbing to the temptation of bleeding edge, and my computer refuses to boot…

Don’t panic!

So the Linux heart has stopped beating, and you can no longer access your precious OS. What do you do? Well the first thing is to remain calm, don’t try anything crazy like doing a complete reinstall, I can almost guarantee you won’t need to.

Pull your bootstraps up

The first thing you need is another means by which to boot your machine so you can mount your hard drive and access your data. This process is known as bootstrapping. There are a number of dedicated rescue disks for this purpose, but most of the time your distribution CD will be just fine. I recently used an Xubuntu CD to rescue an Ubuntu system, because I couldn’t find my Ubuntu disk.

Basically you need to get yourself booted into a shell on your machine ASAP, so you can get to fixing your system. To do this, some disks provide a ‘boot into rescue mode’ option, others will give take you straight into a window manager from which you can launch a terminal. For older disks, you might have specify ‘linux single’ to the the ‘boot:’ prompt to boot into single-user mode.

The kiss of life

Booting into a shell from your CD isn’t in itself going to bring your system back to life. For this you need to switch to a chrooted environment, and I always forget the exact process, hence this blog post! (I recommend writing the following commands on the cover of your boot CD as a future aide-mémoire).

Firstly you need to mount your system disk at a mount point in the current shell’s virtual file system. Something like:

mkdir /mnt/mydisk
mount /dev/sda3 /mnt/mydisk

Where /dev/sda3 is the system disk partition you are recovering. If you can’t work out which partition holds your system, fdisk -l might give you some hints. If you can’t mount your system partition, you are probably in more serious trouble, perhaps try running fsck on the wounded partition e.g. fsck /dev/sda3.

Now we have a mounted system partition, we are half way to accessing it, but first we must bind to our current /dev tree. This means that when we perform the chroot, our new environment will still get access to the special /dev (device) file system:

mount --bind /dev /mnt/mydisk/dev

Now we are ready to chroot:

chroot /mnt/mydisk/dev

It’s alive!

If you’ve got this far, it’s good news, you have now successfully mounted your system partition, and are you are no longer in the boot CD shell, but instead inside a chrooted shell. This means that your system disk root is now your working root. To confirm this try ls -al.

More special file systems

With Linux (and other Unixes), from the Kernel’s perspective everything is a file. Before we did the chroot, we bound to the /dev filesystem, which provides access to devices such as the computer’s disks, sound card etc. We now need to mount the proc and sys file systems:

mount -t proc none /proc
mount -t sysfs none /sys

What to do next?

This article can help you no further! How to get your system back to a state where it boots depends on exactly what your problem is. In my most recent experience, I had corrupted my lilo configuration, and just needed to fix a symbolic link, and re-run lilo -b /dev/sda3. You’ve done the resuscitation, now for the surgery…

1
Close