Saturday, October 22, 2011

Using vi key bindings in Perl's debugger on FreeBSD

Even after verifying that Term::ReadKey and Term::ReadLine were part of my perl distribution:

royce@heffalump$ perl -e 'use Term::ReadKey;'
royce@heffalump$ perl -e 'use Term::ReadLine;'
royce@heffalump$

... and making sure that vi key bindings were listed in my .inputrc:

royce@heffalump$ grep editing-mode ~/.inputrc
set editing-mode vi

... I still couldn't use 'em, as demonstrated by what happened when I tried to use movement keys:

DB<1> testtesttest^[[A

In my research, I discovered that Ubuntu folks were installing a different ReadLine. I eventually found the devel/p5-ReadLine-Perl port, which has this pkg-descr:

Perl 5 ships with a module called Term::ReadLine which is an interface
to command line editing and recall. The version that ships with Perl
is only a stub, and offers little functionality.

This module supplants the Term::ReadLine stubs with real command line
editing and recall facilities, written entirely in Perl. Applications
that use Term::ReadLine do not need to be modified to gain the benefits
of this package; it will happen transparently upon installation.

After installing p5-ReadLine-Perl, I'm up and running.

Monday, September 26, 2011

FreeBSD apr1 upgrade error: Configure: 9904: Syntax error: word unexpected (expecting ")")

I was having trouble with apr1 on a FreeBSD web server. apr1 is used by Apache. The configure script for apr1 was dying with this error:

Performing libtool configuration ...
. / configure: line 9904: syntax error near unexpected token `lt_decl_varnames, '

... which boiled down to:

. / configure: line 9904: `lt_if_append_uniq (lt_decl_varnames, SHELL,,, '

Fortunately, this thread was eventually resolved by someone finding out that they had some libtoo115 files left over, even though it had been deinstalled. I manually removed the extraneous files with:

# pkg_delete libtool-1.5.24
# rm -rf /usr/local/share/libtool15
# rm -f /usr/local/bin/libtool15 /usr/local/bin/libtoolize15

I am now back up and running!

Thanks to Vladislav Staroselskiy for a very helpful post about the FreeBSD apr1 libtool15 problem.

Thursday, August 18, 2011

A little post-1964-earthquake humor

A guest post from my father, for which I asked him to share a story about something that happened after things had mostly gotten back to normal after the 1964 Alaska Earthquake. Dad worked at what was then the 6981st, and is now the 381st Intelligence Squadron on Elmendorf (now Joint Base Elmendorf-Richardson). For those who know the work, the terminology here will be familiar.

...

The Great Alaska Earthquake happened in late March of 1964. 9.2 on the Richter scale. As many folks know, it was devastating to many parts of southeast Alaska.

Sometime after that event, I was on D Flight “tearing traffic” as usual during a swing shift. One of the Flight’s 292X1s was a “goosey” sort of guy. He was diligently working away that evening as I approached his work station from behind, preparing to “tear traffic” from his position. As I came up behind him I reached up and tapped the fluorescent light fixture hanging directly above. This started the fixture swinging. Then, “tearing traffic” in front of him, I got his attention and looked up as if to suddenly notice the swinging light fixture. He saw I was looking up so he looked up too. He saw the fixture moving and before he had any second thoughts, leaped out of his chair and at double time made for the Operations door. He went past other folks diligently working, through the doors, down the stairs, past the Air Police person guarding access to the upstairs Operations area, through the first floor foyer and out the front doors of the building to the flag pole located in the center of the secure compound area.

Once he got there he couldn’t understand why others weren’t there too. He was sure he had quickly reacted to an earthquake aftershock.

When no one else was around except him and the flag pole it dawned on him that perhaps the swinging light fixture had not caused what he thought. He strolled back into the building, up to the Air Police person on guard duty, showed the guard his badge and continued on up to the second floor and back to his position in the Operations area. He did not stop or even slow down to answer anyone’s questions about his rapid departure a few minutes earlier.

By that time I figured that he had an idea who was responsible for his quick-reaction to the swinging light fixture.

I managed to avoid his attempts to find me through the rest of the swing shift.

Damn 202s! Not funny! Be a takin' 'er easy. Ur Dad sends

Sunday, August 07, 2011

Remembering William Sleator

The Sleator family has created a blog for posting memories about William Sleator.

Friday, August 05, 2011

William Sleator, 1945 - 2011

Publisher's Weekly recently tweeted that William Sleator passed away in Thailand on Tuesday, August 2nd. He was 66.

I am a big fan. My default online handle, TychoTithonus, is the name of the main character in his book The Green Futures of Tycho.

I emailed with him a few times, and he signed one of my copies, but I regret that I never met him in person.

His work struck a chord with me in ways that are hard to explain. Some part of my childhood is now written in stone.

Other links about his passing:

Update 2011-08-07: William Sleator's obituary in the New York Times.

Tuesday, July 12, 2011

Wednesday, May 04, 2011

Hawaiian Spam can label contest winner



As some of you may know, I have a collection of SPAM cans. The collector/OCD instinct occasionally compels me to do some web searching for SPAM-related stuff.

This morning, I stumbled upon a brand new can design that renders my collection (temporarily) incomplete.

Hawai'ians are big fans of SPAM. Hormel has been grooving to that vibe, and they recently had a Hawai'i SPAM can label design contest for a special edition the the 25% Less Sodium version.

The winner was announced last week. Congratulations to Hawai'ian artist and designer Scott Kaneshiro of Mililani, Hawai'i! Scott's design was deemed "No Kai 'Oi" (best) by Hormel's judges, and will be used on a special Hawaiian can.

If there's a contest for an Alaskan design, I have a couple of ideas. :-)

UPDATE 2011-05-04 7:05AM AKDT: I found this video of the SPAM can design winner announcement posted by nonstophonolulu. It notes that the can will be available in Hawai'ian stores starting in July, and than Scott won $1000 and a year's supply of SPAM. I also found another entry from the Tasty Island blog.

Wednesday, January 12, 2011

Review of Search Engine Blacklist for Chrome - highly recommended



I was getting really tired of useless quasi-spam in Google search results. It was seriously impacting my productivity (and morale). The tenth time that the same junk domain fools you into selling your eyeballs to it, you really wish that it would die in a registrar fire.

Thursday, December 16, 2010

A Short History of My Shorty



Google Labs has a great new tool called the Books Ngram Viewer. As you can see, the popularity of the phrase "my shorty" in print took off in the mid-1980s.

Side note: Stephanie doesn't believe me that this phrase, currently meaning "my girlfriend", has etymology derived from a phrase for "child" - a diminutive tradition with "my baby" as its most obvious other member. Still researching.

Sunday, November 07, 2010

The best FreeNAS name ever: Meet Atoz.



I've been planning a homebrew NAS system. Most of the parts have arrived, and the system is taking shape. Until today, the system lacked a name, an identity -- a personality.

I'm a sci-fi geek. My home systems are always named after robots and computers -- mostly Heinlein, Asimov and Star Trek. I needed a robot name that captured the idea of redundant storage and archiving. Looking through a list of fictional robots, I found the perfect name, from a character in the original Star Trek episode All Our Yesterdays.

As described at the encyclopedic Star Trek site Memory Alpha:
Mr. Atoz was an inhabitant of the planet Sarpeidon whose sun was going supernova. He was the overseer of a library and the atavachron, a time portal device that he used to transport the inhabitants of the planet into the past in order to escape its destruction. He had replicas of himself to help him in the library. [emphasis mine].

Redundant library robots using history for disaster planning? My choice is clear.

So are my next actions. It is a moral imperative that I order a Mac.

So that I can say that Atoz is helping me to store Time Machine information.


Clever external permalink: xrl.us/mratoz

Sunday, October 24, 2010

Top Ten application, part three

TOP FIFTEEN THINGS OVERHEARD AT THE SUMMIT ON GLOBAL WARMING

15. Plans for a field trip to the brothel in Nevada that draws 10% of its power from solar energy

14. "Can we speed this up? I left my truck running and it's double-parked."

13. "Whoo, put your hand there! Now that's warm!"

12. "Jerry Lewis is the funniest person of all time."

11. "Two large ice waters, please."

10. "Ozone, schmozone. Did you get the keg?"

9. The quiet, gentle lullabye of environmental activists' fists hammering on the inside of 55-gallon drums out back

8. "If the greenhouse effect is going to produce tomatoes like that attendee from Finland, shovel on the coal!"

7. "Got a light?"

6. Members of the hired band arguing about whether or not to play "Smoke Gets in Your Eyes"

5. "Actually, burning sod is a viable alternative to solar energy."

4. "Now you're cooking with gas!"

3. That wacky Dr. Feldman going on and on about his "Pig Methane and Hamhocks" franchising idea

2. "They said that the ice cubes in these drinks came from genuine melted Alaskan glaciers!"

... and the number 1 thing overheard at the Summit on Global Warming:

1. "I love the smell of napalm in the morning."

(Third in a series: part one, part two)

Sunday, October 17, 2010

Top Ten application, part two

Second in a series of retroblogging from 1997.

TOP ELEVEN WAYS TO TELL THAT YOUR SOCKS DON'T MATCH

11. Just "don't feel fresh"
10. Midget chicks at the local dive look the other way when you saunter in
9. "Use the Force, Luke!"
8. One hip wader left behind when buddies pull your drunken a** out of the mud flats
7. "Spiked Vietcong Sock of Death" usually requires stitches
6. Cars always veer to your *left* when night jogging on the median
5. I don't know, but that's the last time I show Michael Jackson where I stash my underclothes
4. Keep having to drop pom-poms to pull up one knee-high, but it won't come up any higher
3. When used as a filter, left sock mysteriously produces decaf
2. That blue-tick hound always goes for the leg with the Smurfs on it whenever you show up at Uncle Carl's trailer

and the number one way to tell your socks don't match ...

1. "But I *am* wearing the other sock!"

Saturday, October 09, 2010

Top Ten application, part one

Back in 1998, I tried out to be a contributor to a humorous web site. To apply, you had to take a seemingly hard-to-be-funny-about topic and make a "Top Ten"-style list about it. I stumbled upon one of them today.

TOP FOURTEEN TOOTHBRUSH-HANDLE STYLES

14. Hari-Kari Combo
13. Hands-Free (with jaw strap; batteries not included)
12. Early Colonial Wood Grain
11. Ribbed (for her pleasure)
10. Hollow-point
9. Shaped-just-like-Ernest-Borgnine-naked
8. Bouffant
7. Self-cleaning (heats to 600 degrees)
6. Flared
5. Louisville Slugger
4. Mark IV (with "stun" option)
3. Dr. Guillotine's Razor-Edge Grip(tm) with realistic Finger-in-the-Sink Action
2. Pre-greased

and the number-one toothbrush-handle style ...

1. Thighmaster

I would have rocked.

Thursday, April 01, 2010

Committing to FreeBSD


After significant effort, I am thrilled to announce that I am now a FreeBSD documentation committer!

I am proud to be part of a history of great design, POLA, and doing things The Right Way. I look forward to contributing in earnest.

Read the official announcement.

Friday, October 09, 2009

A Glorious Dawn - a musical tribute to Carl Sagan



At the age of 8, I was transfixed by Cosmos. Sagan's articulate sincerity was irresistible, and it shaped my view of just about everything.

I actually get a lump in my throat when I watch this video. It makes me want to go work for NASA, or at least contribute to some open-source project that NASA uses.

John Boswell has a keen eye for what Carl Sagan was passionate about: the wonder of the universe. If you are a fan of Sagan, I hope that you enjoy this as much as I do.

Thursday, May 14, 2009

The Bill Paul clause to the BSD license

One of the lesser-known variants. I use "clause" here loosely; it's really in the disclaimer.

THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.

I'm attributing this to Bill Paul based solely on the frequency count in the FreeBSD source tree, though there are others. This sample is from 7.2-RELEASE:

147 ENT SHALL Bill Paul OR THE
28 ENT SHALL THE AUTHOR OR THE
10 ENT SHALL NICK HIBMA OR THE
9 ENT SHALL ICHIRO FUKUHARA OR THE
1 ENT SHALL Ivan Sharov OR THE
1 ENT SHALL David Hulton OR THE

The "THE AUTHOR OR THE VOICES IN HIS HEAD" instances are mostly in some ACL-related code, primarily by Chris Faulhaber. Hard to say which of these are cut-and-paste, and which are deliberate.

Either way, I'm using it from now on. :-)

Saturday, May 09, 2009

Colin Percival's scrypt: a new chapter in the history of encryption


Today at the 2009 BSDCan conference, Colin Percival (of FreeBSD and Tarsnap) announced a new key derivation function called scrypt. I am not a math person by any means - and the slides from the presentation explain it pretty well - but what Percival has done here is phenomenal. I feel lucky to have been there in person for the presentation.

The basic concept is that sequential memory-hard algorithms make dedicated encryption ASICs significantly more costly because they are sequential (difficult to run in parallel) and memory-hard (require a significant amount of RAM relative to the size of the input.)

In other words, making the math hard and difficult to run on ten thousand cores increases the time required, and making the math need a lot of room to be worked on increases the money required to crack the password. This is because it's relatively cheap to put 10,000 encryption-specific CPU mini-cores on a single die, but it's expensive to feed them piles of fast RAM in a small space.

This is nothing short of historic.

Brute-force attacks against encrypted passwords will change overnight - for passwords created after scrypt becomes available, that is. What was once a trivial password to crack becomes decidedly less trivial - literally by an order of magnitude. By Percival's back-of-the-slide-rule math, an 8-character password with good entropy (pretty random-looking) encrypted in .1 seconds (good enough for authentication speeds) will take on the rough order of CAD$4.8M to crack. By contrast, the previous best method (bcrypt) would cost $130K.

Longer strings (source text longer than passwords) become decidedly stronger by much greater factors because the function can spend more time on them, as the user has less of an interactive expectation for file encryption. If allowed to chew on the data for 5 seconds or less, a relatively short English text string encrypted using scrypt would take CAD$210B (vs $47M for bcrypt(!))

This table from the presentation shows the rough cost estimates to crack a string in 1 year (click to enlarge):


The last column may look odd because I've taken this slide out of context. Because the 40-character string is English text, it has decidedly less entropy, and is therefore easier to crack.

This isn't just theory; Percival has published version 1.0 of working FreeBSD demonstration code.

I decided to check it out in its early state. Out of the box, the demo code makes some quick checks of your system to see how much RAM you have, and tries to sanely limit how much it uses - because it can use a lot of RAM, very very quickly. There are also limits on how large a passphrase it will currently accept, as well as other parameters automatically sized based your system's memory size.

On a quick check of the code, the options are:

  • m - maximum memory fraction (default: .5, or 50% of RAM as reported by the hw.usermem sysctl for decryption; .128 for encryption)

  • M - maximum memory in bytes (default: 0)

  • t - maximum time in seconds (default: 5 for encryption; 300 for decryption)

In my testing on a 512M system, I couldn't immediately get it to eat more than 128M of RAM; not sure if this is fully by design, or if I'm passing the parameters incorrectly.
royce@heffalump$ time ./scrypt enc -m 1 -t 20 rand.in rand-scrypt.out
Please enter passphrase:
Please confirm passphrase:

real 0m25.090s
user 0m17.017s
sys 0m0.143s
The resulting file's header may not survive in future versions ... but for now, you can tell where it came from in the first six bytes:
royce@heffalump$ cut -b1-6 rand-scrypt.out | head -1
scrypt
At the presentation, FreeBSD Core Team member Brooks Davis asked a good question about the impact of large volumes of users trying to authenticate simultaneously on a system without huge amounts of RAM. Percival replied that the memory and other options could be tuned to fit the profile of a particular system. These parameters would be stored in the shadow password field, much as the salt and rounds are stored there today.

I look forward to seeing a full-fledged scrypt(3) show up in FreeBSD and OpenSSL ... and I'm sure that the Three Letter Agencies do not.

Thursday, April 30, 2009

update4.freebsd.org via ACS

Speaks for itself (if you speak geek):

$ host -t srv _http._tcp.update.freebsd.org | sort -k8
_http._tcp.update.freebsd.org has SRV record 1 10 80 update1.FreeBSD.org.
_http._tcp.update.freebsd.org has SRV record 1 25 80 update2.FreeBSD.org.
_http._tcp.update.freebsd.org has SRV record 1 5 80 update3.FreeBSD.org.
_http._tcp.update.freebsd.org has SRV record 1 30 80 update4.FreeBSD.org.
_http._tcp.update.freebsd.org has SRV record 1 50 80 update5.FreeBSD.org.
_http._tcp.update.freebsd.org has SRV record 1 5 80 update6.FreeBSD.org.

$ host update4.FreeBSD.org.
update4.FreeBSD.org has address 209.193.13.98

$ whois 209.193.13.98 | grep OrgName
OrgName: Alaska Communications Systems Group, Inc.

I am not authorized to speak on behalf of my employer (as some of you may remember from the May 17, 2002 edition of the ADN), but I'm personally pleased to be helping out with the upcoming release of FreeBSD 7.2!

Update: Note that our update server is only temporary, to help with the expected increased use of freebsd-update(8) for upgrading to the new release.

Also note that freebsd-update selects servers at random; if you're in Alaska, you can use -s update4.freebsd.org to select the ACS server.

Contributing more to FreeBSD

Next week, I am headed to BSDCan. I hope to meet people involved in the BSD family of projects, to learn about what people are working on, to talk about interesting problems ... and to stretch my CS brain that has been occupied by operational issues in the years since college.

But the truth is that I have a larger goal.

(deep breath)

To substantially improve my contributions to FreeBSD.

There. I said it.

I've read that public commitment to a goal increases the odds of success, and this seems pretty public. :-)

So the question is, how? I could use some advice or suggestions, especially from people who have traveled this road. (And if you're in the same boat with me and will be at BSDCan, let me know - I'd love to compare notes!)

So far, my plans for BSDCan are:

  • Spend some time with the FAQs for the topics covered, so that I'm not asking well-known questions.

  • Play with unfamiliar technologies in advance, to have questions ready.

  • At the Getting Started in FOSS session, find some buddies with similar goals - both for the conference and for contributing.

  • Strive to not be too much of a fanboy. :-)


My plans for ramping up in my contributions:

  • Tackling small outstanding problem reports, submitting patches, testing existing patches that are waiting for feedback, and contributing to bug busting.

  • Watching the FreeBSD mailing lists in more depth, looking for problems and practicing figuring out the solutions (and if I can't, find the solution posted and strive to understand it). It's also an opportunity to get a better feel for the culture.

  • Learning SGML so that I can contribute to the docs project.

  • Working through the Deitel & Deitel C book.

  • Use the source, Luke. :-)

  • Find a project that interests me and use it to fuel my C learning.

  • Study the FreeBSD Committer's Guide - I won't need to know most of it any time soon, but it should provide me with a framework to start understand the philosophy of the project in more detail.

  • Ponder the advice from Michael Lucas on becoming a committer (also long term planning).

  • Studying Design and Implementation and Modern Operating Systems.


What other tips or advice do you have?

Update: I'll keep a running list of other suggestions I've gotten below:

Tuesday, March 24, 2009

Ada Lovelace Day: Remembering Grace Hopper


I've always been a fan of Grace Hopper, the US Navy programmer who wrote the first compiler(!), popularized the term 'bug' for computer programming problems, pioneered software validation, and deeply influenced the early design and standardization of COBOL.

Hopper believed that programming in a human-readable language would unlock the potential of computing. She worked hard towards this end, and CS continues to benefit from that effort today.

March 24th, 2009 is Ada Lovelace Day - an international day of blogging to draw attention to women excelling in technology. Maybe you know someone who might have a knack for CS and is looking for a direction to go. Maybe you know a woman in CS, and haven't told her lately how much you appreciate her work.

Female perspectives can enhance many traditionally male disciplines. How can women make CS better?
A ship in a harbor is safe, but that is not what a ship is built for. - Grace Hopper
(More quotes from Grace Hopper)