blino's website

Free software developer and more

Sometimes, after turning off the keyboard raw mode for debugging or recovery purposes (with ALT-SysRq-r), it does not get back to raw mode automatically when switching back to X.

This command allows to put the keboyard in raw mode again:

kbd_mode -s

The big part is rediffing the loop-AES patch. Fortunately, upstream provides a patch for 2.14, but I want to update util-linux-ng to 2.14.1, so it has to be reworked. This new 2.14.1 version introduces a patch to support loopback autoclear on umount, which gets in the way of the loop-AES patch, so better remove it.

Since the loop-AES patch is quite intrusive, to rediff it, it is easier to start for an old tree with loop-AES, and apply the upstream diff from 2.14 to 2.14.1 on it.

tar xjf util-linux-ng-2.14.tar.bz2
tar xjf util-linux-ng-2.14.1.tar.bz2
# extract the autoclear on umount patch from a util-linux-ng git checkout
git show e84feaecfdf44a33ef9eccc5a56c8a6999466140 > util-linux-ng-2.14.1-umount-autoclear.patch

# prepare a 2.14.1 tree without the annoying umount autoclear patch
cp -a util-linux-ng-2.14.1 util-linux-ng-2.14.1-no-umount-autoclear
patch -p1 -R -d util-linux-ng-2.14.1-no-umount-autoclear < util-linux-ng-2.14.1-umount-autoclear.patch
rm -f util-linux-ng-2.14.1-no-umount-autoclear/mount/lomount.c.orig

# get a diff between the old and new versions
diff -rNu util-linux-ng-2.14{,.1-no-umount-autoclear} > 2.14.1.patch

# start from the old version with the loop-AES patch
cp -a util-linux-ng-2.14 util-linux-ng-2.14.1-loop-aes
bzip2 -dc util-linux-ng-2.14-20080624.diff.bz2 | patch -p1 -d util-linux-ng-2.14.1-loop-aes

# apply the upstream diff from 2.14 to 2.14.1
patch -p1 -d util-linux-ng-2.14.1-loop-aes < 2.14.1.patch

# find and fix (or drop) the few rejects
find util-linux-ng-2.14.1-loop-aes -name '*.rej'
emacs util-linux-ng-2.14.1-loop-aes/mount/

# write the update loop-AES patch
diff -rNu -x -x semantic.cache -x '*~' -x '*.orig' -x '*.rej' \
     util-linux-ng-2.14.1 util-linux-ng-2.14.1-loop-aes \
     > util-linux-ng-2.14.1-loopAES.patch
# check that no files are missing or incorrectly touched
diffstat util-linux-ng-2.14.1-loopAES.patch

A funny patch name from Bill Nottingham:

$ grep ^+ SOURCES/sysvinit-2.86-godot.patch | tail -n 1
+       {"WT",WAITING},

(patch on ViewCVS)

It comes from a Samuel Beckett play, En attendant Godot (Waiting for Godot)

The awayproxy script (see irssi scripts) allows to get IRC logs when reconnecting to an irssi proxy.

Here are the marks that I should use to distinguish important articles in my gnus mail client:

  • persistent (* mark): important articles that have to stay at hand ("treasure" articles)
  • ticked (! mark): articles that I've partially read, but that I've yet to process (reply, or read more deeply)
  • dormant (? mark): articles that I want to show up if there are replies in the same thread

See matching entries in the Gnus manual:

If the articles count or list gets wrong in Gnus with the nnml backend (for example because of full disk), it can be rebuilt this way:

M-x nnml-generate-nov-databases

A more generic way is to go in the Server buffer (^ from the Group buffer) and use g to regenerate all its data structures.

Also try C-u M-g (gnus-summary-rescan-group) from Summary buffer to rescan the group for new articles.

To show the list of flags and langs together with a rpm files list:

rpm -q --queryformat '[%{FILEFLAGS:fflags}\t%{FILELANGS}\t%{FILEMODES:perms}\t%{FILENAMES}\n]' <package>

Complete list of rpm tags:

rpm --querytags

For an unknown reason, after updating Mozilla Firefox to latest cooker package, it failed to start with 1 as exit code. Though, it started fine with another user.

I tried to remove files in my profile one after the other, to see which one was causing the issue. It appeared to be ~/.mozilla/firefox/*.default/compatibility.ini. This file is described in Profile folder - Firefox (Files section).

iBurst (or HC-SDMA, High Capacity Spatial Division Multiple Access) is a wireless broadband protocol (can be compared to WiMAX).

It is for example deployed by (PBA) in Australia.

There is an ib wireless broadband driver (sourceforge) for Linux.

pam_console will be replaced by HAL fdi files and ConsoleKit to manage devices permissions. The rules are described in /usr/share/hal/fdi/policy/10osvendor/20-acl-management.fdi (they were previously in /etc/security/console.perms*).

See Remove pam_console (Fedorak wiki)

The Tor network allows to get stronger anonymity, but does not ensure data security. Data is encrypted between the relay nodes, but exits in clear text at the exit node, where it can be sniffed.

Dan Egerstad was able to collect a lot of e-mail information:

Setting up a Tor relay:

Multiple tools exist to manage and switch network profiles based on the physical location:

  • metaconf (written by Gustavo Niemeyer): a generic tool multiple configurations, which can use arping to detect the location
  • guessnet: supports ARP/wireless/pppoe probes
  • divine: uses ARP requests
  • whereami: allows to run a various number of detection hooks, including divine

More on the Network discovering... too many options thread from the debian-laptop ML.

Use post-receive hook to send commit emails (see contrib/hooks/post-receive-email and upstream doc).

/notes/tech/linux Full device Tue, 08 Jan 2008

The /dev/full device, full(4), can be useful to test bugs occuring on full disks (ENOSPC), such as some glibc bugs.

Multiple routing protocols can be used in ad-hoc wireless mesh networks (wikipedia). Some are described in the Wireless Networking in the Developing World (WNDW) book (HTML version).


OLSR, Optimized Link State Routing protocol (RFC 3626, INRIA HYPERCOM project, wikipedia), is a routing protocol for wireless ad-hoc networks.

OLSR is proactive, it runs a distributed election to choose Multipoint Distribution Relays (MPRs), which flood peridiocally the network topology (Mesh Networking with OLSR, in WNDW).

A popular implementation is the OLSR daemon, with a link-quality extension (README) using an ETX (Expected Transmission Count) metric, making it a Radio-Aware OLSR implementation (RA-OLSR).

The Open Mesh project is developping an alternative to OLSR, called B.A.T.M.A.N. (overview).


AODV, Ad hoc On-Demand Distance Vector (RFC 3561), is another routing protocol for wireless mesh networks.

It is reactive, it creates routing traffic only when needed.


The OLPC laptop project plans to use the upcoming 802.11s standard (wikipedia), see the mesh network details.

It uses a new routing protocol as default: HWMP, Hybrid Wireless Mesh Protocol. It is based on AODV for layer 3 routing and uses a modified Rapid Spanning Tree protocol for layer 2.

RA-OLSR was initially included as an optional routing protocol for the 802.11s draft, but it has been dropped because of extra complexity for the standard, with no added value. Though, it can still be used as a routing protocol, since the 802.11s specification allows optional routing protocols (without defining them).

The Arcfour cypher mode (RFC 4345) uses less CPU power than most other cyphers used for ssh connections (like AES). It may be less secure, but is interesting when fastness and low ressources consumption is important. Arcfour stands for "Alleged RC4", see RC4 history (wikipedia). The Cipher::Arcfour perl module is also full of worthy details (pm file).

HPN-SSH (High Performance Enabled SSH/SCP) is a patch to enlarge openssh buffers based on the link BDP (Bandwidth Delay Product), thus removing a network throughput bottleneck:

/notes/tech/linux Using inotify Tue, 18 Dec 2007

inotify might be useful at some point if I decide to cache my blosxom pages and to rebuild the pages dynamically when entries are added/updated.

The noop scheduler looks good to use with Flash memories, or maybe with SATA disks and NCQ (Native Command Queuing) enabled.

While trying to un-blank monitor in a script, I stumbled over various ways to send fake X11 events (for example keyboard ones). Most tools use the XTest X11 extension (like we do in our numlock helper), like Claudio's Anarkey.

For example, xdotool is a rather complete tool to simulate of lot of X11 events, allowing to send keyboard, mouse, and window events.

When turning a monitor off and on (with xset dpms force on) from scripts, the monitor may not be un-blanked automatically.

A trick is to run xset s reset to reset the screensaver and force un-blank (some suggest to use xset s activate, which works, but does not look correct).

This LFS script allows to extract supported PCI IDs from drivers, by dlopen()ing them

For the record, the Makefile uses a weird trick to export Xorg symbols /o\

nm -D /usr/bin/Xorg | egrep ' (B|D) ' | cut -d ' ' -f 3 | grep -v __

SCSI drivers are limited to 15 partitions, kpartx can be used to get more partitions:

all install:
        make $(MAKECMDGOALS) -C po

From taskset(1):

taskset  is  used  to  set  or  retrieve  the CPU affinity of a running
process given its PID or to launch a  new  COMMAND  with  a  given  CPU
affinity.   CPU affinity is a scheduler property that "bonds" a process
to a given set of CPUs on the system.  The Linux scheduler  will  honor
the  given CPU affinity and the process will not run on any other CPUs.

It's actually quite easy to test the stage2 installer, I don't know why I'm so resistant to do it.

  • install build dependencies
sudo urpmi /SRPMS/contrib/release/drakx-installer-stage2-10.4.171-1mdv2008.0.src.rpm
  • build and install stage2 in /export
cd ~/vc/mandriva/soft/drakx/trunk/perl-install/install
make install
  • boot stage1 with automatic=method:nfs,network:dhcp,server:dynamo,directory:/export on the kernel command line
  • update /export after each pm file modification
sudo make install_pms
  • restart installation with Ctrl+Alt+Home after modifications (not really clean)

List of upstream bugs in migration-assistant:

The MIT-SCREEN-SAVER extension of the Xserver allows to control screensaver features, but also to query screensaver info on specific windows.

XScreenSaverQueryInfo() allows to know the time since the last input was received from the user on any of the input devices, which is quite useful to detect if there is some activity in a window (used by pidgin to set away status).

The kernel allows to pass <irq>,<io>,<mem_start>,<mem_end>,<name> options to interfaces using the netdev= option and the deprecated ether= one (kernel-parameters.txt)

Surprisingly, the mem_start option does not match at all its initial meaning (in the context of shared memory). And the Linux devices drivers book does not clearly states that it is now used otherwise.

The Ethernet HOWTO documents it as PARAM_1, which is not very meaningful on purpose. Some drivers uses this mem_start/PARAM_1 field for debugging purposes, some for DMA channel selection, and most for media type (if_port, which can be IF_PORT_10BASET or IF_PORT_100BASETX for example). This is the case in the epic100 driver, which I stumbled upon on old bug #888 7.3 introduces input devices hotplug (wiki) (announce). The X server now registers a D-Bus name, which allows to add/remove input devices on the fly using simple D-Bus requests. A simple python server as been posted, it watches HAL device events and forwards them to the X server if appropriate.

  • enforcing consistency between userspace and module versions: kmod() provides for kernel modules (#30935)
  • enforcing availability of dkms modules when kernel is upgraded (#30907):
    • automatically upload prebuilt dkms package for updates media
    • make dkms prebuilt packages provide dkms-kernel-<flavour> == <kver>
    • make kernel packages conflict with dkms-kernel-<flavour> < <kver>
    • automatically install kernel-source-<flavour>-latest in DrakX when installing dkms source packages
  • automatically upgrade to new module versions: create dkms-<name>-latest packages and prebuilt <name>-kernel-<flavour>-latest packages
  • use -devel packages

/notes/tech/linux/mandriva Todo Wed, 24 Jan 2007
  • update hermes
  • update jasper
  • package sing
  • fix dmidecode with CL50/CL56

From /soft/ldetect-lst/trunk

grep $MODULE /lib/modules/`uname -r`/modules.usbmap  > $MODULE.usbmap
./convert/ kernel_usbmap $MODULE.usbmap lst/usbtable > usbtable
diff -u lst/usbtable .

blosxom Optimised for standards.
Olivier Blin (2005)