Allgemein, Arbeit

from Ubuntu to OSX

Over the years I moved from windows to linux and now to osx. Why you might ask?

Well, this is simple: I no longer have the time to configure the system to work the way I want it to. It is just supposed to do as much as possible without my intervention.

Ubuntu came pretty close to that but sadly my old vaio was breaking down.

 

I’m using OSX now for a month and I’m more that just happy! There are things missing like the “select and paste with middle mouse button” that I’m used from ubuntu and the option to move windows with the mouse and the keyboard, but it is close enough.

Uncategorized

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

[bash]#!/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'” >&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_FILESn$FILE”
continue
fi
fi

$SVNLOOK cat “$REPOS” -t “$TXN” “$FILE” > $TMPFILE_ORIG || continue

if [ -n $DO_DOS_FILE_CHECK ]; then
# check windows line endings
VIOLATIONS=`grep -cIls $’r$’ $TMPFILE_ORIG` >&2

if [ -n “$VIOLATIONS” ]; then
DOS_FILES=”$DOS_FILESn$FILE”
fi
fi

if [ -n $DO_PHP_SHORT_TAG_CHECK ]; then
# check php short tags
VIOLATIONS=`grep -rn ‘&2
if [ -n “$VIOLATIONS” ]; then
PHP_SHORT_TAG_FILES=”$PHP_SHORT_TAG_FILESn$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&2
if [ -n “$VIOLATIONS” ]; then
SPACE_BEFOR_PHP_FILES=”$SPACE_BEFOR_PHP_FILESn$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” >&2
if [ “$DOS_FILES” != “” ]; then
echo “ONLY UNIX LINEENDINGS ALLOWED!!!” >&2
echo “the following file contains Windows / Mac Lineendings:” >&2
echo -e $DOS_FILES >&2
echo -e “n” >&2
fi

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

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

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

exit 2
fi

# All checks passed, so allow the commit.
exit 0
[/bash]

Uncategorized

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 ­čÖé

Uncategorized

Die Wand muss weg!

Vor 2 Wochen war es soweit – mit┬áSchlagbohrmaschine, Vorschlaghammer und Hacke gingen wir auf die Wand los. Das Team: Willi, Sara, Klaus (Vater von Sara) und ich.

Fotos sagen mehr als 1000 Worte:

Ein paar ├ťberraschungen gab es:

  • Man sollte nicht zu viel in ein Auto verladen – sonst nehmen einen die “normalen” Mistpl├Ątze in Wien nicht und man muss zur Deponie fahren die wiederum 69ÔéČ pro Tonne Bauschutt verlangt (die ganze Wand waren in etwa 4 Tonnen)
  • Auch wenn der Vorbesitzer sagt er hat ├╝berall neue Kabeln eingezogen jedes Kabel pr├╝fen! Wir haben ein ganzes B├╝ndel alter Kabel entdeckt die verschiedenste Verwendungszwecke haben (Steckdose┬áWohnzimmer + K├╝chenlicht + hintere Steckdose im Arbeitszimmer)
  • Ziegelw├Ąnde gehen weit hinauf… (aber zum Gl├╝ck nicht so weit wie bef├╝rchtet)
  • Gipskarton Platten findet man ├╝berall (hier im alten T├╝rstock)

An alle die mitgeholfen haben: DANKE! Ohne euch w├Ąre es nicht gegangen – und ganz fertig sind wir ja eh noch nicht.