pero on anything

May, 2007

Aggregate Traffic Used From a Combined Apache Logfile

Today I just wanted to know the traffic sent out by one of our apaches for a certain client. Our administrator came up with the following code that did it – awesome! #!/bin/sh for file in [path to your logifes]/*.bz2; do echo -n ” $(basename $file) ” >> ~/traffic.out; bzcat $file | awk ‘BEGIN{ regex=”^/clientFolder/”;summe=0;} [...]

Typing Special Keys under Linux

Some special characters like ~ (tilde) cannot be typed by simply pressing the key combination. This is true at least for german keyboard layouts and Ubuntu 6.10 (Edgy Eft) and 7.04 (Feisty Fawn). To prevent this behaviour and display the character upon the first stroke add the following to you /etc/X11/xorg.conf under the section Input [...]

How to change encoding of a file?

Another chapter of the book “Encoding is hell” Today I noticed that some files in one of our projects suddenly have been converted to UTF-8 where they should have been in ISO-8859-1. Ok, short question: How to convert it back? Short Answer Use iconv like this: iconv –from-code=UTF-8 –to-code=ISO-8859-1 inputfile.txt > outputfile.txt