Latest Posts
- Error Unable to open env file: /etc/default/locale: No such file or directory
Posted: 7 days ago by Alain Kelder
Some of my systems are logging this error:
su: pam_env(su:session): Unable to open env file: /etc/default/locale: No such file or directory
I alr… more
- Append a line of text after a line matching a pattern
Posted: 25 days ago by Alain Kelder
Let's say we've got:
$ cat file.txt
blah blah blah append after me blah bleh! append after me blah blah blah bleeeh
This will add "new… more
- Shell script to verify zip archives
Posted: 35 days ago by Alain Kelder
This is similar to my little shell one liner to verify tar archives. Exit status of 0 means the archive is good, anything else means there's a problem. Mos… more
- High resolution with extra Compiz effects on Dell Mini 10 with Ubuntu 9.10 Karmic
Posted: 46 days ago by Alain Kelder
Let me preface this post with a rant. In retrospect, I feel that getting this netbook with the Poulsbo chipset / Intel GMA500 video was a mistake since it'… more
- Reject an email message with too many recipients with Postfix
Posted: 53 days ago by Alain Kelder
The following config will reject a message when more than 10 recipients are in the TO: and/or CC: fields.
/etc/postfix/main.cf:
# restrict based on… more
- Little shell script to recursively check a site for broken links
Posted: 64 days ago by Alain Kelder
Needed a script for work to recursively spider one of our sites to check for problems and build a content inventory. As a side project, produced a little s… more
- Responsibly download lots of files with wget
Posted: 65 days ago by Alain Kelder
The goal is to download pdf files from http://example.com/dir1/dir2/, where dir1 name is constant, but dir2 is a number between 100 and 499 (e.g. http://ex… more
- Easily get the correct client IP with mod_rpaf
Posted: 65 days ago by Alain Kelder
Let's say you run a front end system like a reverse proxy, load balancer or http accelerator (e.g. big-ip, squid, pound, varnish, apache, nginx, etc), whic… more
- Insert line numbers in files painlessly with nl
Posted: 66 days ago by Alain Kelder
Was trying to figure out how to insert line numbers into a huge file with sed or awk, then stumbled across "nl", a sweet little baby that comes with GNU co… more
- Display non-printing characters with cat and replace with sed
Posted: 67 days ago by Alain Kelder
Got a csv file created with Open Office from a Microsoft Excel file. It contains characters which in less show up as "^K" (caret upper case K), which trip… more
- Shell script to enumerate titles and chapters of a dvd and rip the longest one into avi using mencoder
Posted: 69 days ago by Alain Kelder
BASH script to enumerate titles and chapters of a dvd and rip the longest one into avi using mencoder. DVD device can be a path to mounted iso (e.g. /mnt/i… more
- SMTP test message via shell script using netcat instead of telnet
Posted: 73 days ago by Alain Kelder
I've always used telnet for SMTP testing. Finally, got sick of copy/pasting and decided to write a quick script. But scripting telnet is a pain. Netcat to… more
- Little script to identify child process
Posted: 76 days ago by Alain Kelder
I've got a script that loops through a list of directory names and compresses them. There are lots and once in a while I want to check on the progress and… more
- WordPress Varnish plugin error
Posted: 77 days ago by Alain Kelder
Was looking for a way to purge Varnish cache when pages are updated or added. WordPress Varnish plugin looks exactly like what I'm after, except it threw u… more
- Exploring methods to purge Varnish cache
Posted: 77 days ago by Alain Kelder
I'm considering implementing Varnish at Stanford Law and have been playing with it here to understand implications and workout issues. One issue is purging… more