January 2011
2 posts
Overriding the displayed hostname in OS X →
sudo scutil --set HostName <override host name>
August 2010
1 post
April 2010
1 post
3 tags
Openvz pretty printing disk usage
Second verse almost the same as the first.
/usr/sbin/vzlist -o ctid,hostname,diskspace,diskspace.s | \ awk 'BEGIN { totalused=0; totalquota=0; } \ $1 ~ /CTID/ { printf "%5s %20s %6s %6s\n", $1, $2, "used", "quota"; next; } \ $1 ~ /[0-9]+/ { totalused += $3; totalquota += $4; split($2, arr, /\./); \ printf "%5s %20s %6.2f %6.2f\n", $1, arr[1], $3 / 1024 / 1024, $4 / 1024 / 1024; } \ END {...
March 2010
1 post
3 tags
Pretty printing openvz memory allocation
awk: when you can’t be bothered to write a proper while loop.
/usr/sbin/vzlist -o ctid,hostname,privvmpages.b | \ awk 'BEGIN { total=0; } $1 ~ /CTID/ { printf "%5s %20s %5s\n", $1, $2, "mem"; next; } \ $1 ~ /[0-9]+/ { total += $3; \ split($2, arr, /\./); printf "%5s %20s %5.2f\n", $1, arr[1], $3 * 4 / 1024 / 1024; } \ END { printf "total %20s %5.2f\n", "", total * 4 / 1024 / 1024; }'
February 2010
1 post
You’re east coast, not New Mexico. If you aren’t used to seeing so much snow,...
– eject: Here’s the part where I tease you about Snow in America
I moved away from the snow so I wouldn’t have to feel like a pansy while making excuses.
April 2009
1 post
HAVE YOU EVEN THOUGHT ABOUT THIS PROJECT FOR MORE THAN A MILLISECOND? THE SPEC...
– The thought that has gone through every software developer’s mind at some point during a big project, as channeled throuh the inimitable Steve Yegge.
March 2009
6 posts
Zeppelin Sightings: Over Stanford this Weekend →
They put up one of my airship photos.
Brazil’s President Luiz Inácio Lula da Silva on Thursday blamed the global...
– I’m usually all about blaming whitey for most troubles, but maybe this is a bit much. From the Financial Times, by way of a colleague. (My eyes are green, and probably bloodshot by the way.)
The file system is not “truncating” files. The application is...
– Theodore Ts’o in a bug comment on how data loss can occur on Ext4. Knowing how the file system works is what separates real programmers from people that hack things together (i.e. people like me). By way of Jeremy Zawodny.
February 2009
5 posts
2 tags
Count files in subdirectories
find . -type f -print | awk '{ FS="/"; print $2; }' | uniq -c | sort -n
There’s not an easy way (as far as I know) to get a summary of how many files are in each subdirectory of a given parent directory, so I came up with this one-liner.
Customer: ‘You’re part computer?’
Me: ‘Yes sir, I am a...
– Not Always Right. I always wanted to say something like this when I worked tech support.
Flickr: The Far side Reenactments Pool →
by way of Jeff Atwood.
I LEGO N.Y. - Abstract City Blog - NYTimes.com →
A few lego bricks can illustrate the world. By way of my mom(!).
Flickr: In Numerical Order →
Number-themed pictures posted in numerical order. Something greater than or equal to 1512 is next.
January 2009
5 posts
Taking photos of police officers could be... →
From the British Journal of Photography, by way of Paul Buchheit.
Gizmodo: Cable Action Figures →
They’re not really made out of ethernet cable, it’s higher gauge stuff. But still, cool. My colleague thinks we shoudld attach cockroaches to them and use them as our minions.
Of course, the biggest disappointment was Gore’s failure to handle...
– A little bit of revisionist history from TA Frank at The Guardian in London, by way of Paul Buchheit at FriendFeed.
Yes, it’s a frustrating job, where little details threaten to derail the...
– Give and Take in the Software Industry from secretgeek.net by way of Jeff Atwood
Other director's adaptations of board games →
by way of Merlin Mann’s Most Days
December 2008
1 post
Python syntax checking
python -m py_compile <file to test>
Yes I know I’m supposed to do unit tests. But for “quick” scripts, sometimes you just want to know that your spacing is right and you didn’t leave the colon off the end of an if statement.
November 2008
3 posts
Flickr: The The End Pool →
Classic end title cards from old films and cartoons, by way of Laughing Squid.
This shift in consciousness, including same-sex marriage, is a move towards the...
– The Rt. Rev. Marc Andrus, Bishop of the Episcopal Diocese of California by way of Google News
October 2008
3 posts
George Ward Photography →
An impressive landscape photographer.
Flickr Group: The Entrance to Hell →
Using Biology, Not Religion, to Argue Against... →
So marriage is only to ensure the continuation of the human species? What should we do to the many married couples that choose not to reproduce? I guess all the arguments around this are slippery slope ones.
September 2008
3 posts
We Have Met the Enemy and He is Us Maxim: The insider threat from careless or...
– Physical Security Maxims from Argonne National Lab (they still do classified stuff there)
Conservatives have been told that the colleges are liberal brainwashing...
– Chris Espinosa of Apple fame on What’s at stake in this election cycle.
For fuck’s sake, they’ve played you exactly the same way since the 2000...
– John Scalzi on the Democrats acting like they always do.
August 2008
3 posts
Old Vine Grapes - Old Vines Zinfandel - Klinker... →
This wine was recommended to me by the waiter at dinner earlier. Of course, he was bringing me glasses of a Pinot Noir at the same price what which this goes for by the bottle.
Did you ever see Rael Dornfest’s bloxom blog project? Elegant, tight perl...
– From a comment by Clay Shirky on Why Corporates Hate Perl
The LOLcat school of economics →
July 2008
1 post
Pinball never died in this arcade - Los Angeles... →
I have a love-hate relationship with Vegas, but 200 pinball machines may fully redeem the town.
June 2008
3 posts
Nautilus trash across file systems →
I moved my digital photos onto another partition and noticed that I was no longer able to move items to the trash, only delete them immediately. Creating a directory in the root of the new file system named .Trash-<username> takes care of that. On Fedora 9, however, the trash display in Nautilus does not update if you move stuff into the various directories from another process.
7 things you can't say on the Internet :... →
By way of Jeff Atwood, a quick list of tales too ticklish to tell. I might not completely agree with the reasoning, but the bullet points are hard to quarrel with.
The Wine Country Deck: 50 Best Northern California... →
Winery flash cards! That’s for me.
May 2008
3 posts
research!rsc: Lessons from the Debian/OpenSSL... →
A quick and easy to understand overview of what went wrong with Debian’s OpenSSL patch
Ministers are to consider plans for a database of electronic information holding...
– BBC NEWS | UK | Phone calls database consider - I guess not unexpected in a country whose capital prides itself on the number of CCTV cameras per square inch, but still.
April 2008
2 posts
tar takes it off
I can never remember that it’s —strip-paths=# to trim some # of directories off the front of a tarball when extracting it. —strip-components=# is required on newer versions of tar.
Savage Chickens on the changes the internet wroth →
Originally I inlined the cartoon but I don’t think the artist allows that. I’m spoiled by Creative Commons I think.