Shell Scripts
Here are some scripts I've written over the years for Slackware Linux (though some of them can
be used on other distributions also). You can download
the scripts by clicking on "Show the script" links below the script
descriptions, and then saving them from your browser.
Place the scripts in the directory of your choice (for example /usr/local/bin or
/usr/local/sbin) and do chmod a+x [script] to make them executable. The
scripts will do the settings that they need (if any) when they are first
started, or at least guide you to do them.
Needless to say, you run all the tools here with your own
responsibility. I will not take blame or responsibility for absolutely
anything that
happens (including, but not limited to ;) strange noises or paranormal
activity...)
(Script updated 2.2.2006: Automatic md5 check for retrieved files
+ performance improvements)
Fetchpkg is a download helper for retrieving packages from Slackware package
sources. It does the following:
- list packages
- list files in packages
- view information about packages
- find packages containing a certain file (find
missing libs and such)
- list available upgrades for the installed packages
- display the changelog on the current mirror
- download packages and check their md5 sums
Fetchpkg does not install or upgrade packages (like for example
swaret and slapt-get do).
It only fetches packages from servers and checks their md5sums to make sure that
they were transferred correctly. Upgradepkg and installpkg exist for
upgrading and installing. See fetchpkg's help with -h
parameter or see "man fetchpkg".
Download
Slackware package
Querypkg
(Script rewritten 2007)
Querypkg is a simple tool for retrieving information about installed packages. It can:
- list packages
- list files in packages
- view information about packages
- find packages whose description or filelist
matches a certain criteria
- calculate the compressed and uncompressed sizes of packages
You can, for example, check which installed package provides
a certain file in your system. Total number of matching packages
(along with the total size of the packages with -t option) is also shown. See querypkg's help with -h parameter.
Show the script
Ldm
(Script updated 6.8.2005)
Find unsatisfied library dependencies in your system. This is done by running ldd on a selected group of
files, or alternatively all the binary files in the directories in your $PATH. After
running ldm you can use fetchpkg to find out which packages would provide the
missing libraries. Running ldm without parameters will display a brief help-message.
Show the script
Sacron
Slackware has cron but no anacron, so I wrote my own
job scheduler. The goal was to keep it as simple as possible, so I decided to use crondirs in
/etc (cron.hourly, cron.daily, cron.weekly and cron.monthly) instead of crontabs to schedule the jobs. It is
however possible to add more crondirs and tell Sacron their paths and execution intervals as needed.
This version of Sacron always runs the jobs as root but I am currently
testing a version that runs the jobs as the actual owner of the cronscript.
Cron skips the jobs that are set to run on a certain time
if the machine is not up at that time. Sacron can
be used to processes the missed jobs, or alternatively it can
take over the whole scheduling. Normally the jobs are run at specified
intervals. The jobs missed because of system downtime are run as soon as the system is up again.
To make Sacron start automatically on bootup, add a line that says
"/usr/local/sbin/sacron" (provided that you placed the script in /usr/local/sbin) to your
rc.local. In Slackware rc.local is in /etc/rc.d directory.
If you want sacron to take over the whole scheduling:
- stop crond: killall crond
- remove the execute permissions of crond: chmod a-x
/usr/sbin/crond
Now type "sacron" (as root) on the commandline to have it
set itself up and start immediately.
On the first start all the jobs in all the crondirs will be run as part of the setup procedure! This is
because there is no way of knowing when they have been last run. The
timestamp information is stored as files in /var/sacron, so you can find out
the last execution-time of the jobs with "ls -l /var/sacron".
Show the script
Config for Joe's Own Editor
Joe is a great
text-editor written and maintained
by Joseph Allen. It does all of the things you'd expect from an editor
and a whole bunch of others in a very compact package. It has full
undo/redo functionality, unicode support, macros, bookmarks, proper
shell integration, syntax hilighting, regexp(ish) search/replace,
spellchecker integration, multiple edit-buffers, excellent on-line help
facility, loads of configurability, and so on.
Joe comes with jpicorc configuration-file that apes Pico and Nano
editors.
As editors the two are less than impressive, but I really like their
keybindings (more than I like the default keybindings of Joe). njpicorc configfile is a tuned up version of Joe's jpicorc with
cleaner and more logically organized helpscreens and some added
functionality. You can place the file in your home directory as .joerc or
replace the old
/etc/joe/jpicorc with it, in which case you will have to start the editor
with command 'jpico' instead of 'joe'.
Show the configfile
Psion/Linux
I used to have a page telling all kinds of things about
Psion/Linux connectivity. I suspect that that information has mostly
become obsolete (at least my Psion has died a long time ago). Should
you still find yourself needing it, please see:
A zip package containing the trusty old Scan dictionary
for the Psion devices is available here with the
kind permission of Mr. David Cumberworth, the author of the original Scan
dictionary program.
|