Today is: 8 January, 2012
Check todays hot topics

Bash

Thursday, September 3, 2009 - 17:29

This is useful (probably responsible as well) for owners of large blocks of IP space. This is useful to people who are not you. It's always nice to have forward and reverse resolving ip space even if it's not being used.

In my case we had large net blocks straddling several physical locations. This really helped me locate large blocks and their relative location without having to telnet into network gear and dicking around with all 28347238947238942984 ports feeding our network. It's plenty ghetto. Enjoy.

#!/bin/bash

0


Thursday, September 3, 2009 - 17:34
bugtraq, motd, rss

Force your sysadmins to keep on top of the latest security advisories. Change $outputfile to /etc/motd or change your login profile to cat something else. Do whatever you want with it really, it's essentially an RSS reader in bash.

#!/bin/sh
 
url="http://www.securityfocus.com/rss/vulnerabilities.xml"
 
 
pagetitle="=============================================================================
                         Current Bugtraq Vulnerabilities 
============================================================================="

0


Tuesday, August 4, 2009 - 16:55
bash, bc, strings

This is my revision to Statistics gathering in one line and 30 seconds. Stripped and sanitized.

#!/bin/bash
 
LOG_PATH="" # Leave this empty if you wish to be prompted for it
USERNAME="" # Leave this empty if you wish to be prompted for it
HOSTS=(web1.example.com web2.example.com web3.example.com)
 
echo -n "Enter the search criteria: "
read PATTERN
 
if [ -z $LOG_PATH ]
then
        echo -n "Enter log path: "
        read LOG_PATH
fi
 
if [ -z $USERNAME ]
then

0


Monday, August 3, 2009 - 18:10
bc, statistics, strings

At work we had some crazy error happen in bulk and without warning. We have a number of clusters with several different classes of machine in each, and I was told to gather statistics now now now. The resulting one-liner is what happened (with a little bit of scrubbing to protect the innocent).

#!/bin/bash

0


Wednesday, July 29, 2009 - 16:43

This is a script a friend and I wrote while working at an ISP years ago. This script has been the subject of an inside joke of ours for a long time. We got tired of receiving several mailq alerts a day. After being beat down by the management (pertaining to why we needed to run open spam relays...) we accepted our fate and automated something up.

This script moves the mail queue to something completely new and random, starts a separate queue runner for it and restarts sendmail with a fresh empty queue. It's about as ghetto as they come.

#!/bin/bash
LOGIN=$1

0