Search Results: "tar"

22 January 2008

Chris Lamb: XORLY? Losing your GPG private key safely.

It’s quite convenient to have your GPG private key on your desktop, laptop and USB stick.. but if one of these is stolen or lost, you are pretty much obliged to issue a revocation. Now, RAID-5 has this wonderful property whereby it is impossible to recover data from an array of size n if you have (at most) n-2 elements. So, one idea would be to create a small loopback device -based array that you can spread around your nice stealable items - you then use your key by combining >= n-1 of them. ..Or Eve must steal n-1 items before she can reconstruct your secret key. You can recover the “missing data” from single lost device, obviously. There are almost certainly cooler algorithms for this, but none that are in the Linux kernel. Some scriptage that seems to work for me:
#!/bin/sh
set -eu
NUMITEMS=3
SIZE=30
create()  
	for NUM in $(seq $NUMITEMS);
	do
		dd if=/dev/zero of=$NUM.img bs=1M count=$(echo "$SIZE/($NUMITEMS-1)"   bc)
		losetup /dev/loop$NUM $NUM.img
	done
	sudo mdadm --create -l5 -n$NUMITEMS /dev/md0 $(seq -f "/dev/loop%g" $NUMITEMS)
	sudo mkfs.ext3 /dev/md0
 
stop()  
	sudo mdadm --stop /dev/md0
	for NUM in $(seq 1 $NUMITEMS);
	do
		sudo losetup -d /dev/loop$NUM   true
	done
 
start()  
	# Collect array elements from argv
	NUM=0
	for ELEM in $ELEMENTS;
	do
		NUM=$(( $NUM + 1 ))
		sudo losetup /dev/loop$NUM "$ELEM"
	done
	sudo mdadm --assemble --run /dev/md0 $(seq -f "/dev/loop%g" $NUM)
 
recreate()  
	# Assume already running
	dd if=/dev/zero of=$NUMITEMS.img bs=1M count=$(echo "$SIZE/($NUMITEMS-1)"   bc)
	losetup /dev/loop$NUMITEMS $NUMITEMS.img
	sudo mdadm --add /dev/md0 $NEW
	sudo mdadm --misc --wait /dev/md0
 

(This proof-of-concept script is deliberately broken: you’ll have to write the argument handling yourself and convince yourself you don’t have anything important at /dev/loop* or /dev/md0 or /. It might also make sense to only use the array in read-only mode, or you will have syncing issues.)
Ingenious learners may wish to construct other scenarios with other RAID levels; 5-device RAID-6 would only require 3 elements present to function (or to be stolen by Eve, naturally). Not that I’m actually doing this: it’s almost certainly as stupid as it sounds, I just haven’t thought of a convicing reason yet.

Matthew Johnson: Packaging Java with Javatools

I have just uploaded javatools 0.5 to unstable and it is currently waiting in NEW. Anyone wishing to try it out earlier can find source and packages (it's arch: all) at http://www.srcf.ucam.org/~mjj29/javatools/ . Javatools replaces the existing jarwrapper package and also contains programs to help packagers in creating packages for Java programs and libraries. Packaging tools The javahelper package consists of several small programs which make packaging Java programs and libraries easier. They are generally designed to work in the same fashion as the debhelper programs, but start with the jh_ prefix. All of the programs have their command line arguments documented in manpages. jh_build Many Java programs and libraries are distributed without sane build systems. jh_build provides a simple interface for building Java source code into Jars, including setting the appropriate entries in the manifest. In almost all cases all that needs to be done to call jh_build is to set JAVA_HOME and CLASSPATH and then call jh_build with the name of the jar and the directory containing the source.
JAVA_HOME=/usr/lib/jvm/java-gcj
CLASSPATH=/usr/share/java/esd.jar:/usr/share/java/jsch.jar
jh_build weirdx.jar src
   
This command will compile all the Java files under src , set the classpath in the manifest and build it all into weirdx.jar. A couple of other options are worth mentioning. If this jar contains an application rather than a library then the -m or --main option can be used to set the Main-Class attribute in the manifest which will allow the resulting jar file to be be executed jh_build also provides a --clean parameter which should be called in the clean target of debian/rules . jh_libs For library packages Debian Java policy currently requires that the libraries be installed to /usr/share/java in a versioned format and with an unversioned symlink. jh_libs will take a jar and correctly install it. As with debhelper programs, this can either take a jar as a parameter, or read a list of jars from a file in the Debian directory. It also follows the -p , -i and -s semantics of debhelper for selecting which packages to install the jar to. When operating on a package, jh_libs will read the list of library jars from debian/package.jlibs or debian/jlibs . The jlibs file is a list of jars to install, one per line, and works exactly the same as listing them on the command line. Each jar is installed to debian/package/usr/share/java/ in the appropriate versioned and unversioned forms. jh_depends jh_depends works like dpkg-shlibdeps, but for jar files. For each jar in the package it takes the jars on which it depends and finds the packages to which they belong. These are included in the debhelper substvars as $ java:Depends . The control file can then just list that variable which is filled in automatically. This is done by reading the Class-Path attribute from the manifest of each jar. Jar files should include this attribute to prevent applications which use them from needing a full recursive classpath in their startup scripts and to prevent unneccessary transitions when the library changes its dependencies. If the package is not built with jh_build and the upstream build system doesn't set it correctly then jh_manifest can be used to fix this. If the application uses executable jars (see Runtime support below) then jh_depends will also add the appropriate depends on jarwrapper and the correct Java runtime. jh_manifest Many upstream build systems do not set the Class-Path attribute in the jars they create. This leads to several unwanted problems, such as expanding the classpath which applications have to use and introducing unneccessary transitions. They also may not set the Main-Class attribute. Both of these are required for running jars with the -jar parameter. jh_manifest can fix the manifest files of jars. It can either read from a manifest file in the Debian directory or run in a mode which updates all the jars with the CLASSPATH environment variable. The manifest files can either be debian/package.manifest or debian/manifest . The format of this file is a list of jars and indented below each one a list of manifest elements to set:
usr/share/weirdx/weirdx.jar:
 Main-Class: com.jcraft.weirdx.WeirdX
 Debian-Java-Home: /usr/lib/jvm/java-gcj
   
jh_exec The Runtime support section below describes running executable jars directly. jh_exec will scan package directories for jars in the paths, or symlinks to jar from the paths, and ensure that they have been set executable if necessary. jh_makepkg jh_makepkg will create template Debian packages for Java programs and libraries similar to dh-make . It should be run in the source directory and it will create the orig.tar.gz and most of the files in the Debian directory, which need only small changes neccessary to build the package. java-propose-classpath Some upstreams have complicated classpaths which may not be obvious to the packager when using jh_manifest to set the Class-Path attribute. java-propose-classpath will unpack a jar and look at the symbols imported to the class files, then scan all the jars in /usr/share/java . This shouldn't be run in the build since it is slow, and there may be ambiguities that the packager must resolve. It is still very useful for the packager as most of the time it will get it right automatically. Runtime support Javatools also provides some runtime support. Unlike compiled programs, or purely interpreted programs with hash-bang lines, Java programs cannot be directly executed. Many upstreams expect them to be run using java -jar jarname or java classname . This is not generally acceptible in systems which expect to just be able to run the command or launch it from a menu. As a result, many packagers are writing wrapper scripts which just call java with the correct classpath, jar and main class. jarwrapper There is an alternative to wrapper scripts, however. The binfmt_misc kernel module allows the kernel to call out to a program in userspace to execute specific types of file. jarwrapper registers itself as a handler for executable jars. This is done by reading values from the manifest file. In order for executable jars to work the following attributes must or may be defined in the manifest. These attributes can be set using jh_build and jh_manifest . Putting it together This section shows the debian packaging generated by jh_makepkg for an application and a library using jh_build . Sample Library Packaging debian/control
Source: jsch
Section: libs
Priority: optional
Maintainer: Matthew Johnson 
Build-Depends: debhelper (>= 5), javahelper, java-gcj-compat-dev, libzlib-java
Standards-Version: 3.7.3
Homepage: http://www.jcraft.com/jsch/
Package: libjsch-java
Architecture: all
Depends: $ java:Depends , $ misc:Depends 
Description: Java secure channel
 JSch is a pure Java implementation of SSH2. JSch allows you to
 connect to an sshd server and use port forwarding, X11 forwarding,
 file transfer, etc., and you can integrate its functionality
 into your own Java programs. JSch is licensed under a BSD style
 license.
   
debian/rules
#!/usr/bin/make -f
export JAVA_HOME=/usr/lib/jvm/java-gcj
export CLASSPATH=/usr/share/java/zlib.jar
build: build-stamp
build-stamp:
	dh_testdir
	jh_build jsch.jar src
	touch $@
clean:
	dh_testdir
	dh_testroot
	jh_build --clean
	dh_clean
	rm -f build-stamp jsch.jar
install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
binary-arch: build install
	# Java packages are arch: all, nothing to do here
binary-indep: build install
	# Create the package here
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_install -i
	dh_installdocs -i
	dh_installchangelogs -i
	dh_javadoc -i --sourcedir=src 
	jh_libs -i
	jh_depends -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
   
debian/libjsch-java.jlibs
jsch.jar
   
Sample Application Packaging debian/control
Source: salliere
Section: misc
Priority: optional
Maintainer: Matthew Johnson 
Build-Depends: debhelper (>= 5), java-gcj-compat-dev, fastjar, 
               libmatthew-debug-java, libcsv-java,
               libitext-java, javahelper
Standards-Version: 3.7.3
Package: salliere
Architecture: all
Depends: $ java:Depends , $ misc:Depends 
Description: Short Description
 Long Description
   
debian/rules
#!/usr/bin/make -f
export JAVA_HOME=/usr/lib/jvm/java-gcj
export CLASSPATH=/usr/share/java/csv.jar:/usr/share/java/debug-disable.jar:/usr/share/java/itext.jar
build: build-stamp
build-stamp:
   dh_testdir
   # Build the package
   jh_build salliere.jar src
   touch $@
clean:
   dh_testdir
   dh_testroot
   jh_build --clean
   dh_clean
   rm -f build-stamp salliere.jar
install: build
   dh_testdir
   dh_testroot
   dh_clean -k
   dh_installdirs
binary-arch: build install
   # Java packages are arch: all, nothing to do here
binary-indep: build install
   # Create the package here
   dh_testdir
   dh_testroot
   dh_clean -k
   dh_install -i
   dh_installdocs -i
   dh_installchangelogs -i
   jh_manifest -i
   dh_link -i
   jh_exec -i
   jh_depends -i
   dh_compress -i
   dh_fixperms -i
   dh_installdeb -i
   dh_gencontrol -i
   dh_md5sums -i
   dh_builddeb -i
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
   
debian/salliere.install
salliere.jar usr/share/salliere
   
debian/salliere.links
usr/share/salliere/salliere.jar usr/bin
   

Wouter Verhelst: Adrian,

No, that is not the correct key combination. You were looking for start+r.

Wouter Verhelst: FOSDEM 2008 approaching...

In just over a month (1 month and 1 day, to be precise), it's FOSDEM again. The Debian Developers Room schedule is almost complete, and some interesting things are being published around it. Such as the pre-FOSDEM beer event. In previous years, this always happened at the "Le Roi d'Espagne", a bar at Grand Place in Brussels. This was a nice place for many years, because it's easily found, and they have this backroom where quite a lot of people would fit in. Unfortunately, "quite a lot" does not equal "a huge number", with the amount of people going to the pre-FOSDEM beer event more and more approaching the latter than the former as the years go by. Last year, it finally became too crowded, and it was decided that the pre-FOSDEM beer event would change bars this year. Which has now happened. This year, the pre-FOSDEM beer event will be at the Delirium Caf , which is not at the Grand Place anymore, but just 100m away from it; the FOSDEM website has more information. A nice feature of the Delirium Caf , besides the fact that they are much larger, is the huge amount of different beers they have. Over 2000 of them, which you can query online!. And that's not even considering the soft drinks or waters or whatever, which they also have on their menu. Another novelty this year is the streaming; the main tracks that will be held in Janson will be streamed out of the event, and the Debian video team is also planning to do some streaming. Meaning, even if you can't make it to FOSDEM, you'll still be able to follow some of it. You won't be able to follow everything, especially not the hallway track which at FOSDEM is a very important one; but at least you'll be able to sample some bits, which is nice. Other than that, not much will change. There'll be a key signing party, organized by yours truly. There'll be Lightning talks, there'll be the Main track, and there'll be a number of Developer rooms, including the Debian one—which, occasionally, is also organized by yours truly. This conference has always been my favourite (even though I haven't been to many conferences besides FOSDEM); I've never missed even one edition ever since the very first one back in 2001 (when it was still called OSDEM). And since a few years, I've also been offering crashing space at our office, for international geeks who don't mind roughing it a bit (it's an office, there no shower, there's only floor space). This year, perhaps I haven't been spamming enough for that, but for now I only have two people who're interested in sleeping over (and they're not even sure); if you're going to FOSDEM and still need a place to sleep, you're (probably ;-) welcome. Send me an email. On the Debian front, things are going well, for the most part. The list of speakers for the Devroom is nearing completion, leaving me with little more to do than to start assigning times. We've been assigned a booth as well, but there I still need to figure out how to organize it, and what to do with it. There will of course be the regular UK T-shirts, and probably some other merchandizing, but I also want something involving some computer device. We've had this d-i "babelbox" installation running a few times now, which was nice; but I do think we need some variation, too. The only problem with that approach is that I don't really know what that variation could be. Suggestions are welcome! And so time goes on, and FOSDEM draws nearer. At some point it'll eventually happen, and then it will be over before one can say "blueberry pie". Sometimes I wonder whether all these months of preparation are actually worth it. But when FOSDEM is actually here, I'm sure I'll find that it is, indeed, worth it...

Robert Collins: 22 Jan 2008

I send mail from my laptop by a local smarthost-with-auth install of exim4. Recently I got motivated to setup smtp submission port for this, as I got tired of borked hotel wifi intercepting smtp, and was behind a firewall that allowed no smtp out... It was pretty simple - on my mail server, enable listening on port 587 by putting: 'daemon_smtp_ports = smtp : 587' in before the local_interfaces line. And on my laptop, edit the 'remote_smtp_smarthost' stanza to add 'port = 587'. Yay to less mail headaches.

Russell Coker: Secure Computation on an Insecure Base

Julien Goodwin asks whether an insecure platform can perform secure computation [1]. My immediate reaction was to recall Charles Babbage’s quote On two occasions I have been asked, ”Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?” […] I am not able rightly to comprehend the kind of confusion of ideas that could provoke such a question [2]. However on careful reading of Julien’s post it seems that he is most interested in the integrity of the computations rather than the secrecy. He suggests the possibility of performing the computation twice and comparing the results. Of course the issue to consider is whether both computations could be subverted. It seems most likely that if you are using someone else’s computation cluster for the calculations then performing the same calculation on two nodes of that cluster will give the same result both times (whether it’s right or wrong). If there was a computation that would get a result that can be verified with little computation then it would be an easy problem to solve. For example if I wanted to brute-force a passphrase for a GPG key then I could try all combinations that were known to be possible, if one was flagged as correct then in a millisecond I could verify it. If none of the possibilities were listed as correct then I could assume that the process was broken in some way. The problem with this is that such a passphrase can have arbitrary length (I know someone who uses more than 50 characters). So if I used a brute-force attack on passwords of up to 9 characters that doesn’t exclude a 10 character password. Probably the best potential use for insecure systems is for analysing large data sets. There have been several projects to harness unused computation resources to perform various large calculations (protein folding and SETI are two examples). Most such projects use closed-source programs because the people who run the contests are afraid of cheats who modify their programs to merely say “no” repeatedly and quickly. Of course this wouldn’t be a problem if they didn’t have a high-score table, and disassembling the program to hack the protocol can’t be that difficult (consider the work invested in reverse engineering protocols such as SMB which are much more complex). It would probably be reasonably to randomly send batches of work to two machines in different regions for such large-scale public computation projects. Finally if you want to perform calculations on secret data on someone else’s hardware then you may have lost before you even start.

Adrian von Bidder: Pitfalls of Remote Access

Hit Alt+F2, type notepad, hit enter. An editor window pops up. Something is very strange, though ... until I realize that KDE has caught my Alt+F2, so that the “Run Command” box I was typing notepad into was not that of the Windows session on the terminal connection but the one of my local KDE. And since I've installed Wine some time ago, there actually is a text editor called notepad on my local computer which closely resembles the one from windows. And the whole thing because apparently Copy and Paste doesn't work from my local desktop to a (Citrix based) terminal session. (Hmm. Is Alt+F2 even the correct key combination for Windozes? Update: Several people have pointed out that it's Start+R in Windows. Thanks, will have to try if that's put through to the terminal session correctly, then.)

21 January 2008

Michal Čihař: When to release 1.0?

This is not about any particular project, but more a generic thought. When should be something considered to be stable enough to be released as 1.0? Over ages I started several projects which are in different quality right now and this is maybe not completely related to version they use. Let's take one of older ones - Wammu. It was started long time ago, it really does not get any major code changes for several years and I still don't want to make 1.0 release there. The reason is that I think that many things could be done better there. However there are quite lot of users which use it and they probably consider it stable enough :-). But they will have to live with 0.x versions as I do not plan 1.0 at all for now even if it maybe deserves it :-). Different case is Ukolovnik. It does not have tons of features, but it's enough for me and it will be 1.0 soon. I have features to add, but I don't thing that RPC interface has to be in 1.0, it can be just thing added later.

Gunnar Wolf: Yay, new gadget!

A week ago, I got my fourth cell phone so far. This is the first time, however, that I pay for it - even though the first one I had was a very nice smartphone for its time (basically, a not-really-well-integrated Palm Vx and a bulky phone very worthy back in its time. Anyway - Some months ago, I decided I wanted a Wifi-able phone, in order not to need to carry around my laptop for simple tasks such as checking my mail. Shortly after I started looking for phones which fit my needs, I found Nokia's N95. The map-maniac in me found it had a GPS, and... Well, it just became matter of waiting until my phone company brought it to the Mexican market (as I paid about half its street-price... Y'know, points for customer loyalty, blah blah).
Anyway... I've been extensively playing with my new toy, and although I am still often frustrated by Symbian's so very-very-propietary-minded OS and general culture (it's amazing the number of for-a-fee very simple applications!), I'm very happy. So far, my favorite application (and, of course, the one that made me jump for it) is Nokia's Sports Tracker. While it does have some issues (particularly the web application - at least its interaction with firefIceWeasel is somewhat buggy; it abuses AJAX interaction and some pieces of information are just not linkable, they lack a proper URL), I'm delighted at using it - tracking my theoretically daily excercise sessions, be they excercising per se or my bike rides to work, linking photos taken during those sessions, tagging them to the point and moment they were taken (although, I must admit, it is awkward to take photos while running - And next to impossible while biking, of course).
Yes, to many this is not so impressive... But it is really the toy I was looking for.

Russell Coker: Free Software Community and forking

I just read an interesting approach to finding a life partner [1]. A summary is “There is a sad truth to the world today. I am part of a dying breed of people known as “shell users.” … Because there are fewer and fewer of us, I must help keep our lineage alive. I am looking for someone to help me do this. I need a woman (obviously) who is willing to raise a child with me in the method of Unix.“. While there is a moderate amount of humour in the post (I recommend that you read it in full) it is a genuine attempt to find a partner. One thing that has occurred to me is that part of the cause of the attitude toward women that is sometimes demonstrated in my community is the fact that there are so many guys who are single and have been single for a long time. If this problem was alleviated then I believe that some of the other social issues would be significantly improved. The advert in question is a bit more courageous than most guys would be prepared to consider (it’s up there with the guy who paid for a giant sign to be installed beside a highway). But there are many other options. ESR has some advice to offer [2], but the name of the URL (sextips) seems an accurate representation of the focus of the pages. One problem with ESR’s advice is that it seems to assume an ability to be extroverted (or at least fake it) which is greater than many geeks possess. Another problem is that he assumes that geeks are inherently more intelligent than average people - there is more than adequate evidence to disprove this theory. It seems more reasonable to only assume that geeks are better than average at doing geeky things. It seems to me that the one thing that geeks really are better at is writing email! Therefore it seems logical that geeks who want good success in meeting women should try and involve the use of email in some way. Singles web sites seem an obvious way to take advantage of this. Unfortunately there is a strange cultural aversion to using such web sites which even afflicts geeks. For some reason it’s thought to be a good idea to try and meet a life partner in a place where there is inadequate light, too much background noise to talk properly, and where everyone has taken mind-altering chemicals (I am referring to drinking alcohol at a bar of night-club). Once strange cultural ideas are discarded it seems obvious that if you want to meet a potential life-partner then you should do so in a place where there is good light, an opportunity to talk, and where everyone is in a normal state of mind. Starting out with email and then talking over the phone and exchanging JPEG pictures seems to be a sensible option in this regard. Most times that you chat to someone you meet over the net it won’t go any further than email or maybe phone-calls. But that’s still entertaining and useful practice at communicating with women. One thing that the Craig’s List advertiser really got right is that he knows what he wants. An advantage of the singles sites on the net is that they often force people to make decisions. When a singles site demands that you enter a desired number of children that you want to have (with 0 being an acceptable answer) then you will be forced to consider the issue and make a decision. While being prepared to negotiate about such things may be desirable, I can’t imagine anyone finding it appealing when someone doesn’t know what they want or doesn’t have the confidence to say it. Finally don’t rule out the possibility of meeting someone through your local LUG. There are a quite a few married couples who met through the Linux community. But don’t go making “pick-up” attempts on women in the community - the result will not be positive. Via Michael Still.

20 January 2008

Martin-Éric Racine: xf86-video-amd: patched xserver-xorg-core available

Great news: After several weeks of investigating, Bart finally figured out what made the driver for the AMD Geode GX/LX chipset fail on recent X.org servers: it turns out that, starting with X server 1.3, changes under the hood took place that affect a number of products booting off a General Software BIOS, making the whole hardware freeze as soon as a DDC probe is attempted. Bart promptly produced two patches against the x86emu component of X server 1.3 that fix the issue. Hurray! Ubuntu/Gutsy packages of the patched X server 1.3, plus current AMD 2.7.7.5 drivers, are available in my PPA. For Debian/Lenny, the same packages compile from Ubuntu sources as-is. Meanwhile, those of you running Debian/Etch only need to compile the Ubuntu sources for the above AMD driver against the X server 1.1 available in Etch. This should finally allow people developing distributions for LTSP or for the OLPC to use standard Debian packages. The next step is to produce patches against the X server 1.4 in Debian/Sid and Ubuntu/Hardy, and then get the fix merged into the upstream X.org tree before X server 1.5 is released. We're already working on it, but help is always welcome.

Ian Wienand: 5 Second VPN

I was recently on a wireless network I trust even less than I usually trust wireless networks, so was looking for a way to ensure a little more security. I've previously setup a PPTP tunnel, but that server is on a boat heading to San Francisco so that was not an option. I have a linode with a generous bandwidth limit, so my first thought was to set that up and route through it with OpenVPN. It started getting a bit complicated and didn't work out-of-the-box with NetworkManager so I gave up. Then I found that ssh has a really nifty -D option to implement a SOCKS5 proxy. Therefore all I needed to do was ssh -D localhost:8080 remote.box and then setup Firefox to use localhost:8080 as a SOCKS proxy server. But it gets better; I did wonder if my DNS requests were leaking onto the local network, which a quick packet sniff confirmed. It turns out with SOCKS5 all you need to is go to the Firefox about:config page and turn on network.proxy.socks_remote_dns and DNS is tunnelled too. Since my mail already comes and goes via encrypted channels, this zero maintenance approach pretty much wraps up everything I need from a VPN solution!

Eddy Petrișor: NSLU2 on flash - script +not+ broken :-D

Update: Why don't I learn my lesson and stop working too late? Making a fool of myself in public isn't something to be proud of.

Ignore this post if you're seeing it for the first time.




Martin, David, this script is broken. When trying to set kernel parameters, there should be a new line, it shouldn't be explicitly removed. I know it looks weird, but this seems to be proven by this output:


kinder:/etc/init.d# ./params4flash start
kinder:/etc/init.d# cat params4flash
#! /bin/sh

exit 0

PATH=/sbin:/bin

# Max time to wait for writeout
MAX_AGE=120
CENT_AGE=$((100 * $MAX_AGE))
# Max percent of mem to use for dirty pages
DRATIO=10
# Once we write, do so until this many percent of mem is still in use
DBRATIO=1

case "$1" in
start)
echo -n 0 >> /proc/sys/vm/swappiness
echo -n $MAX_AGE >> /proc/sys/vm/laptop_mode
echo -n $CENT_AGE >> /proc/sys/vm/dirty_writeback_centisecs
echo -n $CENT_AGE >> /proc/sys/vm/dirty_expire_centisecs
echo -n $DRATIO >> /proc/sys/vm/dirty_ratio
echo -n $DBRATIO >> /proc/sys/vm/dirty_background_ratio
;;
restart reload force-reload)
echo "Error: argument '$1' not supported" >&2
exit 3
;;
stop)
# No-op
;;
*)
echo "Usage: $0 start stop" >&2
exit 3
;;
esac
exit 0
kinder:/etc/init.d# cat /proc/sys/vm/swappiness
60

Neil Williams: Fosdem 2008

Sadly, I can't seem to get things right re: Fosdem. I got the dates wrong for Fosdem and had to pay extra to change the bookings. Last year I got the flight wrong and had to pay extra to fly from Gatwick instead of Heathrow (and when I got to Brussels there was some bomb alert that had closed the airport, just to make things worse).
I will now be in Fosdem, on time but poorer than necessary. :-(
I can't get to London in time to take the same Eurostar as many others and there isn't time get back home with the Sunday evening train so I'm staying until Monday morning.
Things are so much easier when public transport isn't involved.
Bah - there's always next year to get things right.

Ross Burton: Linux Wakeups

To satisfy an idle curiosity, I installed PowerTOP on my Zaurus to see how many wakeups a second it was doing. It started out at 112w/s, which isn't that great, but Richard told me that I should give our 2.6.24-rc8 kernel a go, because it has NO_HZ defined. To our surprise it booted, and to cut a long story short my Zaurus is currently idling at 5.4 wakeups per second, and 11% of those are about to be patched out of the kernel.

Jacobo Tarrío Barreiro: Flags and languages

Many languages are spoken in more than one country, and many countries have more than one language. When you forget this you do stuff like language selection menus that use flags to represent languages. This is problematic for several reasons, starting with having to ask yourself what flag you are going to use to represent English, and how to deal with the angry letters you’ll receive when you use the national flag to represent a regional language. So, using flags to represent languages is definitely discouraged. This said, have a look at this small piece of the KDE l10n stats page: Galician language with flag of Greenland The funny thing is that the flag you see next to Galician is the flag of Greenland. And Galician is not spoken at all in Greenland! So, what happened? Why did they use so wrong a flag? The problem is that the ISO 639-1 code for the Galician language is gl , which is the same as the ISO 3166-1 code for Greenland. So, when choosing the flag for Galician they confused the language code with the country code and selected the flag for gl : that is, for Greenland. (I’m surprised that they used the Ukrainian flag ( ua ) for the Ukrainian language ( uk ), and not the Union Flag. Perhaps that would have been too obvious an error :) – although I have been told by email that the ISO 3166-1 code for the UK is GB , not UK ) So, my takeaway message is: don’t use flags to represent languages and if you do, make sure you use a flag of a place where the language is actually spoken! Addendum: I have just seen that Basque is accompanied by the flag of the European Union! That’s because the language’s code is eu . Ah, and there are three variants of the Chinese language (Hong-Kong, Simplified and Traditional), all with the flag of the People’s Republic of China. Someone is bound to receive angry email – Taiwan is a political hot potato. I have sent email to the maintainer of the page.

19 January 2008

Theodore Ts'o: Why I purchased the Sony PRS-505 Reader

Although I lot of people have been lauding the Kindle, I recently decided to go with the Sony PRS-505 instead. Yes, the Kindle has built-in EVDO access, and the ability to buy books without a computer, or even browse the web; and yes, the Sony has once again demonstrated it can’t create a compelling 21st century computer application to save its life. However, it had a few things that at least for me, made a better choice for me than the Kindle:
  1. The Sony is thinner — I want to be able to slip it into my laptop case and have it take the absolute minimum amount of space.
  2. The Sony simply looks much more elegant than the Kindle; steel with a leather cover simply looks a lot better than white, cheasy plastic.
  3. I’m not interested in buying a lot of DRM’ed ebooks; ergo, I won’t be buying may books from either Sony or Amazon’s web sites. It is highly likely that within 2 years I will be buying a more advanced eBook reader, possibly one with color, and I don’t want to be locked into a single format where I have to go and repurchase all of my books just because some the latest and greatest eBook reader uses an incompatible DRM technology from whatever Sony or Amazon has used.
  4. The Sony is $100 cheaper. Given that something better will be available within 2-3 years at the very most, and possibly sooner, I’m just not interested in spending $400 on a first generation prototype.
  5. Perhaps the most important, the Sony has the really, really good open source support. Kovid Goyal’s libprs500 project supports the Sony PRS-500 and PRS-505, and has very good version tools, allowing people to convert eBooks previously stored in HTML, PDF, TXT, Microsoft Reader (.lit), IDPF/Open eBook (.epub) into Sony’s format. And with a little bit of work, it does a very, very good job with the conversion. Better yet, its ability to convert multiple HTML pages into a single eBook, with credible table of contents, means that libprs500 can pull down the New York Times, the Economist, etc., automatically format it into a single eBook which you can save onto your Sony Reader, and then read it while you are on the airplane. No muss, no fuss. I can also take various books that are available on the web as HTML and also convert them into an eBook which can be used by the Sony Reader very easily.
This last point is I believe one of the best reasons why the Sony Reader will be able to compete very successfully with the Kindle. The libprs500 software is written as a python application, and it will work on Windows, Linux, and MacOS — and its GUI user interface is far better than the truly pathetic Sony Connect software. Score one for Open Source! In my opinion, Sony should send a very nice gift certificate to Kovid as a thank you; his open source project has added an immeasurable amount of value to their product. The only thing that you can’t do using the libprs500 software is buy DRM’ed books which are locked to the Sony Reader — but that isn’t something that many people will be particularly interested in, I suspect. OK, I did buy Pillars of the Earth, which was available on the Sony site for $6 dollars — hmm, cheaper than Amazon’s $9.99 — but that was an investment I was willing to flush down the toilet when the PRS-505 becomes obsolete, mainly so I could test what buying a DRM’ed book would be like from the Sony web site. But I probably won’t be buying many books with DRM that way. On the other hand, I am quite willing to spend quite a bit more money on non-DRM’ed books from publishes such as Baen Books. Here’s to the hope to the publishing industry figures things out faster than RIAA’s member companies. In the meantime, I will be mostly pretending that the both the Sony and Amazon eBook stores with their proprietary DRM’ed books don’t exist…

Neil Williams: Debian Lenny on amd64 HP Pavilion dv6000 (dv6615ea)

Working!
I've decided to replace the previous post rather than leave it in place when there is a solution available.
Fixing the problem
I've been considering a new laptop for weeks - mainly to get more RAM, more space but without adding to the actual size of the machine (or weight). I know, I should have taken more time over the selection, I should have found out more about the hardware, etc.etc.
I've ended up with an HP Pavilion dv6000 (dv6615ea) for the 2Gb RAM, 15inch screen, 250Gb hard drive to replace my ageing iBook 12inch with 128Mb RAM and 30Gb hard drive - all for barely an inch extra depth and very similar weight (and it was cheaper than the original price of the iBook). I thought I'd made a good choice. Yes, it was "NVidia Graphics" according to the sticker and yes, I could have spent more time (and money) finding a pre-installed lappy but I was hasty. (Much the same way as you should never go food shopping whilst hungry). I've managed with NVidia graphics before without using the horrid proprietary rubbish and I was prepared to put up with less-than-perfect graphics (I never use 3D anyway) because the free driver is at least stable with the graphics that I actually need.
Updated
The ethernet card is not recognised by the Debian Etch installer - after a comment placed on this blog after my original post, I tried the Lenny installer for amd64 with signficant success. Selecting the vesa driver for the graphics provided a usable X setup (1024x768). I've still spent a lot more time on this than it should really have required but I do now have a genuine amd64 Debian installation with GNOME. The only thing not working is wireless (oh and sound). The wireless appears to be a bcm43xx issue - the driver appears to let the card work (the orange light turns blue) and the device is created but scanning fails.
I'm probably still going to have to leave this new lappy behind and take my existing iBook to Fosdem in a few weeks, but I'm now happier with HP in general.
I'll try to post a longer review somewhere soon.
So, thanks for the tip, Julian!

Neil Williams: Blaming HP for a laptop problem

The problems are now fixed, thanks to a tip from Julian.
See Debian Lenny on amd64 HP Pavilion dv6000 (dv6615ea).
Julian notes that HP do make some friendly laptops. Thing is, I'm not looking for a "business laptop" - neither are many potential GNU/Linux users. I took the chance to persuade the sales assistant about Debian and all things free software - URL's, etc., then the laptop demonstrated the size of the gap that we still need to cover - that needs a change of heart at NVidia.
I had already found that Wiki page but that refers to the dv6116eu as opposed to the dv6615ea - a small difference but these things can mean big differences in how the chipsets are actually implemented.
Matthew - I tried to install an amd64 etch installer (4.0r2), i386 etch installer (4.0) and I tried upgrading to Debian sid once I did have a working implementation via Mepis. I wasn't at all surprised that the graphics were going to be a problem - my surprise is reserved for the parts of a laptop that I tend to assume are no longer proprietary, like ethernet. Guess I was wrong.
The bcm43xx driver problem is a Broadcom issue - it is hardly suprising that the free software driver has problems when there is no spec. What is more annoying is that the wireless device does not show up anywhere in the logs, even with Mepis, with or without the bcm driver + firmware.
GNOME does need more than the expected graphics problems - without the proprietary drivers the trackpad is also non-functional, the Mepis patches for X mean that the Gnome libraries don't load and updating the X packages means that X itself fails.
I may have been "frank" in my assessment of the laptop but that was simply down to the frustration. I don't have time to faff around with this kind of hassle.
I really don't mind having problems with the NVidia graphics - what annoys me is that the lack of any kind of ethernet support and the sheer number of fixes and hacks that Mepis have to use to get something out of the laptop.
Each time I tried to move to an updated Debian package of a mepis version, something else proprietary broke and I really can't use KDE long term. I also wanted to be able to use this in 64bit but the (non-graphics) proprietary stuff just doesn't allow that.
Not everyone has the option of only buying expensive business laptops or those that are known to work and not everyone has the time to spend working out how to fix these problems. (I used to but I wanted something that required less downtime.)

Jacobo Tarrío Barreiro

Many languages are spoken in more than one country, and many countries have more than one language. When you forget this you do stuff like language selection menus that use flags to represent languages. This is problematic for several reasons, starting with having to ask yourself what flag you are going to use to represent English, and how to deal with the angry letters you’ll receive when you use the national flag to represent a regional language. So, using flags to represent languages is definitely discouraged. This said, have a look at this small piece of the KDE l10n stats page: Galician language with flag of Greenland The funny thing is that the flag you see next to Galician is the flag of Greenland. And Galician is not spoken at all in Greenland! So, what happened? Why did they use so wrong a flag? The problem is that the ISO 639-1 code for the Galician language is gl , which is the same as the ISO 3166-1 code for Greenland. So, when choosing the flag for Galician they confused the language code with the country code and selected the flag for gl : that is, for Greenland. (I’m surprised that they used the Ukrainian flag ( ua ) for the Ukrainian language ( uk ), and not the Union Flag ( uk ). Perhaps that would have been too obvious an error :)) So, my takeaway message is: don’t use flags to represent languages and if you do, make sure you use a flag of a place where the language is actually spoken!

Next.

Previous.