David Hancock

Jan 5

“Stealth” error messages

Weird but true: If your Linux disk is full, your XWin-32-based PC xterms won’t connect, complaining of an “authentication error.”


netstat -tpe

From Linux magazine sidebar, nice set of switches for netstat:

netstat -tpe

t limits to TCP, p lists PID, and e gives some nice extra stuff (sendq, recvq, username, inode, foreign address looked up via DNS, program name)

You need to be root for some of these to appear. This is my new favorite invocation of netstat (I used to use -anp routinely).


Jan 2

Oldest file (of my own) in my home directory

If I’m pretending to be a blogger, I should jump on a meme or two. Here’s one (find and post the oldest file in your home directory):

http://rhodesmill.org/brandon/2009/new-years-meme/

Not much earthshaking to find, because I change computers pretty often. This was in a backup from a prior computer:

2002-03-26 ./backups/dhancock_old_dev/oracle/schemas/save/reserved28/xmlrpc.py

This was nothing more than my playing with XMLRPC.


Dec 31

Fontcase is Very Nice Indeed!

Fontcase (beta font-viewing) utility is GREAT! Very handsome user interface, for starters, and completely intuitive to use.

I’ve been using Lord Pixel’s UnicodeFontInfo tool, which is nice, but Fontcase seems much easier to get an overview from and then to delve deeper into a particular font.

I got on their beta by signing up on their website. I don’t know how much it will cost, once released, so I don’t know if I’ll buy it.

http://www.bohemiancoding.com/fontcase/


Dec 19

Right-click without Ctrl key!

I’ve been doing Ctrl-click on my Macbook Pro to simulate a right-click, but I learned yesterday that you can do this directly on the trackpad: Place two fingers on the pad and click!


Dec 16

Oracle XE reinstallation woes

Argggghhh! After spending most of the day trying to reproduce yesterday’s successful Oracle XE installation, I finally figured out why it wouldn’t work. The shared memory segment for Oracle wasn’t being released (I don’t know why) when the RPM was uninstalled, and each time I installed after that, the startup script refused to create a second instance of XE.

I used ipcs to find the shared memory segments and ipcrm to remove them.

Why would I want to keep reinstalling Oracle XE on the same machine? It’s because I’m developing a deployment script to use via the nice (and new, with growing pains) deployment tool called Fabric: http://www.nongnu.org/fab/


Dec 9

Dec 8

Change password without prompts from command line

I found this while surfing. I think it only works on RedHat Linuxes and their progeny. And of course, you need to be root. This is nice for adding a user and password from a script.

echo 'NewSecretPassword' | passwd --stdin someuser

This sets the password for ‘someuser’ to ‘NewSecretPassword’


Nov 26

Giving Dropbox a try

2GB free storage, a UI that promises to be easy to use. I’ll update as I try more.


Nov 18

PostgreSQL dump and restore with PostGIS data

Our initial data load from production to test wasn’t complete, and we figured out that we got correct results using a custom format for pg_dump. We don’t have to DEFINE the custom format, just use it. On the other end, you need to use pg_restore to bring that custom format dump into a database.

To dump:

pg_dump -Fc dbname > dbname.dmp

To restore:

pg_restore -Fc -d dbname dbname.dmp

One benefit of the custom format is that it is compressed during the dump; there’s no need for an additional gzip (dump) and zcat (restore) to be run. The compression is about the same as with gzip.