1 <!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
4 <meta http-equiv="Content-Type"
5 content="text/html; charset=iso-8859-1">
6 <meta name="Author" content="Fred T. Hamster">
8 content="Mozilla/5.0 (X11; U; Linux i686; en-US) [Mozilla]">
9 <meta name="Description"
10 content="Open Source Perl for Your Perusement">
12 content="reusable, open source, perl, shell, script, recursive, diff, snarf, yeti, free, source code, example, filename, snarfer">
13 <title>Feisty Meow Concerns Perl Scripts</title>
14 <meta content="Fred T. Hamster" name="author">
16 content="Scripts for backing up hierarchies, generating documents from other documents, etc etc."
20 style="background-image: url(pics/celtic_destiny14.jpg); background-color: rgb(0, 0, 0); color: rgb(255, 255, 153);"
21 alink="#ffcc00" link="#66ff99" vlink="#00cc00">
24 <table bgcolor="#330000" border="4" cellpadding="0" cellspacing="0"
30 <h1><a href="http://feistymeow.org/">Feisty Meow Concerns Codebase</a> Open Source Perl
32 <h2>Some Hopefully Useful GPL-Licensed Perl Code<br>
35 <center>Contributed by Chris Koeritz (<a
36 href="mailto:%20koeritz@gruntose.com">Koeritz@Gruntose.COM</a>) <br>
37 See the <a href="http://www.gruntose.com/Info/GNU/GPL.html">GNU Public
38 License</a> for details of licensing.<span style="font-style: italic;"></span><br>
42 <li>No warranty, express, implied or imagined, is offered for
43 these files. If you destroy your life by running one of them, I
44 will have sympathy, but that's about it.</li>
45 <li>Some of these shell scripts depend on environment variables.
46 The most frequent case of this is FEISTY_MEOW_DIR, which should point to the
48 directory where the Feisty Meow scripts are stored on your
49 machine. This variable is set by default when the scripts are in
50 the ~/feisty_meow folder. Consult your operating
51 system documentation if you are
52 unfamiliar with the concept or management of environment variables.</li>
53 <li>These files are provided as possibly useful shell scripts
54 rather than as full-fledged reusable and object oriented components.</li>
55 <li>Improvements and contributions are gladly accepted.
56 They will be processed as fast as our schedule permits. Please
57 send any changes to the Gruntose Curator at <a
58 href="mailto:%20fred@gruntose.com">fred@gruntose.com</a> .</li>
59 <li>These files are mostly portable between Unix and the
60 various Windoze OSes, but in many cases you may want to fix the
61 defaults or path names to make them more suitable for your own needs.</li>
62 <li>Some of the scripts invoke external programs that are
63 available for most Unixes. For Windoze users, a set of GNU Unix
64 utilities is available at "<a href="http://www.mingw.org/">http://www.mingw.org/</a>".</li>
65 <li>An alternative, but not recommended, GNU suite is
66 at "<a href="http://www.cygwin.com/">http://www.cygwin.com/</a>".</li>
67 <li><span style="color: rgb(255, 255, 204);">Direct Cognition</span>:
68 View the scripts directory itself rather than navigating with the links
69 below: <a href=".">scripts</a>.</li>
78 <table bgcolor="#330000" border="4" cellpadding="0" cellspacing="0"
86 <h3><a href="../text/diff_lib.pl">diff_lib.pl</a></h3>
87 <blockquote>The "differ" utilities can be used to compare two
88 directories of text or binary files against each other. The two
89 directories are presumably close in contents. This can be useful
90 when one is revising a set of files and wants to synchronize an older
91 copy against a newer version. Support for "<a href="#differ">differ.pl</a>"
94 <h3> <a name="filename helper"></a><a
95 href="../files/filename_helper.pl">filename_helper.pl</a></h3>
96 <blockquote>Contains a handy set of utilities for manipulating
97 filenames. These can help to make perl scripts portable across
98 the two well-known types of filename separators ('/' and '\').
99 They also provide support for ripping up filenames into their
100 components.</blockquote>
101 <h3> <a href="../core/inc_num.pl">inc_num.pl</a></h3>
102 <blockquote>This is a simple utility that manages a file with a
103 number in it. This is somewhat more useful than it sounds.
104 Functions are provided to get the current number and to change the
107 <h3> <a href="../archival/shared_snarfer.pl">shared_snarfer.pl</a></h3>
108 <blockquote>This library supports the "snarf" utilities.
110 utilities manipulate archive files with the ".snarf" extension.
113 snarf files are compressed chunks of directory hierarchies. Bob
115 are useful because they track a number per distinct "snarf" types that
117 used to make uniquely named new archives of the appropriate type.
119 number is an ever increasing integer that's stored in a well-known
120 (configurable) location. When a snarf file is unpacked (using the
121 "unsnarf" tool), the number is updated on the local machine so that the
122 next generated file will
123 be one greater than the previous number. If one is travelling
125 two machines with the same snarf file, this will have the effect of
127 the number updated on both sides.
129 <h3><a href="../files/zap_the_dir.pl">zap_the_dir.pl</a></h3>
130 <blockquote>Support for the zapdirs utility. This library
131 cleans out the directory that it is passed by removing files that are
132 not considered important (using "<a href="#filename%20helper">filename_helper.pl</a>
133 "). The list of important files is something you might want to
134 look at to ensure that you won't get burned by zapdirs.</blockquote>
143 <table bgcolor="#330000" border="4" cellpadding="0" cellspacing="0"
144 cols="1" width="92%">
148 <h2>Applications</h2>
150 <h3> <a href="../text/add_cr.pl">add_cr.pl</a></h3>
151 <blockquote>Processes Unix format text files for pcdos by
152 forcing the line endings to be Carriage Return plus Line Feed (CRLF).</blockquote>
154 <h3><a href="../cgi/cgi_display.pl">cgi_display.pl</a></h3>
155 <blockquote>Turns the files passed on the command line into a
156 stream of CGI compatible text output. The javascript show_file method
158 source for this page) is preferred since it is lighter weight and
160 need cgi, but there are some situations where cgi is the only option
162 browsers or requirements of no javascript).</blockquote>
164 <h3> <a href="../files/change_endings.pl">change_endings.pl</a></h3>
165 <blockquote>Replaces the suffix of all filenames in the current
167 with a different suffix. Suffix here is defined as the set of
169 after the last period ('.') in the name. Note this will not work
171 names without suffices.</blockquote>
173 <h3><a href="../text/cpdiff.pl">cpdiff.pl</a></h3>
174 <blockquote>Copies files from a source directory into a
175 destination directory. The files are only copied when they are
176 missing in the destination or when the destination version has
177 different contents. The syntax looks like this:<br>
178 cpdiff source destination<br>
179 The assumption is that the files in the source directory are somehow
180 better, newer or more complete than the set of files in the destination.<br>
182 <h3><a href="../text/cpdiffnow.pl">cpdiffnow.pl</a></h3>
183 <blockquote> Similar to cpdiff, but this utility sets the
184 destination file's time stamp to "now". This should cause the new
185 or changed files in the destination directory to be more recent than
186 anything else in there. This is helpful sometimes for forcing
187 compilation of modified source files.<br>
190 <h3><a href="../rev_control/cvs_fix.pl">cvs_fix.pl</a></h3>
191 <blockquote>Wraps the cygwin cvs command for pcdos/win32.
193 unfriendly backward slashes are flipped to be forward slashes.<br>
196 <h3><a name="differ"></a><a
197 href="../text/differ.pl">differ.pl</a></h3>
198 <blockquote>Compares two directory hierarchies and the files
200 contain. The first parameter is a directory
201 to compare against "this" directory;
202 every subdirectory "here" will be traversed in order to build the
203 output file that shows the differences. An optional second
204 argument can be used to specify a different directory than the current
205 one as the source of the comparison (the first argument is always the
206 destination of the comparison).</blockquote>
207 <h3> <a href="../files/filedump.pl">filedump.pl</a></h3>
208 <blockquote>Collects the contents of the files whose names are
209 passed on the command line into one gigundo stream which is passed to
210 standard output. The output can be piped into another file as desired.</blockquote>
211 <h3> <a href="../core/generate_aliases.pl">generate_aliases.pl</a></h3>
212 <blockquote>Performs some useful activities for the shell
213 environment. Using the environment variable for FEISTY_MEOW_SCRIPTS (which
214 is set in the appropriate startup files to be the shell scripts
215 directory, where all this stuff lives), generate_aliases will create
216 all of the aliases files for the combinations of operating systems and
217 types of shells supported. Currently this includes Linux, Unix,
218 PCDOS, OS/2 and MS-WIN32 (9x, NT, 2K, XP, etc) for
219 supported operating systems. The shell languages supported are
220 dos's command, nt's cmd, unix's sh and bash, and perl. This script will also look for
221 any files ending in ".sh" or ".pl" and it will create aliases for them
222 in forms appropriate to the different shells. The .zz_auto_gen
224 is created under the home directory (or under TMP in DOS and Win32) as
225 a storage place for the generated
228 <h3> <a href="../users/goodbye.pl">goodbye.pl</a></h3>
229 <blockquote>A logout script for exiting from a shell; it prints
230 a message using the nechung oracle for the user's benefit and starts a
231 byejob before exiting. The byejob will wait for a few seconds, then
232 clear the screen and print another fortune. It attempts to leave the
233 screen looking like a
234 standard login, but with an extra fortune.</blockquote>
237 <h3> <a href="../text/new_sig.pl">new_sig.pl</a></h3>
238 <blockquote>Generates a signature file from the nechung
240 using the 'nechung' application. See the <a
241 href="http://feistymeow.org/">Feisty Meow Concerns Codebase</a> for the nechung
243 The database for nechung resides in the <a href="#download">whole Feisty Meow Concerns code package</a> in "feisty_meow/database".</blockquote>
245 <h3> <a href="../files/renlower.pl">renlower.pl</a></h3>
246 <blockquote>Renames all of the files passed on the command line
247 such that they are only in lower-case. Useful if you're tired of
248 passing mistakenly re-capitalized names from a defective 8.3 OS (e.g.
250 a file system where you care about the case.</blockquote>
251 <h3><a href="../processes/runner.pl">runner.pl</a></h3>
252 <blockquote>Finds all executable files in the current directory
253 (and subdirectories) and runs them. The output of the programs is
254 sent to standard output. Standard error is used to report which
255 file is being worked on, plus the running programs' own standard error
256 streams are merged into runner's standard error stream. This
257 makes it nice to do something like:<br>
258 runner >runs.log<br>
259 where the runs.log file will contain the output of each program that
260 was executed and the console will be sent messages as each program is
261 started and finished (and errors show up at the console also).<br>
263 <h3> <a name="safedel"></a><a
264 href="../files/safedel.pl">safedel.pl</a></h3>
265 <blockquote>Makes deleting files and directories a little less
266 nerve-wracking. If you substitute safedel as an alias for rm or
267 del or deltree or whatever, it will make a zipped backup of the items
268 before they are actually deleted. Safedel keeps track of a number
269 that is attached to each zip to enforce uniquely numbered
270 archives. They are stored in a directory named "zz_del_keep"
271 that is stored under the temorary directory (specified by the
273 variable named TMP). A report of the contents of the compressed
275 is appended to a file named "zz_safedel.rpt" in the TMP directory.
277 cleaning of the deleted files folder is recommend, but this utility has
279 my various parts several times already.</blockquote>
282 <h3><a href="../archival/snarf_linux_config.pl">snarf_linux_config.pl</a></h3>
283 <blockquote>A snarf utility that packages up the
284 important configuration files in a Linux installation.</blockquote>
286 <h3> <a href="../archival/snarf_light.pl">snarf_light.pl</a></h3>
287 <blockquote>A selective snarf of the source hierarchy.
289 collects the code that I manage. As such, this is probably
290 irrelevant to anyone but CAK.</blockquote>
291 <h3><a href="../archival/snarf_notes.pl">snarf_notes.pl</a></h3>
292 <blockquote>Gathers all "important" files from the home
295 is somewhat personally tuned but it includes files and directories that
297 "project", "notes", or "crucial" in their name.</blockquote>
299 <h3> <a href="../archival/snarf_src.pl">snarf_src.pl</a></h3>
300 <blockquote>A source code grabbing snarfer. The entire
302 code hierarchy is snarfed. Note that one should edit the
304 location to make it appropriate for your local source code.</blockquote>
306 <h3><a href="../files/summing_dir.pl">summing_dir.pl</a></h3>
307 <blockquote>Offers a directory listing along with total file
309 and disk free space.<br>
312 <h3><a href="../build/synch_build.pl">synch_build.pl</a></h3>
313 <blockquote>This is a helper utility that synchronizes the binary
314 outputs from a build process with an existing installed location. Given a target directory, the executable
315 programs and dynamic libraries that exist there will be synchronized
316 with the build repository's versions. This is kind of a quickie
317 upgrade process, as long as the files in the target location are not
318 locked by other processes.<br>
320 <h3> <a href="../archival/unsnarf.pl">unsnarf.pl</a></h3>
321 <blockquote>Uses the snarfer utilities to undo a previously
322 snarfed file. A folder named "snarf_BASE" is created for the
324 is replaced with the basename of the snarf file (that is, without the
326 suffix). The number that tracks the snarf files of this type is
328 such that the next snarf file will be at least one higher than this
331 unique number. The number will be managed correctly if you're
333 unsnarfing the most recent snarf files before creating any new snarfs.</blockquote>
335 <h3> <a href="../files/whack_forever.pl">whack_forever.pl</a></h3>
336 <blockquote>Since all of my file deletion commands are aliases
337 to <a href="#safedel">safedel</a>, it is hard to actually remove a
338 file. If I'm really really sure that a file or directory needs to
340 permanently deleted, then this command can be used. It shows the
342 it is removing also, but it does _not_ ask for confirmation.</blockquote>
344 <h3><a href="../security/y2038_check.pl">y2038_check.pl</a></h3>
345 <div style="margin-left: 40px;">Tests the system for survival
346 past the year 2038, which is when the Unix time scale runs out of bits
347 for the number of seconds since 1970 measured in a 32 bit integer.<br>
349 <h3><a href="../files/zapdirs.pl">zapdirs.pl</a></h3>
350 <blockquote>Removes empty directories and directories
352 unimportant crud (see "<a href="#filename%20helper">filename_helper.pl</a>").
353 If there are no arguments, then the current directory is cleaned up;
355 will be traversed into and removed if it seems appropriate.
357 zapdirs operates on the arguments passed to it as if they are directory
359 to be cleaned.</blockquote>