Search Results: "Michael Prokop"

4 December 2007

Michael Prokop: Power drain with Suspend-To-Disk?

The battery of your laptop keeps getting drained even though you are using Suspend-To-Disk [STD]? (No, I’m not talking about Suspend-To-RAM!) That’s what happens at least on my Lenovo ThinkPad X61s notebook. Thankfully there exists a workaround: Check out what suspend method you use:
# cat /sys/power/disk
[platform] test testproc shutdown reboot
So by default ‘platform’ is used, which corresponds with ACPI S4 and is fine if it works for you. What should fix your problem if you notice too much power drain with STD:
# echo shutdown > /sys/power/disk
Now you shouldn’t find any “blinking suspended leds” on your system any longer and no further power drain should happen. More details available at $LINUX_KERNEL/Documentation/power/.

3 December 2007

Michael Prokop: git[-svn] in 30 minutes

… or something like that… I planned to write a short note about how to start with using git-svn so I can provide a pointer to some of my colleagues. It turned out that git has too many nice features that you should be aware of. :) Hopefully my notes (now being a reference for myself as well, thx to gebi for all the help and feedback) are useful anyway. If you think something (more or less essential, or at least something most of us should be aware of) is missing: please feel free to mention that in the comment section of my blog entry, thanks. Disclaimer: I’m still happy with mercurial for what I - and we at grml in general - use it: linear, but anyway distributed development. git on the other hand provides some really nice features. Rebasing and branching with git is really great - so non-linear development just works. As usual: use the right tool for the right job. git is a bit complicate to use. Not only but especially in the beginning. On the other hand I’m not such a big friend of subversion. If you wanthave to use subversion (Graz University of Technology for example provides a svn service to their students and employees) but prefer to work with git instead you should be aware of git-svn. git-svn gives you bidirectional operation between subversion and git. First of all make sure you have all you might need when working with git. Make sure to use a current version of git (I’m refering to version >=1.5.3). Just execute the following command line on your Debian system to install all relevant packages:
aptitude install \
git-buildpackage git-core git-cvs git-daemon-run \
git-doc git-email git-gui git-load-dirs git-svn \
gitk gitweb qgit
Now let’s start with some general and basic configuration:
# Remove directories from the SVN tree if there
# are no files left behind, configure it globaly:
git config --global svn.rmdir=true
# Want some more global, personal git configuration?
for line in  
  user.name=Michael Prokop 
  user.email=foo@example.invalid 
  color.diff=auto 
  color.diff.new=cyan 
  color.diff.old=magenta 
  color.diff.frag=yellow 
  color.diff.meta=green 
  color.diff.commit=normal 
do
  git config --global $line
done
Check out man git-config for much more details about configuration options. First tip: set ‘g’ as an alias for git so you don’t have to type that much. I’ll write the long version in the following examples so copy/paste works for everyone. Make sure to use the short options of git itself as well: use ‘git co’ for example instead of ‘git checkout’. You can define your own aliases inside git as well - either manually in ~/.gitconfig or running something like:
git config --global alias.st status
Enough pre-configuration for now. It’s time to checkout the SVN repository:
# Check out the SVN repository and set 'svn/' as
# prefix for the branches:
git svn clone -s --prefix=svn/ \
https://svn.tugraz.at/svn/$project foobar && 
cd foobar
# Adjust svn:ignore settings within git:
git svn show-ignore >> .git/info/exclude
# List all branches:
git branch -a
# List all remote branches:
git branch -r
# Rebase your local changes against the
# latest changes in SVN (kind of 'svn up'):
git svn rebase
# Checkout a specific branch:
git checkout $branch
Ok so far? But what do we have to do if we want to work on the upstream source and are allowed to commit/push directly to the repository? Let’s see how to work on that without using branches:
# Hack:
$EDITOR foobar
# Check status
git st[atus]
# List diff:
git diff [foobar]
# Commit it with a commit message using $EDITOR:
git commit -a
# Now commit your changes (that were committed
# previously using git) to SVN, as well as
# automatically updating your working HEAD:
git svn dcommit
But what should we do if we do not have commit rights? Let’s create our own branch and send a patch via mail to upstream:
# Make a new branch:
git checkout -b mikas_demo_patch
# and hack...
$EDITOR
# Commit all changes:
git ci -a -m 'Best patch but worst commit msg ever'
# ... and prepare patch[es]:
git format-patch -s -p -n master
# Now send mail(s) either use git-send-email:
git send-email --to foo@example.invalid *.patch
# ... or if you prefer mutt instead (short zsh syntax):
for f in *.patch ; mutt -H $f
You got a mail from someone else and would like to incorporate changes from the attached patch in your repository? Just store the mail in a seperate mailbox (use save-message in mutt for example, keybinding ’s’ by default), then execute:
# Apply a [series of] patch[es] from a mailbox
git am /path/to/mailbox
Want to work on a seperate branch and rebase your work with upstream?
# First of all make sure to use recent sources...
# So pull when using plain git:
git pull -u
# .. or when using git-svn use:
git svn rebase
# Then create a new branch:
git checkout -b mika
# Hack:
$EDITOR
# Commit:
git ci -a -m 'Best patch but worst commit msg ever'
# Switch to master branch:
git checkout master
# Pull again when using plain git:
git pull -u
# .. or when using git-svn use:
git svn rebase
# Finally switch back
git checkout mika
# Now rebase it with plain git using:
git rebase origin/master
# ... or when using git-svn:
git svn rebase
# Now check out the last 5 commits:
git log -n5
Another branch-session might look like:
git co -b foo
$EDITOR
git ci -a -m 'foo changes'
git co master
git co -b bar
$EDITOR
git ci -a -m 'bar changes''
git co foo
git rebase bar
git log -n5
git st
git branch
Pfuhhh? Right. :) Now it’s time to check out another cool feature: git stash, which is just great when pulling into a dirty tree or when suffering from interrupted workflow. Demo:
git stash
git pull / fetch+rebase
$EDITOR # fix conflicts
git commit -a -m "Fix in a hurry"
git stash apply
git stash clear # unless you want to keep the stash
git reset rocks as well:
# List all recent actions:
git reflog
# Now undo the last action:
git reset --hard HEAD@ 0 
How to get rid of branches?
# Delete a branch. The branch must be fully merged:
git branch -d remove_me_branch
# Delete a branch irrespective of its index status:
git branch -D remove_me_branch
# Delete a remote branch:
git push reponame :branch
Repack a git repository to minimize its disk usage:
git pack-refs --prune
git reflog expire --all
git repack -a -d -f -l
git prune
git rerere gc
Use git cherry to find commits not merged upstream. Another really cool feature is the interactive rebasing: git rebase –interactive Make sure you are aware of gitk: Screenshot of gitk … and don’t forget to set readable fonts for gitk, like:
[ -r ~/.gitk ]   cat > ~/.gitk << EOF
set mainfont  Arial 10 
set textfont   Courier 10 
set uifont  Arial 10 bold 
EOF
If you prefer a Qt based interface check out qgit. Useful ressources:

28 October 2007

Michael Prokop: Failed to bring up mika.

No, not running out of coffee (well, maybe) - but:
# ifup wlan=mika
[…]
No DHCPOFFERS received.
No working leases in persistent database. Exiting. Failed to bring up mika.
:grin:

27 October 2007

Michael Prokop: Could not set non-blocking flag

Looks like many people didn’t manage to solve this problem, so let’s feed google… If you notice the following error message when running apt-get:
# apt-get update
[…]
98% [Working]FATAL -> Could not set non-blocking flag Bad file descriptor
E: Method http has died unexpectedly!
# echo $?
100
… you forgot to mount the according partition using the dev mount option. So fix it via running something like:
mount -o remount,dev /path/to/filesystem

21 September 2007

Michael Prokop: grml-live - framework for building a live system

[Gnaaaaa, sorry Planet Debian for sending a german article to you a few hours ago. I just chose the wrong category for the article. I removed the tag already and the article disappeared from Planet Debian right now; so if you don’t know what I’m talking about just don’t care. ;-) To the german readers: it’s just the same article as my previous one, but this time in english. :-)] grml-live is a framework which lets you build a grml/Debian based Linux Live-CD with one single command. grml-live is based on FAI (Fully Automatic Installation) and uses its class based concept: Screenshot: grml-live In this example I built a full grml-ISO. All I did was setting the Debian-Mirror in /etc/grml/grml-live.conf to my local one (to save traffic and time) and invoking the following command:
# grml-live -t /grml/grml-live -c GRMLBASE,GRML_FULL,LATEX_CLEANUP,I386 -s sid
About 50 minutes later I have a grml-ISO inside grml_isos at directory /grml/grml-live/ (-t …). It was built using the classes (-c …) GRMLBASE (all the core, essential stuff), GRML_FULL (software selection like official grml provides), LATEX_CLEANUP (clean up some very big LaTeX directories) and I386 (x86-specific packages like kernel). Debian unstable/sid was used as the suite (-s). And that’s it. You want a smaller grml-version using Debian/stable? No problem, let’s do it in shared memory (being very fast, and with enough RAM and mountoptions rw,suid,dev no problem at all): Screenshot grml-live: the beginning A ‘grml-live -t /dev/shm -c GRMLBASE,I386 -s etch’ and not even 5(!) minutes later I’ve my 135MB small grml: Screenshot grml-live: done So using grml-live you can build your own, customized Linux Live-CD without having to deal with remastering in detail. Via creating a new class (or just editing an existing one) its easy to include the software you would like to get. So, will the official grml-ISOs become obsolet? No, definitely not. The goal of grml-live is to give the grml-team a buildsystem providing exactly what we need. It should give us the possibility to concentrate on the important and interesting tasks, like: testing, bugfixing, implementing new features, working on the kernel, quality assurance, documentation,… grml-live should work on every Debian based system. If you want to give it a try just grab the Debian package from grml’s repository. The source is available (as usual) via mercurial. Find more details on the grml-live-webpage. If you have any further questions that aren’t answered by the docs yet, have feature requests, bugreports or patches: please let me know.

20 September 2007

Michael Prokop: grml-live - mach dir deine eigene Live-CD

grml-live ist ein Framework, mit dessen Hilfe man mit nur 1 Kommando eine auf grml/Debian basierende Linux Live-CD bauen kann. grml-live baut auf FAI (Fully Automatic Installation) auf und nutzt dessen klassenbasiertes Konzept: Screenshot: grml-live In diesem Beispiel habe ich gerade ein gro es grml-ISO gebaut. Dabei habe ich einfach nur den Debian-Mirror in /etc/grml/grml-live.conf auf meinen lokalen Mirror gedreht (um Traffic und Zeit zu sparen) und dann folgendes Kommando aufgerufen:
# grml-live -t /grml/grml-live -c GRMLBASE,GRML_FULL,LATEX_CLEANUP,I386 -s sid
Ca. 50 Minuten sp ter habe ich im Ordner grml_isos unter /grml/grml-live/ (-t …) ein fertiges grml-ISO. Dieses wurde auf Basis der Klassen (-c …) GRMLBASE (da steckt alles essenzielle drin), GRML_FULL (Software-Auswahl wie auf der offiziellen gro en grml), LATEX_CLEANUP (ein paar sehr gro e LaTeX-Verzeichnisse aufr umen) und I386 (x86-spezifische Pakete wie z.B. der Kernel) gebaut. Als Debian-Suite (-s) wurde sid (unstable) ausgew hlt. Und das war es auch schon. Ein kleinere grml-Version auf Basis von Debian/stable gef llig? Kein Problem, machen wir es doch einfach mal im Shared-Memory (superschnell und mit genug RAM und den Mountoptionen rw,suid,dev auch kein Problem): Screenshot grml-live: der Start Ein ‘grml-live -t /dev/shm -c GRMLBASE,I386 -s etch’ und keine 5(!) Minuten sp ter hab ich dann mein 135MB kleines grml: Screenshot grml-live: done Mit grml-live kann man sich somit seine pers nlich angepasste Linux Live-CD erstellen, ohne sich erst mit Remastering im Detail besch ftigen zu m ssen. Auch muss man dabei nicht zwingend Debian/unstable nehmen, sondern kann auch Debian/stable als Basis ausw hlen. Durch das Erstellen einer neuen Klasse oder das Anpassen einer existierenden kann man auch spezielle Software-W nsche ganz einfach erf llen. Wird damit das offizielle grml-ISO etwa obsolet? Nein, auf keinen Fall. grml-live soll dem grml-Team als Buildsystem dienen (automatisierte Snapshots auf regelm iger Basis z.B. sind schon in Planung) und die langweilige Arbeit abnehmen, damit wir uns auf die wirklich wichtigen Sachen konzentrieren k nnen: Testen, Bugfixing, Implementieren von neuen Features, Arbeit am Kernel, Qualit tssicherung, Dokumentation,… grml-live hat den Anspruch, auf jedem Debian-basierten System zu funktionieren und wer Interesse daran gefunden hat, kann sich das Debian-Pakete aus dem grml-Repository holen. Den Quellcode gibt es nat rlich auf unserer Mercurial-Webseite. Wer jetzt noch Fragen hat oder mehr Details zu grml-live erfahren m chte, der m ge einfach auf die grml-live-Homepage schauen. Falls dort eine Frage noch nicht beantwortet sein sollte, jemand Feature-Requests, Bugreports oder Patches hat: meine Inbox freut sich ber Post! :-)

11 September 2007

Michael Prokop: git-server for the poor: git-update-server-info, rsync and remote repository

I was working on the integration of live-initramfs for grml in the last few days. As the Debian maintainers of live-initramfs switched from svn to git and I contributed several patches I had to deal with git as well. Thanks to my personal VCS hero gebi I learned some cute tricks for working with git. One very nice tip is the ‘git-server for the poor’, which is pretty simple to use and set up as soon as you know what to do. ;-) As there isn’t that much documentation regarding this issue on the net yet I’ll provide the necessary steps here: On the server side (where you are running a webserver) you just need a directory for serving via HTTP:
% mkdir -p /var/www/grml/git/live-initramfs.git
On the client side check out the original repository, create a branch, edit what you want to and finally put it on the server so upstream can grab it:
% git clone git://git.debian.org/git/users/daniel/live-initramfs.git
% cd live-initramfs
% git checkout -b cool_new_feature
Switched to a new branch "cool_new_feature"
% $EDITOR $FILE(S)_YOU_WANT_TO_CHANGE
% git commit -a
% git-update-server-info
% rsync -az .git/* server:/var/www/grml/git/live-initramfs.git/
Now upstream (or you) can work with the remote git repository in the local repository and can refer to it through a name:
% git remote add prokop http://grml.org/git/live-initramfs.git
% git remote update
Let’s checkout what we have on the remote repository available:
% git remote show prokop
* remote prokop
  URL: http://grml.org/git/live-initramfs.git
  Tracked remote branches
    cool_new_feature master
% git diff master..prokop/cool_new_feature
Finally do with it whatever you like, for example:
% git merge master prokop/cool_new_feature
... or ...
% git merge $COMMIT_ID
... or ...
% git co master
% git merge prokop/cool_new_feature
... or ...
% git checkout -b my_test_branch prokop/cool_new_feature
... or ...
% git-merge
... or ...
% git-cherry-pick
... or ...
This process might be very handy for working together with upstream (hi, panthera :-)) JFTR: I’m tracking useful ressources for working with git at my del.icio.us page.

1 September 2007

Michael Prokop: Froscon 2007 - lessons learnt

25 August 2007

Michael Prokop: Debian @ Froscon 2007

The Debian-Team at the Debian-booth of Froscon 2007: Debian-Team at Froscon 2007, picture Standing (from left): Bernd Zeimetz, Thomas ‘MrFai’ Lange, Sebastian Harl, Elmar Hoffmann, Martin Zobel-Helas, Luk Claes;
Sitting in the middle: Christoph ‘myon’ Berg

6 August 2007

Michael Prokop: Kill your server with slrn

No, that’s not a joke. Today I had to (hard-)reboot one of my servers because the console newsreader slrn produced such a high load on the system that it was everything but responsive as a consequence. Huh. What? Yes, right. It was the fault of slrn. I had not set up any default limits on the server yet (stupid, me) but finally I could find and reproduce the source of the problem under the control of pam-limits. What was going on? slrn failed at processing a message on gmane.linux.debian.user.german. It always hang at the same message. Via setting ‘limit addressspace 62000′ and therefore causing slrn to fail with ‘Memory allocation failure.’ instead of requesting more and more resources I could find the origin of the problem: slrn fails to parse the X-Face header in my UTF8 enabled setup. *gna* Looks like I’ve to investigate on that in further detail… In the mean time I set up limits and a monitoring system…

3 August 2007

Eddy Petri&#537;or: more news from the nslu2 front

The main reason for the lack of activity during this week was that I had some problems with my router, a NSLU2 running the debian arm port. This was the machine I wanted the softfloat rrdtool I was talking about in these 2 posts.

It turns out that for some weird reason the USB controller of the slug resets when there is too much traffic going on. I got lots and lots of messages like:


$ grep reset -A 1 /var/log/syslog grep -E '(reset repeated)'
Aug 3 07:02:27 ritter kernel: usb 3-1: reset high speed USB device using ehci_hcd and address 2
...
Aug 3 11:50:29 ritter kernel: usb 3-1: reset high speed USB device using ehci_hcd and address 2
Aug 3 11:51:03 ritter last message repeated 4 times
Aug 3 11:53:15 ritter kernel: usb 3-1: reset high speed USB device using ehci_hcd and address 2
Aug 3 11:53:46 ritter kernel: usb 3-1: reset high speed USB device using ehci_hcd and address 2
Aug 3 11:55:48 ritter kernel: usb 3-1: reset high speed USB device using ehci_hcd and address 2
Aug 3 11:56:07 ritter last message repeated 2 times
Aug 3 11:56:52 ritter kernel: usb 3-1: reset high speed USB device using ehci_hcd and address 2
Aug 3 11:56:57 ritter kernel: usb 3-1: reset high speed USB device using ehci_hcd and address 2



That wouldn't have been a problem as long as the damn thing worked, but in some cases after the reset the root filesystem was lost and all the services running on the machine died (except the networking itself since all of that is part of the kernel and is loaded in memory).

It took me about three evenings to get to this conclusion (imagine being locked out of a machine which advertised running ssh, http, and dns services, being able to telnet and getting a respons, but the full protocol failed).

It all became more clear when, while being connected via ssh I got his result:

eddy@ritter ~ $ ls
-bash: ls: command not found

"WHAT?" was the first reaction, then I figured that life without ls is unbearable and came up with this bit:

alias ls='for I in * ; do echo $I ; done'

Quite cool to understand a little bit about the system. Still, cat was unavailable so having /proc and /sys available did not help that much. At some point I was thinking about a busybox shell, tried that, it didn't work since it wanted to remove some important bits like the initramfs tools.


I googled again and found a good starting point for a discussion of the same problem someone else was having. I ended up trying all the proposed solutions: rmmod-ing ehci-hcd, blacklisting the module, regenerating a initrd image with the blacklisted module... None of these worked (individually) and I ended up having an even more unstable system when ehci was not present (I was loosing the root FS after aprox. 1 min after logging in remotely immediately after start). Restoring the image with ehci was a pain (not to mention the time spent trying to figure a way to revert the change safely, since bricking the machine was not out of the question - imagine loosing the FS while flashing the ram drive image).

I finally managed to revert the ehci enabled image and tried the workaround proposed in this gentoo BR. I tried 128 and now I am at 64 and I am still getting those resets; Still something good came out of this, I followed Michael Prokop's Use root=UUID on NSLU2 article and I think I have now a stable root file system just thanks to him.

Now I am stuck:


grep -E '(max_sect reset)' /var/log/syslog
Aug 3 07:02:27 ritter kernel: usb 3-1: reset high speed USB device using ehci_hcd and address 2
Aug 3 08:27:38 ritter kernel: usb 3-1: reset high speed USB device using ehci_hcd and address 2
Aug 3 08:38:43 ritter manual message: max_sectors was set to 128
Aug 3 08:55:25 ritter kernel: usb 3-1: reset high speed USB device using ehci_hcd and address 2
Aug 3 09:31:47 ritter kernel: usb 3-1: reset high speed USB device using ehci_hcd and address 2
Aug 3 09:54:11 ritter set_max_sectors: max_sectors was set to 128
Aug 3 10:09:32 ritter set_max_sectors: max_sectors was set to 128
Aug 3 10:15:27 ritter set_max_sectors: sda's max_sectors was set to 128
Aug 3 10:24:24 ritter set_max_sectors: sda's max_sectors was set to 128
Aug 3 10:38:12 ritter set_max_sectors: sda's max_sectors was set to 128
Aug 3 10:47:04 ritter kernel: usb 3-1: reset high speed USB device using ehci_hcd and address 2
Aug 3 10:48:27 ritter set_max_sectors: sda's max_sectors was set to 64
Aug 3 11:04:36 ritter kernel: usb 3-1: reset high speed USB device using ehci_hcd and address 2
Aug 3 11:06:16 ritter kernel: usb 3-1: reset high speed USB device using ehci_hcd and address 2
....
Aug 3 15:05:58 ritter kernel: usb 3-1: reset high speed USB device using ehci_hcd and address 2

Should I try setting to 32?

In case you're wondering, I am doing the setting with this script:

#!/bin/sh

MAX_SECTORS=64
DISK=$(ls -l grep 'uuid.* / ' /etc/fstab awk ' print $1; ' sed 's#.*/\(.*\)$#\1#' tr -d '[0-9]')

[ -z "$DISK" ] && logger -t 'set_max_sectors' "error: could not detect root disk" && exit

echo "$MAX_SECTORS" > /sys/block/$DISK/device/max_sectors
logger -t 'set_max_sectors' "$ DISK 's max_sectors was set to $ MAX_SECTORS "

exit 0


Dear (not at all) lazy web, what can I do to fix/workaround this issue? Any help would be gratly appreciated (personal mail or comments).

Note: I am reluctant to try the fix proposed in the last comment that claims to fix the issue since compiling an arm kernel natively is a pain and I would like to have an official kernel from Debian Etch, as I do now.

27 July 2007

Michael Prokop: Use root=UUID on NSLU2

As I wrote a few monce ago I’m owner of a NSLU2 device powered by Debian. Now I had to install another device (using di-nslu2-etch-4.0r0.bin - md5: db8e8ec3571aff8fb2132479f860f16b this time) and I wanted to change the setup from using /dev/sda2 to a UUID based one - to get a stable root device. Nothing really tricky (thanks to the existing documentation) but just as a reference (for myself and other users considering the switch as well) the relevant steps… First of all identify the root-device (/dev/sda2 in my case) and get its UUID:
# /lib/udev/vol_id -u /dev/sda2
a98ebb0f-84ae-4f7a-a070-b94ecee3f94a
Make sure initramfs-tools use the given UUID as ROOT-option:
# echo "ROOT=/dev/disk/by-uuid/a98ebb0f-84ae-4f7a-a070-b94ecee3f94a" > \
/etc/initramfs-tools/conf.d/root-device-hack
# update-initramfs -k all -u
Replace the /dev/sda2 line in your /etc/fstab with:
/dev/disk/by-uuid/a98ebb0f-84ae-4f7a-a070-b94ecee3f94a /               ext3    defaults,errors=remount-ro 0       1
Make a backup of the original mtdblock2 and install the one Martin Michlmayr thankfully provides:
# cat /dev/mtdblock* > mtdblock.backup
# cat /dev/mtdblock2 > mtdblock2.original
# wget http://www.cyrius.com/debian/nslu2/files/etch-modified-mtdblock2.bin
# md5sum etch-modified-mtdblock2.bin
e5154ceed8ad7de5bca83cc98fbb4d79  etch-modified-mtdblock2.bin
# cat etch-modified-mtdblock2.bin > /dev/mtdblock2
# apex-env printenv
... compare output with http://www.nslu2-linux.org/wiki/Debian/ChangeKernelCommandLine
Finally set the new kernel commandline:
apex-env setenv cmdline 'console=ttyS0,115200 rtc-x1205.probe=0,0x6f noirqdebug rootdelay=10 root=UUID=a98ebb0f-84ae-4f7a-a070-b94ecee3f94a'
That’s it. Now after rebooting your system should use the UUID-approach instead of /dev/sd*. Check via:
# cat /proc/cmdline
console=ttyS0,115200 rtc-x1205.probe=0,0x6f noirqdebug rootdelay=10 \
root=UUID=a98ebb0f-84ae-4f7a-a070-b94ecee3f94a
Ressources:

Michael Prokop: Linux on the Lenovo Thinkpad X61s

Lenovo X61s - picture Since about two days I’m proud owner of a Lenovo X61s notebook. It will become my main and new developer box for grml, featuring all that nifty stuff like 64bit support, hardware virtualization and so on… I managed to use all the important features with a very current version of grml. I’m using kernel 2.6.22-grml on a setup with LVM, cryptsetup-luks,… everything works fine so far (including Suspend-To-RAM - even in grml live-mode when booting from USB pen :-) - thanks for the excellent hibernate package, madduck!). As you won’t find useful and approriate information about Linux on the X61s yet (either pretty incomplete or wrong) I decided to put all relevant information on a webpage in the grml-wiki: Short version: the X61s rocks. I’ll provide information to thinkwiki as soon I checked out all the details…

Michael Prokop: Setting up your own jabber server: ejabberd

It was on my todo list since ages, finally I took some minutes to set up my own jabber server (reach me at mika@jabber.grml.org). I’m using ejabberd, a free and open source instant messaging server written in Erlang. Reference system: Debian etch (current stable), ejabberd version 1.1.2-6, installed via a simple:
# aptitude install ejabberd
Adjust the hostname in /etc/ejabberd/ejabberd.cfg (I suggest to use something like ‘jabber.$YOURDOMAIN’ so you can update jabber’s DNS SRV according on upgrades, downtimes, moves,…):
 hosts, ["jabber.yourdomain"] .
Register an account:
# /etc/init.d/ejabberd restart
# ejabberdctl register username jabber.yourdomain password
You might want to give your username admin permissions, so adjust /etc/ejabberd/ejabberd.cfg according:
 acl, admin,  user, "username" .
That’s it. If you want to disable registration of users just use (instead of the ‘allow’ line):
 access, register, [ deny, all ] .
Restart the server and make sure you have a running server:
# /etc/init.d/ejabberd restart
# ejabberdctl status
Now you should be able to point your browser to http://yourdomain:5280/admin/ and set up your new jabber account inside your jabber client.

13 July 2007

Michael Prokop: Find out what users request

One of the coolest features of grml IMO is grml-tips. grml-tips is a collection of tips you can request via a keyword. For example if you want to know how to use grml-x just run ‘grml-tips grml-x’:
mika@meilenschwein ~ % grml-tips grml-x
Start X window system (XFree86 / Xorg / X.org):
% grml-x $WINDOWMANAGER
Usage examples:
% grml-x fluxbox
% grml-x -mode '1024x768' wmii
% grml-x -nosync wm-ng
--
mika@meilenschwein ~ %
So as soon as you invoke ‘grml-x $keyword’ and if the grml-tips collection includes something with $keyword inside you’ll get it. I use that on daily base because all the hard-to-remember command sequences or dangerous commands like mdadm, sfdisk,… are easy to use this way. :-) But how about keywords not being availble in grml-tips collection yet? What about keywords other users request but don’t get a match? Thanks to formorer we have a submit feature within grml-tips since version 0.4.1:
% grml-tips nfs
Sorry, could not find a tip for 'nfs'. :-( 
Do you want to submit the keyword 'nfs' to grml's keyword database?
The grml team will write tips for the most requested and useful keywords.
To use and contribute to this feature you'll need a working networking connection.
No personal data will be transmitted to the database.
Send "nfs" to grml's keyword database? [y N]
Keyword 'nfs' has been submitted to grml's keyword database.
Thanks.
%
Now being the maintainer of grml-tips I can check what users want to get through querying the sqlite database which stores the submitted keywords. Dear paranoid users: by default the keyword is not transfered to the database of course, you have to manually press ‘y’ to submit it. It’s not the default behaviour but an option. And there’s really no personal information stored inside the database, all I can query looks like the following:
$ID nfs grml 1.0-1 Release Codename Sonnenbrand [2007-07-13] 1184261151
Oh and thanks to Nico we also have our 24/7 support slave within the #grml channel:
19:37 <     mika > grml-tips: grml-x
19:37 < grml-tips> matches: http://www.grml.org/tips/index.html#23
And if our support guy does not work as expected:
19:38 <     mika > grml-tips: does-not-match
19:38 < grml-tips> Sorry, could not find a tip for 'does-not-match'.
If you want to submit a tip please mail it to tips (at) grml.org - thank you!
… and once a week I get a cronjob-triggered mail sending me all the keywords without a match. Cool, ey? ;-) All what’s missing now is a bot that writes all the missing tips on its own. 8-) Conclusion: make it easy for your users to submit information you might be interested in - to help your users.

11 July 2007

Michael Prokop: VirtualBox + USB

Running hot off the press 2.6.22-grml I took a look at the current version of VirtualBox. And I’m really amazed how responsive it is. Not only booting grml is rocking fast but also typing on the console is reaaaally fast - much more responsive than with VMware. (I took a look at VirtualBox several months ago already but the 64bit version did not work and I lost interest in it temporarly therefore.) Though I stumbled upon a small problem, that’s why I’m feeding google (several users don’t seem to manage the problem ;-)): Virtualbox - USB error message - screenshot of Could not load the Host USB Proxy Service (VERR_FILE_NOT_FOUND). The service might be not installed on the host computer. Result Code: 0x80004005 That’s telling you that USB might not work as expected. ;-) When straceing the process you’ll notice that VirtualBox tries to access /proc/bus/usb/devices. Nowadays /proc/bus/usb is deprecated by libusb + /dev/bus/usb but of course it’s no problem to use /proc/bus/usb anyway. So until upstream of VirtualBox moves to libusb the workaround is as simple as:
# VBOX=$(grep vboxusers /etc/group   sed 's/vboxusers:x:\(.*\):.*/\1/')
# mount -t usbfs -o devgid=$VBOX,devmode=664,nodev,noexec,nosuid none /proc/bus/usb

28 June 2007

Michael Prokop: synergy - share mouse and keyboard

Quoting the project homepage:
Synergy lets you easily share a single mouse and keyboard between multiple computers with different operating systems, each with its own display, without special hardware. It’s intended for users with multiple computers on their desk since each system uses its own monitor(s).
It really rocks, especially as it works for Linux/Unix as well as for Windows and Mac OS. The setup is simple: just run ‘aptitude install synergy‘ on your Debian system(s) or grab the sources/binaries for the other platforms. Assuming you want one screen named meilenschwein on the left, and another client named funkenzutzler on the right:
mika@funkenzutzler ~ % cat .synergy.conf
# synergy configuration file
section: screens
   funkenzutzler:
   meilenschwein:
end
section: links
   funkenzutzler:
      left = meilenschwein
   meilenschwein:
      right = funkenzutzler
end
Now start synergy on the “server” running “synergys -f –config ~/.synergy.conf” and start it on the client using “synergy -f $SERVER”. That’s it. Make sure to check out the security page.

12 June 2007

Michael Prokop: Error handling: ENOSPC

Hopefully fuzz testing is well known nowadays, right? But did you check how smart your software can handle ENOSPC - the ‘No space left on device’ error? I like stress testing software (to be honest: no, not really). Yesterday I debugged a problem regarding zsh history writing on ENOSPC. Usually I use the grml Linux live-cd for stress testing (often running inside Qemu, Virtbox, VMware,…) like in:
dd if=/dev/zero of=/tmp/home.lo count=1000
losetup /dev/loop1 /tmp/home.lo
mkfs.ext3 /dev/loop1
mount /dev/loop1 /home
mkdir /home/grml
chown grml: /home/grml
Now after restarting the shell session of user grml I can play with ‘No space left on device’ situations. (Notice: I adjust the count=… according to what type of application I want to test.) Too many applications don’t really cope with the ENOSPC situation. Firefox for example is very funny, depending on the situation it either just segfaults when trying to start up, or decides to not start up at all and just exits with ‘1′. See the relevant strace output:
mkdir("/home", 0700)                    = -1 EEXIST (File exists)
access("/home", F_OK)                   = 0
mkdir("/home/grml", 0700)               = -1 EEXIST (File exists)
access("/home/grml", F_OK)              = 0
mkdir("/home/grml/.mozilla", 0700)      = -1 ENOSPC (No space left on device)
access("/home/grml/.mozilla", F_OK)     = -1 ENOENT (No such file or directory)
exit_group(1)                           = ?
Opera also just exits when already running and receiving an ENOSPC - I encountered data loss (for example the transfer history got lost) more than once. Very "funny" to see how applications like dillo, joe, wireshark,… behave in the ENOSPC situation. Not. Oh, your application handles ENOSPC just fine? Then continue testing with read-only filesystem, using NFS, removing files randomly,…

6 June 2007

Michael Prokop: Python on the console

I wrote a small python webpage for the grml-wiki to provide some information regarding Python-development on grml. I just upgraded Vim on my main system to version 7.1 and omnicompletion with vim-python became better once more. So time for a short demo of ctrl-x-o: Python coding in Vim 7.1 - Screenshot I also very much like ‘%ed’ within ipython using the following snippet in my ~/.ipython/ipythonrc:
editor 1
editor /usr/bin/vim.python
Notice: Don’t wonder about the prompt style of the following ipython-screenshot, I customized it a little bit (see python-webpage in the grml-wiki again to get an idea). ipython demo - Screenshot So running the last line containing ‘%ed 1′ will execute /usr/bin/vim.python providing the code from the first command line of ipython and I can use all the magic of Vim for editing the code. When exiting the editor I have the code within ipython. Rocking. :) Oh, don’t forget to check out the Quick tips of ipython when exploring it. Now what’s missing in ipython is the edit-command-line feature of Zsh. That would allow me to edit already typed (but not yet executed) code with an external editor. Anyone out there with an according tip? ;-)

3 June 2007

Michael Prokop: Linuxdays in Vienna 2007: done

Linuxdays in vienna were fun (as usual). Lessons learnt: I was responsible for the booth of grml (Linux live-cd for sysadmins and texttool users) as well as for the ones of Debian and Debienna (Debian in vienna) - especially in the first two days, until Markus and Kira joined. Regarding the grml booth: It was once more amazing to see how many people already know and use grml. I had the pleasure to meet people from a professional data rescue organization who use grml in their daily business. Not to forget to mention all the people who let me know how often grml managed to save their lif^Wdata. Oh, and some nice ideas were brought to my attention and are now part of the todo list for grml. Very geeky was the 13 year old boy who visited our booth and when asking him whether he knows how to work on the console (he was staring at our grml-CDs with shining eyes) he replied: "YES, of couuuuurse!" 8-) I couldn’t resist in giving him a grml-CD. Oh, and we were running out of grml-CDs earlier than expected. Thanks to my girlfriend - who can even explain the difference between grml meilenschwein and grml64 to you now :-) - I had the chance to attend some few talks - besides my own one about grml of course. I once more didn’t manage it to take just a single picture :-( but I just received a pointer to the linuxdays photogallery of jostusz, thanks Sven.

Next.

Previous.