Search Results: "Enrico Zini"

12 June 2008

Enrico Zini: Miscellaneous bash tips

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: For more useful keystrokes, run man bash, look for "Commands for Manipulating the History" and read down from there.

Enrico Zini: How to resize a luks partition

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

6 June 2008

Enrico Zini: Italian weather agencies

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. Abruzzo Basilicata Calabria Campania Emilia-Romagna Friuli-Venezia Giulia Lazio Liguria Lombardia Marche Molise Piemonte Puglia Sardegna Sicilia Toscana Trentino-Alto Adige Umbria Valle d'Aosta Veneto Italia suddivisa per regioni I only filled in those regions that I was checking to organise a specific trip. With time, if I'll keep using this map I'll add more regions. Of course, if you now of a weather forecast page of a regional, public funded agency that is missing here, send me an e-mail.

1 June 2008

Enrico Zini: Playing with a Holux M-241

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:
cvs -d:pserver:anonymous@gpsbabel.cvs.sourceforge.net:/cvsroot/gpsbabel login
cvs -z3 -d:pserver:anonymous@gpsbabel.cvs.sourceforge.net:/cvsroot/gpsbabel co -P gpsbabel

Untar this to debianise the sources. If it does to compile because of some errors in lmx.c, apply this patch. Then you can install the resulting package and (hopefully) be happy. Note, after downloading the logs, gpsbabel currently turns on logging. Here is a patch to disable that behaviour. Finally, if you want to hack around a little on the unit, you can play with mtkbabel: the source code is simple, and most of the MTK protocol is implemented, so you can easily feed your own commands to the MTK. Documentation about the commands can be found here: The links are taken from a post in the GPSPasSion forum. For a source of ideas of what commands you can send, you can look into the source code of BT747. For example, to set the M-241 to 2Hz fix, you can add this to mtkbabel:
packet_send('PMTK300,500,0,0,0.0,0.0');
$ret = packet_wait('PMTK001,300,3');

And if you want to set the MTK to an insane 5Hz fix rate, to take really fine grained gpx traces with your laptop, you can use this:
packet_send('PMTK300,200,0,0,0.0,0.0');
$ret = packet_wait('PMTK001,300,3');

25 May 2008

Enrico Zini: LDAP user database errors

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. This is apparently "normal" folk knowledge. Already in the BTS. Now, why is /etc/libnss-ldap.conf not world readable by default? Because a debconf question offers it to be that way. Why does it do so? I have no idea, since passwords should go in the not world readable /etc/libnss-ldap.secret anyway. Why do we get that assertion instead of something like cannot read /etc/libnss-ldap.conf? These sort of obscure errors or behaviours happen so often that I start to believe it's an intentional coding style. Maybe LDAP needs to be something for lite sysadmins with a painful initiation path, so that only the Worth and Pure of Spirit can use the only sane way to have a central user database in Linux. I almost feel like if I disclose these tricky bits one day I will be tied to a rock with an eagle eating my liver.

23 May 2008

Enrico Zini: Conditional partitioning in debian installer

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 website, which does everything except create the partition if it's missing. The technique I used is to create a udeb that would scan the partitions using /usr/lib/partconf/find-partitions and then load the right preseeding for partman-auto, the automatic partitioner. Here you find the udeb source. I'll comment the most important bits: First, the two partman-auto recipes that we are going to preseed. The format is documented in the debian-installer documentation. This will create /home if missing:
        d-i partman-auto/expert_recipe string                           \
                condpart ::                                             \
                2048 2048 2048 ext3                                     \
                        $primary    $bootable                           \
                        method  format   format                         \
                        use_filesystem    filesystem  ext3              \
                        mountpoint  /                                   \
                .                                                       \
                1024 1024 1024 linux-swap                               \
                        method  swap   format                           \
                .                                                       \
                1024 4096 10000000 ext3                                 \
                        method  format   format                         \
                        use_filesystem    filesystem  ext3              \
                        mountpoint  /home                               \
                .
And this will keep /home if it exists:
        d-i partman-auto/expert_recipe string                           \
                condpart ::                                             \
                2048 2048 2048 ext3                                     \
                        $primary    $bootable                           \
                        method  format   format                         \
                        use_filesystem    filesystem  ext3              \
                        mountpoint  /                                   \
                .                                                       \
                1024 1024 1024 linux-swap                               \
                        method  swap   format                           \
                .                                                       \
                1024 4096 10000000 ext3                                 \
                        method  keep                                    \
                        use_filesystem    filesystem  ext3              \
                        mountpoint  /home                               \
                .
Then the postinst file of the package, where the logic is. Otavio and Daniel on #debian-boot have taught me that udebs are, simply put, just big postinsts (installer wise, apart from shipping binaries). Postinst is where the logic is done, or applications are started.
#!/bin/sh
# Copyright 2008 Enrico Zini <enrico@truelite.it>
# Licensed under the terms of the GNU General Public License,
# version 3 or any later version.
set -e
FINDPARTS="/usr/lib/partconf/find-partitions"
notice ()  
    logger -t condpart "$@"
 
error ()  
    logger -t condpart "error: $@"
 
# load debconf
. /usr/share/debconf/confmodule
notice "Checking if we need to recreate /home"
if [ ! -x $FINDPARTS ]
then
    error "$FINDPARTS not found"
    exit 1
fi
if $FINDPARTS   grep -q part6
then
    # Keep
    notice "/home exists: we keep it"
    debconf-set-selections /usr/lib/condpart/part-keep.preseed
else
    # Format
    notice "/home does not exist: we create it"
    debconf-set-selections /usr/lib/condpart/part-create.preseed
fi
notice "Finished special handling of /home"
#DEBHELPER#
exit 0
Finally, debian/control. The basic bits about creating a d-i udeb are to put it in Section: debian-installer and to use XC-Package-Type: udeb. Then there is XB-Installer-Menu-Item, that defines the order of execution of postinsts. The d-i documentation lists the numbers that are currently assigned.
Source: condpart
Section: debian-installer
Priority: optional
Maintainer: Enrico Zini <enrico@debian.org>
Build-Depends: debhelper (>= 4.0.0), cdbs
Standards-Version: 3.7.2.1
Package: condpart
Architecture: any
XC-Package-Type: udeb
XB-Installer-Menu-Item: 38
Description: Conditional partitioning
 Tells partman-auto to create /home if it's missing, or if it exists, to keep
 it.
I am using 38 rather than 3800 because I'm targeting etch d-i. After etch, "numbers have been multiplied by 100 from what they were before to give us more space". This is it. debian/rules is just boilerplate, except installing the preseed files in the right place. CDBS is useful to make this self-evident:
#!/usr/bin/make -f
include /usr/share/cdbs/1/rules/debhelper.mk
install/condpart::
  install -o root -g root -m 0644 *.preseed debian/$(cdbs_curpkg)/usr/lib/condpart/
To build the installer CD with this d-i, I'm using simple-cdd; here are the profile files I'm using at the moment, with the main preseeding for fully unattended install (it is designed to trash your hard disk if you boot it, so only test it in an emulated environment) and the inclusion of the custom udeb.

18 May 2008

Russell Coker: Debian SSH Problems

It has recently been announced that Debian had a serious bug in the OpenSSL code [1], the most visible affect of this is compromising SSH keys - but it can also affect VPN and HTTPS keys. Erich Schubert was one of the first people to point out the true horror of the problem, only 2^15 different keys can be created [2]. It should not be difficult for an attacker to generate 2^15 host keys to try all combinations for decrypting a login session. It should also be possible to make up to 2^15 attempts to login to a session remotely if an attacker believes that an authorized key was being used - that would take less than an hour at a rate of 10 attempts per second (which is possible with modern net connections) and could be done in a day if the server was connected to the net by a modem. John Goerzen has some insightful thoughts about the issue [3]. I recommend reading his post. One point he makes is that the person who made the mistake in question should not be lynched. One thing I think we should keep in mind is the fact that people tend to be more careful after they have made mistakes, I expect that anyone who makes a mistake in such a public way which impacts so many people will be very careful for a long time… Steinar H. Gunderson analyses the maths in relation to DSA keys, it seems that if a DSA key is ever used with a bad RNG then it can be cracked by someone who sniffs the network [4]. It seems that it is safest to just not use DSA to avoid this risk. Another issue is that if a client supports multiple host keys (ssh version 2 can use three different key types, one for the ssh1 protocol, one for ssh2 with RSA, and one for ssh2 with DSA) then a man in the middle attack can be implemented by forcing a client to use a different key type - see Stealth’s article in Phrack for the details [5]. So it seems that we should remove support for anything other than SSHv2 with RSA keys. To remove such support from the ssh server edit /etc/ssh/sshd_config and make sure it has a line with “Protocol 2“, and that the only HostKey line references an RSA key. To remove it from the ssh client (the important thing) edit /etc/ssh/ssh_config and make sure that it has something like the following: Host *
Protocol 2
HostKeyAlgorithms ssh-rsa
ForwardX11 no
ForwardX11Trusted no You can override this for different machines. So if you have a machine that uses DSA only then it would be easy to add a section: Host strange-machine
Protocol 2
HostKeyAlgorithms ssh-dsa So making the default configuration of the ssh client on all machines you manage has the potential to dramatically reduce the incidence of MITM attacks from the less knowledgable users. When skilled users who do not have root access need to change things they can always edit the file ~/.ssh/config (which has the same syntax as /etc/ssh/ssh_config) or they can use command-line options to override it. The command ssh -o “HostKeyAlgorithms ssh-dsa” user@server will force the use of DSA encryption even if the configuration file requests RSA. Enrico Zini describes how to use ssh-keygen to get the fingerprint of the host key [6]. One thing I have learned from comments on this post is how to get a fingerprint from a known hosts file. A common situation is that machine A has a known hosts file with an entry for machine B. I want to get the right key in machine C and there is no way of directly communicating between machine A and machine C (EG they are in different locations with no network access). In that situation the command “ssh-keygen -l -f ~/.ssh/known_hosts” can be used to display all the fingerprints of hosts that you have connected to in the past, then it’s a simple matter of grepping the output. Docunext has an interesting post about ways of mitigating such problems [7]. One thing that they suggest is using fail2ban to block IP addresses that appear to be trying to do brute-force attacks. It’s unfortunate that the version of fail2ban in Debian uses /tmp/fail2ban.sock for it’s Unix domain socket for talking to the server (the version in Unstable uses /var/run/fail2ban/fail2ban.sock). They also mention patching network drivers to add entropy to the kernel random number generator. One thing that seems interesting is the package randomsound (currently in Debian/Unstable) which takes ALSA sound input as a source of entropy, note that you don’t need to have any sound input device connected. When considering fail2ban and similar things, it’s probably best to start by restricting the number of machines which can connect to your SSH server. Firstly if you put it on a non-default port then it’ll take some brute-force to find it. This will waste some of the attacker’s time and also make the less persistent attackers go elsewhere. One thing that I am considering is having a few unused ports configured such that any IP address which connects to them gets added to my NetFilter configuration - if you connect to such ports then you can’t connect to any other ports for a week (or until the list becomes too full). So if for example I had port N configured in such a manner and port N+100 used for ssh listening then it’s likely that someone who port-scans my server would be blocked before they even discovered the SSH server. Does anyone know of free software to do this? The next thing to consider is which IP addresses may connect. If you were to allow all the IP addresses from all the major ISPs in your country to connect to your server then it would still be a small fraction of the IP address space. Sure attackers could use machines that they already cracked in your country to launch their attacks, but they would have to guess that you had such a defense in place, and even so it would be an inconvenience for them. You don’t necessarily need to have a perfect defense, you only need to make the effort to reward ratio be worse for attacking you than for attacking someone else. Note that I am not advocating taking a minimalist approach to security, merely noting that even a small increment in the strength of your defenses can make a significant difference to the risk you face. Update: based on comments I’m now considering knockd to open ports on demand. The upstream site for knockd is here [8], and some documentation on setting it up in Debian is here [9]. The concept of knockd is that you make connections to a series of ports which act as a password for changing the firewall rules. An attacker who doesn’t know those port numbers won’t be able to connect. Of course anyone who can sniff your network will discover the ports soon enough, but I guess you can always login and change the port numbers once knockd has let you in. Also thanks to Helmut for advice on ssh-keygen.

17 May 2008

Enrico Zini: How to view the fingerprint of the ssh host key

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. To figure out how to see the host key, you need to dig through a long manpage with no examples section. ssh-keygen does have commandline help, but does not implement any switch to invoke it (check the getopt invocation in the source code if you don't believe me). It will however show commandline help when given an unrecognised option, so it will mutter but at least give you love if you ask for it:
$ ssh-keygen - 
ssh-keygen: illegal option -- 
Usage: ssh-keygen [options]
Options:
  [...]

After figuring out that it's -l -f, you still have to go and fish the file wherever it is. And luckily we had the recent Debian openssh problems, so now I can get the fingerprint of the RSA file only and be done with it. But thanks to this blog entry, no more of that, at last.

13 May 2008

Enrico Zini: How to generate bootable USB keys with simple-cdd

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:
  1. download vmlinuz and initrd.img from hd-media
  2. apt-get install syslinux mtools mbr
  3. Partition the USB key as needed (from now on, I'll assume the usb key is in the device /dev/sdb1)
  4. Format it as FAT: mkdosfs /dev/sdb1
  5. Put the boot loader in it: syslinux /dev/sdb1
  6. Put the MBR in it: install-mbr /dev/sdb
  7. Mount it: mount /dev/sdb1 /mnt
  8. Copy kernel and initrd: cp vmlinuz initrd.img /mnt/
simple-cdd specific part:
  1. Run build-simple-cdd as usual
  2. Copy the ISO file generated by build-simple-cdd in the USB key. Any name will do, as long as it ends in .iso the installer will find it
  3. Configure the boot loader, fetching the kernel command line out of the cdrom boot loader generated by simple-cdd:
    • echo default vmlinuz > /mnt/syslinux.cfg
    • grep append tmp/cd-build/etch/boot1/isolinux/isolinux.cfg head -1 sed -e 's/^\t//' -e 's/ initrd=[^ ]*/ initrd=initrd.gz/' >> /mnt/syslinux.cfg
This is it, it works nicely, perfectly scriptable, tested today.

Enrico Zini: Setting environment variables at X login

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: Forget about ~/.xinitrc. ~/.xsession and ~/.Xsession: at least in gnome-session, they do not work. Update: * On IRC, I've been told that ~/.xsessionrc should be used since xorg 1:7.3+9

1 May 2008

Enrico Zini: Audit your debian uploads

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:
# go to merkel to access projectb, which is the postgresql database
# with all dak information
$ ssh merkel
merkel$ psql projectb
# look up the database id of my fingerprint
projectb=> select id, fingerprint from fingerprint where fingerprint like '%797EBFAB';
 id                  fingerprint                
    -----+------------------------------------------
     394   66B4DFB68CB24EBBD8650BC4F4B4B0CC797EBFAB
    (1 row)
# get a list of all uploads done with my key, sorted by date
projectb=> select * from source where sig_fpr=394 order by install_date desc;

First you get to do it (done); then you document it (done); then you automate it. It's quite trivial at this point, so enjoy the new Debian upload monitor. It's got search as you type to find your full fingerprint, then you get an HTML page with the log of your uploads in the last 2 months, and the page has an RSS feed that you can use to track your own uploads. Also, generating all this static content is acceptably fast:
merkel$ time ./deb-key-audit 
real    0m7.145s
user    0m4.244s
sys 0m0.384s

If you want to see the code, you can git clone http://merkel.debian.org/~enrico/keylog.git Currently it wrongly encodes UTF-8 characters: I suppose the strings come out of the database as ASCII instead of UTF-8. A patch would be welcome to fix that. I will now contact QA to see what we can do with it; if it ends up fitting in some bigger picture then it may be that the RSS links will change, but I'll post about it in that case.

30 April 2008

Enrico Zini: Meet the Italian income agency

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. That service is supposed to have been taken offline now, after the Italian privacy watchdog issued a polite What The Fuck! Why Didn't You Tell Us Anything About This? sort of note. The minister defended himself by saying "I can't see what is the problem, it's the same in all the world: if you want proof just watch any American TV series". What a wise man. I should watch some of The Greatest American Hero again. Since I could not see the actual data, I could not verify if what people were saying was actually true, that is that income information were published together with the full home address, providing a nice shopping list for house robbers, kidnappers and the other kind of professionals that would politely wait next to your door for you to come home late in the night. But fear not, the website was protected from bots: it used a captcha. Not only that: in order to comply with standard accessibility rules, the website used a perfectly accessible captcha: Screenshot of full text captcha You can't get more accessible than that: the captcha is displayed in plain text, so any accessibility technology will be able to read it. Plus, anyone can easily copy and paste it into the text box. And if someone needs to do it often, it's even trivial to write a script that does it for you! But it's unfair to say that it was just plain text: it was cleverly encrypted:
<div class="educaptcha"><label for="educaptcha">I<!-- id9113507 -->nser<span>ire </span><span>nel c</span><span>ampo</span> di <!-- id5058508 -->v<span>erific</span><span>a suc</span><!-- id2643358 -->ces<span>sivo i</span><!-- id2500023 -->l valore <span>695</span><span>8571</span>4<!-- id3588853 -->:</label>
<input id="educaptcha" type="text" name="ucaptcha" value="" maxlength="10" size="20" /></div>

For your convenience, here is the version cracked with a malicious :%s/<[^>]\+>//g in vim. If you do not speak Italian, you can still look for this phrase in the screenshot above:
Inserire nel campo di verifica successivo il valore 69585714:

The meaning is of course:
Insert the value 69585714 in the following verification field:

It's been a fun day for Italians online.

24 April 2008

Enrico Zini: How to not start a service by default

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.

19 April 2008

Enrico Zini: Laptop stolen

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. All sensitive data in the laptop are protected with one or two layers of strong encryption, and I have fresh backups, so the only work that I've lost was the work I did on the train and airplane on my way to the UK. If anyone around Manchester or Stockport happens to see, in a Cash Generator or second hand shop, a suspicious looking white ASUS laptop with a Taiwanese keyboard (US-style keyboard with extra Traditional Chinese and Bopomofo glyphs on it), please quietly walk out of the shop, alert the police and send me an e-mail. The day after the theft I managed to talk with a pub owner in the area, and there I learnt that pubs are networked and alert each other when suspicious people are roaming around. Lesson learned: if I see suspicious people around the street whem I'm walking home with my laptop, it's a good idea to go inside a pub and ask how's the situation. That night, for example, they've been alerting their customers of the danger. I wish the railway station had done the same.

29 March 2008

Enrico Zini: OpenStreetMap party at Kaohsiung, Taiwan

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: Technical bits: Issues to address:

24 March 2008

Enrico Zini: Glitches in the Matrix

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' pasta sold by British supermarked in Taiwan Italian pasta sold by a British supermarket, in Taiwan. Also, "Messicani" is not a kind of Italian pasta. Google for it, and you'll only find it mentioned in British websites.

Enrico Zini: How to freak out a Frenchperson

How to freak out a Frenchperson
Bottles with 'Champagne Soda' label
'Champagne Soda' label close-up 'Champagne Soda' label close-up
'Champagne Soda' label close-up 'Champagne Soda' label close-up
The way to freak out an Italian, instead, is to show them a bottle of "Lambrini" in the UK.

23 March 2008

Enrico Zini: Italian National Anthem

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 ourselves to not give a damn about it. Which is our general strategy to deal with all the insanity we get every day. What's the point of a nationalist anthem anyway, when the people who care most about the country are wishing for the Germans to invade us? Anyway, here's my attempt at national anthem lyrics that suck less, for the benefit of those, like Christian, who like the music but not the words.
Fratelli d'Italia
L'Italia s' desta,
Chi cazzo sto Scipio
Che ci han messo in testa.
Non c' la Vittoria
che porge la chioma,
Siam schiavi di Roma
E del Vatican.
Scongiuri alla sorte
Si rischia la morte
Si spera di no.
Noi siamo da secoli
Calpesti, derisi,
Perch siam mafiosi
ladroni e collusi.
Si rischia di nuovo
di aver Berluscone
Dell'emigrazione
Gi l'ora suon .
Scongiuri alla sorte
Si rischia la morte
Si spera di no.
Uniamoci, amiamoci,
l'unione, e l'amore
Ridanno alla gente
Il suo buonumore;
Giuriamo far sesso
sul suolo nat o:
Chiaviamo, perd o,
Chi dice di no?
Scongiuri alla sorte
Si rischia la morte
Si spera di no.
Dall'Alpi a Sicilia
Noi ti condoniamo,
Ogn'uom di Bettino
Ha il core, ha la mano,
I bimbi d'Italia
Fan calcio balilla,
Bastardo chi frulla
Gancin non si pu .
Scongiuri alla sorte
Si rischia la morte
Si spera di no.
I nostri politici
Son tutti venduti:
Si sente dall'Austria
L'odor dei rifiuti.
Lavora in Italia,
Il nero, il Polacco,
In nero, perbacco,
Io lo pagher .

Scongiuri alla sorte
Si rischia la morte
Si spera di no.

18 March 2008

Enrico Zini: make distcheck and LaTeX

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. latex --help doesn't mention of such an option, nor of useful environment variables. Googling a bit seems to suggest --include-directory=dir, but that gives me: unrecognized option '--include-directory=../../doc' The manpage doesn't list commandline options. It however says:
The complete documentation for this version of TeX can be found in the info file or manual Web2C: A TeX implementation.
Without saying where that manual is, if it's installed and where, or what package installs it, or if instead should I look it up on the web. info latex gives the manpage itself, of course. Googling the title of that manual finds it, and it's a long one. Reading through, it points at the kpathsea manual, which then mentions you can set TEXINPUTS_latex, which however doesn't add but overrides, so your document will find the includes maybe, but not the LaTeX styles and other stuff. But then later on it mentions that in the env variable you can use "default expansion", and it's another page of manual to read which tells you to put an extra colon in the end of the env var. After half an hour of googling and trying things and cursing loud, here is the solution, which I hope will save others from this ugly search.
%.aux: %.tex
    TEXINPUTS="$(srcdir):" latex $<
# Oh, yes, and bibtex requires BIBINPUTS instead
%.bbl: %.aux
    BIBINPUTS="$(srcdir):" bibtex  basename $< .aux 

9 March 2008

Enrico Zini: ldap-userdb-fields

Fields used by an LDAP Unix user database Some notes about LDAP for Unix user management: Meaning of fields for objectClass posixAccount: Meaning of fields for objectClass posixGroup: For objectClass inetOrgPerson: what you put there can be used as if it were a vCard by mail programs and contact lists. Now, the name of people could potentially be split in cn,givenName,sn,gecos and displayName (possibly more): how would normal user tools deal with the redundancy? To show a gecos field, pam_ldap will search for a gecos field first, then automatically fallback on building a gecos field out of the other suitable info it finds. To show a name, sane programs try displayName first and if it's not present they guess using the rest. Then there is the issue of how to chose the dn to identify users, groups and so on. Users usually go in uid=$USERNAME,ou=People,$SUFFIX, while groups would usually go in cn=$GROUPNAME,ou=Groups,$SUFFIX. Should you need to create the People and Groups organizational units, this could be the proper bit of LDIF:
dn: ou=$NAME,$SUFFIX
ou: $NAME
objectClass: organizationalUnit
To add fields that are not already part of a schema, one needs to create their own schema. To do that, one needs to first obtain (free of charge) a Private Enterprise Number that is used in various places in the schema definition. Making up your own one means risking conflicts if you eventually grow larger. But it is rarely needed, because for most things there are already schemas available. Many thanks to Wouter and noshadow for allowing me to crudely extract all this content from their brains.

Next.

Previous.