Here I collect Linux utilities that I have written that you might find useful.
Abbreviation for rsync -rltE --chmod=ugo=rwX, i.e., preserve data but use destination default security settings. cp2 has replaced cp as my copy command.
| File | Size | Modification time |
|---|---|---|
| cp2 | 45 | 2005-10-24 16:37:44 -0400 |
setexec makes a file executable or nonexecutable by changing the appropriate x permissions according to the same smart algorithm I contributed to rsync. cleanexec is a wrapper that makes a file executable if and only if file(1) says the data is executable; you might find find . -type f -exec cleanexec {} \; useful.
| File | Size | Modification time |
|---|---|---|
| setexec | 1007 | 2006-03-18 14:10:57 -0500 |
| cleanexec | 92 | 2006-06-22 09:46:35 -0400 |
Shows just about all information about a file except its data.
| File | Size | Modification time |
|---|---|---|
| stat2 | 807 | 2005-10-04 10:22:51 -0400 |
A TeX wrapper script that makes TeX compiling fit more nicely into build processes. For example, it exits nonzero immediately if an error occurs, and it repeats until a fixed point is reached in order to handle LaTeX references correctly.
| File | Size | Modification time |
|---|---|---|
| retex | 1209 | 2006-07-12 17:10:07 -0400 |
ftc packages a file tree in a single file of a simplistic format that I designed, and ftx extracts such package files. They have the same purposes as tar -c and tar -x respectively but have no bells or whistles. They handle binary files safely, but a package of only text files is itself a text file.
| File | Size | Modification time |
|---|---|---|
| ftc | 580 | 2006-08-11 00:15:40 -0400 |
| ftx | 752 | 2006-08-11 00:15:43 -0400 |
gitar ("git archive") uses the git backend to make really small packages out of file trees with lots of redundancy. ungitar unpacks the packages; it requires ftx.
A .gitar package consists of an ftc package containing a bare git repository whose HEAD is the original tree and whose objects are all stored in a single pack. Hence, git will represent similar files in the original tree as deltas.
gitar is great for compressing together several versions of the same piece of software. I had seven versions of my custom rsync lying around, each about 585 KB as a tar-bz2 package. I unpacked them all inside a single folder and gitared that folder; the resulting gitar package was only 865 KB.
Note (2008-06-01): A while ago, git gained a standardized binary format for "bundles"; I should change gitar and ungitar to work on bundles.
| File | Size | Modification time |
|---|---|---|
| gitar | 1683 | 2006-08-11 00:17:34 -0400 |
| ungitar | 334 | 2006-08-11 00:20:48 -0400 |
patchsync synchronizes a trunk, a branch, and a patch that contains the differences between the two. If the trunk or patch changes, it updates the branch; if the branch changes, it updates the patch. I developed patchsync to help me follow branches of rsync, but I no longer use it for that purpose. Depending on your situation, you may prefer a more sophisticated patch-management tool such as StGIT.
To set up a patchsync staging directory, run:
patchsync --new trunk patch branch where-to-create-staging
Then, to synchronize, run:
patchsync staging
Read the gigantic comment at the top of patchsync for much more information.
Patchsync files below are named for their versions; I recommend renaming the one you download to just patchsync.
From 2006.12.16 to 2006.12.24, a development version of patchsync was mistakenly identified as version 2.2. As of 2006.12.24, the real version 2.2 is posted.
| Description | File | Size | Modification time |
|---|---|---|---|
| patchsync version 2.4 (current) | patchsync-2.4 | 15377 | 2007-07-05 17:40:59 -0400 |
| patchsync version 2.3 | patchsync-2.3 | 15512 | 2007-01-07 12:00:43 -0500 |
| Really patchsync version 2.2 | patchsync-2.2 | 15579 | 2006-12-16 14:45:17 -0500 |
| patchsync version 2.1 | patchsync-2.1 | 15468 | 2006-12-15 22:34:44 -0500 |
| patchsync version 2 | patchsync-2 | 15410 | 2006-12-14 17:13:11 -0500 |
| patchsync version 1 | patchsync-1 | 2895 | 2006-09-03 13:39:32 -0400 |
Continusync is a perl script around inotifywait and rsync that performs continuous mirroring, as suggested by Buck Huppmann. It is currently experimental and rather inefficient, but it does appear to work in simple cases. If you want to use it, I would be much obliged if you improved it as necessary and sent me the improved version.
| Description | File | Size | Modification time |
|---|---|---|---|
| current version of continusync | continusync | 7228 | 2007-08-07 16:15:35 -0400 |
This is a firefox wrapper script that creates and uses a disposable profile. You can make it harder for people to correlate your activities across multiple Web sites by browsing each site with a separate Firefox profile created by this script. This script was inspired by the Facebook Beacon outrage.
To use this script, install it in your $PATH and name your master Firefox profile (from which the disposable ones will be copied) 00000000.master; then just run firefox. Your mileage may vary.
Last update 2007-12-02: Initial posting. Seems to work.
| File | Size | Modification time |
|---|---|---|
| firefox | 1283 | 2007-12-02 16:22:23 -0500 |
ntfsresizecopy copies an NTFS filesystem from one block device to another, resizing it to the size of the destination device in the process. (It uses ntfsprogs.) This is EXPERIMENTAL; after using this script, you should mount the destination read-only and check that everything looks intact.
An expanding copy is just done with ntfsclone followed by ntfsresize. A shrinking copy is done by running ntfsclone and ntfsresize on devices specially crafted with the Linux device-mapper (requires dmsetup and losetup); you may save time by checking first that the shrinkage is possible with `ntfsresize -n -s SIZE SRC'.
The special shrinking technique should be applicable to any filesystem type that has an in-place shrinking command that doesn't write outside the new size. Just change the calls to ntfsclone and ntfsresize; ntfsclone can be replaced by a dd of the beginning of the source for filesystems that don't have a sparse clone command.
| File | Size | Modification time |
|---|---|---|
| ntfsresizecopy | 6934 | 2008-06-01 09:59:42 -0400 |