Perl scripts

These are useful things made in Perl. Mostly they have a GUI, some are driven by input text files. They are mostly made for one objective and may not operate for another. They may have bugs. I use these scripts in Linux (Debian 10).
They mostly require Perl/TK for a nice GUI.

PROGRAM: Copier.pl
 

OBJECTIVE:

To copy files in specific order on media which requires it. For example, these little MP3 players or cheap digital picture frames.
 

USAGE:

Just run it. With +-button add files or folders, and order them as you want. Then you can insert divisions and resets. Use pre/post processing if you need.

The pre-processing works on a copy in temporary directory and expects your script to overwrite it. Counter variables are mostly for pre/post processing purposes, so you can, with your pre-processing script, e.g. record a nice message like "part x of y" on each sound file or scale the image to picture frame's size. There are a resettable and irresettable counters - irresettable is for file names which should have continuity, resettable is handy for pre-processing if you e.g. want to copy a few audiobooks on a player. Remember to review the sync policy inside script (do not use SYNC_HARDER on active multiuser system).

t

Download copier.pl.tar.gz

 

PROGRAM: Xspelling.pl
 

OBJECTIVE:

To make a spell-checking using ASpell for clipboard or text file.
 

USAGE:

xspelling.pl -c - check clipboard's contents

xspelling.pl -f file.txt - check text file contents
 

If additional argument is present, it is assumed to be language. The language selected by user is stored in config file.

WARNING: Overwrites clipboard or file without warning when "Confirm" button is clicked AND DOES NOT EXIT. Putting things to clipboard and exiting is very non-X-ish way and it is expected you run a more complex desktop which supports such feature like getting clipboard contents after closing the program which copied it. So please paste it somewhere and then close, for safety of antique standards and dinosaur-class software (especially simulation and algebra CAS programs).
 

Requires Text::Aspell module too.

 

Download xspelling.pl.tar.gz

 

PROGRAM: menu.pl
 

OBJECTIVE:

To provide the most simple programs/features/commands menu configurable with text file


USAGE:

menu.pl menufile


Where menufile consists of the 3-line entries:

[Item's label]

command

icon path (e.g. PNG file, preferably scaled to the proper size)


If no icon is needed, use '' or something similar. Generally wrong icon file is not considered an error.

 

Download menupl.tar.gz

 
 

PROGRAM: imagenes.pl
 

OBJECTIVE:

To organize large number of images to directories.
 

USAGE:

imagenes.pl  ... ... ... - run from directory with images (default JPG), call with parameters with directory names.

The directories, if not present, will be created. Every image in base directory will be shown and clicking on a button corresponding

to directory will move the image there and show the next image.

There is also a "Restore" button.

 

Download imagenes.pl.tar.gz

 

PROGRAM: launchme.pl base.pl
 

OBJECTIVE:

A cardfile-like database of disc images made from book discs.
 

USAGE:

First, you make media image. If it's a floppy, use dd/ddrescue or better, a DOS/Win9x machine. If it's a CD, the launchme.pl allows to take it using ddrescue. When the image is ready, fill in the author, title, media count, type and condition and register it in. This will be written to database file.
 

To view database entries, use base.pl, double-click on the item to open directory with images in file manager. The default file manager expected is KDE's Konqueror, but can be changed to e.g. Ubuntu's Nemo, MATE's Caja, Thunar for XFCE or KDE's Dolphin.


Data is stored in "database.csv" file in scripts directory. Contents are stored in the same directory, in subdirectories with IDs as names. A sample CSV is attached.

 



Download dimagebase.tar.gz

 

PROGRAM: rssgen.pl
 

OBJECTIVE:

To create a RSS-compatible XML file from any website.


USAGE:

The program works by reading preferences from file. Then, it creates XML file, overwriting previous without warning. The resulting file is completely compatible with RSS specification, so Your desktop mail client or RSS reader can read it (most of readers allow to subscribe to file:// RSS streams). The program should be called, generally, at least so frequently as RSS reader refreshes its RSS, but don't DDoS websites with it.
 

The construction of input file is simple and lines have consistent meanings:

Line 1: The address, or addresses, of websites to process. Separate addresses with ; sequence: Space, semicolon, space.

Line 2: The selection of title for feed items

Line 3: The selection of URL of feed items, usually the same as Line 2. This takes by default the href=... value.

Line 4: The selection of content for feed items.

Line 5: Title or content killlist, ;-separated

Line 6: Title killlist, ;-separated.

Line 7: Content killlist, ;-separated

Line 8: Removal list in title or content, ;-separated.
 

The first 3 killlists work by removing entire item from feed if it contains phrases from lists. The last killlist removes only these phrases, so it is possible to remove these nasty "no photo" texts from classified ads while seeing everything else :).

 

Download:

rssgen.pl.tar.gz