Bryan Dongray's
UNIX & DOS tools
C, shell, perl

(all free to download)
 
Source Last update
Size (bytes)
Description
byte.tgz
C source
1995-10-18
2368
Binary edit/view file
Opens a file to edit bytes in place (although can be used to append bytes).
Useful for modifying/viewing a binary file.
dayago.tgz
perl script
2008-03-04
1072
Find out how long ago a date was (or will be)
Converts date YYYY-MM-DD into how many days ago (or "will be" as a negative number).
Also given a number of days ago returns when was date was (or "will be" - if a negative number).
dexit.tgz
sh script & C program
2009-06-09
875
Run command in prompted loop
Useful as a frontend to (for example) xterm, so when the command die that is running in an xterm window, you can still see the error - and optionally re-run it just by pressing return, or change the command via CTRL+C. I use it for my ssh sessions.
Requires C program (provided) which runs subprocess giving back default interrupts.
diskseek.tgz
C source
2010-07-13
1862
Disk seeking/testing
Has a few different options to sequentually go from one end of a disk (or file) to the other, or it can start at both ends moving the offset closer to the middle, or it can randomly skip around the disk. The default is to go sequential, but at the start and mid-point, ending at the mid-point and the end.
By default it is also in read-only mode, use the -w option to write over your disk, but without the -n option, it will read back the data written and compare it.
It does its best to be synchronous, but sometimes you need the -o option to close and open the disk after each write, especially when using raw devices.
easter.tgz
C source
1995-12-15
873
Work out Easter day
It's been accurate every year so far.
I found the algorithm in the mid 1970's, coded it in Basic on an ancient home computer, and it worked. Since then it got coded into C - as seen here.
fakeftp.tgz
sh source
2009-02-19
472
Fake FTP server
Does what you expect from an FTP server, except never logs anyone in.
Useful when you need to appear like you have a working FTP server, but don't want one really!
Add a xinetd.d ftp file, eg:
service ftp
{
  socket_type = stream
  wait = no
  user = nobody
  server = /usr/local/etc/fakeftp
}

and restart (or signal a HUP to) your xinetd.
fields.tgz
perl source
2005-01-27
1262
parse fields in input
An input stream of the format:
Identifier na=va nb=vb nc=vc ...
can be trimmed down to just view named fields requested.
Handles quotation on input, and provides as necessary on output.
gethost.tgz
perl source
2003-04-15
534
Lookup hostname or IP
A bit like "nslookup" or "dig", although much much simpler, without any extra features, but importantly it does not use any DNS backdoors to get its results, it just uses standard libaries (most code does) to lookup hostnames or IPs.
Output looks like a normal hosts file.
Handles multiple results returned in an expected way.
hdr.tgz
perl source
2003-04-23
326
Show/remove email/web headers
Very simple, but useful as a pipe command to only see headers, or to strip off headers of messages.
killtree.tgz
perl source
2009-01-22
922
kill process and children
Kill PID, but also any children, and any children's children, etc.
latency.tgz
C source
2002-09-14
3254
Test network latency
Uses the "echo" port (port 7) to send (and time) a byte going to a remote host... and back. It gives a real sense of how long an interactive session (eg over ssh or a VPN) will feel like (far better than ping can).
mkpass.tgz
perl source
2003-07-11
556
make crypt'd password
(for UNIX and webservers)
Useful to make htpasswd files for Apache.
parallel.tgz
perl source
2008-12-16
1866
Run command in parallel
Like xargs, but runs one command with each stdin line (as arg to command), but (unlike xargs) runs those commands in parallel (as parallel as requested). As one finishes it will start another, keeping up the parallelism.
Useful for pushing files out in parallel, or running remote commands (or ping) to many remote systems (if input is list of hostnames).
Useful on multi-cpu machines to run parallel compute intensive commands, on given input values.
There is the -a option to allow a given number of stdin lines per parallel command.
Hint: Use $PARALLLELID for unique ID (eg tmp file identifier to stop parallel writing to the same output file, then cat/sort those tmp files into one)
Included is a "pingall" script showing how to quickly ping all systems on your local network.
Be careful with this code, you can flood your own system!
pos.tgz
C source
2002-08-22
1020
Find position of text in binary file
Simple text searching in any file (or raw disk), but missing "backtracking" - sorry.
rand.tgz
perl source
2003-04-15
477
Random number
As every high school student gets to write.
rm.tgz
C source
2003-04-15
3908
Remove command - with secure option
There is also "srm" out there, but I wrote this one years ago.
Uses the Gutmann 35 pass sequence (although this code only does one pass of random numbers, and does a final write of all zeros as its last sequence) to really erase a file and hide the magnetic pattern on various types of disk.
This code also tries to do the same on the filename, file times, permissions, and owner too. Really hiding all details of the file you want to "shred" securely.
sleep.tgz
C source
2002-11-10
1679
Fully featured sleep command
Allows the use of subsecond values, the ability to give time in hours and minutes (and days), or combinations, and allows to sleep to a specific time of day.
So you can sleep for 1h 30m, or until 3am (without having to calculate number of seconds).
It can also be told to sleep forever (without putting lots of 9's).
Is compatible with normal sleep command.
sparse.tgz
perl source
2005-04-21
1019
Format columns into a table
Convert a column of pairs of values, into a table.
eg
INPUT:
A,1
B,2
A,3
B,3
OUTPUT:
,1,2,3
A,Y,,Y
B,,Y,Y
When formatted:
123
AYY
BYY
There is an optional 3rd column as the value to show in the output, instead of "Y".
superlative.tgz
sh script
2012-02-08
427
Display superlative value
Script to search given files and/or folders for the oldest, newest, smallest or biggest.
syncup.tgz
perl source
2011-10-21
3131
directory synchronization
Sync two directories by creating, copying, deleting, setting times, owner and attributes of any files, directories, and symbolic links in the destination that were added, changed, or deleted in the source tree.
Perl enables the code to work for UNIX and DOS.
thru.tgz
C source
2003-02-04
5421
Network forwarding/listening
Written years ago, and is sort of similar to the more recent popular program "netcat".
This program can listen on a port as well as send to remote port, to/from a local file or program, but can do both at the same time (a port forwarder). It can even listen on 2 ports as a strange backwards port forwarder, for those times when you want to startup a TCP connection but from the remote end (eg through a firewall).
It can handle 3 (or more) way connections, but it's a bit hokey.
In loop mode, it's a one port inetd.
It is only TCP though.
timeout.tgz
C & perl source
2003-03-08
1933
Timeout command
A way to run a command and have it stop after a specified time. I found it useful for scripted "rsh" (or ssh) commands.
uu.tgz
perl source
2003-07-12
688
Decode UUencoded
uuencode still exists and needs a manual way to read (or write) such a format.
Also useful to encode/decode "basic encryption" of web authenication.
wipefree.tgz
sh script
2003-03-08
804
Securely erase disk freespace
A script using my "rm" code (above) and creates big files until the disk is full, and then erases them securely.
End result your disk freespace is securely erased.
x10cmd.tgz
C source
sh script
2009-12-13
2195
Control X10 firecracker
Linux program (set SUID root) to control the x10 firecracker, an RS232 serial device which can control upto 256 power outlets.
Also a simple queueing system so no x10cmd commands conflict (eg if via cron, etc).

DongraysBryan Dongray → UNIX/C/Shell/Perl/DOS tools Powered by Linux Validated by HTML Validator (based on Tidy)