April 25, 2007
SquashFS is a compressed read-only file system for Linux. Most live-cd distributions compress the data on their CDs with (you guessed) SquashFS.
It used to be necessary to patch and recompile the kernel to get SquashFS to work, but in modern distributions it seems to work out of the box – at least in Ubuntu it does. All you have to do is install the squashfs-tools package.
sudo aptitude install squashfs-tools
I’ll give an example of how to create and mount a SquashFS image. I will compress two directories: kdelibs-apidocs (the API for KDE 3.5, about 280MB) and jdk-1_5_0-doc (the API for Java SDK 5.0, about 225MB). To create the image, use the command mksquashfs <list of directories> <image name>
mksquashfs kdelibs-apidocs/ jdk-1_5_0-doc/ doc.squashfs
Pure magic! 505MB of data compressed into a reasonable-sized 71MB image!
But that’s not all. Now you can mount the image and browse the directories in it at a speed almost as high as if they wouldn’t be compressed.
sudo mount -o loop -t squashfs doc.squashfs /mnt/doc
And unmount it with
sudo umount /mnt/doc
You can put these into scripts and have them on your desktop, only one click away!
Here’s a tip for the more adventurous folk: You can have LZMA compression with SquashFS, but that requires some dirty kernel patching. LZMA is one of the best compression algorithms out there, as you may know from the 7-Zip file archiver. The default SquashFS uses mere gzip compression.
Read the rest of this entry »
Leave a Comment » |
Linux, Shell, Technology |
Permalink
Posted by Constantin
April 15, 2007
Many audio books are split into tiny pieces of 1-2MB (under 10 minutes). This has bothered me for quite some time, as my DAP has a nasty habit of not playing the last few seconds of files, thus making it impossible to hear the last words. Today I decided to do something about it. I expected powerful tools like mplayer/mencoder to have an option for this kind of thing, but wasn’t able to find one. So I went for the hard way: I created a file with 0.5 seconds of silence (with Audacity), and manually appended it to each and every of the 100+ files (with qwavjoin, which is part of the quelcom package). I made a bash script for automating it (and converting to OGG right away). Note that to merge two WAV files they need to be the exact same format (i.e. the same sampling rate and number of channels). If the stereo, 22050Hz “silence file” I used doesn’t work, you’ll need to create your own. You can see this script and some other stuff in the Magic section.
Good luck and happy listening ;)
1 Comment |
Linux, Programming, Random, Shell |
Permalink
Posted by Constantin
April 12, 2007
Breaking news! Mark Shuttleworth announced today that the following version of Ubuntu, scheduled for release in October, will be called the Gutsy Gibbon.
Here’s the official announcement on the ubuntu-devel-announce mailing list.
Leave a Comment » |
Linux |
Permalink
Posted by Constantin