Recently in Source Code Category

Bitlbee 1.2 challenge/response update

| | Comments (0)

I have updated my previous
bitlbee challenge/response patch, to work on bitlbee 1.2. You can get it at http://gigo.com/ftp/pub/src/bitlbee-challenge-response.patch . Please let me know if you use it and find it useful.

logbot - irc services bot for logging, in perl

| | Comments (0)

Net::IRCService is an interesting module - it allows you to make a "services" type irc bot, in perl, which can be much more hackable (in the good way) than most of the current irc services bots out there. I used it to make a bot that can be invited into channels to log their activity.

The main reason for a services bot, is it can speak server to server protocol - and therefore see new channel names as they are created. Based on this, this bot can join channels automatically based on regular expression.

http://gigo.com/ftp/pub/src/log-irc.tgz - BSD licensed.

scandisk.pl

| | Comments (0)

This script will read a file (or raw character device, such as /dev/rdisk0 on a mac), looking for read errors. It tries to work in large chunks to reduce the system call overhead, but will bring itself down to 512 byte blocks to accurately report how far into the (file or disk) the read errors are happening. It also reports on slow reads (>3 seconds).

http://gigo.com/ftp/pub/src/scandisk.pl

Cache CGI for offloading content to cheap host

| | Comments (0)

The good news, is that I painted my motorcycle.

The bad news is, I posted a url to the pictures, and other folks are inline imaging that photo on various forums, and it is risking my colo bandwidth bill into overage.

The good news, is I've written a cache to offload these requests to, to run on a cheap shared hosting environment, where they bill by total bandwidth per month instead of on semi-peak usage.

index.cgi

Edit the file to suit your needs. Be sure to edit the part where you indicate what paths you are willing to cache and serve - this was meant to only serve the data I wanted to serve, and not to be the latest slashdot abuse host.

An example of the script in action:

http://cache.gigo.com/index.cgi/gallery.gigo.com/jfesler/st1300/.lowres/aag.jpg

index.cgi is the script itself. The path before it is where I placed it on a cheap host. The path after that, is the web url I want mirrored.

You can set the parameters on how often it should refresh a mirror. If there were no changes (and the source is not dynamic), then the mirror should be cheap to refresh.

There is no cache cleanup script (yet). I'll post that here, when I've gotten around to writing that. :-)

Newer greylisting daemon for Postfix

| | Comments (0)

http://gigo.com/ftp/pub/src/postgreysql.pl

for postfix, frankensteined from various bits of code to make this only require *one* instance running (not several). uses DBD::SQLite, a free local disk based SQL engine (CPAN will install all you need, no daemons needed). This is what I'm currently using as it is lower weight on the server.

Btw, sqlite rocks. It is worth looking at. You may not have a use for it today, but you may in the future. It is free, bundleable, requires no server, default now in PHP; and easy to install for perl (just install DBD::SQLite, done!).

upsd.pl

| | Comments (0)

http://gigo.com/ftp/pub/src/upsd.pl

UPS monitoring script for the cheap APC UPS I bought. I made the mistake of buying things thinking it would talk like any other APC. I was wrong. The cheapness of this device made up for that fact however. Reading the /dev/uhid0 file handle for this device was not too hard. Device: USB based APC Battery Backup 500 VA (ES series), aka BE500U

% sudo usbdevs
Password:
addr 1: UHCI root hub, Intel
addr 2: Back-UPS ES 500 FW:2.e2.D USB FW:e2, APC

Greylisting daemon for Postfix (mysql version)

| | Comments (0)

http://gigo.com/ftp/pub/src/greylist.pl

My mysql greylisting interface. This also has some bypasses for things I wanted to not be greylisted. This version invokes one copy of greylist.pl per smtpd; something which I did not like. Look for my other one, that is done as a single daemon, using DBD::SQLite .

authd - SMTP filter daemon

| | Comments (0)

See authd.org for details.

mfpitgdav.pl

| | Comments (0)

http://gigo.com/ftp/pub/src/mfpitgdav.pl

Filter for Verisign's wildcarding of *.net/*.com . This will prevent senders from using bogus "MAIL FROM:" addresses that wildcard resolve to verisign. Easy to extend to other types of wildcarding entities like .cc or .tv. (This is a postfix policy server)

xtail.pl - tail multiple files at once

| | Comments (2)

http://gigo.com/ftp/pub/src/xtail.pl

This rocks. That's all I can say.

This can follow when log rotations have rotated the log from under you; It can also watch an entire directory for any changes, new additions, etc.

About this Archive

This page is a archive of recent entries in the Source Code category.

Services is the previous category.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 4.0