This is really dumb – I was getting errors of “skipping incompatible libraries” when I was compiling a 32-bit executable (using -m32) on 64-bit linux

And this is after I have installed “ia32-libs lib32gcc1 libc6-dev-i386″

The solution is apparently “ln -s /usr/lib32/libstdc++.so.6 /usr/lib32/libstdc++.so”, because the package manager is not making the links that the linker expects.

And this wasted an hour of my time.

Wikileaks is the one site where you can finally answer the question – “who watches the watchmen”.

I think it is more than our duty to keep a site going, which guarantees release of information, that would otherwise be locked up by powers-that-be. There exists, no finer site to protect our freedom and liberty.

Donate now – http://wikileaks.org/

I think I found a 5$ webcam which can be used with Skype in Linux. I used Skype 2.1 with Ubuntu Karmic 64-bit.

The said webcam is this : http://www.dealextreme.com/details.dx/sku.13 . I am not 100% sure, since I bought a variant of it in India, but as long as the lsusb output shows

Bus 002 Device 010: ID 04fc:2001 Sunplus Technology Co., Ltd

you should be fine (the ID 04fc:2001 being most important).

One needs to compile and install the gspca drivers, as outlined here, but I have also checked in the .config file needed in my github repository.

On that topic, the GSPCA linux webcam driver makes for very interesting history, with one man having written 235 drivers! I’m not sure, who is the current maintainer, but hats off to all of them!

Guys, always buy UVC (USB Video Class) webcams.

Edit: By the way the Dealextreme product is pretty random in its choice of chipset – it sometimes comes with non-UVC class chipsets .. which then are a pain.

When resizing extended partitions with gparted – and your extended partition contains your swap partition – make sure you turn off your swap (right click and “swapoff”). Otherwise you will NOT be able to resize your extended partition.

I had a duhh moment, until I realized that the swap partition showed a key/lock symbol next to it – meaning it was in use.

By far, the best Office software for Linux – SoftMaker Office 2008 – is being given away by free for a charity campaign.

For those not in the know, it kicks OpenOffice’s ass.

Dont walk.. run and get it!!!

Just reposting a call for grassroot funding by the most exciting lisp-like project to come out in recent times – Clojure, especially since it is built over the Java Virtual Machine (JVM). This enables businesses to leverage the gazillions of existing enteprise-scale Java libraries, and still use it in a lisp like syntax.

Scala (and Lift) and Clojure are two of the most exciting new developments happening in the programming-language theory world. Who knows, they may end up saving Java from Rails and Django !

We are strongly considering using Scala and Lift to build our next webapp over Rails.

If only Java had a better package manager (like gem) rather than that god-forsaken maven.

THIS is one superbly researched, behind-the-scenes, whistle blower article. Wow.
A window into the murky world of billion dollar CPU and graphics designs.

Personally, I am rooting for nVidia (thanks for the Linux support!). But, just last week I built a machine for virtualization – Quad X4 620, on a Gigabyte 785GS board with integrated ATI 4200 graphics. The price-to-power-to-power-consumption ration was just awesome.

AMD/ATI is in a nice position with their integrated chipsets – and the discrete ATI5870 is kicking ass.

But there is a new entry into the graphics arena – Imagination Technologies with the PowerVR core.

Nice.

when I was working on the Windows Management Instrumentation (WMI), we got to use wbemtest quite a lot. Especially the root/cimv2 namspace was good to get information about system hardware.

These days if someone asks me (on a windows machine about how many RAM slots it has, etc., I can look it up in wbemtest quick enough.

Call me stupid, but I never knew what the Linux equivalent was – considering Linux addresses everything as a file it was exceedingly straightforward

read bv < /sys/class/sound/card0/device/modalias

echo $bv

or

read bv < /sys/class/dmi/id/bios_version

echo $bv

We needed to build a network storage system to store a few hundred gigabytes of data. Our goals were pretty basic at first : reliability and serving the data to windows clients. So started a search for several fileserver systems – we looked basically at OpenFiler and FreeNAS. Both were good enough, and had a sizeable community behind them.

OpenFiler was looking a little more desirable because of the Linux base (FreeNAS has a FreeBSD base). However, I could not wrap my head around the snapshotting system. Moreover, the backup methodology was a bit too weird. Incremental backup was simply too difficult (Amanda?).

Eventually, my search led me to ZFS – it is a filesystem built to simplify enterprise-scale data management. It handles everything – striping, mirroring, backups, incremental-backups, etc. at the filesystem level. It is free and opensource – developed by the wizards at Sun. Moreover, companies like Netapp (whose enterprise systems cost hundreds of thousands of dollars) have been embroiled with Sun over intellectual property rights on ZFS – I dont want to go into which one was first, just that they are both technically great.

What’s the catch? ZFS has an opensource license which makes it incompatible with Linux’s GPL2.

Enter the ZFS-FUSE project – a way to get around the GPL2 by linking the ZFS filesystem with a user-mode driver (rather than the kernel). Both FreeNAS (based on FreeBSD) and Nexenta (a distribution built on OpenSolaris) have ZFS included – but I really preferred using a Linux based distribution.

ZFS-Fuse can be installed as part of the Ubuntu package manager, however it is a very old release (0.5.0). Instead, I checked it out from the repository and built it – well actually I redid the build system and contributed that patchset back to zfs-fuse.

how ZFS-Fuse works

  • Create a pool using sudo zpool create tank /dev/sdb1 . I like to think of a zfs pool as a one-to-one relationship between usable free space and it’s underlying hardware. At this point, you can create zpools of various types – like RAIDZ, etc. ZFS-Fuse will create a directory called /tank in your root.
  • Going forward you can seamlessly grow the pool using sudo zpool add tank /dev/sdb2 . No need to use third-party software to resize disks, etc.
  • When you attach a blank disk to your compute, the raw disk (without any partitions) is addressable using monikers like /dev/sda /dev/sdb , etc. while partitions (after creation) are addressable using /dev/sda1 /dev/sdb1 , etc. It is advisable to create one partition (using gparted), since if you dont, the zfs volumes are not portable across linux and solaris – this is because zfs implicitly creates a partition on Solaris, while Linux doesnt.
  • Once a pool is created/managed, you never need to bother about the hardware again.
  • Create a filesystem using zfs create tank/filesystem1 . I like to think of a filesystem as a logical unit of management (as opposed to a pool, which has a hardware relationship) - in the same pool, I can have a read-only filesystem, an encrypted filesystem, etc.
  • To set the filesystem as readonly, do sudo zfs set readonly=yes tank/filesystem1
  • Delete a filesystem (or pool) by sudo zfs destroy tank/filesystem (or sudo zpool destroy tank). You may have to use the -r flag to destroy the filesystem and all its contained snapshots.

Snapshots

In ZFS snapshots are instantaneous using sudo zfs snapshot tank/fileserver@snapshot1 .

ZFS is a copy-on-write filesystem – which means that if you have snapshotted something and you overwrite the file, it will not actually overwrite the file, it makes copies (however it is smart enough not to copy the entire file, only at the block level).

In Solaris, you can navigate your snapshots by going in a special .zfs directory and having all snapshots available as aseparate directory. In ZFS-Fuse on Linux, this facility is not available (yet). However one can create a clone (which is also instantaneous and does not occupy extra space) by doing sudo zfs clone tank/fileserver1@snapshot1 tank/restore and you will instantaneously get a new directory /tank/restore which has the contents of your snapshot1.

Backup

To backup, you need to create a snapshot – this allows your users to keep working and for you to know that you are backing up a known state.

  • Full backup - sudo zfs send tank/fileserver1@snapshot2 > /media/externaldisk/backup.snapshot2
  • Incremental backup – sudo zfs send -i tank/fileserver1@sourcesnapshot tank/fileserver1@newsnapshot > /media/externalsdisk/backup.incremental_wrt_newsnapshot

Restore

  • Full restore – sudo zfs receive tank/newfileserver < /media/externaldisk/backup.snapshot
  • Incremental restore – sudo zfs receive tank/newfileserver < /media/externaldisk/backup.snapshot_wrt_original

(you may have to use the -f flag to force, since even doing an ls seems to make zfs think that the restore has been modified)

Mirror

After you have added a new hard-disk and created a new partition on it, you can mirror your pool by doing sudo zpool attach tank /dev/existingpartition /dev/newpartition

One of the things that happened to me was that actually a 320 GB hdd doesnt have 320gb exactly – the addressable disk space varies according to model and/or manufacturer. A mirror can only be added if its size is greater than or equal to existing pool. What happened to me was that the new disk I got actually had a few hundred mb lesser than the original – which meant I got an error of disk is not big enough. What I then did was to create a new pool on the newer disk – copy over everything, destroy the previous pool and add that as the mirror.

My current el-cheapo setup

Two 320GB SATA hard disk as a mirror and a 80GB IDE harddisk as the OS.  I snapshot everyday for a week and then cleanup the next week. We do a full backup every monday and incremental backup every weekday. Your paranoia level may differ. If anybody screws up and wants to recover an older version of the fileserver – I simply clone a previous snapshot (as detailed above) and make it available.

I share this pool using samba. You may need to set the startup sequence (Linux distribution dependent) to start samba after zfs-fuse has already started up.