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
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
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
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
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
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
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
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
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:
- Ubuntu’s diplicity entfernen:
aptitude purge duplicity
- python-dev und librsync-dev werden zum kompilieren von duplicity benötigt:
aptitude install python-dev librsync-dev
- 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