Samurai Penguin's Lair
Sorry for the downtime... 
Tuesday, July 22, 2008, 07:49 AM
Posted by Administrator
Sorry I haven't updated much recently, but I've been extremely busy in my personal life. Part two of the Ubuntu Mailserver tutorial should be forthcoming very soon, which will detail setting up SMTP Auth and some basic spam filtration techniques. Keep checking back!
add comment ( 76 views )   |  0 trackbacks   |  permalink   |   ( 2.9 / 34 )
Custom Bash Prompt 
Monday, May 12, 2008, 07:02 AM
Posted by Administrator
All things have to start somewhere. Linux starts with the shell, and this blog embodies that spirit by hacking it up. This is my prompt on all my servers. It’s 3 lines, and includes all possible relevant information. Date/time, load, and memory use, and the normal user@host:path info. It’s also easily customizable. Here’s how it looks:



The comments pretty much cover how it works, with the memory working the same as the load average. It does require the ‘ansicolor’ library, which I borrowed and improved from ubuntuforums. It’s quite useful for bash programming. This makes it trivial to customize the prompt. Set the colors you want at the top under the PROMPT_COLOR variables. I’ve included two variations(one commented) in the script, so I can tell which machine I’m on at a glance.

Click here to download the code
add comment ( 127 views )   |  0 trackbacks   |  permalink   |   ( 2.8 / 36 )
Deep Thoughts... 
Monday, May 12, 2008, 06:57 AM
Posted by Administrator

add comment ( 107 views )   |  0 trackbacks   |  permalink   |  related link   |   ( 3 / 25 )
Ubuntu MailServer Part 1: Making Postfix and Dovecot play nice 
Friday, May 9, 2008, 11:41 AM
Posted by Administrator
This is the first entry in a series on how to build out a stable, easy to manage, multiple-domain mailserver. I personally use this to host mail for my clients, and can say that it works quite well with no problems. Postfix is the SMTP server, handling remote deliver of mail, as well as accepting incoming mail and delivering it to user's mailboxes. Dovecot is responsible for accepting POP and IMAP connections, and reads mailboxes and sends them out. I'll explore a few different avenues and optional features you can add or remove. The original inspiration for this article is from the Ubuntu Wiki.

Read More...
6 comments ( 949 views )   |  0 trackbacks   |  permalink   |  related link   |   ( 3.1 / 26 )
Bash one-line script to find common referrers 
Monday, May 5, 2008, 02:55 PM
Posted by Administrator
Recently, I had a need to find common referring URLS for a site NOW (which meant no time to install webalizer, which I highly recommend.) This is a fairly standard bash one-liner, but it might be useful to someone in a pinch:

grep "/page.html" access.* | awk '{print $11}' | sort | uniq -c | sort -n

Basically, this checks for all requests to page.html in all access logs. It then spits out only the 11th column(referrer), then counts and sorts.

Other useful columns (assuming that you're using the standard "combined" log format:
- $1 - IP address
- $12+ - user agent
- $6 - request type(GET, POST, PUT, etc.)

This can be useful in a number of different ways. For example, trying to find abusive behaviors can be done by looking for a lot of POST and PUT requests from a specific IP:

grep "POST\|PUT" access.* | awk '{print $1}' | sort | uniq -c | sort -n

Hopefully this is of use to someone!
add comment ( 129 views )   |  0 trackbacks   |  permalink   |   ( 3 / 30 )

| 1 | 2 | Next> Last>>