Saturday, August 11, 2007

Life with Linux

I haven't been very good about posting lately. I've recently started a new job and there's lots to learn. I'm dealing with Packet over SONET (POS) now which is somewhat unfamiliar.

I was given my choice of development platforms at the new job - Windows or Linux. I've grown quite tired of the poor performance, hangs, and crashes which seem to come with using Windows a a development platform so I opted for Linux. That also kept me from having to go through the effort of setting up the CygWin utilities to get a reasonable development environment. With CygWin I can almost tolerate Windows. Without, Windows is just too painful to use. The standard command line tools in Windows are not terribly powerful. The telnet client is buggy and poorly featured. And the command shell is decidedly substandard with its broken pipes and terribly weak wildcard support. Give me regular expressions any day!

I had to install Fedora 7 on the laptop my company provided on my first day there. The Linux install has gotten much better over the years but the Fedora install still isn't as good as the Ubuntu install for finding hardware and picking appropriate drivers. The Fedora install did not recognize the Nvidia video adapter which the laptop has. Fortunately, Fedora now comes with an easier method of updating software called yum.

Once I figured out how to use yum, finding the Nvidia driver was easy. With the Nvidia driver installed, the laptop is now able to drive the 22" LCD monitor I now have at work at its maximum resolution. I always like to drive monitors at their highest resolution because it allows me to fit more information on the screen at one time. That makes me a lot more productive because I'm not forced to switch constantly between windows. What would be ideal is multiple large LCD monitors like Al Gore's setup. Maybe someday I'll find that sort of dream setup.

After living with Linux full time for about 6 weeks, I still like it. Would I recommend it to my parents? Not quite yet, but it's getting close. For most tasks, it's pretty easy. But having to fool around with command line tools like yum and using su to change to the superuser mode (yeah, yeah, I know it's the root user but I'm not assuming everyone who reads this is a Unix type) is sufficiently cryptic to keep me from giving it a hearty recommendation to normal users.

Less we assume that everything has been sweetness and light, running Linux has not been without a few gotchas. Being a long time geek, I can't help fiddling to try to improve my setup. Fedora/Gnome has an optional window manager called Compiz which features a very cool way to switch between virtual desktops. It's got a 3-d cube you can rotate by holding down the Ctrl and Alt keys while dragging the mouse. The cube rotates to show the next virtual desktop. It's much cooler than the desktop switcher which sits in the tray. Of course it relies heavily upon the capabilities of the video driver. Fedora by default checks for updates every time you book. Being a compulsive geek, I always want the latest and greatest software running so I always apply these updates as soon as they're available. Last week, an update to the nvidia driver broke Compiz's rotating cube feature which left me with no way to switch to another virtual desktop. That will teach me to use new features. I uninstalled compiz and went back to the simpler and less elegant method of switching virtual desktops. I've learned my lesson... at least for the time being.

Wednesday, July 25, 2007

MST3K

The guys from Mystery Science Theater 3000 (AKA MST3K) have a new project called The Film Crew Online. It's sort of a continuation of the work they did with MST3K. I'm giving it a recommendation based on how funny MST3K was.

Michael J. Nelson, the former head writer of MST3K, also has a series of MP3 files you can buy and play at the same time you're watching DVDs. They're available at a site called RiffTrax. It's a funny concept.

Mike Nelson has also written a few really funny books. My favorite is Mind Over Matters though Mike Nelson's Movie Megacheese was pretty entertaining.

Tuesday, July 24, 2007

Cory Doctorow

Lately I've been listening to Cory Doctorow's podcast available from both his website CrapHound.com as well as from iTunes. On his podcast he frequently reads from his works in progress as well as some of his older stories. I've been finding them immensely entertaining. If you like Cory's work as much as I do, please buy his books to help support his efforts. He's a real stand-up guy. He used to work for the EFF, he gives lectures on the absurdity of DRM around the world, and he licenses many of his works under Creative Commons. All that and he edits one of my favorite blogs, BoingBoing. I don't know where he finds the time to do all of that but I'm glad he does.

Saturday, July 14, 2007

Creating strong passwords

Gina Trapani has posted a great article on LifeHacker showing how to choose strong passwords that are also easy to remember. I've been using a variation of this method for a long time and have made slight modifications based on advice I've heard from security experts.

I use 2 classes of passwords. The weakest is used for the multitude of web sites which ask you to create an account but which store no financial or personal data about you. I reserve the strong passwords for web sites which store data which could cause me financial harm if it were to be discovered.

Choose something which works for you but which offers reasonable strength. Use the Password Strength Meter at SecurityStats to test the strength of your chosen method to make sure your passwords can't be broken too easily.

Sunday, July 08, 2007

Steve Wozniak interview

10 Zen Monkeys has a great interview with Steve Wozniak (aka Woz), a personal hero of mine.

Woz is a true geek success story. He made his money from sheer technical prowess. The elegance of his designs are the stuff of legend. Through it all he's remained a genuinely nice guy, seemingly unaffected by his success. Just last week he was handing out t-shirts while waiting in line for an iPhone.

If you get the chance check out his book, iWoz. It's a great read about a fascinating guy. Another great book about the early days of Apple is Revolution in The Valley: The Insanely Great Story of How the Mac Was Made. The stories will give non-engineers a taste of what it's like to create something from scratch.

Wednesday, June 27, 2007

miniature engines

I just found a New York Times article which brought back fond memories. It's about people who build scale model replicas of engines as a hobby. One guy built an amazing 1/6 scale model of a Chevy V8. These really must be seen to be believed. The pistons are not much larger than a quarter. The rocker arms (the parts which help the valves open and close) are incredibly tiny. It's hard to believe these small engines actually run.

I mentioned that seeing these brought back fond memories. No, I didn't used to build working engines though I did spend many happy hours in my younger days building model cars. This reminded me of one of my favorite books of all time, Trustee from the Tool Room by Nevil Shute. Shute is my favorite author of fiction, bar none, and Trustee is an excellent example of his best work. It's the story of an engineer who builds and writes articles about miniature machines including engines. He undertakes a very long journey due to a strange twist of fate and develops some well deserved self confidence along the way. Sadly, like many of his books, it's no longer readily available in America. You can still get many, if not all, of his books from Amazon UK though.

Sunday, June 24, 2007

vi macros

Many years ago I learned vi, the visual editor which came with Unix. At the time it was one of two full screen editors readily available on nearly every version of Unix - the other being Emacs. For some reason, the vi commands seemed more intuitive to me. This was probably because I'd previously spent a fair amount of time using a PC editor distributed by IBM called "PE" (which stood for personal editor). In any case, it turned out to be a fortunate choice because vi quickly became available for every computing platform I used. Emacs was also ported to the same platforms but had higher resource requirements (memory and disk space) than I could afford on my hobbyist budget.

I wouldn't recommend anyone not already familiar with vi go through the steep learning curve to learn its somewhat cryptic commands. For those of us who have gone through that painful learning experience, the commands become second nature.

The end result is that I've been using vi for about 20 years and have come up with a few macros I use to save time. These are two character macros which help me perform various operations on blocks of text. My favorite vi port, vim, has many additional commands such as visual block commands which I use frequently. People learning vim and not needing to switch back to a more standard version of vi will probably not find these terribly useful. However I sometimes still need to edit files on Sun servers where vim is not readily available, so I find my macros pretty handy.

Here's a list of the block macros I use most often.

\m - marks beginning of line block
\y - yanks from beginning of line block to current line
\d - deletes from beginning of line block to current line
\p - pastes block previously yanked or deleted to current line
\i - indent block by shiftwidth
\I - indent block by 1 character
\u - unindent block by shiftwidth
\U - unindent block by 1 character

Here are the actual macro definitions. In the following definitions, the ^M is entered by typing a Control-V (which causes the next character to be entered without any special processing) followed by a Control-M (also known as a carriage return).

" delete lines (from mark to cursor pos. - uses b mark, b buffer)
map \d mb"ad'a`b
" indent one shiftwidth (which I have set to 4 characters)
map \i :'a,.>^M
" indent (1 char)
map \I :set sw=1^M:'a,.>^M:set sw=4^M
" mark beginning of a line block (uses the a mark)
map \m ma
" paste lines previously yanked or deleted at cursor pos.
map \p "aP
" unindent one shiftwidth (4 char)
map \u :'a,.<
" unindent (1 char)
map \U :set sw=1^M:'a,.<^M:set sw=4^M
" yank lines (from mark to cursor pos. - uses b mark, b buffer)
map \y mb"ay'a`b