Don’t complain about it – make it better? Bug Jamming for a better tomorrow

Agreed, that was too much pathetic. But you got the point, didn’t you? Free software like every software is full of bugs and possibilities for enhancements. So is Ubuntu. But that’s okay, because we have the power to change it. No need to be a developer, no need to be an ubernerd. All you have to do is to spent some time. Need somebody to motivate you? Want to do it in a group? Then a Bug Jam is perfect for you!

No, it’s not a jam made of bugs :) It’s a get together where people work on eliminating software bugs by spending some time reading bug descriptions, checking them, writing new ones, informing developers about bugs or even patch the software by themselves. The Ubuntu community crew tries to push these events as they really help you to kick your ass and just get started as it’s much easier to get into the bug business in a group and it makes a lot of fun. And of course bugs fixed in Ubuntu can be ported to Debian and upstream quite often.

All you for a Bug Jam is… Ah, just come to one of the four Bug Jam irc sessions taking place in the next weeks, held by some Ubuntu people who already have some experiences with Bug Jamming and Ubuntu related events (I will support Daniel Holbach on two of them, one this Friday, 16:00 UTC). See the schedule on Daniel’s blog entry.

And keep in mind:

1. There is the 5-a-day project where you and your loco team, group or whatever can make a difference and pop up on the first line of the statistics.

2. There will be a Global Bug Jam which will be the first and biggest of it’s kind so far and you can be part of it.

Hope to see you there.


My 5 today: #156204 (pidgin-otr), #130443 (pidgin-otr), #144770 (pidgin-otr), #240420 (ubuntu), #231660 (ubuntu)
Do 5 a day – every day! https://wiki.ubuntu.com/5-A-Day

my (not yet) package of the day – circular application menu

(Not yet a package, but still interesting enough to tell and hey: bleeding edge.) Circular Application Menu for Gnome is a Google Code hosted project providing a different access method to your Gnome menu. Actually all it does, is displaying the menu as circles:

hauptmenuecircular.png

Installation

But as it is different, it is somehow attractive and therefore let’s give it a try. Building „circular application menu“ is quite easy. You just have to install some libraries, subversion and essential build stuff, check out the current repository and compile it. Huh? Try this:

$ sudo aptitude install subversion build-essential \
libgnome-desktop-dev libgnome-menu-dev
$ svn checkout \
http://circular-application-menu.googlecode.com/svn/trunk/ \
circular-application-menu
$ cd circular-application-menu
$ make

Running

If no severe error occurred, you are already able to run „circular application menu“ it via ‚./circular-application-menu‘ now. Ignore error messages on the console as long as it comes up. Strange feeling to use it, isn’t it? I haven’t decided, if I really like it or not, until now.

If you like you can now install it to the system via make install, though I am fine with running it from the build directory, which I moved to „~/opt/circular/“. As it is pre-alpha-something, I just don’t want the code be mixed up with my distribution binaries.

Customizing

If you want to go one step further, install the Avant Window Navigator („$ sudo aptitude install avant-window-navigator“), the OS X style application panel, which just moved from Google Code to Launchpad (points taken!) and add an icon for circular menu to it by doing a right-click=>settings=>Launchers=>Add. Now you can start all normal applications by calling Circular Menues from the AvantGo launcher. Definitely an eye catcher:

Circular Application Menu combined with Avant Window Navigator
(click to enlarge)

Pitfalls

There are, of course, a couple of pitfalls. For instance, when running circular application menu on top of a dark or even black application, you cannot see it’s borders:

bildschirmfoto-1.png

Also, you currently don’t have the possibility to customize the launcher at all.

Nevertheless: circular application menu for Gnome is a nice desktop gimmick. I am sure, it will be packaged soon (will I?) and go to the community repositories of most GNU/Linux distributions.

my package of the day – sash – the Stand Alone SHell for system recovery

Let me introduce you today to a package that is quite unknown as you hopefully never need it. But when you need it and have not thought about it before, it is probably already too late. I am talking about „sash“ – the „Stand Alone SHell“. Yet another shell? Yes and no. Yes it is a shell, but no, I am not trying to show something like the shiny friendly interactive shell or (my favorite) „zsh“. Quite the contrary: You can give „sash“ a lot of attributes, but not „shiny“.

So what is about? Imagine the following case: You are running a machine and suddenly something goes totally wrong. Partition errors, missing libraries, you have messed around with libc, whatever. This can get you into serious trouble. You are fine, when you have the possibility to boot a recovery cd or something similar. But under some circumstances you might have to stick to the programs already installed though they seem to be broken. Maybe it is a virtual server somewhere on the web and you are only allowed to boot into a recovery mode giving you a prompt to your server. So you are trying to login as root but it just does not work for some reasons. Broken dependencies. Who knows.

The point is: When you login onto a machine for system recovery, you are already relying on a lot of tools and dependencies – though it only seems to be a shell. The shell might be linked against a couple of libraries, a lot of commands you want to run are not build in and therefore a bunch of external dependencies can bar your way. So what you actually might need in a situation of severe pain is a shell that provides you with as much essential tools as you need on its own without relying on external code.

Installing sash

This is where „sash“ comes into play. Sash is not a dynamic linked executable, it has actually all needed features built in. So as long as you can execute the sash binary, you can have a working shell. Let’s check it! Install „sash“ by using „aptitude install sash“ or you preferred package manager. Please note, that sash will clone your current root account:

cloning root account entry to create sashroot account in /etc/passwd
Cloned sashroot from root in /etc/passwd
cloning root account entry to create sashroot account in /etc/shadow
Cloned sashroot from root in /etc/shadow

So you have this new line in your /etc/passwd:

sashroot:x:0:0:root:/root:/bin/sash

You should consider giving sashroot a password if you want to be able to login with this account. But please check if this applies to your security needs.

See the difference

Now let’s check how the sash binary differs from the standard shell, the bash and the zsh. We are using „ldd“ for this, as it is lists libraries, an executable is linked against:

bildschirmfoto-terminal.png

Pretty impressive. All „normal“ shells have at least three dependencies, sash apparently has none.

But getting rid of external libraries is not the only difference sash makes. Another major feature is the collection of built-in commands:

-ar, -chattr, -chgrp, -chmod, -chown, -cmp, -cp,
-dd, -echo, -ed, -grep, -file, -find, -gunzip,
-gzip, -kill, -ln, -ls, -lsattr, -mkdir, -mknod,
-more, -mount, -mv, -printenv, -pwd, -rm, -rmdir,
-sum, -sync, -tar, -touch, -umount, -where

Seems like a list of commands you yearn for, when in recovery mode, don’t you? Note the leading „-“ at the beginning of those commands. This is the way, sash handles your attempts to run internal and external commands. When using „mv“, sash gives you the normal /bin/mv, when using „-mv“, sash provides you with it’s own replacement. But „sash“ helps you when you don’t want to type the „-“ at the beginning of every command. You can enter „aliasall“ in a sash session as it will create non permanent aliases for all builtin commands:

bildschirmfoto-terminal-1.png

Emergency

In case of an emergency you might need to boot directly into sash as maybe your initrd stuff is broken. How? Just append a „init=/bin/sash“ to your kernel command line – be it lilo or grub. This way, you will be directly dropped into a sash session.

What’s missing?

Sadfully one essential command is missing: fsck. As the sash manual points out: fsck is just way too big to be included in a statically linked binary. Sad, but true. But hey: Better being to able at least to act on the console than having no console at all.

Sash as a standard shell?

… is not a good idea. It just lacks a lot of features you’ll really want when working on the command line: A verbose prompt, command history, tab completion and so on.

So it’s to install sash now as you will miss it, when it’s too late :)
(And just if you’d like to ask: Yes, at least once I really needed sash and it helped me to save a lot of time.)

First BBJ – Berlin Bug Jam – with MOTU Daniel Holbach on Monday, 16th of June at c-base Berlin

Ubuntu Berlin ist proud to present you the first BBJ: A „Berlin Bug Jam“ with Ubuntu MOTU Daniel Holbach, who will rock the place, for sure. Don’t know what a „Bug Jam“ is? Well, imagine it as a gettogether for working on bugs in a team. That does not mean, you have to be a developer: Everybody is welcome, who can do things from testing bug reports, triaging, patching or just wants to see how it all works. So this will rather be an „event“ than a lecture/workshop and provide you with a lot of fun and knowledge. If you want to see a detailed description of a bug jam, check the wiki page.On the BBJ, we will try to persuade to join the 5-A-Day project, motivating people to continuously enhance the Ubuntu Distribution and helping you to spread the word (and yes, to compete if you like) by trying to work on five bugs every day. Let’s see, if we succeed…

Feel free to bring your notebook along. We have power and free wifi, of course.

Event: 1. Berlin Bug Jam (BBJ) with Daniel Holbach
Location: c-base Berlin, Rungestr. 20
Date: 16th of June
Time: 18:00

Please note: If you want to support the Global Ubuntu Bug Jam, which is taking place from 8th to 10th of August,
this is a perfect possibility for you to gather some hands on
experiences. Of course, Ubuntu Berlin, will bring up a great lineup and
event for the Global Bug Jam. We are already working on it.

my package of the day – aiccu (and sixxs.net) for IPv6 connectivity

It’s time: No reason should prevent you from adding IPv6 connectivity to your machine – desktop, notebook or server. Of course it is still an issue, as most internet service providers don’t provide native IPv6 yet. So in most cases the easiest way for you is setting up an ipv6 tunnel to a IPv6 broker. There are currently several IPv6 brokers around providing you with IPv6 access for free. Let me, in short, show a simple way of getting this with the package „aiccu“ and the IPv6 broker „Sixxs“.

Apply for an account

First you have to apply for an account on SixXS. Go to sixxs.net and sign up for a new account. Please note: As Sixxs is kind of an ISP, they really need valid customer information from you. If you provide them with a link to your Xing or LinkedIn profile they’ll give you even more credits.

Your application will be checked and (probably) given access. Wait for the mail. Afterwards log in with the credentials on the SixXS site and request a new tunnel and decide for an entry point close to you. Also this step needs to be approved. Wait for the mail, it will take upto a day. Now you should have a Sixxs account, an approved tunnel request and of course login credentials for Sixxs.

Set up aiccu

Now let’s get it running. Install the package aiccu via „aptitude install aiccu“. During installation you will be asked, which broker you are using. SixXS is already preconfigured. Nice, isn’t it? So choose SixXS and provide your credentials. If everything is fine, aiccu will check SixXS and ask for your tunnel data. If you did not get an error message, you are already done!

Open a terminal and run „ifconfig sixxs“ – it should show a new network interface with an IPv6 address. Now let’s check, if you have really access to IPv6. Open Firefox and go to www.kame.net. If the turtle logo is moving, your are using IPv6, if it does not, you don’t.

The SixXS credit system

Please note: When using SixXS you should understand it’s point system. For every action like requesting a tunnel or even a subnet, you will be taken points. For running a stable connection, you will be given points. This should motivate you to really use the service. Check it.

Security issues

Also note that all your IPv6 traffic will be directed through the broker. Of course you should check your security. As a tunnel with aiccu will „break“ a router (filtering on firewalls won’t grab the IPv6 data), you have to take care of the security by yourself on the machine which has IPv6 access.

IPv6 content

How to continue? Check www.sixxs.net/misc/coolstuff/ for interesting IPv6 only content. Yes, there are services on the web providing you with nice content via ipv6, for free. For instance access to high traffic news servers, access to a IPv6 freenode server and so on. Always keep in mind, that not every application yet is ready for IPv6 or needs to be configured to allow IPv6. With Debian/Ubuntu at least you should be able using Firefox, Thunderbird, the newsread Pan and Irssi as a start.

Happy networking!

[update]

Tiago mentioned in the comments, that he set up a wiki page explaining the IPv6 in detail. See https://wiki.ubuntu.com/IPv6. A really nice howto, which’ll probably work for most Debian based systems.

my package of the day: mpd – the Music Player Daemon

There are dozens of nice music players around, that’s for sure. You can choose between featur rich killer applications like Rhythmbox or Amarok, use old-school but up to date standards like XMMS or even a console classic like mp3blaster. Most of the standard players have in common, that the interface and the player itself are the same. That’s normal and therefore everything is fine. But maybe you are in a situation where you prefer playing music on a remote machine, only have a console or just don’t want your music player to stay open while playing. Huh?

Okay, again: Imagine, you set a machine dedicated for playing music. You put it into a corner, it has no keyboard, just a network interface. How do you proceed? Ah, you install mp3blaster via ssh and let mp3blaster run in the console, right? That’s fine and mp3blaster really kicks ass. But… With mp3blaster you are forced to have a shell account on the machine, just for playing music. Mp3blaster has a lot of features, but it has only one interface and you have to stick to it – and at least you also have to get into the „screen“ business for letting the player run while not being logged in.

So what’s the alternative? Well: Imagine a music player daemon, that keeps your music collection and listens for clients telling him, what to play next. You don’t even need to imagine the music player daemon, just have a look at the „Music Player Daemon“ – abbreviated „mpd“. It’s idea is to completely split user interface and player daemon, enabling you to choose between different user interfaces (from console to gui) and to manage a remote daemon without the need of logging into the machine directly.

Now let’s test it, right away. First, we install „mpd“ by calling „aptitude install mpd“. This will enroll the daemon and start it right away. „mpd“ organises its files in „/var/lib/mpd“ and expects music by default in „/var/lib/mpd/music“. Strange location, isn’t it? While you are free to configure the mpd daemon in /etc/mpd.conf, the easiest way of getting you music into the daemon is to symlink your directory/directories. I keep my music collection in /home/ccm/Music. Therefore I run „sudo ln -s /home/ccm/Music /var/lib/mpd/music/ccm“. Now you have to take a short break and think about access rights: While mpd runs as user „mpd“, which is a good idea, you need to make sure, that your music files are accessible to mpd. I ran into trouble as my mp3 files provided read access only the owner (me). Therefore I needed to decided whether to run mpd as „ccm“, chown my music to „mpd“ or to extend access rights. I decided for last version and just chmod’ed the music files and directories (see below). Now you need to tell mpd that there is new music around. Just run „sudo mpd –create-db“ and it should crawl your library quite fast. So until here we took the following steps:

# install mpd
$ sudo aptitude install mpd
# symlink current music to mpd music library
$ sudo sudo ln -s /home/ccm/Music /var/lib/mpd/music/ccm
# make sure, mpd can access the music
# please be careful with this
$ find /home/ccm/Music -type d -exec chmod 755 '{}' \;
$ find /home/ccm/Music -type f -exec chmod 644 '{}' \;
# tell mpd about the music
$ sudo mpd --create-db

A first graphical approach: Ario

Now let’s listen to some music! But stop: We need a client! Until now we only installed the daemon. An „apt-cache search mpd client“ gives you a brief overview over possible clients. I’d suggest you install „mpc“ (the classic command line tool), „ncmpc“ (an enhanced menu driven client), ario (a gtk client) for now, to see differences. Therefore run „sudo aptitude install mpc ncmpc ario“. Give ario a try if you prefer a gui. Like all clients, ario tries to connect to a mpd instance on the localhost by default. You should already see your music like this:

bildschirmfoto-ario.png

The mpd daemon expects a playlist from you. This is party on the lower side of the interface. Feel free to drag and drop the name of a band/musician, an album or even just a single track into this area and hit play. Hey, mpd play music! But that’s actually like the situation before…

A first console approach: ncmpc

For getting the difference, close the player by clicking on the X on the upper right side. Ario will totally disappear (feel free to check with „ps aux | grep ario“, but the music will continue to play. Nice. Now let’s get it even more abstract and open a console and start „ncmpc“. In this player you can switch to the different „tabs“ by hitting a key from 1 to 5. „2“ is the current playlist, „3“ a file browser. You can hit ENTER on a file in the playlist, and it will play, while DELETE will remove it from the playlist. In the browser, you hit SPACE on a directory and it will be added to the file list or ENTER on a single track. This way you can build a huge playlist very fast.

Let your command line completion work: mpc

With Ario and ncmpc you can already choose between a gui and console interface for controlling your music player. As I really like working on the console, I was happy to see, that the TAB completion from Bash and ZSH support the „mpc“ command, which is the standard console interface. With „mpc“ you will normale use one of the following commands:

# add a directory to the playlist
$ mpc add directory
# add a single track to the playlist
$ mpc add file
# play a track by number from the playlist
$ mpc play NUMBER
# show current playlist
$ mpc playlist
# update the current database as new files have been added
$ mpc update
# list all availabe music
$ mpc listall

If you are a ZSH user like I am, you will be pleased by the heavy TAB completion support. All commands and file names can be completed which actually makes you faster than bothering with any gui. The Bash support is okay, but not that sophisticated. If you don’t know, what I am talking about: never mind. You will, one day :)

Let the browser work: Relaxx

A crazy Ajax guru here from Berlin wrote „Relaxx“, a nice web interface to mpd. Check out the project page for screenshots and the sourceforge page for downloads:

relaxx-light.png

I think this is enough for a first insight into „mpd“ and its clients. If you like the idea, you should read about connecting to remote mpd instances, so you are able to use your local client for a daemon running on a different machine, enabling authentication in mpd or maybe think about running mpd just on your local machine as it is a nice way of keeping your music collecting while being able to choose a client depending on the situation you are in. The mpd wiki is a great place to start gathering further information. You’ll find that a lot of utilities are available – from pidgin plugin for showing the music you are listening to a gnome panel applet. Always have in mind, how strong you are while being on the console as you can even use pipes when using mpc… Have fun.

my package of the day: synergy and quicksynergy – share a single mouse, keyboard and clipboard between multiple computers

Once upon a time… I sat beneath a person who tried to show me something on his GNU/Linux desktop. As he noticed, he needs to copy a password from his Windows machine (was it OS X?), which was standing close, I waited for him to copy and paste by using his eyes. But hey: He just moved his mouse across the boarder of his screen and the mouse pointer appeared on the screen of the other computer. There he marked something, copied it to the clipboard by using the very keyboard, moved his mouse back to the first screen and pasted the content from the clipboard. I am neither talking about two screens attached to one computer, nor about a kvm device. You can probably imagine, how surprised I was…

The solution to this magic is rather simple. It is called „Synergy“ – a program available for GNU/Linux, Windows, OS X. It is a server/client application. Given the situation that you are mainly using one computer – let’s say your desktop, but also need access to your notebook, or even notebooks, standing left and/or right of your desktop screen, you make your desktop the synergy server. This is rather simple: Install the packages „synergy“ and for your convenience „quicksynergy“ – a graphical configuration wrapper – by calling „aptitude install synergy quicksynergy“ or just Synaptic on EVERY machine.

Now let’s get it running: First, start „Quicksynergy“ on your main computer (the desktop in this case) from your menu (you should find it under Accessories or Utilities). Click on „Settings“ to make sure, that the checkbox „Keep… running“ is not checked, as you probably don’t want to see Quicksynergy the whole time. Now go back to „Share“. You see you computer in the middle and four text boxes around it. The magic of Synergy is, that you need to know the hostname of the computer that wants to connect to your computer as Synergy relies on this information. If you are unsure, just run a „hostname“ on the console of the other machine.  I repeat: Don’t use fancy names, don’t use the ip address here – you need the hostname of the machine that will connect to your computer.

In my case my notebook is called „hasung“. Now decide, where the connecting computer/notebook is placed. In my case „hasung“ is right of my desktop screen. Therefore I enter the term „hasung“ into the text field labeled „Right“:

bildschirmfoto-quicksynergy.png

Afterwards clicking „Start“ will launch the Synergy daemon and fork the program into the background.

Now you have to find out the ip address of your main computer, as the computer/notebook beneath needs to connect to it. If you don’t know how to do this: open a console and run „ifconfig | grep inet“. If you are on a typical local area network, it will start with something like „192.“ or „10.“. Just check it out or ask somebody who knows. In my case the ip address is „192.168.1.2“.

Now lay your fingers on the keyboard of your second machine – hopefully for the last time for today. You have two ways of connecting here – either by using quicksynergy or by using the command line. If you want a gui, start Quicksynergy, make sure, that the checkbox „Keep… running“ is not checked, on the „Settings“ tab, then click on the tab „Use“ and enter the ip address of your main machine, where the synergy daemon is already running. In my case „192.168.1.2“:

bildschirmfoto-quicksynergy-1.png

Click start and you should be up and running! Check this by using the mouse of your main computer and move the mouse pointer beyond the (right or left) screen frontier. The mouse pointer should appear on the other screen. You are done!

Network issues in Ubuntu Hardy

With Ubuntu Hardy suddenly strange things happened with synergy, as something on the network layer of the kernel has changed. The best workaround I know so far, is to run (quick)synergy on the client with sudo, so it does not get interrupted that often. As I am a heavy console user, I just run

$ sudo synergyc 192.168.1.2

from a terminal window instead of quicksynergy. If you have a better hint, let me know.

Firewall

Synergy opens a tcp port on the main machine. If you are using a firewall or even iptables manually you have to allow acccess to this port. Synergy uses port „24800“ by default. So if you know what you are doing, a „iptables -A INPUT -p tcp –dport 24800 -j ACCEPT“ might help you.

Staying on the same network

Actually your computers don’t have to be in the same network, but: The client machine has to be able to access the synergy tcp port on the master. Imagine the following: You are bringing your notebook to your company. It uses wifi while your desktop uses a cable connection. As your administrator does not trust wifi connections, he split the networks, so no direct connection from the wifi network to the cable network is possible. In this case you have to deal with your administrator. But trust me: synergy is not a reason for breaking company security rules :)

Security

From a security point of view, synergy is … let’s say… simple. There is no password protection, no security layer, no encryption. The only access control is the hostname of the client, which can, of course simply be forked. What does that mean? It means two things: First: People could annoy you by using your hostname on their machine and connect to your synergy instance. Counter measure? Ban them by using a local firewall, if you know, how. Second: People on the network might be able to sniff your data (mouse gestures, key strokes, content of the clipboard). Counter measures? Use a ssh tunnel! I won’t explain this here, but might already have a clue, what I am talking about.

Recovery

If your (quick)synergy forked into the background and you feel, that somehow it all does not work, open a terminal and run „pkill synergy“or „sudo pkill synergy“. This should stop all running instances.

Get more!

As might already have noticed, you can even connect more machines. Feel free to place machines to the left and right, even upper and lower side of your main screen at the same time.

So that’s for now. Feel free to post your experiences here, and yes: I am also using synergy in combination with hosts running Windows and/or OS X, though configuration on GNU/Linux with Quicksynergy is the best method I have seen.

my package of the day: proggyfonts – tiny fonts for programmers and console users

(Well, it is not yet a package, but trust me: I’ll make sure it gets one.)

As a programmer or console user you might know the pain of having not as much characters on you screen as you would like to. You tried around with different fonts, it got better by reducing font size but it is not yet perfect. If I tell you, that you just have the wrong fonts you probably moan „… I tried all installed fonts“. And you are right by that: The fonts I am going to tell you about are definitely not preinstalled.

I ran into the font trouble a couple of years ago. As my eyes are quite good I yearned for a really tiny font to overflow my brain with as much content as possible on the same time. After I a while I started a research on the web and found a page that already sounds like a perfect hit: proggyfonts.com. The site hosts 24 monospaced bitmap programming fonts (licensed under a free BSD-type personal license) enhanced for a small screen footprint and issues that programmers often run into like differing 0 (zero) from O (capital letter „o“).

Font comparison

The font I use is called „ProggyFont Tiny Slashed Zero“ which stands for: A real tiny font with a cleary slashed zero. To compare it to a „normal“ font let’s see it in action. Here you can see a default installed Monospace font which has been set up to a small font size:

bildschirmfoto-mc-hasung-mnt-cryptdevice-live-home-ccm.png

Concentrate on the characters you see above: They blur a bit. It’s not a big deal but if you are working with it for hours it gets one. Now let’s compare the same screen with ProggyFont Tiny Slashed Zero:

bildschirmfoto-mc-hasung-mnt-cryptdevice-live-home-ccm-1.png

See how clear the characters are? It even got smaller – you could handle one or two lines more within the same space if you would resize the window according to the previous one. What a relief!

Even more fonts

Now the example given is the most aggressive one as it is really small. You might consider other fonts as helpfull. Let me give you another example of a font: Proggy Clean (better to read as it is bigger) Slashed Zero Bold Punc – see yourself:

font.png

What have they done? They assume when you are a programmer you like characters like brackets, colons and so on being bold as the mean something in the code. Often you have to deal with interfaces that don’t mark those characters. Now the font does this for you. Nice, isn’t it? Now even cat and less show you bold coding elements without even configuring them to do so.

Installation

The site hosts the fonts in different formats. As I am lazy and is supported I only use the TTF font. To enroll a font in Gnome you have two ways depending on your Gnome version. First download a font package, unzip it, so you have file named fontname.ttf. To speak in Ubuntu versions: If you running Ubuntu Gutsy or below, open Nautilus, go to „fonts:///“ and drag and drop the ttf file into it and just restart your X session. If you have Hardy, create a directory called „.fonts“ in your home directory and copy the ttf file into it. Restart X afterwards (though not all applications depend on this).

Now open the application you want to enhace with your shiny new font. Let’s say it’s gnome-terminal. You should be able to choose a font named ProggySomething. Now you have to choose a font size and that is the only tricky thing to do: You have to find out the only possible font size. This setting might differ from application to application. In gnome-termin it is „11“ for instance which seems huge, but in fact is not. Just try it out. Under KDE or even Windows/OSX you’ll find out fast how to enroll the fonts. In fact it works, you just have to try.

So now you have a new set of fonts ready to boost your productivity. Make sure you don’t get a headache when using it and don’t crash your brain with an information overflow. I’ll report back when I packaged those fonts for a simple usage in Debian/Ubuntu.

my package of the day: file – classify (unknown) files and mime-types on the console

You know this? Somebody just sent you a mail with attachments that don’t have usable file extensions so you don’t really know how to handle them. Audio file? PDF? What is it? The same problem might occur after a file recovery, on web pages with upload features or just when you are really and time pressure and have time for messing around with file type guessing.

While you can try to give the file an extension and open it with a software you think might be suitable, the more sophisticated way is to let your computer find out what is all about. As a GNU/Linux user you probably already think „There is surely a command line tool for this“. Of course there is: The package „file„, that often gets automatically installed by dependencies or just an „aptitude install file“ will help you out.

„file“ depends on „libmagic“ which provides patterns for the so called „magic number“ detection. You don’t have to know, what that is, but if you want, see this Wikipedia article for reference. So all you have to know, is how to handle the file command. And actually there is not much to learn. Let’s assume we have the following directory with unknown files:

file1.png

Now we want to know what’s inside those black boxes. Therefore we just call „file *“ on the console:

file2.png

Hey, that’s all. Pretty impressive, isn’t it? „file“ does even not only differs binary from text files, it even tries to guess what programming language a text file is written in. And the magic is not that much magic: In case of the zsh file it just sees a shebang pointing to the zsh in the first line of the file, a PDF file typically starts with „%PDF“ and so on. It’s all about patterns.

„file“ provides you with some command line options that make it’s usage even more helpful. The most interesting is „-i“ as it prints out mime types instead of verbose file types. If you are a web developer and want to know the exact mime type for a file download, this can save you a lot of time:

file3.png

Great, isn’t it? The Apache webserver also uses libmagic for this purpose. With „file“ you just use a wrapper for the same task.

That’s all about „file“ for today. Happy file detection – and feel free to report back.

my package of the day: listadmin – moderate mailman mailing lists from the console

Are you involved in moderating Mailman mailing lists? Then maybe you know the pain: As you try to stop spammers flooding you list you hold messages from unknown senders back for review. Or you have a moderated mailing list that only allows postings explicitly published. However. In most cases you get mails from Mailman telling you that there are messages you have to moderate. The common way is to enter the web interface, enter your password, read the messages and discard/reject/allow them.

This workflow is easy but it can really get on your nerves as the web stuff is somehow time consuming. Therefore from time to time you get lazy on moderating…

Well, there is light at the end of the tunnel and one cannot repeat this hint often enough: The package „listadmin“ provides a powerful console tool for moderating mailman mailing lists. As Debian/Ubuntu user you just have to install it via „aptitude install listadmin“ on the console or via Synaptic. You just have to write an .ini file with the configuration (admin url, credentials). The files looks like this:

adminurl https://hostname.tld/mailman/admindb/{list}
default skip
log ~/.listadmin.log
password secret
[email protected][email protected]

So we just give an url with a placeholder named „{list}“. This way we can moderate multiple lists with fewer lines of configuration. Now let’s see how listadmin behaves when checking existing mailing lists (in this case our Berlin based Ubuntu mailing lists):

bildschirmfoto-damokleslilith-listadmin.png

Nothing to do – no messages to moderate in this case. But hey – we just got an incoming request. Let’s rerun listadmin and check:

bildschirmfoto-damokleslilith-listadmin-1.png

A spammer tried to hit our list. We now can decide wether to Approve, Reject or Discard the message. If it’s spam you want to discard as this just deletes the message. When you want to provide feedback to the user, you have to reject and are able to enter a reason. Of you course you also can examine the full body of the message or just skip it and keep for the next session. In our case „d“ was entered for deleting the spam and the request was submitted. If you are fast the session will not take more than 10 seconds – try this with the web interface!

So though it’s age and the ajax web 2.0 shiny wysiwyg plinkplonk alternatives Mailman provides you with nice wrappers for moderating larger amounts of mails within seconds. If you stick to a community you will probably sooner or later be asked to moderate a mailing list. Now you can say: „No problem. I have a command line tool for this“.