Photos from Memorial Dr.

Today was the first warm day in quite a while here in Cambridge, so I decided to go out (*gasp!*) and walk along Memorial Drive and shoot a few pictures with my camera.

For some pictures, I used my Tiffen Sky filter (blocks UV).  On others, I used my polarizing filter (also from Tiffen) to get bluer skies.  On some, I used both, but the vignetting was particularly bad…  I have to zoom in quite a bit (~3x) to prevent it, or I can just crop the picture later.

View the Full Set

Customizing MOC to Perfection

Every month, I take a screenshot of my desktop and post it to the Arch Linux forums.

I included a shot of my music player of choice, MOC, in the background.  But after looking at it for a few seconds, I realized that I have spent months using this music player without giving it a proper color theme (looks really ugly, doesn’t it?).  Furthermore, the default keymap for MOC isn’t very Vim-friendly.

So, after a little work, I achieved some nice results.  First of all, I remapped a bunch of keys to make things a bit more comfortable for Vim users like myself.  Then, I set to work building a nice theme that would work well with my particular terminal colors (MOC only supports the 8 terminal colors).  The result is this:

Perhaps others might find my configuration useful.  So, I’ve included the config files below.  First of all, I should note that my terminal colors do not support the “standard notion” of what they should be, primarily because I chose to get rid of “cyan” and make that color a dark bluish color.  The terminal colors are almost identical to the dante.vim Vim colorscheme, a theme I encountered a while back (I’m currently using a modified version of lucius.vim as my colorscheme, but it is very similar).  Here they are:

Color    Regular Intense
------------------------
Black:   #1B1D1E #343737
Red:     #F92673 #FF5996
Green:   #86B413 #B8E354
Yellow:  #FDB436 #FEED6A
Blue:    #55C5D6 #8CEEFF
Magenta: #8952FE #9C6EFE
Teal:    #465457 #899CA1
Gray:    #CCCCC7 #FFFFFF

Foreground: #FFFFFF
Background: #000000 (semi-transparent)

Here’s a quick table showing the resulting colors:

Colorscheme and Keymap

If you have similar kinds of colors, you might be interested in the MOC theme.  Download the following file and drop it in ~/.moc/themes.  Then, you can also added into your config file as the default theme.

http://jwcxz.com/other/mocp/dante

And, here is the Vim-like keymap:

http://jwcxz.com/other/mocp/keymap

You can just drop this file in ~/.moc and then edit your config file to use this keymap file.

Global Keyboard Shortcuts and Remote Status Display

I chose MOC over MPD because of its nice lightweight footprint and tidy environment.  MOC actually supports remote operations so you can easily bind your keyboard’s media keys so that they control the player.  I also want to be able to display the current song and progress in my Conky setup (see screenshot).  It turns out that this is also pretty easy.  I have been using the following configuration for a while now:

First, to control MOC, I bound these commands to my media keys:

Play/Pause: [[ -z $(pidof mocp) ]] || mocp -G
Stop:         [[ -z $(pidof mocp) ]] || mocp -s
Next Track: [[ -z $(pidof mocp) ]] || mocp -f
Prev Track: [[ -z $(pidof mocp) ]] || mocp -r

And to display the current song information, I used the following lines in my .conkyrc

${if_running mocp}${alignc}${execi 10 mocp -Q '%song\n%artist\n%album'}
${execbar mocp -Q '%cs/%ts*100' | bc -l}${endif}

This will display the song, artist, and album each on their own lines.  Below that, it will display a progress bar.

The Keyboard Saga

Short story: static electricity sucks.

Slightly longer story: static electricity really sucks.

Longish story: For about a month, I have noticed that the metallic rim around my Kensington keyboard is susceptible to ESD.  Furthermore, I realized that this rim is not grounded because occasionally, a shock would cause the keyboard to reset.  So, I’ve generally been careful about using it and have tried to touch something metallic before sitting down to type.

Inevitably, I forgot to do this and blew out the keyboard driver’s brains one unfortunate night.  So, I scrambled to find a new keyboard and came up with another Kensington keyboard.  I like scissor-switch keyboards (the kinds used in laptops) because of the low travel distance.  Kensington seems to be one of the few makers of scissor-switch keyboards nowadays.  This keyboard has no exposed metallic parts, so I was a little more confident about purchasing this unit.  Another option would have been to purchase the same keyboard that I had before and then connect the metallic rim to the ground port of the USB input.

Anyways, overall, I like the feel of it and I have gotten used to the significantly lower travel time, but I don’t know if my typing is quite as fast as it was on my previous keyboard yet.  The arrow keys are really small, which makes them hard to reach quickly if I’m in Insert mode in VIM and need to move quickly (so I’ve started to use ^O + movement more often).  The keys feel a bit flimsy compared to my last keyboard.

Unfortunately, the little plastic mat that is underneath all of the keys was not built to size and bulged up right underneath the CTRL key (which I consider to be extremely important).  So, I had to cut away a piece of the mat to make things work again.  Unfortunately, this now exposes the (surprisingly dirty) metal beneath it, so the keyboard is again exposed to ESD…  Hopefully this part is grounded (though I’ll probably try to add some kind of layer of insulation when I get a chance).

It’s clear that this keyboard just doesn’t have the quality of my last one.  The keys are thinner and feel much cheaper.  For comparison, I took off the CTRL keys.

However, I’m getting used to the slight differences in this keyboard and my typing speed has improved dramatically since I first got it.  The low travel distance isn’t really a problem for me; I haven’t accidentally hit any keys because of it.

PGP Key Changed

For some reason, I’ve been using 1024-bit DSA keys to sign my mail.  It generally suggested that keys of at least 2048-bits be used for good security, so I have revoked the three keys I have been using (one for each email address) in favor of a single 3072-bit DSA/ElGamal key, which I will use from now on to sign (and encrypt if possible) all of my email.

The key ID is B1CFED68 and the subkey is 7C692AD9.  The key fingerprint is 475D 276D 25C4 43C9 9DD3 CB95 8213 A610 B1CF ED68.  You can find the public key on the MIT PGP Key Server (pgp.mit.edu) or you can get it here on my website.

*adjusts tinfoil hat*

A Few Photos of Gloucester, MA

I haven’t had a chance to play with my camera too much lately, so this was a good chance to mess around with my polarizing filter.  Unfortunately, there is some unintentional vignetting occurring with the filter, but it’s pretty cool to see the intensity of the sky change as you rotate the filter.

CD V-700 Geiger Counter

The CD V-700 (Wikipedia) is a geiger counter designed to detect low levels of beta and gamma radiation.  The device was designed by US Civil Defense and manufactured by numerous companies.  I managed to score one on eBay from someone who had purchased them from a state surplus sale of some kind for just $55.  This particular geiger counter was built by Electro Neutronics, but hasn’t been calibrated since 1998.  So far, I have only been able to pick up some background radiation present in my room, but I have some uranium glass marbles at home that I’d like to test.

February Desktop Screenshot

Mostly the same as last month, but I’ve switched my music player to MOC.  I also used MPD a bit, but I like this one better.

Optical Trapping and the Momentum of Light

Recently, there have been a few posts on LaserPointerForums with regards to a curious little experiment.  A laser is focused as close to the aperture as possible and is pointed straight up at the ceiling.  Then, a piece of very soft black plastic or felt marker tip is burned.  With some luck, a small particle will burn off, and then seem to float in mid-air.  In fact, it looks something like this:

The marker is pointing roughly to the particle in question.  It is not smoke and this fact can be verified because you can actually move the laser around gently and the particle will follow it!  I made a brief write-up in one post on why this works, but I decided to play around a bit and get some better quality pictures and a few videos.

Here’s the essence of why this phenomenon occurs.  A principle called wave-particle duality states that light (but not only light) can be represented as both a wave and a particle; that is, it can have both wavelike and particlelike characteristics.  When you observe Airy disks and other diffraction patterns, you are observing wavelike phenomena; the light behaves just as if you were to take a tank of water and perform the same experiments.  However, light can also behave like a particle–the term for a particle of light being a photon.  Particles have an energy and momentum associated with them and it was shown that photons do indeed have this property.  For more information on wave-particle duality, I recommend the HyperPhysics slides on the subject.

Because photons have an associated energy and momentum, they can impart a force onto other objects.  This is exactly what is occurring in the picture above!  The particle is experiencing a set of force vectors from the laser light which cause it to find an equilibrium position very close to the waist of the beam.  Here is an interesting explanation of this phenomenon, known as optical trapping.  To borrow a diagram from Wikipedia’s excellent optical tweezers article:

When a particle moves out of its equilibrium position, a restoring force will push it back just above the waist.

To illustrate further, I’ve taken a video (720p :D ) and a few pictures:

Edit: It seems as though my video has made it to Reddit and LiveLeak:

http://www.reddit.com/r/science/comments/auh5b/optical_trapping/

http://www.liveleak.com/view?i=995_1264499775

Black Squirrel

A black squirrel lives somewhere in our yard and stops by the bird feeder in the mornings for a meal.  Wikipedia has a nice article on these curious creatures.  This was also a good way to test the 18x optical zoom of my camera.  Unfortunately, by the time I was able to make the necessary adjustments to the camera to improve the contrast, he ran off.

tmux – A Powerful, Intuitive Alternative to screen

Almost everyone who uses the command line extensively knows about GNU screen.  It is a clever utility that allows you to manage your workflow in many ways.  When you start a screen session, you will be presented with a virtual terminal where you can do your work.  You can launch multiple terminals in a single session and quickly switch between them and even copy and paste between them as well.

I have used screen for a while, but it’s a little too intensive for my needs.  Its layout is not very sane by default, but it can be configured extensively.  So, when I heard about tmux, an alternative to screen popularly used in OpenBSD systems, and its reputation for being a more elegant solution.

One unfortunate bug with tmux is its failure to render transparent backgrounds in 256-color environments.  Apparently this issue is due to the inability to “erase” backgrounds.  Fortunately, the latest CVS revision fixes this problem, so I’ve been able to switch entirely from screen to tmux.

Here is my tmux config.  I haven’t worked on keybindings yet (I’d like to make them more vim-like).  Here are some screenshots from my laptop: