This section is now closed for posting code. Please use Cool Uses For Perl instead.

Code Categories
Audio Related ProgramsFTP stuffNT Admin
CGI ProgrammingFun StuffWin32 Stuff
Chatterbox ClientsGUI ProgrammingMiscellaneous
CryptographyHTML UtilityText Processing
Database ProgrammingUtility ScriptsNetworking Code
E-Mail ProgramsWeb StuffPerlMonks Related Scripts


New Code
art2bmp
on Feb 08, 2008 at 04:38
0 replies by shotgunefx
Converts obscure ".art" files that were generated from "VGA Art Studio" into bmps. If you have a ".art" file, it is almost certainly a different format. A quick hack, but it works.
histogram
on Jan 20, 2008 at 10:26
1 reply by polettix

USAGE

histogram [--usage] [--help] [--man] [--version] histogram [--include-zero|--zero|-z] [--min-data-points|-m <num>] [--noise|-N <threshold>] [--numeric|-n] [--percentual|-p] [--step|-s <step>] [--tail|-t <length>]


EXAMPLES

# Generating histogram's data shell$ grep 'interesting' file.txt | gawk '{print $3}' | histogram # If you have numbers you can keep ordering a divide into "classes" shell$ histogram --step 10 --numeric data-column.txt


DESCRIPTION

This utility produces histograms out of input data. Every line in input (except the optional newline) is regarded as an item, and a count is kept for each different item. After the counting phase is terminated, the label-count pairs are printed in output, ordered by count, descending. This is the basic work mode.

If you happen to know that your inputs are numbers, and you care about keeping them in order, you can specify --numeric|-n. This will make sure that you'll have something resembling a distribution, and also that all the gaps between will be filled (at integer intervals). If also want 0 to be included, however far it may be, just pass option --include-zero|--zero|-z.

Moreover, if your data are numeric, and you'd rather group them by steps (e.g. 0-9, 10-19, ecc.) you can pass option --step|-s. Steps start all from 0, and need not be integer ones.

pcap2mpeg
on Jan 09, 2008 at 09:50
2 replies by walto
pcap2mpeg is a script to extract data from a network capture of an IPTV session and saves it to a file which can be viewed as mpeg. IPTV uses the UDP protocol and is (in this case) sent via multicast addresses. The capture has to be in pcap format (tcpdump or wireshark).
DB2 Log analyser
on Jan 08, 2008 at 09:20
0 replies by theroninwins
Analyses DB2 logs and searches for errors. Has a verbose mode. The comments used to be in german so I rather shortened then while translating
read MS Outlook Calendar
on Jan 04, 2008 at 22:47
0 replies by blahblahblah
Last year I finally had to give up my plain-text mail client and start using outlook, and also lost my linux workstation. Transitioning to outlook wasn't as hard as I'd expected -- it has a lot of keyboard shortcuts -- but I missed the unix calendar program's daily mails. I threw together this quick script to email myself a daily calendar preview, and set it up in my task scheduler to run every morning.
RFC1751 encoder
on Jan 02, 2008 at 18:03
0 replies by mugwumpjism
This script converts strings like: sam i am egg an ham To the equivalent RFC1751 128-bit hex string: 3a439c0688701e31 Note that the algorithm includes two parity bits. If you start the program interactively with Term::ReadLine::Gnu or Term::ReadLine::Perl installed, you should find tab completion on rfc1751 words follows. It also will attempt to find a valid sequence in every 6 words entered. Use '-v' to see all of the attempts, and not just the successful ones. For in
quick and dirty cryptogram puzzle
on Jan 01, 2008 at 04:37
1 reply by Snarius
Here's a little game that I made today. It finds a fortune using the fortune command, scrambles the letters using a substitution cipher, and has you guess what each letter represents.

This requires fortune and gtk2-perl

This can be challenging. If you have trouble, either increase the mininum fortune size or use the Jack Bauer fortune file.

It can also be very easy. A lot of fortunes have unique patterns that are easy to spot.

I made this for my grandfather, but I don't know if I'll have a chance to set it up on his computer.
Punch hole inbound for Apple NAT-PMP Router
on Dec 31, 2007 at 23:52
0 replies by merlyn
Recent apple base-stations understand the Apple-created (but open documented) "NAT-PMP" protocol to dynamically establish forwarded ports. This is similar to the uPnP protocol for windows-compatible firewalls.

I couldn't find any existing tool to forward an arbitrary port, but hey, it's just simple UDP, so I whipped up this Perl program to do the forwarding.

Adjust the capitalized configuration constants in this program as follows:

$GATEWAY
Internal IP address of your NAT-PMP-enabled router
$PROTO
1 = udp, 2 = tcp
$EXTERNAL
external port on router to map
$INTERNAL
internal port on your box to map to
$TIME
Time in seconds to keep alive (max one hour = 3600)
Then let it run in the background. It'll start by printing the external IP address of the router if all goes well, and then it'll start mapping the port. Every half of $TIME (as recommended), it'll renew the mapping for another $TIME seconds.

Quick and dirty. No warrantees expressed or implied.

Petrolhead Automatic Racer
on Dec 24, 2007 at 18:19
1 reply by davidov0009
A program that races a given Facebook account 10 times using the petrolhead racing application. (to gain you points) See POD for more details.
A WebDAV server with authentication
on Dec 23, 2007 at 07:27
0 replies by Corion

This is a small WebDAV server I use for serving files to other people. WebDAV is quite convenient for serving files because "all three" operating systems offer a client that allows you to treat a WebDAV share as a remote file system. It extends the sample code of Net::DAV::Server to provide HTTP basic authentication, so it can be exposed on the internet without being completely open.

I've implemented a separation of privileges into "readers" and "writers", but so far I haven't felt the need to export write privileges. So maybe that part shouldn't have been written at all, in the spirit of Dominus.

On the side of prerequisites, this one is quite heavy. It uses Net::DAV::Server, which in turn pulls in XML::LibXML. It uses Filesys::Virtual, Authen::Htpasswd and HTTP::Daemon.