Sony Vaio VPCZ11 with Kubuntu Oneric

Everything works except keyboard backlight. But this can be reenabled by calling:

sudo sh -c ‘echo 1 > /sys/devices/platform/sony-laptop/kbd_backlight’

SVN Hooks

Hi there, within a big php project you make typos. here is a small prehook script for svn that will actually prevent commits with several common and annoying mistakes:

  • Spaces in filenames
  • Spaces prior to the first <?php tag
  • PHP Short Tags
  • windows line endings
#!/bin/bash

# configuration
DO_DOS_FILE_CHECK=1
DO_SPACE_FILE_CHECK=1
DO_PHP_SHORT_TAG_CHECK=1
DO_SPACE_BEFOR_PHP_CHECK=1

REPOS="$1"
TXN="$2"

SVNLOOK=/usr/bin/svnlook
TMPFILE_ORIG=/tmp/svnhook_$TXN
TMPFILE_UNIX=/tmp/svnhook_unix_$TXN

FILES=`$SVNLOOK changed "$REPOS" -t "$TXN" | sed -r 's/^[D].*$//;s/^[AU]{1,2}\s+//'`
DOS_FILES=""
SPACE_FILES=""
PHP_SHORT_TAG_FILES=""
SPACE_BEFOR_PHP_FILES=""

IFS=$'\n'

for FILE in $FILES
do
LAST=${FILE#${FILE%?}}

# echo "FILE = '$FILE'" &gt;&amp;2

if [ "$LAST" = "/" ]; then
continue
else
if [ -n $DO_SPACE_FILE_CHECK ]; then
# space in filename check
SPACE_VIOLATIONS=`echo "$FILE" | grep -l "\ "`

if [ -n "$SPACE_VIOLATIONS" ]; then
SPACE_FILES="$SPACE_FILES\n$FILE"
continue
fi
fi

$SVNLOOK cat "$REPOS" -t "$TXN" "$FILE" &gt; $TMPFILE_ORIG || continue

if [ -n $DO_DOS_FILE_CHECK ]; then
# check windows line endings
VIOLATIONS=`grep -cIls $'\r$' $TMPFILE_ORIG` &gt;&amp;2

if [ -n "$VIOLATIONS"  ]; then
DOS_FILES="$DOS_FILES\n$FILE"
fi
fi

if [ -n $DO_PHP_SHORT_TAG_CHECK ]; then
# check php short tags
VIOLATIONS=`grep -rn '<!--?[^p]' $TMPFILE_ORIG` -->&amp;2
if [ -n "$VIOLATIONS"  ]; then
PHP_SHORT_TAG_FILES="$PHP_SHORT_TAG_FILES\n$FILE: $VIOLATIONS"
fi
fi

if [ -n $DO_SPACE_BEFOR_PHP_CHECK ]; then
# check for space prior to php tag
VIOLATIONS=`head -n 1 $TMPFILE_ORIG | grep '^\s<!--?php'` -->&amp;2
if [ -n "$VIOLATIONS"  ]; then
SPACE_BEFOR_PHP_FILES="$SPACE_BEFOR_PHP_FILES\n$FILE"
fi
fi
fi
done

rm -f $TMPFILE_ORIG
rm -f $TMPFILE_UNIX

if [ "$DOS_FILES" != "" ] || [ "$SPACE_FILES" != "" ] || [ "$SPACE_BEFOR_PHP_FILES" != "" ] || [ "$PHP_SHORT_TAG_FILES" != "" ]; then
echo -e "\n" &gt;&amp;2
if [ "$DOS_FILES" != "" ]; then
echo "ONLY UNIX LINEENDINGS ALLOWED!!!" &gt;&amp;2
echo "the following file contains Windows / Mac Lineendings:" &gt;&amp;2
echo -e $DOS_FILES &gt;&amp;2
echo -e "\n" &gt;&amp;2
fi

if [ "$SPACE_FILES" != "" ]; then
echo "SPACES ARE NOT ALLOWED IN FILE / FOLDER NAMES!!!" &gt;&amp;2
echo "the following file contain spaces:" &gt;&amp;2
echo -e $SPACE_FILES &gt;&amp;2
echo -e "\n" &gt;&amp;2
fi

if [ "$SPACE_BEFOR_PHP_FILES" != "" ]; then
echo "SPACES ARE NOT ALLOWED BEFOR THE PHP TAG IN THE FIRST LINE!!!" &gt;&amp;2
echo "the following file contain spaces:" &gt;&amp;2
echo -e $SPACE_BEFOR_PHP_FILES &gt;&amp;2
echo -e "\n" &gt;&amp;2
fi

if [ "$PHP_SHORT_TAG_FILES" != "" ]; then
echo "SHORT PHP TAGS ARE NOT ALLOWED!!!" &gt;&amp;2
echo "the following file contain short tags" &gt;&amp;2
echo -e $PHP_SHORT_TAG_FILES &gt;&amp;2
echo -e "\n" &gt;&amp;2
fi

exit 2
fi

# All checks passed, so allow the commit.
exit 0

Kubuntu 11.04 Upgrade “no init found. try passing init= bootarg”

Hi there,

yesterday I did a small dist upgrade that actually bricked my system. The only thing I was able to reach was busybox which told me after invoking “sh init”

mount none failed for /dev, device busy
mount none failed for /sys, device busy

Booting from a Live CD showed that I was indeed able to mount the partitions without any trouble. Invoking update-grub or update-initramfs did’t improve the situation.

What finally worked was to disable the raid autodetect in grub:

raid=noautodetect

Thanks to that my system boots and I can finally work again on some real stuff :)

Runlevel Service Übersicht

Nettes Commandline Tool um die Runlevel aller Services zu bearbeiten.

http://www.liberiangeek.net/2010/05/how-to-start-stop-services-in-ubuntu-lucid-automatically/

Open

just read it – perhaps we’ll have a future where the customer will actually be able to use his/her handset with any os they choose.

http://android-developers.blogspot.com/2010/12/its-not-rooting-its-openness.html