Spahni Stein Rechtsanwälte
 
Navigation
Wichtige Links

Some useful programs for download

These are some of my programs, mostly shell scripts.

Disclaimer: These programs are in the public domain (with the exception of dbtool and timon which are distributed under the GPL2 GNU Public Licence). All others may be freely copied, distributed and changed. However, no guarantee is given that they are useful for any purpose or that they will run on any particular machine without damaging hard- and software. Enjoy at your own risk!


ASCII-file to TeX Converter

Program name: totex

This is a bash Shell-Script running under Linux and eventually some other flavours of Un*x (untested). It makes use of the sed stream editor which should be part of user's system.

totex tries to figure out how to format a plain ascii-file in a way to make it look nice when subsequently processed with TeX. It is intended to process a wide variety of texts the user could download from the internet. The problem is to find titles, alineas and paragraphs. The script probably needs some editing to reflect personal preferences. Don't forget to set the downloaded file to executable:
chmod a+x totex

Usage: totex [-t] filename
where the option [-t] will call TeX after conversion.

Download totex and report any stories of success or failure to thomas@spahni.ch.


Extract UU-encoded files from Mail & News

Program name: uuesplit

Another Shell-Script for bash/Linux. When you have saved a couple of UU-encoded files to a news od mail folder, then this file must be split before uudecode can be run. This script will do exctly this, using a brute force approach (not very fast on *big* files).

Usage: uuesplit filename-of-folder

Download uuesplit and report any stories of success or failure to thomas@spahni.ch.


Calculate Position of the Sun

Program name: sunpos

The program calculates the apparent position of the sun for a given local position of the observer. Besides azimuth and elevation, data for right ascension, declination and ecliptic longitude are given as well. Nutation data display can be enabled.

The scope of this program is to provide an easy determination of the relative solar position for photographers, pilots, environmentalists and others. Accuracy is within 2 - 3 seconds of time. For a determination of sunrise / sunset the effects of atmospheric refraction must be taken into account. If high accuracy is desired then more advanced methods of computation should be used.

The program is written in "C" and must be compiled on the users machine. It was tested under Linux/gcc and contains very few machine specific code. The code contains a 'Makefile' appended as a comment. This Makefile can be extracted after downloading and be saved as a separate file using your editor.

Usage: sunpos

Download sunpos.c and report any stories of success or failure to thomas@spahni.ch.


Delay and Date Calculation with Shell Scripts

Program Names: jd, dow, dt, delay, easter

This is a package of 5 shell scripts to handle delay and date calculation easily from the command line. They should run on any Linux/UN*X system with a "bash" or original "Bourne Shell".

These programs do:

All five shell scripts can be downloaded by clicking the following links, but don't forget to set the downloaded file to executable like "chmod a+x jd".

Download jd,  dow,  dt,  delay  and   easter
and report any stories of success or failure to thomas@spahni.ch.


Calculate relative humidity

Program name: relhumidity

This is an example how to use the bc calculator in a shell script. The program calculates relative humidity from temperature and dewpoint.

View the code relhumidity.html or download relhumidity and report any stories of success or failure to thomas@spahni.ch.


Calculate dewpoint

Program name: dewpoint

This is an example how to use the bc calculator in a shell script. The program calculates dewpoint from temperature and relative humidity.

View the code dewpoint.html or download dewpoint and report any stories of success or failure to thomas@spahni.ch.


Show nesting level of braces in a TeX file

Program name: nesting

Show the contents of the input file on STDOUT, each line preceded by a number indicating the nesting level of braces '{}' valid at the end of the respective line.

TeX syntax is used. Braces in comments are not taken into account.

Download the source package with a right click on nesting-1.0.tar.bz2.


Text based user frontend for the MySQL database

Program name: dbtool

dbtool is basically a shell script for interactive access to MySQL. Menus are presented in nice windows thanks to the dialog utility. A patched version of dialog-0.6z supporting some basic editing functions is included in the package. It should still be compatible with the original version but not with newer versions of dialog.


Time accounting and invoicing system

Program name: timon

timon is a shell script making use of the MySQL database. timon means Time Is MONey. Time and expenses spent on projects for various clients may be stored and detailed invoicing is generated from the data.

This code is still alpha, but it's actively maintained and works pretty well. Expect new versions frequently. You need MySQL 4.0.6 or better and the TeTeX package to run 'timon'. Some basic knowledge of TeX is required to design your own letterheads for invoicing.


Mommsen: Römische Geschichte (transcription from HTML to TeX)

Program name: mommsen.sh

Theodor Mommsen's famous work "Römische Geschichte" (Roman History) has been made publicly available in HTML format at Project Gutenberg. A similar version is available at www.zeno.org. My script will convert the sources from Project Gutenberg into TeX language for typesetting and printing. It makes extensive use of the sed editor and regular expressions.


Calculating sequences of the Collatz Conjecture

Program name: collatz.c

Lothar Collatz suggested in 1937 that the following repeated operation on any arbitrary positive integer N:
— If the number is even, divide it by two (N = N/2)
— If the number is odd, triple it and add one (N = N*3 + 1)
will eventually transform N to 1. Starting from 1 is an infinite loop 1 - 4 - 2 - 1.
David Barina verified that all numbers N below 270 converge to 1 (see his list).

The Collatz conjecture is one of the most famous unsolved problems in mathematics. However, it's fun to play with it. You can search for regularities and irregularities or for values of N with a high number of steps required to reach 1. Some other vales of N have a high maximum trajectory point (= highest value of N reached during the sequence). Eric Rosendaal published a list of records.

Examples:
N=27STEPS=111MAX=9232
N=9016346070511STEPS=886MAX=252229527183443335194424192
N=14022512981985STEPS=1569MAX=79988992024030705960

The program is written in "C" and must be compiled on the users machine. It links to the GNU Multiple Precision Arithmetic Library (GMP) and is capable of dealing with quite large values of N. A sample logfile for N=2 to N=1000000000000 is included.

Download collatz-1.0.6.tar.xz, compile, have fun, and let me know of any faster or better versions you created from it.


Back to the Top
Back to my Homepage