linux

[Ubuntu] Upgrade Feisty, Gutsy, Hardy

Sven Bachmann
Hi, today I upgraded my server from Feisty to Gutsy and than again from Gutsy to Hardy. Problems? Only one. dmesg was spamed with the following: device-mapper: ioctl: error adding target to table device-mapper: table: 254:1: linear: dm-linear: Device lookup failed The bug is known in launchpad: Launchpad-Link To solve this, simply remove evms: sudo apt-get remove evms Bye Sven

[VIM] Tip

Sven Bachmann
Hi there, guess you have a python file, filled up with tabstops and now someone comes in and tells you, that tabstops are uncool and overall indenting should only use 4 spaces. With vim no problem: :set tabstop=4 :set expandtab :retab Done! Greetings to PhiBo ;-) Bye Sven

OCS Inventory

Sven Bachmann
Hi there, today I tried to install OCS Inventory - an Open-Source tool for inventoring your PCs with mostly all data they provide. It took some time to figure out how to install the server in Scientific Linux 5, but after all - I got it ;-) For the clients I found a nice source-rpm which I can easily deploy via my rpm-repo and pdsh (parallel distributed shell). The client itself reports once a day to the server about its collected data.

[Bash] Remaining Battery Power as Prompt

Sven Bachmann
Hi, as seen at my pal Philipp, I also wanted to see the current battery power in the bash prompt. So here is a script which works fine on my X60s. #!/bin/bash REMAIN=`grep "remaining capacity" /proc/acpi/battery/BAT0/state | sed 's/remaining capacity:\(.*\)mWh/\1/'` FULL=`grep "last full capacity" /proc/acpi/battery/BAT0/info | sed 's/last full capacity:\(.*\)mWh/\1/'` echo $[ $REMAIN * 100 / $FULL ]`</blockquote> Just save it for example in your home directory as bat.sh and make it executable with chmod +x bat.

Using a 56k modem with an Asus wl-500g premium router and OpenWrt Kamikaze 7.09

Sven Bachmann
Hi there, this (easter) weekend, I had to fiddle around with an Asus WLAN router, a 56k modem (yes, in Germany we have places without DSL or similar things) and OpenWrt. And what should I say? It works! Thanks to OpenWrt.First of all, you need some packages which you can install with ipkg on the router: chat, ppp, various usb modules (see openwrt wiki for details) and the usb-serial module.

postfix, msmtp and domainfactory - reloaded

Sven Bachmann
Hi, because it didn’t work like it should, today I sat down and tried to fix it - with success :-) My config now sends all mail which is sent on my server to my external account at domainfactory. So I don’t need to check if there are any errors occured, because the errror mail will be forwarded. How does my config look? I’ll only post the relevant parts. /etc/postfix/main.cf

Unzip/unrar multiple files with file-specific folders

Sven Bachmann
Hi, if you want to unzip/unrar multiple files in a directory, but want to create a special folder for each content, you can use the following bash-code. #!/bin/bash IFS=' ' # ZIP files for i in `ls *zip`; do DIRNAME=${i%.zip} mkdir $DIRNAME cd $DIRNAME unzip ../$i cd .. done # RAR files for i in `ls *rar`; do DIRNAME=${i%.rar} mkdir $DIRNAME cd $DIRNAME rar x ../$i cd .. done Bye Sven