Offlineimap

Just upgraded my Debian GNU/Linux, this upgraded offlineimap so I needed to modify my configuration (i.e. .offlineimaprc) adding the cert_fingerprint in the remote repository stanza.

This now looks like:

[cc lang="apache"]
[general]
metadata = ~/.offlineimap
accounts = gmail

socktimeout = 60
fsync = false

[mbnames]

enabled = yes
filename = ~/Mutt/muttrc.mailboxes
header = “mailboxes ”
peritem = “=/%(foldername)s”
sep = ‘/’
footer = “\n”

[Account gmail]
localrepository = Local-Gmail
remoterepository = Remote-Gmail

autorefresh = 20
quick = 10
expunge = no

[Repository Local-Gmail]

type = Maildir
localfolders = ~/Mail
sep = /

nametrans = lambda folder: re.sub(‘spam’, ‘[Google Mail]/Spam’,
re.sub(‘drafts’, ‘[Google Mail]/Drafts’,
re.sub(‘sent’, ‘[Google Mail]/Sent Mail’,
re.sub(‘flagged’, ‘[Google Mail]/Starred’,
re.sub(‘trash’, ‘[Google Mail]/Trash’,
re.sub(‘important’, ‘[Google Mail]/Important’,
re.sub(‘archive’, ‘[Google Mail]/All Mail’, folder)))))))

folderfilter = lambda foldername: foldername not in [ '[Google Mail]/Posta inviata’, ‘[Google Mail]/Trash’, ‘[Google Mail]/Cestino’, ‘[Google Mail]/Important’, ‘[Google Mail]/Importanti’, ‘[Google Mail]/Bozze’, ‘[Google Mail]/Spam’, ‘[Google Mail]/Drafts’, ‘[Google Mail]/Sent Mail’, ‘[Google Mail]/Trash’]

[Repository Remote-Gmail]

cert_fingerprint = f3043dd689a2e7dddfbef82703a6c65ea9b634c1
maxconnections = 5
type = Gmail
remoteuser = my_user@gmail.com
remotepass = my_password
realdelete = no
ssl = yes
folderfilter = lambda foldername: foldername not in ['[Google Mail]/All Mail’, ‘[Google Mail]/Important’, ‘[Google Mail]/Spam’, ‘[Google Mail]/Drafts’, ‘[Google Mail]/Trash’, ‘[Google Mail]/Sent Mail’ ]
nametrans = lambda folder: re.sub(‘.*Spam$’, ‘spam’,
re.sub(‘.*Drafts$’, ‘drafts’,
re.sub(‘.*Sent Mail$’, ‘sent’,
re.sub(‘.*Starred$’, ‘flagged’,
re.sub(‘.*Trash$’, ‘trash’,
re.sub(‘.*Important$’, ‘important’,
re.sub(‘.*All Mail$’, ‘archive’, folder)))))))
[/cc]

apt-spy migrated to git.debian.org

Asking for a sponsor for apt-spy was for me the starting point for a big new job. Paul Wise did a great review an found out many errors and pointed out that github is not so free as it looks out at a first glance. Paul pointed me to Benjamin Mako Hill‘s great post titled: Free Software Needs Free Tools. So even if I decided to not switch apt-spy to native package with the help of Fabrizio Regalli I imported apt-spy package that is actually on Debian archives in the collab-maint git that was created a while ago.
I merged github repo (I’m going to leave or even delete) following the guide Git community book chapter about merging.

Debian on a Stonesoft FW-300 (some they came back)

At the Associazione per le Libertà Informatiche e Digitali (the site is only in Italian) more the one year ago we started a project to spread the use of free educational software in schools, one part of the project is to help teachers in the day to day administration laboratories’ PCs and of the filtering proxy. Schools taking part at the project are more and more and we need some way to access PCs from remote so that our volunteers do not need to go to schools in person. The first solution we tried was ssh on a strange port with only key authentication but in many situation school networks are behind firewalls or worst connect to ISPs that does not provide them with public address. The solution is to install OpenVPN. I did some experiments with OpenVPN at home so we decided to go on, but we have to cope another challenge: ALID base is shared with other groups and we cannot leave a noise PC switched on 24/7. The solution to this second problem was the Stonesoft FW-300 I
successfully installed Debian in August.
As I tried also to install zeroconf on that hardware I need to reinstall Debian and, I’m sad to say that, the installation was a little bit tricky so I report the most significant task I did in the hope this will be usefull for someone else.

  1. I downloaded boot.img.gz from: http://http.us.debian.org/debian/dists/squeeze/main/installer-i386/20110106/images/hd-media/
  2. I gunziped the image on a USB thumb drive following the Installation guide (i.e.: zcat boot.img.gz > /dev/sdb)
  3. I edited syslinux.cfg so that now it looks like the following:
    [cc lang="bash"]# D-I config version 2.0
    CONSOLE 0
    SERIAL 0 9600 0
    include menu.cfg
    #default vesamenu.c32
    prompt 0
    timeout 0[/cc]
    Note that it may be not necessary to comment out vesamenu.c32 but I did.
  4. I downloaded netinst.iso from http://cdimage.debian.org/cdimage/squeeze_di_rc1/i386/iso-cd/ and copied it on the USB drive
  5. I configured minicom starting it as root with the -s parameter. I also tried to use gtkterm (which I find more user friendly that minicom) but for some strange reason I cannot understand I was unable to have a fully function VT102 terminal and I was not able to edit files using gtkterm.
  6. I started the stonesoft using with the USB drive inserted (follow my previous article to setup Stonesoft FW-300 to start from USB) and followed all installer steps till grub install
  7. grub installer failed as it tried to install on /dev/sda that is the USB drive. I entered the command prompt from the installer menu followed the usual GRUB recovery procedure and installed grub in /dev/sdb. The usual recovery procedure is (as /dev/sdb1 was already mounted as /target from the installer):

    mount –bind /dev /target/dev
    mount –bind /proc /target/proc
    mount –bind /sys /target/sys
    chroot /target /bin/bash
    rgub-install /dev/sdb

  8. Even though grub-installer did not failed I would have to enter chroot to customize /etc/default/grub to instruct grub to use the serial console. I edited the file so tha now it looks like this:
    [cc lang="bash"]# If you change this file, run ‘update-grub’ afterwards to update
    # /boot/grub/grub.cfg.

    GRUB_DEFAULT=0
    GRUB_TIMEOUT=1
    GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
    GRUB_CMDLINE_LINUX_DEFAULT=”console=tty0 console=ttyS0,9600n8″

    # Uncomment to disable graphical terminal (grub-pc only)
    GRUB_TERMINAL=serial
    GRUB_SERIAL_COMMAND=”serial –speed=9600 –unit=0 –word=8 –parity=no –stop=1″

    # The resolution used on graphical terminal
    # note that you can use only modes which your graphic card supports via VBE
    # you can see them in real GRUB with the command `vbeinfo’
    #GRUB_GFXMODE=640×480

    # Uncomment if you don’t want GRUB to pass “root=UUID=xxx” parameter to Linux
    #GRUB_DISABLE_LINUX_UUID=true[/cc]
    after exiting the editor I issued a update-grub.

  9. I exited the chroot, than the console to come back to installer menu
  10. I select not to install a bootloader and ended the installation. Note that grub unsuccessfull install was necessary to have grub installed by debian-installer.
  11. I rebooted the firewall just to be sure everything was ok

In near future I’ll report about OpenVPN installation.

gnus, debian, and spam on lists

I switched to emacs for most of my activity been writing code, debugging, organizing my life and reading emails with gnus. I know that most of the people out there just think that using emacs requires to remember lots of key-bindings and configuring it requires writing to many parenthesis but i like it.

I like to help debian list administrators to fight spam and in the meanwhile I prefer to leave spam out of my mailbox so with the following little function I bounce the email to debian and move it to spam folder of my local IMAP server. The server is synced with my gmail account so gmail knows of other spam.

(defun sc-forward-spam-lists-debian ()
(interactive)
(gnus-summary-resend-message "report-listspam@lists.debian.org" 1)
(gnus-summary-move-article 1 "nnimap+localhost:spam")
(forward-line 1)
)

(add-hook 'gnus-summary-mode-hook
(lambda ()
(local-set-key (kbd "") (quote sc-forward-spam-lists-debian))))

Nuovo portatile

Ok, molti lo sanno già perché è più di una settimana che mi bullo del mio nuovo portatile, però sono molto contento del mio nuovo HP ElithBook 8440p.
Sulla mia nuova bestia ho già installato Debian che va come un orologio svizzero, ho lasciato anche un piccolo spazio per Windows7 e grazie a VirtualBox la partizione Windows7 avvia in una bella macchina virtuale.
Appena avrò un po’ di tempo scriverò una pagina dedicata a questa macchinina e un bug report per riportare l’installazione in Debian. A onor del vero l’installazione non è stata facilissima con un primo reboot con mille righe verticali e nessun carattere visibile.

Howto install Debian on a Stonesoft FW-300

The Stonesoft FW-300 is a firewall appliance that was discontinued by Stonesoft, I found one as I was looking for an headless little PC to use it as home server. I did not jet deployed it in my home network as I left it on my office desk after I installed it.

To install it I just did the following:

  1. I got my 256 USB stick. Inserted it my PC, unmounted it as it was automounted.
  2. I got the sid install files, that can be used also to install etch/lenny/squeeze, with following commands:
    1. wget ftp.us.debian.org:/debian/dists/sid/main/installer-i386/\current/images/netboot/debian-installer/i386/linux
    2. wget ftp.us.debian.org:/debian/dists/sid/main/installer-i386/\current/images/netboot/debian-installer/i386/initrd.gz
    3. wget ftp.us.debian.org:/debian/dists/sid/main/installer-i386/\current/images/netboot/mini.iso
  3. I installed mbr, syslinux amd mtools using the following command: aptitude install mbr syslinux mtools
  4. I created a FAT partion on the stick: mkdosfs /dev/sdb1
  5. I created the mbr: install-mbr /dev/sdb
  6. Set the USB stick to boot: syslinux /dev/sdb1
  7. Mounted the USB stick: mount /dev/sdb1 /media/usb
  8. I copied initial ram disk image and the mini iso to the USB stick: cp linux initrd.gz mini.iso /media/usb
  9. I edited the syslinux.cdf on the USB stick to let it boot using the serial port. I just added these two lines:

    CONSOLE 0

    SERIAL 0 9600 0

  10. At the end I umounted the USB stick: umount /dev/sdb1
  11. I inserted the USB stick in the appliance and started the standard installer.

The appliance did not boot the first time I tried. I rebooted entered BIOS setup and set it to boot for USB Floppy.

NLog rpm

In many of the applications we are developing at Penta Engineering we make use of NLog logging library. From the NLog website you can download the Windows ™ installer or the source code, Mandriva has a package but nor Fedora nor Debian so yesterday I created a Fedora RPM. I started using the  Mandriva spec file modified following the Fedora packaging guidelines for Mono . Today I discovered the way to let Monodevelop see the dll in its  dependancy window and added a .pc file to the RPM.

I’m publishing my RPM in the hope to help someone not to loose her/his time. I’ll look the way to let this package enter Fedora and the time to create a DEB

Java and Internet connection on Debian

I like Eclipse but I was unable to use all of its feature becouse it was unable to access the network. I blamed the Debian java installation so I downloaded and installed SUN Linux JDK but this was not the correct solution, so I started doubting about Debian eclipse package so I removed all eclipse and java packages but without any changes. At the end I downloaded and installed netbeans that have the same problem but this was the key to the solution becouse at http://forums.netbeans.org/ptopic22280.html I found out that with the following command all java application can access the network without any problem:

sudo sed -i ‘s/net.ipv6.bindv6only\ =\ 1/net.ipv6.bindv6only\ =\ 0/’ \
/etc/sysctl.d/bindv6only.conf && sudo invoke-rc.d procps restart

Now I can work with Eclipse and try out Netbeans, too.

apt-spy 3.2.2 is ready to be released

Today I finished testing apt-spy 3.2.2. This release closes some bugs (#457049,
#515515, and #447232) and introduces a new feature: instead of testing for ftp.xx.debian.org, if this is an alias of one or more mirrors apt-spy tests for the real server. This is done parsing the list in parentesis under the alias.
I’m investigating why version 3.2-1 I released in august never entered the archive. This version was just a new upstream version with code refactory and no new features or bugs solved. The same appened to version 3.1-20 that solved bug #491802 and #317592.

apt-spy

A new version of apt-spy is going to be uploaded. I’m planning the future for this package, I would like to internationalize it and to support long command line options, what do you think about these goals? I already started using anjuta, autotools and the like.

eeePC sempre soddisfazioni

Il mio piccolo eeePC mi sta dando sempre più soddisfazioni. Il fatto di avere poco disco mi costringe a studiare soluzioni a cui non avrei mai pensato. Oggi ho messo su mutt con gmail (semplicissimo), è probabilmente l’unico MUA usabile con uno schermo così piccolo e un touchpad in miniatura. Non avevo mai provato mutt prima d’ora con IMAP. Ora dovrò studiare come funziona imapfilter per avere l’email filtrate prima di collegarsi al server.

Starting managing apt-spy

I’m starting working on apt-spy. I started creating a git working directory on my PC and cloning it in my home page on alioth/git as apt-spy does not have a public code repository. I’ll apply all patches that were created during these years by QA to close bugs.

NOTE: This is the first post about my work on Debian packages. I’ll publish these series of posts in English, as English is not my mother tounge any correction is welcome.