A small, comfortable nook pertaining to technology, current events, astronomy, and sailing and navigation.

Tuesday, March 17, 2009

Blog Relocated

I have permanently moved this blog to my own server. Please point your browser at http://garychambers.com/nq/ and update your bookmarks. I know, I know -- I'm being presumptuous. That would require someone to actually have bookmarked this blog in the first place.

Friday, February 6, 2009

Multi-Year Interactive Computer Almanac (MICA)

I just picked-up a copy of one of the later versions (2005) of the Multi-Year Interactive Computer Almanac (MICA). It's a product of the U. S. Naval Observatory (USNO) published by Willmann-Bell and it provides high- (and low-) precision astronomical data for many celestial objects. I have always been intrigued by this rather pricey product and wondered about its capabilities, and I thought it would be a valuable addition to my computer-based astronomy repertoire. Unfortunately, I'm somewhat disappointed by what I've seen so far. I don't want to rehash the MICA features/capabilities in this post, so please visit the USNO site to review them.

I use a Mac and my complaints begin there. The Mac version is built only for the PowerPC architecture. I have an Intel Mac and, although it runs without modification, it uses Rosetta, which is a PowerPC emulation mode that Apple wisely included in the newer Macs to ensure that users' weren't stuck with useless software. The Intel Macs have now been out for several years and it's trivial to compile a universal binary that will run natively (and much more quickly and efficiently) on either platform.

Second, the entire application requires the use of the mouse. I am a keyboard person; I always have been and I always will be. The mouse is nothing more than a necessary evil when in a GUI-based environment. I'd much prefer the slightly steeper learning curve of a command line interface to obtain the information.

Finally, it runs only in the GUI, so accessing the data remotely requires the overhead of a network-based remote desktop utility such as Apple Remote Desktop, VNC, or Microsoft Remote Desktop Connection.

Overall, it's an adequate application for its intended purpose. The data may be very accurate, but it isn't easy to get to it.

Friday, January 30, 2009

Cisco ASA 5505 Static Assignment Issue

I've been fighting with a Cisco ASA 5505 for the past couple of days trying to pass traffic on a site-to-site VPN. One of my Google searches hit on this blog entry. This entry is a note to myself to remember (which I probably won't) that if you use a Cisco ASA 5505 with only a single outside IP address, ensure that you use the interface keyword when creating static routing entries. For example, the following entry will not work:

static (inside,outside) tcp 12.34.56.233 smtp 192.168.1.188 smtp netmask 255.255.255.255

The following entry, however, will work:

static (inside,outside) tcp interface smtp 192.168.1.188 smtp netmask 255.255.255.255

I'm familiar and comfortable with several Cisco routers and switches, but I have to admit that the ASA 5505 is one of the most confounding network products I've had the opportunity to use. That being said, I would not consider using networking hardware from anyone except Cisco.

Wednesday, January 14, 2009

Word Of The Century

I saw this word for the first time on Van Helsing's outstanding Moonbattery blog:

kakistocracy:
Government by the least qualified or most unprincipled citizens.
This word so accurately describes government at every level: local, state, and federal. We have absolutely no representation whatsoever; only greedy, corrupt, self-serving, self-aggrandizing hacks! I see no relief in sight -- especially what awaits us after January 20, 2009.

Israel vs. Hamas

In Michael Graham's superlative article on the war with Hamas, he articulates how I feel about the situation far better than I ever could.

Apple iPod Touch

Best. Electronic device. Ever.

I've had my iTouch for just about six months now, and I continue to be amazed by how extraordinary this device is. I bought the 16GB version and I'm completely satisfied with it as far as the storage space is concerned. In the interest of full disclosure, I also have a 60GB iPod (I have no idea what G (generation?) it is, but it does video), so storing my entire library on the iTouch was never a consideration.

Master Of My Domain

For the past couple of years, I parked my domain at an inferior hosting service (I'll divulge the name of the organization if you e-mail me) and did almost nothing with it. That's about to change! Years ago, before the dot-com implosion, I was the co-owner of an ISP up in Maine. My business partner (and friend) and I ran an exceptional operation and built a fiercely loyal customer base over the nearly three years we were in business. As you might expect, I grew accustomed to (and took for granted) having firsthand, direct access to an internet-connected network. Worse, however, was having to relinquish control of it to the party to whom we had sold the entire operation.

It's been almost ten years, but I will soon have complete control over my own personal domain (garychambers.com), and I am nearly as excited now as I was the day my friend and I opened the doors to our company.

Monday, June 23, 2008

VMware Fusion Command Line Access

I'm a command line person -- I always have been and I always will be. I am a very big fan of VMware Fusion and use it daily. I was pleasantly surprised to discover that I could control it by the command line and decided to write a quick script to do just that:

#!/bin/bash

VMWARE="/Applications/VMware Fusion.app/Contents/MacOS/vmware"
VMSTORE="/Users/gwc/Documents/Virtual Machines"

function vm_list()
{
local VMDIR="${1}"

IFS=$'\n'
[[ -z "${VMDIR}" ]] && exit 1
VMLIST=$(/bin/ls -1 ${VMDIR})
for VM in ${VMLIST}; do
# echo ${VM} | sed -e 's/\.vmwarevm$//'
echo ${VM}
done
}

[[ -x ${VMWARE} ]] || \
{ echo "** ${VMWARE} not found or not executable"; exit 1; }

# If user doesn't specify a command line option,
# show what's available, then exit

if [[ ${#} == 0 ]]; then
echo "-- Available VMs --"
vm_list "${VMSTORE}"
exit 0
fi

OLDIFS=${IFS}; IFS=$'\n'
USERVM=$(echo ${1} | /usr/bin/tr '[:upper:]' '[:lower:]')
VMLIST=$(vm_list "${VMSTORE}")

for VM in ${VMLIST}; do
VMLOWER=$(echo ${VM} | /usr/bin/tr '[:upper:]' '[:lower:]')
if [[ $(/opt/local/bin/gexpr match "${VMLOWER}" ${USERVM}) > 0 ]]; then
MATCH=1
break;
fi
done

if [[ -n ${MATCH} ]]; then
echo "-- Starting ${VM} Virtual Machine"
${VMWARE} "${VMSTORE}/${VM}"
RC=${?}
else
echo "-- No matching VMs"
RC=1
fi

echo "-- Exiting with code ${RC}"
exit ${RC}

One of the unintended benefits of using such a method of controlling VMs is the ability to easily break out of the VMware Fusion configuration process. If your VM doesn't require a GUI to interact with it, simply press CTRL-C and the configuration process quietly goes away leaving your VM running and freeing some valuable memory.

Friday, February 22, 2008

Notable Quote, February 22, 2008

A group of Americans, retired teachers, recently went to France on a tour. Robert Whiting, an elderly gentleman of 83, arrived in Paris by plane.

At French Customs, he took a few minutes to locate his passport in his carry on: "You have been to France before, Monsieur?", the customs officer asked sarcastically. Mr. Whiting admitted that he had been to France previously. "Then you should know enough to have your passport ready."

The American said, "The last time I was here, I didn't have to show it."

"Impossible. Americans always have to show your passports on arrival in France!"

The American senior gave the Frenchman a long hard look. Then he quietly explained: "Well, when I came ashore at Omaha Beach on D-Day in 1944 to help liberate this country, I couldn't find any damned Frenchmen to show it to!"

Monday, February 18, 2008

Notable Quote, February 18, 2008

When in England at a fairly large conference, Colin Powell was asked
by the Archbishop of Canterbury if our plans for Iraq were just an
example of "empire building" by George Bush.

He answered by saying, "Over the years, the United States has sent
many of its fine young men and women into great peril to fight for
freedom beyond our borders. The only amount of land we have ever
asked for in return is enough to bury those that did not return."

It became very quiet in the room.

Friday, February 15, 2008

Wash Your Hands, Please!

I apologize in advance for a potentially pathetic digression, but I need to make a passionate plea: After using the restroom, PLEASE WASH YOUR HANDS! I'm no Adrian Monk, but gentlemen, do yourself (and all with whom you have contact) a favor and wash your hands after using the restroom in any capacity -- especially after the big deuce. Thank you!

Thursday, February 14, 2008

Bit Reversal By Bit-Banging

Here's an interesting C function to reverse the bits of an unsigned integer:
unsigned int reverse(unsigned int v)
{
v = (((v & 0xaaaaaaaa) >> 1) |
((v & 0x55555555) << 1));
v = (((v & 0xcccccccc) >> 2) |
((v & 0x33333333) << 2));
v = (((v & 0xf0f0f0f0) >> 4) |
((v & 0x0f0f0f0f) << 4));
v = (((v & 0xff00ff00) >> 8) |
((v & 0x00ff00ff) << 8));
return((v >> 16) | (v << 16));
}
I really need my reverse(0x77ff0300) in the morning! Sorry, bad joke (and for the odd word-wrapping)...

Version Control With Subversion

Over the years, I've used more than a few methods of version or source control -- SCCS, RCS, CVS -- but I discovered that each had its weaknesses, and eventually stopped using them altogether. Then, about six months ago, I set aside my preconceived notions about learning yet another version control system (at the risk of wasting time), and began investigating Subversion. I cannot overemphasize how glad I am that I did. In addition to being significantly easier to use than CVS, Subversion provides atomic commits. This means that either the commit succeeds in its entirety, or it doesn't commit at all (i.e. all commits in the current context are rolled-back). This is a vital piece that insures the integrity of your data (e.g. if you experience a network or disk failure during the commit). Subversion also supports WebDAV access to the repository. This means that, in addition to direct access via the file:// method, and svn:// or svn+ssh:// protocol, a properly-configured Apache web server will allow access to the repository via http:// or https:// protocols.

If you're on the fence about whether or not Subversion can help you, or if you are seeking an experienced opinion about using it, leave a comment and I'll get back to you as soon as I can.

Pretty-Print With Enscript

Here's how I obtain high-quality, syntax-colored prints (or PDFs) of my source code files:
#!/bin/bash

ENSCRIPT_OPTS="--fancy-header=emacs -H3 -j -f Courier7"
ENSCRIPT_OPTS="${ENSCRIPT_OPTS} --color -2 -r -E"
ENSCRIPT_OPTS="${ENSCRIPT_OPTS} --mark-wrapped-lines=arrow"
ENSCRIPT_OPTS="${ENSCRIPT_OPTS} --ul-position=+125-25"

if [ $# -lt 1 ]; then
echo "Usage: ..."
exit 1
fi

FILE=${1}

enscript ${ENSCRIPT_OPTS} ${FILE} -o ${FILE}.ps
Enscript knows about dozens of types of source for colorizing its output. Once I've created the Postscript output, I can either print it as it is, or generate a PDF file for a handy on-screen reference.

Wednesday, February 13, 2008

Quick Powers Of Two Table

Here's a quick and dirty method of generating a table of powers of two at the command line:
#!/bin/bash

echo "Powers of two (2):"
echo;
for i in `seq 0 34`; do
printf "2**(%2d) = %11d\n" $i "$(( 2**$i ))"
done
echo;
Note that this does require BASH.

Thursday, September 27, 2007

Amazon MP3

I just downloaded my first album from the new Amazon MP3 service, and I have to say that I'm impressed. Here's what I've discovered:
  1. Most individual MP3 files cost $0.89 (compared to Apple's iTunes $0.99).
  2. They have no digital rights management (DRM), so you are free to play the music without limitations.
  3. The songs are encoded at 256kbps (compared to Apple iTunes' 128kbps). As an added benefit, I noticed that the files on the album I downloaded were created with LAME 3.97, a superior, free MP3 encoder.
One minor annoyance is the requirement (for entire albums, anyway) to install Amazon's MP3 Downloader software. It's easy to install, fairly straightforward to configure, and integrates seemlessly into iTunes (on my Mac). The downloader saves and organizes the music downloads in its own directory, plus instructs iTunes to add the song to your library as each file is transferred. This creates duplicate downloads, but that could be a benefit for iTunes users since it fragments some albums by placing individual music files in separate directories.

Based upon this single experience, I can say with a fair amount of certainty that I'll use the Amazon MP3 service before Apple's iTunes.

Wednesday, September 26, 2007

When Will The Moon Be There Again?

While driving this evening sometime between sunset and the end of civil twilight, my two-and-a-half-year-old son noticed a blood-red, rising full moon. Upon seeing it, I immediately felt disappointed for not having my camera with me to photograph it in the midst of this particular farmland scene. I began to wonder when the full moon would be in that position again, which led me to begin thinking about how to solve the problem.

In theory, it seems there should be a fairly straightforward solution. First, determine the apparent azimuth and elevation (which may or may not be that easy; I cheated and used Planetarium, my Palm-based astronomy application) at the time of observation. The solution could then be determined by iteration or by rewriting the position determination equations to accept the azimuth, elevation, and position information. The former seems easiest to implement, but much more resource-intensive. The latter seems exceedingly difficult (at least for me) to implement, but would be preferred because of the ability to perform a direct calculation of the solution. If I have some time, I'll try to solve the problem using both methods.

Monday, September 24, 2007

JPL Ephemerides CD-ROM

A few days ago, I received the JPL Ephemerides CD-ROM I recently purchased from Willmann-Bell. Being a big fan of VSOP87, I hope to implement this theory in C in a short amount of time.

Sunday, September 23, 2007

Autumnal Equinox

As of this morning at 09:52:05 UT the sun reached the autumnal equinox -- where it crosses the celestial equator and, in theory, for the second time of the year, the amount of darkness is equal to the amount of daylight. This point also marks the beginning of my favorite time of the year. Welcome fall!

Wednesday, September 19, 2007

VSOP87 C Application Programming Interface (API)

On and off [albeit more off than on] over the past few years, I've been developing an astronomy C library. The crown jewel (in my opinion) is the VSOP87 portion of it since it solves the equations using the complete theory which is comprised of thousands of terms for each celestial body. A couple of days ago, I decided it was time to blow-off some of the dust and start working on it again. I did so by starting to write some documentation for the entire library using Doxygen, an open-source tool designed for such a task. If you're interested in seeing what I have done so far, point your browser at http://www.garychambers.com/orbital-docs/ and let me know what you think. I'm also trying to determine the license under which I should release the code, so I'd also appreciate any input you might have in that respect.