Helping awstats to correctly interpret lighttpd’s log format

Note to self:

when configuring awstats using lighttpd logfiles, you have to use the following log format:

LogFormat="%host %virtualname %logname %time1 %methodurl %code %bytesd %refererquot %uaquot"

neighter 1 nor 4 will work correctly.

Posted in Uncategorized | Tagged , , | Leave a comment

How to get a list of manually installed packages (and remove the other ones)

The Good

Every other year or so I feel the need to clean up my Debian system and remove the installed packages I’m not interested in anymore. I remember there was a nice aptitude pattern to search for packages which I have manually installed (i.e. which were not installed to satisfy a dependency). Ideally I would then go through the (presumably short) list of packages and remove the ones I don’t need any more.

Since I always forget the aptitude pattern to search for those packages, I google for something like “list of manually installed packages” and find a solution like: aptitude search ‘~i !~M’. Although this solution is not wrong, it is not quite what I was looking for. Sure, it will find you all packages which are installed and not installed to satisfy a dependency, but it also contains packages of priorities: required, important and standard which you usually don’t want to deinstall. So the actual solution should also exclude those packages.

aptitude search '~i !~M !~pstandard !~pimportant !~prequired'

The above line will do the trick and present you a list of packages which are: installed and not dragged in to satisfy a dependency and not of priority standard, important or required.

If you where only interested in the solution of the quest of getting a list of all manually installed packages you can stop reading here.

The Bad

If you’re running your system for longer than, say, a few weeks you will probably notice that the list is very long and contains much more packages than you actually installed manually. You will probably notice a lot of libs and other packages in this list and wonder why they aren’t marked auto as they should since you didn’t install them on purpose. Unfortunately I don’t have an answer for that question. I’m using aptitude exclusively to install packages and rely on the fact that aptitude does install the dependencies automatically and more importantly: also removes them if not needed any more. But it seems like something is broken in aptitude (or somewhere else) and packages simply lose their auto status instead of being removed and thus stay on your system forever if you don’t manually clean your system.

The Ugly

To solve that issue I started aptitude and filtered the package tree with the above pattern (press l in aptitude and enter ~i !~M !~pstandard !~pimportant !~prequired). Now the package view shows only packages which are safe to remove since they are not of of priority standard or higher and manually installed by you. Now I navigate with the cursor to the list of installed packages an mark all of them as auto by pressing M. For each package in this list, aptitude will try to find an installed package which depends on that package and mark that package auto. The remaining packages which no other packages depend on, aptitude will mark for deletion. If you now press g one time, aptitude will show you which packages will be removed. I then go through that list and mark every single of the remaining packages I really want on my system with + as manually installed. After I’m done I proceed by pressing g again which will remove all remaining packages. In my case nearly 600 packages (1GB) where removed.

Bugreport!

I assume there is a bug in aptitude or some related package which sometimes(!) removes a packages auto status instead of removing it. Unfortunately I did not find a way to reproduce that (except that it obviously does happen). If someone could find a way to reproduce that problem, one could fill a bugreport and help to get that bug fixed. Right now, a Debian system suffers (like many other operating systems) from a slow but steadily growing bloat of installed software. In my case 600 packages with 1GB accumulated over one or two years.

Posted in Uncategorized | Tagged , | 6 Comments

No sound with Gnome 3 and pulseaudio?

Dear Lazyweb,

I recently switched from KDE to Gnome 3 and I am so far very happy with the decision. One thing that bothers me since then is that the sound does not work when restarting the computer or waking it up from suspend. After a while I figured that a simple sudo killall pulseaudio fixes the problem — but only until the next reboot. Has anyone a hint what the problem could be/ I found quite a few similar problem descriptions on the internet but with no satisfying solutions so far.

Posted in Uncategorized | Tagged , , , | 9 Comments

Speech Recognition Software

Dear Lazyweb,

Having broke my elbow last week, I’m experiencing serious trouble typing with only one hand on the computer. I know that there is speech to text software, but I was never really interested in that — until now of course. Is there any good software available on Linux you can recommend?

Posted in Uncategorized | Tagged , | 12 Comments

KDE4′s annoying taskbar

Dear Lazyweb,

since KDE4 is in unstable, the taskbar behaves very annoyingly when working with two monitors with different resolutions. I have a laptop. When I’m at work, I put it into a docking station which is connected to a huge monitor. I’m not working with dualhead or something, I’m just using the huge monitor at work and the laptop’s screen at home.

I always want the taskbar to be maximized. The problem is, that KDE’s taskbar fails to adjust the size of the taskbar correctly: Starting KDE at work, the taskbar is always too small (as wide as the laptop’s monitor) and my first task is to maximize the taskbar. Starting KDE when I’m back home, the taskbar is too wide (as wide as the external monitor’s size) for the smaller monitor and I have to (ironically) maximize it again to fit on the now smaller monitor.

Note that I’m not using suspend or something. I’m booting the laptop with the big screen connected or not.

I also had that problem with KDE3, but that was fixed upstream long time ago. Has anyone a solution how to avoid this problem?

Posted in Uncategorized | Tagged , , | 7 Comments

Happy Birthday Debian!

18 Years and still rocking!

Posted in Uncategorized | Tagged | Leave a comment

Not coming to DebConf

Unfortunately Debian cannot sponsor my trip to Banja Luka this year and it’s too expensive to pay it from my own budget. Thus I just cancelled my attendance for the conference. I’m very sad, since my first DebConf last year in NY was a lot of fun and I was really looking forward to see you guys again this year.

I wish you a lot of fun anyways. Have a productive and fun conference!

Posted in Uncategorized | Tagged , | 2 Comments

I’m going to DebConf11

Weee! After the excellent experience last year in New York, I couldn’t resist :)

See you all in Banja Luka!

Posted in Uncategorized | Tagged , | Leave a comment

Installing Dropbox in Debian/Sid

A few months ago dropbox was a Debian packge in non-free. Recently I noticed that there are several new versions available and tried to notifiy the maintainer and ask him to update the package. But unfortunately it looks like the package is not available any more (Here’s why).

However getting Dropbox is quite easy if you know what to do.

The obvious choice would be to go to dropbox.com and download either the source package and compile it yourself or try to install the precompiled Ubuntu packages. The first option is not really an option for most users and the second one does currently not work on Debian/Sid (aka unstable).

However, there is an easy solution: on the download page search for the CLI script (currently it is named dropbox.py) Download that and run it with python dropbox.py start -i. That will download the propritary binaries into ~/.dropbox-dist. Now go into that folder and start dropboxd. There you go, you have a fully working systray app for dropbox.

Depending on your desktop environment you might want to put dropboxd in your “autostart”. So you don’t have to start the daemon every time you login. And that’s it.

It is not really ideal, since a Debian package would be much better for updates, security, yada yada, but it’s still better than nothing.

Posted in Uncategorized | Tagged , | 7 Comments

Introducing python-ardrone

Flying AR.Drone

The last weeks I spend quite a lot of time hacking on a Python library for the AR.Drone. The AR.Drone is a nice toy for nerds. You connect to it via WIFI and soon you’ll realize that it has 4 ports open. Reading the specs you’ll find, that on one port it listens for AT-Commands with which you can remote control the drone, on the other two ports it waits for an incoming package which will trigger the drone to send the navdata (speed, angles, battery status, etc) and the video stream. Heck, you can even telnet into the drone…

Unfortunately it comes without a proper software to control the drone, only an iPhone app (w/o iPhone of course). But given the documentation, it should be easy to write your own. While getting the beast to fly was relatively easy, decoding the “almost”-jpg-video-stream was not. Almost-jpg, since the images the drone sends are more or less jpg with a small difference which makes it impossible to decode them using standard multi-media libraries. Anyways, the format is documented and implementing a decoder was not that hard. The tricky part was to get the framerates from unacceptable 0.5 FPS to 12-22 FPS — the whole decoder is written in Python. I’m cheating a bit by using psyco, but the code in arvideo.py is heavily optimized to minimize calculations and to please psyco.

In the code is also a small demo app which uses Pygame to display the video stream and allows to control the AR.Drone with the keyboard. It should be ready-to-use as soon as you are connected to the drone via WIFI.

The git repository is here, the license is MIT. Suggestions and patches are welcome.

Here is a video of the drone flying through the office.

Posted in Uncategorized | Tagged , | Leave a comment