Archive for the ‘Tips’ Category

Search and replace multiple lines across many files

Wednesday, August 11th, 2010

sed is usually my favourite tool to search and replace things from the command line, but sometimes Perl's regexes are far more convenient to use. Recently I found out another reason why Perls -pi -e is superior over plain sed: when you want to change multiple lines in a document! Imagine ...

Tip: Enforce specific key usage for a single SSH connection

Thursday, February 4th, 2010

In case you have to access a very restricted SSH server which only accepts a single key (ie. the one which is set up in ~/.ssh/authorized_keys) and otherwise fails, its the easiest to set the specific key in your local ~/.ssh/config file as follows: Host very.secure.server IdentityFile ~/.ssh/id_dsa ...

Tip: Logging with Symfony >= 1.2

Monday, January 25th, 2010

Imagine you have a business method in your model which needs to be accessed by two environments: once from a symfony task and once from the web. So far so good, now what if this business method should be able to log contents somewhere visibly, in case of the command ...

Configure Thunderbird 3′s indexing behaviour

Thursday, December 24th, 2009

The current version of Thunderbird comes with a terrific global search functionality, but sometimes its cumbersome to watch it reindex the email history if something corrupted the database or to get emails in the search results which you're absolutely not interested in (commit messages, f.e.). Unfortunately Thunderbird 3 has only a ...

Tip: Ctrl-R with zsh in GNU screen

Friday, December 18th, 2009

If you can't search the history with zsh in GNU screen, check if Ctrl-R is issued at all through your terminal, ie. by $ cat ^R If this works, append the following keybinding to your ~/.zshrc: bindkey '^R' history-incremental-search-backward (Source)

Quick Tip: NetworkManager and /etc/resolv.conf

Friday, November 6th, 2009

If you have trouble with NetworkManager overwriting your search and domain configuration after every startup and you're using DHCP, add the following line to your /etc/dhclient.conf: append domain-name " company.local other.company.local"; So whenever your DHCP server doesn't provide these information (the one in my company does not), it'll add this domain company.local search company.local ...

Useful Gotcha #27

Thursday, April 9th, 2009

If you get this error ssl_error_rx_record_too_long when browsing an SSL-secured virtual host and wonder what the heck is going on (hey, it worked the day before), ensure that you've noticed that your admins have changed the IP address of the machine and that you have to adapt the IP-based VHost ...

Enable more locales in stock Debian installations

Tuesday, January 13th, 2009

If you wonder why $ php -r "setlocale(LC_TIME, 'de_DE.UTF-8'); echo strftime ('%A %e %B %Y', mktime (0, 0, 0, 12, 22, 1978));" gives you Freitag 22 Dezember 1978 on most systems like f.e. openSuSE and Ubuntu, but Friday 22 December 1978 on Debian, you need to remember that the Debian guys ...

Hint #746: How to preserve alternative names when signing certificate requests

Monday, January 12th, 2009

If you follow this guide to setup your own CA and your certificate requests contain subjectAltNames (i.e. to match multiple virtual hosts with the same certificate), don't forget to add copy_extensions = copy under the [ CA_default ] section of the default openssl.cnf file. Took me a while to realize... Happy signing!

If you’re setting up exim from scratch…

Saturday, September 27th, 2008

...and you're a bloody novice like me, you'll probably stumble upon Marc Merlin's "Very detailled and featureful configuration example". If you use that one and you wonder why on earth people can't authenticate against your local SMTP via PAM, you seek hours and hours in different places, forums, IRC and ...