The unrar.dll library is written in C and provides functions for extracting/uncompressing rar archives. In the developer distribution there are code examples on interfacing with the library in many languages but not in Perl, so I wrote one which is going to be included in the development edition after Winrar 3.9 gets released.
It offers an example of Perl interfacing with C libraries, mapping C structures to Perl structures, using raw pointers from Perl and how to use of Win32 low level API calls.
To use it you need to :
1. have the Win32::API module installed
2. get unrar.dll from http://www.rarlab.com/rar/UnRARDLL.exe and place it inside your Windows\System32 directory
3.run it as :
for listing the contents of the file : perl unrar_wrapper.pl L filename.rar
for extracting contents of file : perl unrar_wrapper.pl X filename.rar
Any suggestions/comments/corrections are welcome
Ever want to search and replace, but on many terms and don't want to run a SAR routine over and over again for each instance? Script searches and replaces text in columns based on a mapfile. The
output is a tab delimited text file.
Application visualizing "Divide" challenge. Run it without params - you can play the board loaded from __DATA__ section. Pass dimension (integer) as first param - program will generate random board for you, which you can paste into __DATA__ section.
The goal is to place all connections marked green between left and right side nodes, and red connections between nodes on one side.
TODO: canvas size scaling refresh canvas on resize draw initial connections (right now you must click 'Swap' to see initial board)
try to connect lines to nodes - this could allow automatic redrawing and resizing more colors for connections
small random offsets to coordinates of buttons to avoid labels' overlapping
Script will interface with Cisco router via SNMP or Telnet, supporting regular login or username, and perform actions. SNMP supports a get config, put config and a save config ("wr mem" for IOS). SNMP mode also supports get and clear VTY line function and a get interface list and monitor interface utilization function, including CPU, memory and proxy ping.
Telnet mode supports the issuing of commands from a file. The only default command issued in TELNET mode is "terminal length 0" for IOS or "set length 0" for CatOS. Therefore, show commands can be in the commands file along with config commands (on IOS, as long as preceded by a "config term" and followed by an "end" and "wr mem" if save is desired). Telnet mode supports log file of session transcript.
Password decrypt and encrypt mode is provided for Cisco passwords. Type 7 (not "enable secret") are decrypted or encrypted to the 16 possible encryptions. Type 5 ("enable secret") are encrypted or decrypted by dictionary brute force.
Server mode is provided for simple service listening mode.
An example of things I do when bored at work. Not a terribly good example of much else. We use the names of Greyhawk deities for our internal projects, and scanning the Wikipedia page to find them was getting old. So, uh, this thing grabs the page markup using LWP::UserAgent, does some simple parsing, and internalizes the result for easy searches.
Update: As requested, made some minor adjustments to the usage description which should improve its clarity.