Category Archives: Software

Last.fm in your language: 1.1.3.0 is out!

Just a couple of days after we published an update for Last.fm 1.0.9.6, a new version was released: Last.fm 1.1.3.0.

Besides some bugfixes, the UI has been translated into several languages, so you can run this program in english, italian, german, french, spanish, portuguese, polish, russian, japanese and korean.

Moreover, this time the Last.fm team has released a Debian package (for Debian etch), available from the Last.fm downloads page.

However you still might find our packages interesting because:

  • We’re including some enhancements not available in the official version.
  • We have packages for several distros: Debian sarge and etch, Ubuntu dapper and edgy.

As usual, you can get the source code and diff at John’s page for original source code, Debian diff and a description of our changes. The compiled packages are available here.

And as usual, feedback is appreciated. Enjoy!

Last.fm 1.0.9.6 updated

John has been working in the Last.fm client code and prepared some nice patches, so here’s a new minor release for Debian etch (1.0.9.6-0etch3) and Ubuntu edgy (1.0.9.6-0edgy3).

Changes include:

  • Some leaks were fixed, so now the client wastes less memory 😉
  • A new ALSA plugin has been introduced.
  • Users can select the web browser from the options dialog.

Get the full changelog and source code at John’s page.

As usual, compiled packages are available from my webpage. Comments and suggestions are welcome.

Enjoy!

My first programming book

I don’t remember exactly what my first programming book was, as it was many years ago (when I was about 12) and I keep a number of programming books from that time, but it was probably this one:

Novas aventuras no seu ZX Spectrum

It was a Portuguese translation of “Creating Adventure Programs on the ZX Spectrum“, originally by Peter Shaw and James Mortleman.

It explained how to design and code text adventures, one of the earliest genres of computer games that was about to disappear completely in the early 90s but fortunately is still alive thanks to the Internet (although it’s not a commercial genre anymore, obviously). There’s a number of free software programs for Unix-based systems to play classic and new games from that genre. Maybe one day I’ll post something about them 😉

With this book I learned some interesting things about algorithms, text parsing and data structures. All the programs included in the book were written in Sinclair BASIC, the first language that every Spectrum owner learned as the computer included an interpreter.

However, it wouldn’t be fair to say that I learned programming thanks to any book, because without any doubt almost all of my early programming experiences began with MicroHobby, a Spanish magazine dedicated to Sinclair computers. Thanks to the work of some enthusiastic fans who scanned all the issues, MicroHobby is available online in the MicroHobby Forever site.

Last.fm 1.0.7 updated

I have updated the last.fm packages for Debian sarge (1.0.7-0sarge2) and Ubuntu dapper (1.0.7-0dapper2). This update solves a bug that caused the program to segfault when double clicking on Friends.

Download them at http://people.igalia.com/berto.

Version 1.0.9.6 is not affected by this bug, so if you’re using Debian etch or Ubuntu edgy you don’t need to do anything.

Happy holidays.

A Christmas gift for you

I’m pleased to announce the availability of new Debian and Ubuntu packages of the the latest version of the Last.fm client for x86 systems.

New versions have been released by the Last.fm team, being 1.0.9.6 the current one. However the only official download for GNU/Linux is still several months old and lacks the newest features and bug fixes.

I have been combining efforts with John Stamp and we have prepared packages for Debian and Ubuntu. We’ll try to keep them updated with every new release from Last.fm (you can subscribe to this blog’s feed for announcements if you want to).

Go here for downloads and more information.

These packages are unofficial and they haven’t been tested thoroughly, so comments and suggestions are welcome.

Merry Christmas for you all!

P.S.: I’m sure that some of you know where I took this post’s title from. Highly recommended, of course, and not just for these dates 😉

Last.fm client for Debian and Ubuntu

I wrote about Last.fm some time ago in this blog, and mentioned some of the programs you can use to listen to this internet station.

However, the previous official player is deprecated and no longer supported (although it still works) as the Last.fm team has released a new client (in beta stage for GNU/Linux systems). This new client can be downloaded here, but there’s no Debian package, just a precompiled binary in a .tar.bz2 file. Moreover, this binary does not work in sarge, the current stable release of Debian.

As this new client is GPL too (congratulations!) I downloaded the source code and made a Debian package ready to run in sarge systems. You can get it from my webpage. I have been using it successfully for some time, but any comments regarding its packaging are welcome. Enjoy!

Updated 03-12-2006: I also built another package for Debian testing (etch). You can download it from the same page I mentioned above.

Updated 04-12-2006: Now a package for Ubuntu edgy is available too!

Disk encryption in Linux (IV): Encrypting a full partition with LUKS

LUKS is a hard disk encryption standard for Linux created by Clemens Fruhwirth. Althought the reference implementation is based on dm-crypt, it has several improvements over plain dm-crypt (as seen in the third post in this series), including support for multiple keys and passphrase revocation.

To use LUKS you’ll need a recent cryptsetup package (Debian sarge users can get it from backports.org). You will also need an empty partition to encrypt. You should fill it with random data before beginning:

$ shred -v /dev/hdaX

Now you have to initialize that partition with LUKS:

$ cryptsetup luksFormat /dev/hdaX

A random key will be generated and you will be asked a passphrase to encrypt it. Now you can decrypt your newly created LUKS partition and begin to use it:

$ cryptsetup luksOpen /dev/hdaX myname

Here, myname is the name of the device that will be created under /dev/mapper. Now it’s time to create a filesystem:

$ mke2fs /dev/mapper/myname

Now you can mount and use /dev/mapper/myname just like any other filesystem. When you’re done, unmount it and close the LUKS device so it won’t be accessible anymore until you open it again:

$ cryptsetup luksClose myname

So far so good, but how do you mount that partition automatically on boot? Just put this in your /etc/crypttab (and don’t forget to add /dev/mapper/myname to your /etc/fstab file!):

myname    /dev/hdaX    none    luks,check=ext2

myname is the encrypted device that will appear under /dev/mapper and /dev/hdaX is the original device.

The third field, none, means that the key to decrypt the filesystem is not stored anywhere, so cryptsetup will ask you during boot.

The fourth field lists misc options: luks means that the partition is encrypted with LUKS format (as opposed to plain dm-crypt format). check=ext2 will make cryptsetup look for an ext2/ext3 filesystem on the decrypted partition. That way, cryptsetup will notice whether you introduced the right passphrase and ask it again in case you typed it incorrectly. There are several partition checks (not just ext2), and you can write your own scripts. Just have a look at /lib/cryptsetup/checks/.

And that’s all for the basic usage, but there are some other nice things that you can do, such as adding more valid passphrases to a LUKS partition:

$ cryptsetup luksAddKey /dev/hdaX

You can see some information about the partition (including the number of valid passphrases available):

$ cryptsetup luksDump /dev/hdaX

And obviously you can remove any passphrase:

$ cryptsetup luksDelKey /dev/hdaX slot

Where slot is the number of the key slot you want to remove (you can see it with luksDump).

And that’s enough by now. As you can see, it’s not that hard to keep your data secure. Keep in mind, however, that encrypting a whole partition introduces some extra overhead, so your system will be slower. You don’t have to encrypt everything (i.e. under /usr you probably don’t have any confidential data). Choose wisely and enjoy!.

Disk encryption in Linux (III): Encrypting temporary filesystems

So far we have mentioned some tools to easily encrypt files. Keeping files encrypted is a good way to protect your data in case someone steals them.

However, if we’re talking about serious encryption, just encrypting files is not enough to keep your data protected. There is no use in having a secured document in your hard disk if the program you use to open it stores some of its contents in /tmp. And that’s not the only risk. Maybe your program keeps passwords always in memory and it does not store them on disk, but what happens if you run out of memory and all of your passwords go to the swap partition? If someone steals your hard disk, she could easily get them with a disk editor.

There are many ways to encrypt entire partitions in Linux, and there are many kinds of partitions that should be encrypted, but swap and /tmp are two important ones and arguably the easiest to set up. Both share a common feature: they store temporary data. Once the computer is turned off, all stored data is no longer important, so it can be discarded.

In this example we’ll use dm-crypt to set up these encrypted partitions. You need to enable CONFIG_DM_CRYPT in your kernel configuration and install the cryptsetup package (if you’re using Debian sarge, it’s highly recommended to install cryptsetup 1.0.x from backports.org).

Once installed, put this in your /etc/crypttab:

cswap    /dev/hda5      /dev/random    swap
ctmp     /dev/hda6      /dev/random    tmp

The first field is the name of the device that will be created (under /dev/mapper) to access the encrypted partition.

The second field is the real partition that will be encrypted.

The third field is the file where the key to encrypt the partition is stored. In this setup, that file is /dev/random so each time the machine boots partitions will be encrypted with a different key chosen randomly. So the data will not be recoverable if you turn off the PC. But that’s what we want, isn’t it? 😉

The fourth field list misc options for cryptsetup. Here, swap will run mkswap on the device and tmp will run mke2fs.

To mount these partitions, your /etc/fstab should contain these lines:

/dev/mapper/cswap    none    swap    sw         0   0
/dev/mapper/ctmp     /tmp    ext2    defaults   0   2

Last but not least, before using this system you should erase the contents of the partitions completely. The recommended way is to fill them with random data (but unmont them first!):

shred -v /dev/hdaX

Now each time you boot your machine you will have your partitions encrypted. That’s all folks!

Disk encryption in Linux (II): Easy encryption with EncFS

Sometimes you don’t want to encrypt all of your files. You just have some important data you’d like to keep protected, but your other files are not confidential at all and you don’t care if someone steals your Firefox bookmarks or your .procmailrc.

In those cases encrypting a whole disk or even a single partition might be too complicated (you don’t want to mess with partitions), or it could make your system too slow. There are other alternatives. A classical approach is to encrypt your important files using a tool like GnuPG. While this method works perfectly, it’s not the most convenient approach when you have, say, dozens of different files to encrypt.

EncFS is a cryptographic filesystem that transparently encrypts a whole directory tree. Data is always kept encrypted in a regular directory within an existing filesystem, and you have to mount that directory using EncFS in order to see its contents. Thus, once mounted, encrypted files can be accessed through this virtual filesystem just like any other file: you can edit, copy, rename and erase them just like you would do with any other file.

One of the main problems of EncFS is that each file stored maps to an encrypted file, so even though the file names and contents remain protected, anyone with access to your hard disk can see how many files you have, the directory structure, the metadata and even the approximate size of each file. If that’s not a problem for your needs, EncFS is a good piece of software and it’s very easy to install, set up and use.