A home for those vital pieces of information, which make it all work. This site is initially just a container for Chris Dew's blog, but it may grow to be more than that. All from a UK/Linux/Haskell/Python/C perspective.

Best UK linux wireless broadband, May 2009 - T-Mobile and Ubuntu 9.04.

Ubuntu 9.04 and t-mobile wireless broadband.

I bought a t-mobile 'USB stick 110' (which is actually a Huawai E160 dongle). It cost £40, including £20 credit. It's PAYG, costing £2/day, with a 3GB monthly limit.

I plugged it into my laptop and a new connection appeared in the network manager.

Sceptically, I clicked to enable it - and *it just worked*.

No messing with kernels, mode switching or anything else.

The E160 is detected as an E220, which is fully supported by linux.

chris@vostro:~$ lsusb | grep Huawei

Virtual Machines - client filesystems should stop using green-field blocks in sparse files.

A small change to client filesystems could stop unnecessary growth of virtual machine storage requirements.

Virtual machines' storage is often provided by sparse files.

Sparse files are space-efficient because blocks which solely contain zeros are not stored. If a sparse file contains 100MB of zeros followed by 1MB of data, it's length will be 101MB, but it will only occupy 1MB of disk space.

There are problems with using sparse files as VM storage:

  • If an area of a sparse file used to contain data, but now contains zeros, it will still occupy disk space.

kill -0

Introduction
I must admit, after a decade of working professionally with unix/linux, that I had never encountered kill -0 until last week.

What does the -0 signal do?
Nothing at all...

What is it useful for?
It returns 0 if the process exists, or 1 (and an error message on stderr) if it doesn't.

errno.h - C Error Codes in Linux

I occasionally google C error codes, but always end up grepping through /usr/include to find the answer (on Ubuntu 8.10). To save myself, and a few others, some time in the future...

/usr/include/asm-generic/errno-base.h

#ifndef _ASM_GENERIC_ERRNO_BASE_H
#define _ASM_GENERIC_ERRNO_BASE_H
 
#define	EPERM		 1	/* Operation not permitted */
#define	ENOENT		 2	/* No such file or directory */
#define	ESRCH		 3	/* No such process */
#define	EINTR		 4	/* Interrupted system call */
#define	EIO		 5	/* I/O error */

SSD and HDD in one laptop?

SSD and HDD in one laptop?

Yes, you can fit two hard disks in one budget laptop. This gives you the benefits of OS speed on the SSD and capacity on the HDD. See my review of Dell Vostro 1710 with x86_64 Ubuntu for details. Also see SSD benchmarks.

The Ultimate Budget Desktop Replacement for £624? Dell Vostro 1710 with Ubuntu 8.10 x86_64 review.

I recently purchased a Dell Vostro 1710 17" laptop, with 2.1GHz Core2 Duo, 4GB RAM and 1920x1200 display for £624 + VAT.

The requirement was for a new machine to be used as a 'desktop replacement' laptop. As I'm a software developer, it needed a big screen, lots of ram, and to have virtualisation support in the CPU. Fast OpenGL support didn't hurt either :-)

SSD Bonnie++ Benchmarks

I've been in the fortunate position to test a couple of SSDs recently. To round things off, I've also included results for a standard 7,200rpm SATA disk and a USB key.

The results are:

SAMSUNG MCBQE32G5MPP-0VA £400
seq. write: 65MB/s
seq. read: 96MB/s
random seeks: 7,511/s

OCZ VERTEX 00.PT1 £100
seq. write: 77MB/s
seq. read: 142MB/s
random seeks: 9,058/s

WDC WD1600AAJS-00B4A0 (normal 3.5" 7,200rpm hdd) £30
seq. write: 68MB/s
seq. read: 91MB/s
random seeks: 226/s

KINGSTON DATATRAVELER USB STICK
seq. write: 8MB/s
seq. read: 32MB/s
random seeks: 2,828/s

Fix for Cursor Keys in VMware server, under Ubuntu 8.10 Intrepid

To make the Arrow Keys (and other cursor control) work in VMware 1.x server, under Ubuntu 8.10, do the following in bash:

cat > ~/.vmware/config <<EOF
xkeymap.keycode.108 = 0x138 # Alt_R
xkeymap.keycode.106 = 0x135 # KP_Divide
xkeymap.keycode.104 = 0x11c # KP_Enter
xkeymap.keycode.111 = 0x148 # Up
xkeymap.keycode.116 = 0x150 # Down
xkeymap.keycode.113 = 0x14b # Left
xkeymap.keycode.114 = 0x14d # Right
xkeymap.keycode.105 = 0x11d # Control_R
xkeymap.keycode.118 = 0x152 # Insert
xkeymap.keycode.119 = 0x153 # Delete
xkeymap.keycode.110 = 0x147 # Home

How to undelete any open, deleted file on linux.

Introduction

There are many situations where a file has been deleted (typically by an overnight log-cleaning process), yet the inode is still held open by a process reading from, or writing to, it. Recovery of such a file is simple, regardless of whether it is on ext2, ext3, reiserfs or any other filesystem.

When a file is deleted in linux, it is simply 'unlinked'. The inode, which contains the file's data, is not deleted until all processes have finished with it. This is why processes can carry on writing to deleted files.

Decoupling time from physics.

It's possible to decouple time from physics, and it's especially easy in Haskell.

The (higher order) function below (lazily) accepts a list of events and yields a function which can give the historical or predicted displacement at any given time.

Note: The events do not have to be in chronological order - this provides a way to deal with lag in networked games.

Syndicate content