Oct 10

Thanks to geohot 10/10/10 has finally a meaning since limera1n has been released.

What worths a mention is that to run the jalibreak tool i installed a 64bit winblows on a 32bit Pentium 4, no need to say more.

The world is running binary today.

May 19

In 1999 i subscribed to a usenet provider named Newsfeeds, the following year i didn’t renew the account but they forgot about me, so i cheated the following 10 years without paying a cent.
Thank you Newsfeeds, it’s been a huge joy downloading 10 years of binaries for free, too bad today it’s all gone, and not because they remembered about me.

This week marks the end of an era for one of the earliest pieces of Internet history, which got its start at Duke University more than 30 years ago. On May 20, Duke will shut down its Usenet server, which provides access to a worldwide electronic discussion network of newsgroups started in 1979 by two Duke graduate students, Tom Truscott and Jim Ellis.

News of the day is also the shutdown of the British Usenet indexer Newzbin today; the site sank under the weight of a lawsuit and outstanding debt. Combine these stories with the recent news of Microsoft shuttering its newsgroups, along with otherrecentstories, and the picture does not look bright for Usenet.

Jan 29

The pride of being outta the biggest social crapsite of the web got its peak after reading such sweet news.

Have fun having your identity stolen.

Jan 01

New year, new post.

Navigon chooses navigation voice according to your iPhone’s language and gives you no way to change it, pretty dumb.

To put things right go to:

/var/mobile/Applications/NAVIGON/NAVIGON.app/en.lproj

and modify the “TXT_LOCALE” string in file GUI.strings to suit your needs: dut-NLD for dutch, eng-GBR for english, ger-DEU for german and so on (look for .nfs files to get more language flags).

С наступающим 2010 годом. С Новым годом, с новым счастьем.

Sep 10

When i was looking for a Nagios replacement i stumbled upon Zabbix and i suddenly fell in love with it. Too bad it’s auto-discovery feature doesn’t allow CIDR/16 classes to be scanned, but even if it did it wouldn’t be that nice to scan the whole Amazon EC2 network just to monitor my hosts.
I’ve read in Zabbix forums that host auto-registration will be re-implemented as of version 1.6 but until then i needed an automated solution, manually add each server is not tolerated.

I wrote therefore the following script, which basically simulates logging in and manually adding a new host through web interface.
Username and password are stored into an external file (first line and second line), this because i bundled this script into a RPM for Zabbix’s agent (which erases it through %post scripts) and i don’t want my server login credentials to travel with it (i know, you can always unpack the RPM…).
The IF statement checks whether the host on which the script is run is an EC2 host or not by merely seeing if hostname begins with “ip-”, it’s a shoddy method but it does its job.
I left out template linking since it was outside my scope but it would just take a couple of seconds in tuning the POST request.

I guess all the rest is kinda self explaining. Sorry for poor formatting (WordPress doesn’t seem to handle wordwrapping properly), orange lines are of course one line only.

#!/bin/bash

USERNAME=`sed -n '1p' /usr/local/zabbix/sbin/zabbix_credentials`
PASSWORD=`sed -n '2p' /usr/local/zabbix/sbin/zabbix_credentials`
URL=http://<your_ip_address>/zabbix   # NO trailing slash
HOST=`hostname`

if [ ${HOST:0:3} = "ip-" ]; then
        IP=`wget -q -O- http://169.254.169.254/latest/meta-data/public-ipv4`
        DNS=`wget -q -O- http://169.254.169.254/latest/meta-data/public-hostname`
else
        IP=`ifconfig eth0 | sed -n 2p | cut -d ":" -f2 | cut -d " " -f1`
        DNS=`hostname -f`
fi

wget --keep-session-cookies --save-headers --save-cookies /tmp/cookies -O- \
--post-data="form=1&form_refresh=1&name=$USERNAME&password=$PASSWORD&enter=Enter" \
$URL/index.php

wget --keep-session-cookies --save-headers --load-cookies /tmp/cookies -O- \
--post-data="form=Create+Host&form_refresh=1
&config=0&groupid=0&devicetype=&name=
&os=&serialno=&tag=&macaddress=
&hardware=&software=&contact=&location=
&notes=&host=$HOST&groups%5B%5D=2
&newgroup=&dns=$DNS&ip=$IP&useip=1
&port=10050&status=0&save=Save" \

$URL/hosts.php

Sep 04

UDF writing support, Xcode compatible with latest Python, iPhone SDK, stack overflow protection… i lasted as long as possible but too many minor (for the others) but vital (for me) features were becoming Leopard’s exclusive, therefore last sunday during a grey and sleepy afternoon it happened: i upgraded.

After having CarbonCopyCloned my installation to a firewire drive i inserted my CPU Drop-In DVD (my 2004 G4 PowerBook can read double layer DVDs, awesome) and started experiencing the smoothest upgrade process ever. No silly questions and no setup glitches, just pure installation time (about 1 hour with 4 years old hardware) and perfect results: everything at its place, properly upgraded or untouched.

The same process on a black MacBook (Tiger installed) took one step more, since the installer was unable to find 10.4 installed on the drive. A quick trick did the job: choose to restore from a Time Machine backup (but be sure no drive is actually connected), cancel the procedure, continue button in main installer is now enabled ;)

Aug 19

So sweet… Even more when you hear rumors claiming Billy was just there sitting and watching his evil deeds rising up.

Hope at least the machine carrying Li Ning around was running a real operating system…

More hilarious detailed info here.

Aug 14

A quick reference on how to debug Python applications (this is of course specific to shell environment, no IDEs involved).

Python features a debugging module called, unsurprisingly, pdb (Python DeBugger).
To activate the debugger add this at the beginning of your program:

import pdb

You can then set one or more break points by placing the following text:

pdb.set_trace()

Start the program as usual, once the break point is reached the interpreter will stop and wait for your input, you can then enter:

  • “n” to execute the next statement
  • “q” to quit
  • “p ” to print the value of one or more variables (use comma to separate)
  • “c” to stop debugging and continue with normal execution
  • “l” to see where you are in the code, if repeated it will show more lines
  • “s” to step into subroutines
  • “r” to continue (stop debugging) until the end of the current subroutine

Please note that:

  • You can just press the ‘enter’ key to repeat the last command
  • You can change a variable’s value on the fly by adding a leading exclamation mark to the standard Python syntax, it tells pdb we’re entering a statement instead of a command (e.g. !text = “hello”)

Happy debugging.

Aug 08

Some days ago i performed a dist-upgrade command on a Debian Etch server with two disks RAID1+LVM and it ended up with a new 2.6.25 factory kernel.

After a reboot it was stuck in BusyBox unable to mount the root filesystem…

I then rebooted and selected the previous kernel, same story (failsafe kernels as well)…

I realized (thanks Linux for being so verbose) there was a problem in creating the /dev/mapper directory and therefore no chance to be able to mount my raid.

A deeper inspection revealed that the mdadm script in BusyBox to mount the raid used the command “mkdir –parent” but long arguments have been deprecated in recent versions of BusyBox. Even worse: the correct syntax would be “–parents” (they even lost the trailing “s”), shame on you Debian mantainers.

I therefore had to manually extract my initrd (which is a gzipped cpio archive), edit the mdadm script and recreate the initrd with mkinitramfs.

It worked but i’m quite disappointed i haven’t found yet an “official” clean solution about it.

CentOS 2 – 0 Debian

May 27

Though i’ll always love Debian and its philosophy i remember i immediately felt happy since i moved most of my main servers to CentOS, and when such news reach me it gets even better.

It looks like keys generated with ssh-keygen from Debian or other Debian based distros (e.g. Ubuntu) have a case of weakness due to an error in the package and can therefore be guessed. Additionally, other systems can be indirectly affected if weak keys are imported into them.

If you run any Debian based system it is highly recommended that you upgrade as soon.
More info can be found at: http://lists.debian.org/debian-security-announce/2008/msg00152.html