Thursday, March 19, 2009

Google Voice

Well, okey doke. Google's finally bringing GrandCentral back as Google Voice.

Let's see if their new call button works.


Sunday, January 11, 2009

Grand Central

I'm not posting regularly, but once in a while something is a must-post. This is one.

In the Marine Corps I was a radio operator, which required acquiring the skill "push to talk." Finally, this reflex returns in a way I wouldn't have predicted.

Jeff Bezos has a call-me button? Me, too.


Friday, August 15, 2008

Kevin Kempter





I met Kevin Kempter at a CLUE Installfest.

Kevin was hauling around gear in a great, Marine Corps bag. I thought, "Hah! Another jarhead. Hey ... how can I get one of those bags?"

He'd had the same thought. On a visit to MCRD, he saw a guard with the same bag, and asked him where he could get one.

"They're only for active-duty Marines, so I'm not allowed to tell you that if you go down that way one block and over two, you'll find the PX. Sir."

"Interested in giving a BLUG talk?" I asked Kevin.

"Sure."

"What would you talk about?"

"Postgres."

Turns out, people are interested in Postgres.

Kevin played to a standing-room-only crowd last night.

He told us he has one client who's now pulling in a terabyte of data a day, and expects to expand this by a factor of 100.

Thursday, August 14, 2008

Apache Status

You can get your apache2 (and, I suspect, apache) server to display status information on prefab server-status and server-info pages by loading the status and info modules and tweaking the configuration files to pay attention to them.

Having done that, http://localhost/server-info and http://localhost/server-status
will tell you what modules are loaded and what they do. With little more work, you can also permit access to these pages by other boxes.

I set this up yesterday at work, but haven't done it at home because this laptop isn't serving up web pages at all.

Monday, August 11, 2008

Gitosis

I spent part of the weekend playing with gitosis, a tool for administering remotely-accessible git repositories.

Access revolves around ssh and public/private key pairs. You give me your public key, and I can grant you selective permissions, repo-by-repo, if I'm the gitosis administrator. Once I do, it's painless to check stuff in and out, since all the permissions stuff is under-the-covers. Much nicer than Subversion's cacheing of passwords in plain text.

One of the coolest things is that the administrative data, including public keys, are kept in a git database. If I'm the (or an) administrator, I can administer access remotely, with git pull and git push -- including adding new users and their keys -- using gitosis itself for the repo access.

Sunday, August 10, 2008

Error-handling, again.

Here's a better version of my error-handling shell functions. Maybe I am educable, after all.
# common error-handling functions

if [ $_gripe ]; then return 0; else _gripe=1; fi # include guard

warn() { printf "$* at line %s file %s: $msg\n" $(caller) 1>&2 ; }
die() { printf "$* at line %s file %s: $msg\n" $(caller) 1>&2 ; exit -1; }
I have an include guard so I can include it in other shell functions that may be included with one another. I use if, rather than a [test] || alternative construct because I'm often running set -e, and don't want to die because of the test itself.

I have die() printing its own message, instead of calling warn(), so that it reports where it's invoked. Otherwise, warn() announces it's being called by die(). Duh.

It amazes me that after doing this for so long, I can still be fixing bugs in my own code -- and code as basic as this.

Saturday, August 9, 2008

Making Makefiles Behave: Loops

The last command in a shell for loop determines whether the loop succeeds or fails.

This succeeds:
$ for i in false true; do echo $i; $i; done
false
true
$ echo $?
0
This fails
$ for i in true false; do echo $i; $i; done
true
false
$ echo $?
1
When does this matter? In Makefiles. Suppose you have a make rule that looks like this:
foo:
for dir in $(SUBDIRS); do $(MAKE) -C $$dir; done
A failure of one of the subdirectory makes will not cause the make to fail!

How do you solve this? There are several sophisticated ways, but the dead-easy way is to start the Makefile like this:
SHELL := /bin/bash -e
This will cause all shell commands to be executed with the -e flag, which causes any simple command to terminate the shell.
$ ( set -e; for i in false true; do echo $i; $i; done )
false
$ echo $?
1
(I have to put the command and the set -e in parens here -- though not in the Makefile -- because any failure causes the command to fail and the shell to exit, so the following "echo $?" would never be reached.