Archive for July, 2009

Summer vacation in the moutains

We took a week off while the girls were “tracked out” of school, and we went to the mountains.

Saturday 2009-07-18

We eased into our vacation by driving half-way to the mountains, stopping in Winston-Salem to visit my parents. We spent some time with my two grandmothers. And then we came went for a walk around the neighborhood, pointing at all of the houses where my childhood friends used to live, and we caught up on what we had heard from everyone.

Sunday 2009-07-19

We packed up the Family Truckster and headed to the mountains by way of Hiddenite, NC. This town is famous for the minerals found there, and was named after an associate of Thomas Edison, who was sent there to find a particular type of mineral. Instead, he found a completely unknown type of stone, which ended up bearing his name. The town later changed its name as well.

The gem mine in Hiddenite is a lot of fun for smaller kids. But older and more cynical kids might wonder why such large stones can be found in such soft and freshly ground up dirt. One older and more cynical friend took his kids to see a geologist at NC State University, who told them that the rocks they had brought back from the Hiddenite mine were not native to North America. Hmm.

From the mine, we headed up through Lenoir and into Blowing Rock, which would be our home for the next week.

Monday 2009-07-20

Our plan for the day was to head over to Grandfather Mountain, but we were in no hurry to get started. So instead, we explored the local park in Blowing Rock, and we found a couple of geocaches. It had been a long time since we had done that as a family, and the two we found did not disappoint (one “virtual” and one multi-stage cache).

We finally headed out to Grandfather Mountain, where low cloud occasionally obscured the peaks. The swinging bridge seemed even higher than it is because of the visible cloud moisture blowing up one side of the mountain and through the gap between the peaks. Sydney showed no restraint as she ran on the rocks, while the rest of us imagined the impending disaster. We took plenty of pictures, and finally made our way down to the museum, where we saw such attractions as: lunch, bears, a bald eagle, and fudge.

While we were there, we ran into a guy from my office… hey, isn’t that against the rules?

Tuesday 2009-07-21

On Tuesday, we went into Boone to see Mystery Hill, which can best be described as a tacky little tourist trap that aspires to be something bigger than it is. The main attraction is the room that is built at a 45-degree angle, which is a much more compelling optical illusion that you might expect. The rest of it was like a very small science museum, with some funny mirror tricks and a large hula-hoop bubble station. Next door is a museum that houses items from the first half of the 20th century… a good chance to explain things like a record player to my two digital-age children.

The main attraction of the day was Tweetsie Railroad. They had a lot of little shows and shops and carnival-style rides and even a petting zoo. But at center stage was the steam locomotive, which takes a short trip around the park, with a cowboys-and-indians adventure thrown in.

We wrapped up the day with a couple of geocaches, a good way to discover some of the local parks.

Wednesday 2009-07-22

On Wednesday, we decided to get out of town and into the woods, with a day hike at Linville Falls. Our trip the Blue Ridge Parkway was slow because of very thick fog. And when we reached the Linn Cove Viaduct, it seemed like the road just ended at a cliff.

There is a very nice National Park at the Falls, with very wide and comfortable trails that take you to several vantage points to see the falls. This was the perfect setting for a family hike… a fairly high climb, but an easy grade and lots of rewards along the way. We took a lot of pictures at the peak, and then returned back for a picnic lunch.

On the trail back out, I noticed that there was a geocache hidden near one of the overlooks (I did not expect this, since geocaches are usually not allowed on National Park land). So I had to find it. I was rewarded with a geocoin whose last stop had been in the United Arab Emirates.

We had our picnic lunch, and then headed down into the valley to Linville Caverns (Foong asked me when we stopped what that smell was, and then we realized that it was our burning brake pads). The cavern was cool, in more ways than one.

And as we left, it started raining. Good timing. We took an extremely scenic route back to Blowing Rock. Part of that was due to our GPS being stuck in “shortest distance” mode — it did not seem to matter that part of that route was really some hillbilly’s driveway.

Thursday 2009-07-23

On our last full day in the mountains, we decided not to do any one big thing, but instead to see a bunch of smaller things. So we drove to the small town of Valle Crucis. The big attraction there is an old general store with an entire room devoted to candy (our girls each got one handful of whatever they wanted).

We drove to Fosco, NC, where we found an “Earth cache” — a geocache that is educational, and somehow related to some natural earth formation. This one required us to take a picture of a mountain that looked like it had a face on it.

We went back to Blowing Rock, where we explored the old manor house at Moses H. Cone Memorial Park. Finally, we saw The Blowing Rock, which is a rock outcropping on the windy side of the mountain. This was the last of many, many gift shops that we visited during the week.

Friday 2009-07-24

We woke up on Friday and packed up to leave. We headed back a different way than we came, a route that seemed to be one long ramp that goes straight down the mountain. On the way back, we stopped in Wilkesboro at Moravian Falls, a slide-type waterfall with a small campground next door (and, of course, a geocache).

When we got back to Winston-Salem, we were reunited with our dog, Maggie, and we got to spend another night with Mimi and Pops.

Saturday 2009-07-25

Saturday was “tech support” day, helping Mimi and Pops with digital photos, backups, and how to post to Craigslist. Eventually, we tore ourselves away from the fun and returned home.

When we got home, we gave the girls a rock tumbler, which we used to polish the stones that we had found in the Hiddenite mine.

Plant my key

Here’s a neat little script that I developed at “the oven place”. It “plants” my SSH key on a remote machine, so I can get in later without entering a password.

#!/bin/sh
user_at_machine=$1
# plant my SSH key on the target machine
cat $HOME/.ssh/id_rsa.pub | \
   ssh $user_at_machine \
      "if [ ! -d .ssh ] ; then mkdir -m 700 .ssh ; fi ; \
      cat >> .ssh/authorized_keys"

All of the action takes place in one single line (which I broke up here so it would wrap OK). It takes your public key from the machine you’re on, and it pipes it into an SSH session, which you’ll have to type your password into. On the remote machine, it creates a .ssh directory if it needs to, and then it appends your public key to an authorized_keys file.

The next time you log in to that remote machine, you will not need to enter your password.

Counting down with ‘pv’

Here’s a neat tool.

Ever start some long task, and wonder how much longer it has to go? There’s a small utility called pv (short for “pipe viewer”) that counts time and bytes through a pipe, and it shows a nice progress bar.

Here’s how I used it to watch a very large file being compressed (note the use of the most excellent lzma compression utility.

$ pv < winxp.vdi | lzma > winxp.vdi.lzma
1.79GB 0:21:50 [1.49MB/s] [===>          ] 10% ETA 3:11:02

Note that if I had used a different pipe notation, pv would not have been able to read the input file size, and therefore it could not make estimates of remaining time. So instead, it shows you the “Knight Rider” scanning eye for progress.

$ cat winxp.vdi | pv | lzma > winxp.vdi.lzma
5.48MB 0:00:04 [1.27MB/s] [  <=>         ]

Nice tool. Thanks, Andrew!

Save that thought…

At work, our build process can produce thousands of lines of code, and sometimes the important bits can slide off of the terminal’s scrollback buffer.

So I created an alias that logs all output of the shell. It’s nothing fancy… it’s just a call to script with an argument to put the time and date in the filename. But it goes a step further, actually exec-ing the script command, so you do not have to exit twice when you’re done (once to exit the script, and once to exit the original shell).

alias log='exec script "/home/alan/logs/terminal-$(date +%Y%m%d-%H%M%S)-$$.log"'

Still, this requires you to think about logging before you start your work.

Since I normally launch my shell windows from a Gnome application launcher icon, I decided to modify that launcher so that EVERYTHING is logged.

On Gnome, right-click on the panel at the top and select “+ Add to panel…”. Then select “application launcher” and pick out the gnome-terminal from the menus. You’ll have a little terminal icon on the top Gnome panel.

Right-click on that terminal icon and select “properties”. It should say “gnome-terminal”. Change it to the following:

sh -c "exec gnome-terminal -x script $HOME/logs/terminal-$(date +%%Y%%m%%d-%%H%%M%%S)-$$.log"

The double-percents are so the launcher will not interpret them.

Now, when you click on that application launcher icon, a new terminal window will open, and all output to that terminal will be logged.

Firefox: invalid or unsupported form of compression

Occasionally, I have been seeing the following error in Firefox (v3.0.11).

The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.

It occurs frequently when I am using a SOCKS proxy. One web site which happens to exhibit the problem more than others is Bruce Schneier’s blog.

The work-around that seems to work for me is to do a “Tools / Clear Private Data…” and select Cache, Cookies and Offline Website Data.

There’s a lively discussion on the Mozilla support forum, but no one seems to know what the source of the problem is.

Peek-a-boo!

Please welcome the newest addition to our family, a hermit crab named “Peekaboo”.

He comes from Wings at Atlantic Beach. He lives in a plastic shoe box with a sandy floor, a water dish to bathe in, and LEGO’s to crawl on. He likes to be sprayed with water, and he likes to crawl up Audrey’s arm.

peekaboo

Two heads are better than one

At work, I got a new PC with two monitors, and I have really enjoyed having the extra screen real estate.

When I worked from home this week, I decided that I needed to try hooking an external monitor to my HP laptop. I was happy that, unlike the last time I tried this a few years ago, it “Just Worked” ™ without any special calesthenics on my part.

I wondered why Gnome decided to put the panels (the bars at the top and the bottom) on the external monitor instead of on the laptop display. To me, it seemed more natural to have the “start” menu (actually, the “Applications, Places, System” tri-menu) on the external display instead of right in front of me.

It turns out that this is really easy to fix. Gnome has this configuration tool that is roughly equivalent to the Windows registry… yuck. You can access it using either gconf-editor or gconftool-2. Inside that deep mine of settings, there is one jewel that tells where the panels should go. So I wrote a quick script to move the panels from one monitor to the other and back.

#!/bin/bash

m=$1
if [[ ( ! -z "$m" ) && ( ( $m -eq 1 ) || ( $m -eq 0 ) ) ]]
then
   menu="/apps/panel/toplevels"
   panels=$(gconftool-2 --dump $menu | \
      grep '<key>.*/monitor</key>' | \
      sed -e 's/^.*<key>//g' -e 's/</key>.*$//g')
   for p in $panels
   do
      gconftool-2 --set "$menu/$p" --type integer "$m"
   done
else
   echo "usage --> $0 [ 0 | 1 ]"
   echo "moves gnome panels to monitor 0 (VGA) or 1 (LCD)"
fi
exit 0

The Quick Lounge

In my line of work, I occasionally have the luxury of working from home. When that happens, I prefer to run all of my applications on my desktop PC at the office, and I use “NX” to connect remotely. Specifically, I use the NoMachine NX server on my Ubuntu PC at work (although I am considering trying the open source “freenx” server), and at home I use the “qtnx” client on my laptop, which also runs Ubuntu.

This works pretty well, except my desktop environment does not like the stress of changing resolutions back and forth. It seems that the “panels” in Gnome get confused about where to place the different applets and widgets, since at one time it may have a lot of room, and at another time it may be more cramped.

I got tired of scooting my quick-launch icons around one-by-one, and so I was looking for a container where I could keep them together and move them around as a group. I tried the “drawer” applet, which is available in Ubuntu by default, but that was not quite right. I don’t want to open and close the drawer every time I launch something… I just want the icons to always be there in a group.

I found an applet called “quick-lounge-applet” which really fits the bill. One wonders whether the author meant to say “quick launch”, but perhaps had a poor grasp of English. Either way, this little applet does a great job of keeping my quick-launch icons together in a group, and it can be moved around easily.

After installing the applet (using the normal apt-get install quick-lounge-applet, I found that it was not listed in the “+ Add to panel…” menu. Apparently, Gnome needs to be prodded before it recognises newly-installed applets. There is a simple work-around. Simply re-start the service that keeps track of that stuff: killall bonobo-activation-server. The service will re-start, and there will be a new entry in the “+ Add to panel…” menu called “Launchers List”.

Now, if you’ll excuse me, I am in a hurry. I have some quick lounging to do.

Go to Top