You are here

Enrico Zini's blog

Enrico Zini's blog
Checked: 3 years 5 months ago
Updated: 3 years 5 months ago
Update every: 2 hours

Enrico Zini: blog
Subscribe to Enrico Zini's blog

Fagottini di pollo agli spinaci

Enrico Zini's blog - Tue, 15/07/2008 - 9:27pm
Fagottini di pollo agli spinaci

È da tempo che cerco di capire come cucinare una buona bistecca, e finalmente ho trovato un sito di cucina che parla la mia lingua.

Using OpenStreetMap maps with gpsdrive

Enrico Zini's blog - Wed, 02/07/2008 - 11:23pm
Using OpenStreetMap maps with gpsdrive

Here's how I made it:

Joys of schroot

Enrico Zini's blog - Tue, 17/06/2008 - 3:29pm
Joys of schroot

Schroot is good! Try schroot. You have LVM set up and some free extents in a vg? Try this:

# Create a new logical volume for a sid chroot
lvcreate -n schroot-sid -L1G YOUR-VG-NAME
mke2fs -j /dev/YOUR-VG-NAME/schroot-sid

# Debootstrap sid into it
mount /dev/YOUR-VG-NAME/schroot-sid /mnt
debootstrap --keyring=/etc/apt/trusted.gpg sid /mnt http://ftp.uk.debian.org/debian
umount /mnt

Then apt-get install schroot and put this in your /etc/schroot/schroot.conf:

Passing values to turbogears widgets at display time (the general case)

Enrico Zini's blog - Tue, 17/06/2008 - 8:48am
Passing values to turbogears widgets at display time (the general case)

Last time I dug this up I was not clear enough in documenting my findings, so I had to find them again. Here is the second attempt.

In Turbogears, in order to pass parameters to arbitrary widgets in a compound widget, the syntax is:

Saving waypoints with Holux M-241

Enrico Zini's blog - Sat, 14/06/2008 - 5:32pm
Saving waypoints with Holux M-241

The Holux M-241 is a nice unit, but it looks like it cannot store waypoints while you're recording a track.

In fact, if you set it to display latitude and longitude, every time you press enter it stores a track point with the current location. However, after downloading the data with gpsbabel, they are indistinguishable from all the other track points.

If you are not taking a track, this is sufficient: your track will be made by all the waypoints you recorded.

Send a fax from the laptop

Enrico Zini's blog - Fri, 13/06/2008 - 12:30pm
Send a fax from the laptop

My bank sent me a PDF form via e-mail. I needed to fill it in, then send it back via fax. Send it back via e-mail would not work because it's not secure. The bank agrees that this is fantastically silly, but apparently this requirement is not their fault.

How to autologin X without a display manager

Enrico Zini's blog - Fri, 13/06/2008 - 1:16am
How to autologin X without a display manager

Problem: configure a custom Debian box used to drive some industrial machinery. The system should boot directly into the GUI control application, that runs full screen, with root privileges. Everything should respawn if X is killed or the control application dies.

In theory, you'd run an X display manager with autologin, then run matchbox-window-manager and the control application as the X session. You wish. At the end of the post is an explanation of why this way failed.

Miscellaneous bash tips

Enrico Zini's blog - Fri, 13/06/2008 - 1:16am
Miscellaneous bash tips

A few useful configuration bits:

# Don't put duplicate lines in the history
export HISTCONTROL=ignoredups

# When you use history expansion (the !something), allows to edit the
# expanded line before executing it
shopt -s histverify

# Correct spelling mistakes when using 'cd'
shopt -s cdspell

# Do not attempt completion on an empty line
shopt -s no_empty_cmd_completion

A few useful keystrokes:

How to resize a luks partition

Enrico Zini's blog - Fri, 13/06/2008 - 1:16am
How to resize a luks partition

After things-not-to-do.mdwn I want to be careful when resizing a luks partition: here's a note with the right procedure.

As explained in this bug report, the way to resize a luks partition is:

# lvresize -L+100M /dev/vg00/test 
  Extending logical volume test to 400.00 MB
  Logical volume test successfully resized
# cryptsetup resize test1 
# resize2fs /dev/mapper/test1

Italian weather agencies

Enrico Zini's blog - Fri, 06/06/2008 - 12:24pm
Italian weather agencies

Most Italian regions have agencies providing good regional weather forecast. However, I could not find a useful national index of all their weather forecast pages. So I made one, tweaking an image map found on wikipedia.

Italia suddivisa per regioni

Playing with a Holux M-241

Enrico Zini's blog - Sun, 01/06/2008 - 2:46pm
Playing with a Holux M-241

Here is how to download tracks from the Holux M-241:

gpsbabel -t -r -w -i m241 -f /dev/ttyUSB0 -o gpx -F `date +'%Y-%m-%d-%H%M%S'`.gpx

It might work also via bluetooth, but I have not tried yet.

Now, until M-241 support will be released in a stable version of gpsbabel, here is how to compile the version from CVS.

Get the sources:

LDAP user database errors

Enrico Zini's blog - Sun, 25/05/2008 - 8:24pm
LDAP user database errors

In case your machine uses an external LDAP server for the user database, and you see this error:

id: ldap-nss.c:1376: do_init: Assertion `cfg->ldc_uris[__session.ls_current_uri] != ((void *)0)' failed.

The solution is to check that you have no passwords in /etc/libnss-ldap.conf and make it world readable, because software needs to access it in order to access the user database.

Conditional partitioning in debian installer

Enrico Zini's blog - Fri, 23/05/2008 - 8:55am
Conditional partitioning in debian installer

I needed to create an automatic, unattended installer that would repartition the whole disk, but keep an existing home partition if it is already existing. The idea is to replace the operating system, but keep the user's home files. If the home partition does not exist, however, we need to create it.

The starting point for this is In Holger's blog, which does everything except create the partition if it's missing.

How to view the fingerprint of the ssh host key

Enrico Zini's blog - Sat, 17/05/2008 - 12:38pm
How to view the fingerprint of the ssh host key

This way, ready to copy and paste:

ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key

Background:

It already takes a lot of resources to recall that to see the host key fingerprint you need to run something called 'keygen'. Then ssh-keygen doesn't support --help: it will try to generate a new key instead. We're in 2008. There should be a law against this sort of behaviour.

How to generate bootable USB keys with simple-cdd

Enrico Zini's blog - Tue, 13/05/2008 - 10:40pm
How to generate bootable USB keys with simple-cdd

simple-cdd is a lovely piece of software that builds a custom D-I image with the package selection and preseeding of your choice.

Today I was asked to build a bootable USB key with the simple-cdd image. Here is how; the general case is described in the d-i manual:

General USB key preparation:

Setting environment variables at X login

Enrico Zini's blog - Tue, 13/05/2008 - 10:22pm
Setting environment variables at X login

I've been asked how to set a variable after gdm has done login. ~/.bashrc is not an option, as it's only run by shells, but we want the variable to be set in every X application that is started.

The answer is:

  • ~/.profile for text and graphical sessions
  • ~/.xprofile for graphical sessions only

Forget about ~/.xinitrc. ~/.xsession and ~/.Xsession: at least in gnome-session, they do not work.

Audit your debian uploads

Enrico Zini's blog - Thu, 01/05/2008 - 3:15pm
Audit your debian uploads

My bank is sending me an e-mail every time I log into the home banking system, so that I can spot malicious logins.

My credit card is sending me a SMS message every time it gets charged, so that I can spot mailicious charges.

Can I get a notification of every Debian upload done with my key, so that I can spot if my key has been stolen?

Let's work on that. As a start, thanks to Ganneff, here is how to do a one-off audit:

Meet the Italian income agency

Enrico Zini's blog - Wed, 30/04/2008 - 9:11pm
Meet the Italian income agency

The Italian income agency decided to publish online all the income levels for each and every single citizen and company in the country.

I did not manage to see the actual data, because the entire income agency website was swamped with request and timing out all the time. You should have heard the comments of my accountant, who every day needs to access other parts of the website for work.

How to not start a service by default

Enrico Zini's blog - Thu, 24/04/2008 - 3:40pm
How to not start a service by default

Use case: in my laptop, I sometimes need MySQL, PostgreSQL or Apache in order to test some software that I'm developing, but I do not want them on all the time.

The solution is: rm /etc/rc*.d/S*mysql* (thanks to Wouter)

update-rc.d will not touch your symlinks as long as there is at least one still around for a package. Also, this leaves the stop symlinks around, so that when I start one of these services for development, it will still be properly stopped on shutdown.

Laptop stolen

Enrico Zini's blog - Sat, 19/04/2008 - 4:25pm
Laptop stolen

Last thursday I flew from Italy to Manchester as usual, and while walking home from Levenshulme railway station my laptop has been snatched off me by a gang of thieves.

I've managed to give the police all the details of the laptop including the serial number. I could also precisely describe to them the dynamics of the incident pointing at places over satellite maps in google maps. And give them the time of the theft with 10 seconds accuracy. And show them pictures of all stolen goods with a few simple internet searches. They were impressed.

OpenStreetMap party at Kaohsiung, Taiwan

Enrico Zini's blog - Sun, 30/03/2008 - 5:10am
OpenStreetMap party at Kaohsiung, Taiwan

Apparently, yesterday we had the first OpenStreetMap event in Taiwan!

We met in a café/restaurant equipped with power plug, wireless network and overhead projector and we had a bit of an introduction, chat and lunch.

Then we split in groups and exploited the fact that the newly built underground (KMRT) system is still free of charge, to spread around and map around the stations.

Finally, we reconvened at someone's house to see how to put the data together, draw roads, tag and upload.

Highlights of the day:

Glitches in the Matrix

Enrico Zini's blog - Tue, 25/03/2008 - 3:29am
Glitches in the Matrix

Taiwanese license plate over German license plate with K nation code]

Korean car with Taiwanese license plate (edited to anonymise it) over EU license plate with (Portuguese??) numbers on the right, and Korea as country code.

Italian National Anthem

Enrico Zini's blog - Sun, 23/03/2008 - 1:32pm
Italian National Anthem

Christian mentions that he likes the Italian National Anthem, although not the words.

No Italian in their right mind likes the words; luckily we are generally not forced to learn them, so we can allow themselves to not give a damn about it. Which is our general strategy to deal with all the insanity we get every day.

make distcheck and LaTeX

Enrico Zini's blog - Tue, 18/03/2008 - 12:51pm
make distcheck and LaTeX

When building LaTeX documentation on a VPATH build, if your .tex file includes other files in the same directory, LaTeX will complain that it cannot find them. The reason is because in a VPATH build, latex is invoked like this:

latex ../../doc/manual.tex

What we need here is an equivalent to cc's -Idir for latex.

Pages

Subscribe to Enrico Zini's blog