Archive for May 2010


PECL crack unter Ubuntu installieren

May 29th, 2010 — 12:00pm

Auch die PECL Erweiterung crack muss erst überredet werden, sich auf Ubuntu zur Verfügung zu stellen, da beim Installieren folgender Fehler auftritt:

/tmp/pear/temp/crack/libcrack/src/config.h:1:26: error: ../../config.h: No such file or directory
make: *** [crack.lo] Error 1
ERROR: `make' failed

Die Lösung ist die manuelle Installation.

apt-get install cracklib2-dev cracklib-runtime
cd /opt
svn co http://svn.php.net/repository/pecl/crack/trunk pecl-crack-svn
cd pecl-crack-svn

Die Datei libcrack/src/cracklib.h editieren:
-# include "../../config.h"
+# include "../config.h"

Die Datei package.xml editieren:
- <file role="src" name="config.h" />

Und dann manuell installieren:
pecl install --force package.xml
echo "extension=crack.so" > /etc/php/conf.d/crack.ini
/etc/init.d/apache2 restart

Comment » | Technik

PECL OAuth 0.99.9 unter Gentoo installieren

May 28th, 2010 — 9:34am

Da einige der Maschinen, mit denen ich arbeite noch (aktuelle) Gentoo-System sind, gibt es immer wieder Probleme, die Gentoo-spezifisch sind, und damit oft auch nervig.

Aktuelles Beispiel ist die fehlschlagende Installation von PECL OAuth:

$ pecl install oauth-beta

libtool: Version mismatch error.  This is libtool 2.2.6b, but the
libtool: definition of this LT_INIT comes from an older release.
libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6b
libtool: and run autoconf again.
make: *** [oauth.lo] Error 63
ERROR: `make’ failed

Abhilfe schafft das nur das manuelle Installieren:

$ wget http://pecl.php.net/get/oauth-0.99.9.tgz
$ tar xvzf oauth-0.99.9.tgz
$ cd oauth-0.99.9
$ phpize && aclocal && autoheader && autocon
$ ./configure
$ make
$ make install
$ echo “extension=oauth.so” > /etc/php/cli-php5/ext/oauth.ini
$ ln -s /etc/php/cli-php5/ext/oauth.ini /etc/php/cli-php5/ext-active/oauth.ini
$ echo “extension=oauth.so” > /etc/php/apache2-php5/ext/oauth.ini
$ ln -s /etc/php/apache2-php5/ext/oauth.ini /etc/php/apache2-php5/ext-active/oauth.ini

Comment » | Technik

Passwörter für SSH-Keys in der Konsole merken

May 15th, 2010 — 12:54pm

Um sich die wiederkehrende Passwort-Abfragen für SSH-Keys auf der Konsole zu sparen, führt man folgende Kommandos aus:

eval "$(/usr/bin/ssh-agent -s)"
ssh-add -L

Das startet den SSh-Key-Agent und damit ist das Passwort des Keys für die aktuelle Sitzung gespeichert und wird nicht mehr abgefragt.

Comment » | Snippets

Timezone in Ubuntu setzen

May 14th, 2010 — 12:53pm

Zum Einstellen der Zeitzone in Ubuntu führt man dieses Kommando aus und folgt den Anweisungen.

dpkg-reconfigure tzdata

Comment » | Technik

Alle ISO-Dateien in einem Verzeichnis nach UTF-8 konvertieren

May 13th, 2010 — 12:50pm

Dieses Bash-Script konvertiert alle Nicht-UTF-8-Dateien in einem Verzeichnis und in allen Unterverzeichnissen nach UTF-8.

find ./ -type f -name "*.php" | xargs file | grep ISO-8859 | awk '{print substr( $1, 0, length($1) - 1); }' | xargs -i recode ISO-8859-1..UTF-8 {}

Comment » | Snippets

Niedrigen Speicherplatz mit Bash überprüfen und per Mail warnen

May 12th, 2010 — 12:00pm

Dieses kleine Bash-Script, versendet als Cronjob eingetragen, E-Mails an den root-User, wenn der Plattenplatz auf allen gemounteten /dev/hd*-Platten weniger als 1 GB beträgt.

for i in `df | grep "/dev/hd" | grep -e "[a-z]$" | awk '{ print $4; }'`; do if [[ $i -gt 999999 ]]; then df -h | mail root -s "Low diskspace warning for `hostname -f`"; break; fi; done

Comment » | Snippets

connect to dead.com: Connection timed out

May 11th, 2010 — 12:00pm

Oct 21 10:08:07 jayla postfix/error[24545]: B13623382E: to=<8b067c20a9cccde27038d13a1c1df64a@dead.com>, relay=none, delay=36297, delays=36267/30/0/0.01, dsn=4.4.1,
status=deferred (delivery temporarily suspended:
connect to dead.com[66.240.173.8]:25: Connection timed out)

Wie könnte es auch anders sein?!

Comment » | Kurioses

Zugriffe nach Host sortiert aus Apache’s Access Log auslesen

May 10th, 2010 — 12:00pm

Dieses kleine Bash-Kommando listet die Zugriffe in einer bestimmten Zeit (“20/Oct/2008:21″ = am 20. Oktober 2008 zwischen 21:00:00 und 21:56:59) und sortiert diese nach Häufigkeit.

cat access_log | grep "20/Oct/2008:21" | awk '{ print $1; }' | sort | uniq -c | sort | tail

Beispiel:

2 66.249.71.205
2 83.7.105.44
2 88.80.205.184
3 38.113.234.180
3 93.158.151.25
4 72.14.199.10
6 72.30.142.245
24 67.195.37.90
48 85.180.64.152
57 80.109.85.214

2 comments » | Snippets

duplicity Fehler “IOError: GnuPG exited non-zero, with code 2″ unter Ubuntu beheben

May 9th, 2010 — 7:33pm

Zum Sichern von Daten auf FTP-Server bietet sich duplicity. Es bietet, ähnlich wie rdiff-backup, die Möglichkeit, volle und inkrementelle Backups zu erzeugen, aber im Gegensatz zu rdiff-Backup eben auf FTP-Server und noch dazu verschlüsselt.

Allerdings hat die Version in Ubuntu 9.04 (Jaunty Jackalope) einen Bug, der bewirkt, dass duplicity mit folgender Fehlermeldung den Dienst quittiert:

IOError: GnuPG exited non-zero, with code 2

Das lässt sich relativ einfach beheben: duplicity manuell installieren.

Dazu geht man wie folgt vor:

  1. Ubuntu’s diplicity entfernen:
    aptitude purge duplicity
  2. python-dev und librsync-dev werden zum kompilieren von duplicity benötigt:
    aptitude install python-dev librsync-dev
  3. Die aktuelle Version herunterladen und installieren
    cd /opt
    wget http://code.launchpad.net/duplicity/0.6-series/0.6.08b/+download/duplicity-0.6.08b.tar.gz
    tar xvzf duplicity-0.6.08b.tar.gz
    cd duplicity-0.6.08b
    python setup.py install

Nun ist duplicity installiert.

Tritt der Fehler auf, nachdem bereits eine Weile das Backup problemlos funktioniert hat, muss man die alten Dateien leider entsorgen und mit einem neuen Full-Backup starten.

Comment » | Technik

Back to top