Not Giving Up

April 3, 2011

I’m having a few technical issues, filming in the sim; namely keeping replays longer than 35 minutes, and exporting movies. This is delaying the next attempt at flying KAUS-KMSY, but I still plan to do it. The recipe will be Sausage & Beans.

Sabine Overflight at Dusk

Meanwhile, here’s a test video I’ve produced for the KAUS-KMSY flight. Yes, it’s cheesy… Yes, it’s montagie….


Austin to New Orleans

March 19, 2011
ICAO:KAUS-KMSYTNV DCT DAS DCT ORG DCT 3014N09310W LFT

I never made it off the ground for the first flight — There was an engine fire!

Engine fire on 17R


Adventures in Virtual Flight

March 18, 2011

This blog has more-or-less become a repository for technical tips, but I thought it might be interesting to diversify content by combining and sharing some other hobbies. I’ve decided to combine flight simulation with culinary arts by flying to a location and then preparing a meal from that area and sharing the recipe. Actually, there’s a high probability that the recipe will have been tested and prepared by Katie, though I’ll probably do a few myself. You should know that I am not a “Real-World” (RW) pilot. I have been a sim enthusiast for 20 years, though. Realism is important.

My Rig:
  • X-Plane 9.6 (Available from www.x-plane.org for $29)
  • CH-Products Yolk and Petals
  • Saitek throttle quadrant.
  • Real-world weather and air traffic control by VATSIM.
  • Real-time. A 3 hour flight in real life takes 3 hours in the sim.

The greatest dilemma was what aircraft I should use. I needed something with reasonable range and speed, and good navigation equipment.  Short takeoff and landing is a big plus, and I don’t want anything too large either (I’m not John Travolta). In my hanger that left me two choices:

Read the rest of this entry »


☘ Easily combine documentation and debug logging in shell scripts

January 8, 2011

Inside your script, include this function:

function about_to
{
	step_action="$@"
	[[ "$verbose" == "yes" ]] && echo "$step_action" >&2
}

What this does is stash all the arguments away in the $step_action variable, and if $verbose is ‘yes’ then it will also print the arguments to stderr.

You use the function in your code to document what you are about to do:

about_to say hello
echo "hello"

about_to say goodbye
echo "bye!" && exit 0

If your $verbose variable is not ‘yes’ then the output is

% myscript.sh
hello
bye!

But if you set $verbose, you get different results:

% verbose='yes' myscript.sh
say hello
hello
say goodbye
bye!

☘ Simple Cleanup Script

November 21, 2010

The older and more curmudgeonly I get, the less patience I have for the point-an-click interface.  This is evidenced by the amount of time I spend in Terminal.app and Gnome-Terminal.

I like the idea enabling numbered backups – several tools obey the $VERISON_CONTROL environment variable, and others have their own settings to enable similar behavior. This results in keeping multiple numbered backup files when files are edited.

The downside of all these backup files are that they clutter up your home folder area.  The rm command and/or find commands can help keep things management, but one slip of the finger and you can easily wipe out the wrong files, for example:

Remove all temporary files in $HOME:

rm -rf *~
# OOPS! DON'T RUN THESE:
rm -rf *  # OOPS! Deleted all files in $PWD
rm -rf ~  # OOPS! Deleted all files in $HOME
rm -rf ~* # OOPS! Deleted all users' home folders!!!

Clearly, there are too many ways that the correct command can be mistyped, possibly resulting in disaster.  Because of this, I use my own cleanup.sh script which runs the correct command:

#!/bin/bash # listing of cleanup.sh
pushd $HOME
# Remove automatic backups
find -name *~ -exec rm '{}' \;
find -name \#*\# -exec rm '{}' \;
# Remove stale tmps
find /home/jagipson/tmp/ -atime +7 -exec rm '{}' \;
popd

This script (which I keep in my $PATH) recursively from $HOME removes all the backup files, plus all the dead emacs temporary files lying around, plus deletes everything in my personal tmp folder that hasn’t been access for 7 days.

How do you, my vast, numerous readers manage cleaning temporary files and backup files?


☘ Automatic Image Scaling Using Snow Leopard

March 31, 2010

You know how I feel about the function of Operating Systems, and you’ve already seen how I use automator to create print services.

This tutorial will guide you step-by-step in creating a folder-actions based setup that will automatically resize your large digital photos into three sizes for use in your website. I use this myself, because one of the sites I work on contains paintings which are presented as thumbnails, large view, and giant light-box views, but even the ‘giant light-box’ views are not as large as the original photos.

So when the setup is complete, you’ll have a folder hierarchy that resembles this:

ss1.jpg

Once your setup is complete, you drop your large-format photos into the Raw folder and you will find that scaled *_large, *_main, and *_thumb versions automatically appear in the Large, Main, and Thumbs folders. Read the rest of this entry »


☘ Create a ‘whois’ command that works on selected text

February 17, 2010

First launch Automator and create a new ‘service.’ Configure it as follows and save it as Whois in your ~/Library/Services folder:

whois1.png

Now from any application select an IP address or hostname. Right-click (or command-click) and on the context menu, select ‘Whois.’

whois2.png

In a moment or two, a whois.txt will open in TextEdit with the results.

whois3.png

☘ House Finches Return

January 21, 2010

The house finches make a return to the backyard.

DSCN1483.JPG

☘ How to Print a PNG to an Email (instead of PDF)

December 31, 2009

For you Snow Leopard users who can send a PDF by email via the Print menu of your favorite application (see screen shot 1), but would rather send a PNG (see screen shot 2), this tutorial is for you.

Screen shot1.png

screen shot 1

Screen shot2.png

screen shot 2

  1. Launch Automator and create a new Print Plugin workflow.
  2. Name the new workflow Convert to PNG and mail.
  3. Add a newRender PDF Pages as Images action.
  4. Append a new New Mail Message action.
  5. Your workflow should resemble this:
    Screen shot 3.png
  6. Save your workflow in the PDF Services folder inside your Library folder, inside your Home folder.

☘ The Operating System as a Killer App

November 28, 2009

The more I keep looking for the perfect applications for personal productivity, I am increasingly concluding that the Operating System should be fulfilling that role. The author of The UNIX Philosophy1 states:

Make each program do one thing well. By focusing on a single task, a program can eliminate much extraneous code that often results in excess overhead, unnecessary complexity, and lack of flexibility.”

The tar command comes to mind. It has a very limited scope, but performs its task well. The lack of features in tar resulted in a smaller, more maintainable code base. With fewer lines of code it is easier to debug.

The UNIX Philosophy continues on to state several other pillars of UNIX thought, including the principle of filtering data, rather than originating it:

Make every program a filter. The fundamental nature of all software programs is that they only modify data, not create it. Therefore, they should be written to perform as filters since they are filters.

In UNIX and Linux, this is accomplished frequently using the common, cheap, ubiquitous and lovely standard input, standard output (and occasionally standard error) files with redirection and pipes, as long as the programs being used operate as filters. On OS X, this is accomplished using AppleScript (for those programs which have exposed good AppleScript API interfaces). This functionality seems to be missing in Microsoft Windows (I hope I’m wrong… Am I?).

The point is that most Productivity Super-Apps throw in every conceivable feature. This feature-bloat weighs down the program, making it take too much disk storage space, too much memory and too many processor resources resulting in a sluggish application, even on modern equipment. After all that effort, the programs still do not fit the user’s desired feature-set. The only way for a user to acheive a 100% feature-requirement match is for the user to write his or her own productivity suite from scratch, or assemble the bits and pieces (a mail program from here, an address book from there, a notebook/journal from elsewhere) and fill in the missing parts will some glue code using the operating system’s available tools ( AppleScript and Automator or $STDIN / $STDOUT ).

When an operating system allows programs to be scripted, then I opt for smaller, less-capable, less-expensive programs with fewer bugs, and add in only the things I need to do repeated tasks more efficiently. More on this later.

1 The UNIX Philosophy by Mike Gancarz; Butterworth-Heinemann 1995; ISBN 1-55558-123-4


Follow

Get every new post delivered to your Inbox.