Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Code Catacombs

( #1747=superdoc: print w/ replies, xml ) Need Help??

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.org Related Scripts


New Code
Google Spreadsheet Distributed Agent System
on Sep 30, 2009 at 07:59
1 reply by dmlond
This object sets up a system to allow a user to configure a set of scripts to use a single Google Spreadsheet as a control panel when running across many servers. See The RFC for more information.
Wx::MediaCtrl and Wx::PaintDC
on Sep 14, 2009 at 10:20
0 replies by Steve_BZ
When I was starting to use wxPerl, I couldn't find enough examples of this control. So here is a small example here of wxMediaCtrl, and the beginning of a Bitmap Status bar underneath using DC::Paint.
Smartphone/Media Center integration via XMPP over GoogleTalk
on Aug 03, 2009 at 10:03
1 reply by mikelieman
In celebration of the birthday of Jerry Garcia ( b. 8/1/1942 d. 8/9/1995 ) I present a Perl script which allows a smartphone user (e.g.: Blackberry ) to control an instance of Amarok 1.4 running remotely on a media center PC by chatting with the daemon through Google Talk.

A few weekends ago, we were sitting on the porch wondering which of MANY Red Rocks shows we had queued up on the media center PC we were listening to at the moment when we started discussing ways to get the information about what we were listening to displayed conveniently.

A few hours later, after dismissing some ideas involving scrolling LED marquees over the cabin door, I got the idea that "Jeff's blackberry can run Google Talk. I can have the a script pull data from Amarok via its DCOP integration{1} and use XMPP to send 'Now Playing' messages" over Google Talk to the daemon's friends.

Once we had Song Change notices being sent, the natural extension was to have a two-way conversation. By the next morning we had transport and volume control integrated. A week later, I spent an hour or two adding *very basic* playlist construction support, and that was pretty much all you'd ever need.{2}

You'll need a Google Talk account, and the people who get control and notices need to be setup to chat with the Google Talk account ( I used the Gmail UI ).

Once the server has friends to chat with, fire up Amarok, fire up this script, and it'll connect to Google Talk and start notifying of song changes and accept volume, transport control, and playlist management commands.

Footnotes:

{1} Which in going to require an abstraction layer or something to accommodate Amarok 2.0's different yet still standards conforming desktop integration API.

{2} While testing, we ended up quickly adding 2 more features ( not shown). "X" will just stop what the server's doing, load a pre-set playlist and just start playing that -- for times when you just want music up, but don't have the time to construct a playlist. And a patch to return to $MUSIC_ROOT if you get confused where you are browsing for content. The playlist construction features need some work.

Check21/X9.37 text extractor
on Jul 31, 2009 at 15:53
2 replies by delirium
This is a simple script to extract the EBCDIC text from an X9.37 formatted file. For those unfamiliar, this is a file format used in banking that has scanned check images in it, mixed with flatfile data describing the account numbers, dollar amounts, etc. The file format is obfuscated, but straightforward. You have a 4 byte record length field, then that many bytes of EBCDIC text, with one exception: the "52 Record". The first two bytes of data are the record number. Record 52 has 117 bytes of EBCDIC, and the remainder is binary TIFF data. This script has a flag that determines whether or not to ignore the binary TIFF data, or export it to files.
An Useless Cipher
on Jul 26, 2009 at 09:47
1 reply by Oromis92
bah... something stupid, just for exercise.
File Backup Utility
on Jul 25, 2009 at 23:04
2 replies by misterMatt

I wrote this utility to assist me in backing up files from my hard drive to an external drive. This is my first perl script!

I tested this on the latest activeperl installation on windows vista. This script requires File::Copy::Recursive.

If anyone has suggestions on how to improve this script either by code improvements, or feature additions post your ideas here! I would appreciate it. Sorry about the formatting.

Simple r-copy style backup
on Jul 07, 2009 at 12:30
1 reply by gman
Simple script I used to back up my Laptop before lease exchange. Was not looking to reinvent the wheel, saw rcopy after I wrote this and rcopy requires rsync. I was running XP with activestate perl, so seemed just as easy to write something quick that would do the job. update: Thanks graff for pointing out the error I had with mkpath
eval { mkpath (["$copy_to/$dir"]); }; die "Could not create Path $copy_to $dir $@" if($@);
LaTeX Abbreviations for Linguists
on Jul 06, 2009 at 14:40
3 replies by Omukawa
This is a script which finds the abbreviations in the glossings and lists them alphabetically. The abbreviations defined by Leipzig Glossing Rules (http://www.eva.mpg.de/lingua/resources/glossing-rules.php) are left out per default. If you want to list the LGR abbreviations, too (and their definition), you should use the "-lgr" suffix.
RAR compressed archives batch extraction
on Jun 12, 2009 at 09:22
0 replies by nikosv
Open source software for batch extraction of RAR compressed archives. Handles password protected, multi-part and encrypted archives with ease. Portable, no installation required, no registry polluting, minimal memory footprint. Written entirely in Perl and gets its core functionality by interfacing with the unrar.dll dynamic library for Windows (http://www.rarlab.com/rar/UnRARDLL.exe) Unrar Extract and Recover
activeblock
on May 30, 2009 at 23:28
1 reply by sflitman
Root-executed code scans logfiles or waits as a daemon for new log entries to actively block invalid access attempts using iptables. IPs are logged in a small database and once there are 5 invalid attempts bada boom they're outta there. Has ability to list the ipchain, unblock/allow an IP, or block a specified IP from the command line. This is Linux (probably Debian/Ubuntu) specific, but might work on Red Hat systems too. Verify which log files to scan by looking for typical phrases like 'invalid user' and 'failed login' or my favorite, POSSIBLE BREAK-IN ATTEMPT. /var/log/auth.log and /var/log/secure are the most common.

For daemon use, put activeblock in /root and this line in root's crontab:

0,30 * * * * cd $HOME; ./activeblock -cu /var/log/auth.log 2>>/root/ac +tiveblock.log &
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (13)
As of 2014-08-21 16:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (137 votes), past polls