Monthly Archives: January 2013

True Love Will Find You In The End

It’s amazing how easy it is to do things like this with modern audio editing software… Anyway, I’ve retuned Daniel Johnston’s classic “True Love Will Find You In The End” (watch on YouTube) into a raga asavari scale while teaching myself the software. Here’s the retuned version (or download the file directly here if the player doesn’t show or work):


And for reference, here’s the original (which is much more beautiful) –

Quebec’s “Death With Dignity” Bill

I am so happy (relieved maybe?… “happy” isn’t quite the right word) that Quebec is pressing ahead — finally, after several false starts across the nation — with its physician-assisted-euthanasia laws, protecting from criminal prosecution doctors who give patients all-options-on-the-table end-of-life counseling and ultimately assistance if needed. I know it can be hard to understand for a healthy person — and I admit that for a long time I was opposed to euthanasia (when my headspace was more in the “mental illness leading to suicide” realm) for any reasons because I was so much of the opinion that there’s always a way to fix things, and any option is better than death. But that’s just not true in far too many cases. The fact is there are many people suffering from conditions that don’t offer an acceptable quality of life either in the present, or in some nightmarish immediate future, have no cure or reasonable treatment options, and have no chance of getting better.

As most of you know, in my own case, I’ve been fighting and trying to survive a condition that is not only physically and mentally debilitating — and progressively so — but is incredibly painful. There isn’t a single moment for the last at last three years where the primary experience hasn’t been pain. Imagine that for a moment. We forgive prisoners at Gitmo when they off themselves after being tortured for few weeks. Why do we expect the ill to suffer nobly and indefinitely? Imagine being tortured every single day, from the moment you wake to the moment you somehow get to sleep. Every day of your life, every moment of every day, and not only that but you’re guaranteed that every day it will get worse. Yes, from time to time hope gets dangled in front of you — a new treatment for the condition, a new painkiller, whatever… but none of them work. The pain keeps getting worse. The painkillers, while they may reduce the pain slightly, don’t come close to stopping it, not even long enough to take a single peaceful breath, and bring their own health problems as well — to say nothing of the “war on drugs” putting all sorts of new limitations on your life, drastically cutting down the choices you have in front of you. Your body and mind keep getting chipped away at. Every day you live with both the horror of what is happening to you at that moment, and the even worse horror that you know that it will only get worse. It’s not unreasonable that at some point, knowing that any time you have left before the disease finally runs its course and kills you (and of course the cruelest ones take their time killing you), that you might say “enough is enough.” Even just knowing that option was there would help so much, giving you some small amount of control in a life where control is increasingly taken away.

Under the current system, patients in my condition — and I’m sure there are a lot of us, and more than would publicly admit it, because we’re brought up being shamed into never talking about this stigmatized act — can’t even talk to their doctors about the way they feel, lest they risk being institutionalized, locked up, imprisoned against their will in order to “protect them from themselves”, and risk limitations being put on pain medication that they could overdose on. Conversely, doctors who do speak honestly with patients put themselves at legal risk, both civil and criminal. Patients are backed into a desperate and grotesque corner, forced to consider their options without anyone to talk to, and in the end, often without even a peaceful way out — instead of being helped to slip away quietly into some eternal slumber, they end up either overdosing — which is often unsuccessful, bringing new medical consequences, to say nothing of adding medication restrictions to other patients in the system, or choosing a violent, often painful method like hanging or shooting, adding shock and trauma to the life of the sadness of the loved one that likely discovers their corpse. It’s incredibly cruel to everyone involve, heaping more pain onto a situation that is already painful beyond description.

This euthanasia bill — you can read a little about the latest steps here — still has a long way to go before it’s law, let alone acted on, and it will take even longer before it creeps across other provinces let alone the federal system (and around the world), but it’s a big, big step in the right direction. Obviously in an ideal world, we would never solve someone’s problems by helping them die — the idea is abhorrent — but as the old saying goes, “there are worse things than dying”…

From one of my favorite Byron poems, aptly titled Euthanasia

When Time, or soon or late, shall bring
The dreamless sleep that lulls the dead,
Oblivion! may thy languid wing
Wave gently o’er my dying bed!

No band of friends or heirs be there,
To weep, or wish, the coming blow:
No maiden, with dishevelled hair,
To feel, or feign, decorous woe.

But silent let me sink to earth,
With no officious mourners near:
I would not mar one hour of mirth,
Nor startle friendship with a tear.

Then lonely be my latest hour,
Without regret, without a groan?
For thousands Death hath ceas’d to lower,
And pain been transient or unknown.

Not allowing euthanasia just heaps more cruelty onto the lives of people who have experienced nothing but cruelty until they have nothing left… The sooner this bill starts setting the way for Canada the better.

Various command-line utilities with source code

Sorry I’m so incognito online these days (outside of being away for the holidays). I’m sure the reasons are obvious enough and not worth moaning about.

I figured it was about time I uploaded a bunch of utilities I’ve written and put them all in one place, along with the sourcecode. All of these are written in the excellent PowerBasic Console Compiler (RIP Bobe Zale) and compile under version six. They’re all command-line Windows utilities, although a few of them can be run directly. All are no-warranty use-at-your-own-risk freeware, and as far as I’m concerned the source code is hereby released into the public domain and you can do as you please with it without having to credit me. I’ll upload some more later…

Download tool: clipcalc.exe
Download source code: clipcalc.bas

This tool is a real time-saver. It performs math on the clipboard. You define what operation you’d like to do (for example, subtracting 0.25) and any time you copy a number to the clipboard, the operation is performed and then copied back to the clipboard. This essentially lets you insert an automated calculator into any program, and is extremely useful for performing repetative operations that involve math. For example, if you have to move a set of images 0.125″ to the right, you could specify a “plus 0.125″ operation, and then go through all your images, selecting the current location, pressing Copy, at which point the operation is automatically done, and then pressing Paste to put the new value right back where you got the original value from. This tool is extremely easy to use and very useful.

clipcalc - clipboard calculator
monitors the clipboard and performs math on it
usage operation value [/r]
    operation is * + - / ^
    returns result of {clipboard} {operation} {value}
    [/r] pushes the result back to the clipboard (optional)

Download tool: deperiod.exe
Download source code: deperiod.bas

This tool cleans filenames from a “downloaded” style to something simpler, converting periods to spaces, cleaning dates, and remove extra tags like Xvid.

deperiod - remove periods from filenames (but preserve extension)
 (also removes underscores, double spaces, and normalizes brackets)
usage: deperiod [/m[u|l]] [/c] [/d|/D] [/y[c]] [/k[c]] filespec
include /c before filespec to force each rename to be confirmed
include /d to include directories as well as files, or /D to only do dirs
include /y to look for dates (ie. 4-digit year) and put them in brackets and
 toss everything after that -- ie. "blah 2010 xxx"=>"blah (2010)".
 (valid years are between 1920 and 2020; all others are ignored).
making it /yc forces confirms, but only on files affected by this rule
 (a good idea since /y is more potentially destructive)
include /k (or /kc to confirm) to kill common terms like "Xvid"
include /m to converted to Mixed-Case if all lower- or UPPERcase
 (optionally /ml converts only from lowercase, or /mu for upper)
filespec can be a literal filename or wildcards

Download tool: dirsort.exe
Download source code: dirsort.bas

This tool sort files in a directory into a collection of multiple subdirectories.

by Shannon Larratt /
This tool creates a batch file to move files and/or directories into a new
sorted and ordered directory tree. Run with /? to see command line options.

Usage: dirsort [optionlist]
 /files = only move files
 /dir = only move directories
 /both = move both files and directories

 /newsort = specify that this is a "virgin" sort and all directories are fair game
 /resort = attempt to skip directories from a previous sort

 /skipthe = remove "the" and "a"/"an" from the start of item names
 /theok = treat "the" as a valid part of an item name

 /alpha = sort into simple a-z directories
 /nestalpha = sort into nested a/aa-z/zz directories
 /2alpha = sort into aa-zz two letter alphabetical directories
 /foldersize=## = sort into folders with a maximum average number of files in them
   /bothnames = when using foldersize, include start and end names in dir name
   /dontpad = when using foldersize, don't pad the dir names for matching length
 /selfname=## = sort into directories based on the first ## letters of filename

 /allare0 = when naming/sorting treat all numbers as '0' (the same)
 /unique123 = treat all numbers as unique "letters"

Note: Command-line and manual function can be mixed.

Download tool: findemail.exe
Download source code: findemail.bas

This tool harvests all email addresses mentioned in a file or set of files.

findemail // by shannon larratt //
harvests all unique email addresses from a file or set of files
-> usage: findemail files.ext (wildcards are ok) [/headers]
-> output is to stdio
-> /headers specifies that only from/to addresses should be used
error: file not found or not specified

Download tool: fixcrlf.exe
Download source code: fixcrlf.bas

This tool convert *nix style text files to CRLF delimited Windows files.

This tool makes sure that all linebreaks are "proper" CRLF style.
Solo linefeeds and solo carriage returns are converted.
Usage: fixcrlf filespec
ie. single file use might be "fixcrlf myfile.txt" or multi-file might be "fixcrlf *.xml"

Download tool: killfirstword.exe
Download source code: killfirstword.bas

This tool remove the first word from a set of filenames.

KILLFIRSTWORD: Removes the first word from a set of files.
Usage is:
 KillFirstWord [separator] filespec
 Filespec must be specific (*.* is OK) just to avoid accidental use.
 Optional separator defines a wordbreak character other than a space.

Download tool: nextdir.exe
Download source code: nextdir.bas

This tool move from the directory you’re in to the next one. That is, it goes up a directory, then looks at the subdirectories, and enters the one alphabetically after the one you were just in. Note that it just copies the command into the clipboard, so you need to run this and then past the result into the command line (otherwise windows will move you to the directory, and then move you right back).

NextDir / Shannon Larratt / / / Free Software

Usage: Just type 'nextdir'
Effect: This moves you to the next alphabetical directory. It's the equivalent
    of typing 'cd ..' and then moving into the next directory alphabetically
    from where you just started.

Download tool: numdirf.exe
Download source code: numdirf.bas

This tool rename files inside all subdirectories with numbered prefixes so they can be merged into a single directory and still retain their order.

prefix and number files in subdirectories
usage: prenumfsd prefix-text
files in dir # renamed to "prefix-text ### origfile.ext"
    ### is the directory number, not the file number

Download tool: pren.exe
Download source code: pren.bas

This tool quickly adds a prefix to a set of filenames.

PREN: Prefix Rename
Usage is:
 pren [filespec] ["]prefix["]
 If you want to specify a filespec, it is assumed to include wildcards; * or ? are OK.

Download tool: seriescheck.exe
Download source code: seriescheck.bas

This tool detects files that are missing from sequential numbered sets. That is, if you have a set of files called file001.txt through file100.txt and file099.txt doesn’t exist, this will tell you.

Seriescheck ...
Program to find missing files from numbered sequences of files
by Shannon Larratt / / free software

Usage: seriescheck filename####*.* or filename@@@@*.*
...that is, a standard filemask, where '#' or '@' indicate a digit counter.
...'@' indicates a 0-padded number, and '#' a number that is not padded.

   'image###.jpg' searches for files from 'image1.jpg' to 'image999.jpg'
   'data @@@@*.jpg' searches for files from 'data 0001*.jpg' to 'data 9999*.jpg'

Download tool: shownohtml.exe
Download source code: shownohtml.bas

This quick’n'dirty tool to remove html tags from files (ie. converts html files to text files essentially).

Usage: shownohtml filename.ext
outputs file with HTML tags trimmed to stdio
alternate use with wildcards overwrites files

Download tool: splitmbx.exe
Download source code: splitmbx.bas

This tool splits Eudora mailbox (mbx) files into individual emails (probably works on *nix mailboxes as well).

splitmbx // by shannon larratt //
create a gazillion text files with one email per file, from eudora mailbox(es)
--> usage: splitmbx filename.ext [/s=searchterm]
     *wildcards are ok in filename
     *optional search term means that only emails matching search will be output
     *if searchterm is a file it can be a list of terms, one per line
     *search is case INsensitive
     *in search mode, new mbx files are created, in normal mode txt files per email

Download tool: vcf2txt.exe
Download source code: vcf2txt.bas

This tool converts vcf files to readable text files. So for example, if you use a tool like “Groups” to email yourself a VCF file of all the contacts on your phone, this takes that file and turns it into something easy to read that you can email yourself or print out for backup/archival.

vcf2txt // converts vcf (vcard) files to simple text files
by shannon larratt // // freeware * sloppy and mostly untested

normal commandline usage:
vcf2txt filein.vcf [-o fileout.txt] [options/mode selector]

filein.vcf is the vcf file to load
output file is to the same filename with the extension changed to .txt
 (unless you use the -o fileout.txt option to specify a new name)
options/modes are (default is -ot):
 -os  simple output, name, email, and phone number(s) only
 -oc  clean output, name on first line, supplemental data in following lines
 -ot  total output, output everything know, with labels, excluding photos

Download tool: webdir.exe
Download source code: webdir.bas

This tool convert filenames to lowercase and replace spaces with dashes.

This will make all files lower case and replaces spaces with dashes!