Monthly Archive for June, 2009

Music Player

About two years ago I started to build a music player. I had an old notebook and a friend gave me his old CD player. The plan was to get the important parts of the notebook into the chassis of the CD player. This was done about two years ago and since then it stayed half-finished. Last week I finally had enough motivation (and the other notebook acting as our music player using mpd was actually being really used again) so that the project is now finally finished. Before I started it looked something like this:

On the left side the board is mounted on two pieces of wood. I had to cut new holes on the backside for all the connectors. Although it is booted over network and running from NFS it needs a hard-disk, because the BIOS needs 15 seconds longer if there is no hard-drive. As I wanted a fast boot I had to connect something to it and that is why I bought a 256MB flash drive with a 44-pin IDE connector.

All the cables which can be seen on the right side are from my idea to use the original buttons of the CD player chassis. The cables are connected to the keyboard controller and they are a very good example that I am more a software than a hardware guy. The plan was that certain combinations of the cables generate certain keyboard events (characters). That worked perfectly and I tried out many combinations and found enough keyboard events to connect all the cables to buttons of the CD player chassis. The problems started when I soldered all the cables to the board with the buttons. After I had soldered all cables to the board behind the buttons I powered it on again and it was generating lots of keyboard events even if I was not pressing any button, probably because I did not think about it that all cables which were connected to ground pins were now all connected together. So it was a bad idea and everything I did was pretty much useless. So I removed everything again and connected it again, but this time I tested the result after every button.

The most important button was the power on button, which works. I have now only four working buttons which is far from what I wanted but better than no possibility to control anything directly at the chassis.

To use the characters coming from the buttons I took mingetty, removed most of the code and modified it to read just one character (readfromtty1.c) and return that immediately to a shell script wrapped around. So if I now press the REPEAT button I get a message in the syslog saying “REPEAT pressed“.

I also had to cut two more holes into the CD player chassis on the left side for the CPU fan and for the audio connectors.

That was the only change to finally use it. If I now press the STANDBY/ON button, about 20 seconds later it starts playing music. I am using mpd so that I can control it from anywhere and pressing the same button again shuts the system down in about 5 seconds. Without much work I could get it probably to boot faster but right now I am using an only slightly modified Fedora 11 with a custom kernel so that I probably leave it the way it is now.

In addition to the buttons and all the available mpd clients I can also control the music player using my phone. I have extended my phone2jabber script to not only send jabber notifications when somebody calls but also to play the next song when one of my unused MSNs is called.

Leonidas Traffic (Part 2)

In one of my last posts I wrote about how much Fedora related traffic we had on our mirror server during the Fedora 11 release. I got one huge comment from Jef with three questions which I am trying to answer now.

1) Assuming you could find an accurate count of EU mirrors on F10 release. Can you use the ratio of available mirrors then to available mirrors now to re-scale the activity…sort of like a mirror inflation correction to scale activity in terms of available bandwidth.

As the mirrorlist is very dynamic I do not think I can answer that.  But if somebody has some useful numbers concerning the number of EU mirrors during the F10 release as well as during the F11 release it can probably be done.

2) Can you trend the “shape” of the first week of F-11 compared to the first week “shape” of F-10 activity on your mirror?  Forget about absolute scales. Normalize each to the maximum associated with the first 24 hours of activity and see how the activity trends in time relative to that normalization. Does F-10 for example see the same second day uptick relative to the first day that you see in F-11?

That should be possible. After some gnuplot-ing I have the following diagrams:

Downloaded Data (Normalized)

This shows the data transferred for each release (normalized to the first day). It is important, however, to know that the first day of a Fedora release is not 24 hours, but only 8 hours on our mirror server as the release usually happens at 16:00 local time. Therefore I also made another diagram using the absolute numbers:

Downloaded Data (Absolute)

It can be seen that basically only the first day differs for some reason. The following days were pretty much the same, just a bit less traffic than during the Fedora 10 release. So maybe this difference is related to my assumption that there are more mirrors in Europe. Although the amount of a traffic does not differ so much the mirror server has been in a much better state during the whole release. The load used to be much higher and the http server had no free connection slots available. This time the load was not really high and after the first day it was always possible to make a http connection (although it took longer than usual).

3)I’d be really interested to know if you could identify any upticks related to F-10 downloads further away from F-10 release that correlate with ambassador activity at an EU event.

No idea, but I have the amount of data downloaded per day for each mirrored project for at least the last year available here. So if there are certain dates it can be looked up.

For my own reference these are the gnuplot commands used to create the two diagrams:

gnuplot> set terminal png size 400,300
gnuplot> set output "absolute.png"
gnuplot> set xlabel 'Days Since Release'
gnuplot> set ylabel 'Terrabytes'
gnuplot> plot 'F10' smooth csplines title 'Fedora 10', 'F11' smooth csplines title 'Fedora 11'
gnuplot> set output "normalize.png"
gnuplot> a=2.23
gnuplot> b=1.54
gnuplot> set ylabel 'Downloaded Data (Normalized)'
gnuplot> plot 'F10' using 1:($2/a) smooth csplines title 'Fedora 10', \
>'F11' using 1:($2/b) smooth csplines title 'Fedora 11'

Bounce/Forward All Mails From A MBOX

So I found out that emails which I expected to have been forwarded a long time ago from my home server to my normal email address where still sitting in the mbox of my home server for over 6 months. So instead of using the easy way of copying the mbox to my real mail server I tried to forward them all using SMTP. I remembered that there exists a program called formail which should exactly do what I want.

To forward/bounce all mails from a mbox to my email address adrian@lisas.de I created a .procmailrc like this:

:0
*
! adrian@lisas.de

and then it does not take more than cat /var/spool/mail/adrian | formail -s procmail and all the mails were in the queue and ready to be delivered.

It took me a few attempts to get it right, so instead of forwarding/bouncing each mail one time I manage to bounce each mail over 200 times so that I had about 6000 new mails in my INBOX.

Leonidas Traffic

The Fedora 11 (Leonidas) release has been the Fedora release with the least pressure on our mirror server. This is probably due to the fact that there are more mirror servers in Europe than ever. In addition to the usual http/ftp/rsync traffic I had bittorrent running for the first time, but the bittorrent client was never using more than 50 MBit/s of the bandwidth (and that also dropped after the second day). Compared to the normal mirror traffic that is not really much. After running for about a week the bittorrent client has uploaded around 600 GB.

The Fedora traffic during the first few days after the release was of course higher than the average ~450 GB/day:

  • 2009-06-09: 1.54 TB
  • 2009-06-10: 2.88 TB
  • 2009-06-11: 1.62 TB
  • 2009-06-12: 1.01 TB

On the second day of the release almost 70% of the mirror traffic was Fedora related:

2009-06-10

And on the bandwidth graph it can also be seen when the bitflip was (around 15:00 local time) and when the release actually went live (16:00 local time):

2009-06-10

I do not know why the traffic dropped so significantly at around 00:00, but probably our mirror was dropped from the mirror list, because the crawler (from MirrorManager) was no longer able to connect and verify that our mirror was up to date.

Following Fedora 11

Syncing Fedora 11 to my mirror went pretty well. With hardlinks it took not much longer than 24 hours to transfer all the data.

On Monday rawhide was updated again and my mirror scripts started. This time it took more than 55 hours for the first run and it just finished a few minutes ago. I re-started the mirror script immediately after it finished because in the 55 hours it was running rawhide had already changed again. So it looks like to get my rawhide mirror in sync with the master server it will take more than three days. The slowness is probably not only caused by the large number of changes but also by the fact that it is now also necessary to transmit all the DeltaRPMS. Somehow it should be possible to use the DeltaRPMS for mirror syncing. Another reason might be that my mirror server has been pushing Fedora 11 data out at about 1Gbit/s, which probably does not help to speed things up.