ruby sockets

Find that your ruby process with sockets and threads suddenly…stops mid-thread?  Make sure you aren’t killing it (inadvertently) via some other thread (like thread.kill).
Have problems connecting to localhost (connection reset by peer, even before you receive the last packet?) — sleep 1 after sending the last packet and the receiving end on localhost will get it [ugh].

Ruby exceptions

So…say you have some exceptions that are thrown in ruby that ‘by pass their bounds’–they just seem to mysteriously ‘skip’ their rescue blocks.  Examine them carefully to make sure they don’t “not inherit from standarderror” as rescue => detail ONLY captures StandardError, so they may not!

Another tip: getting “permission denied” to delete files in ruby? Make sure some other thread does not have them open!

using puttygen with cygwin

So…say you’re using svn within cygwin.  It doesn’t pick up and use your key pairs that are running with your putty agent, unfortunately.  So what you’ll need to do is setup an agent on the cygwin side, and give it the same keys.  Or, the easy way, save your private key to the ~/.ssh/identity file.  Right click your private key, choose edit, then choose “conversions”, choose save as openssh keypair, then navigate to c:\cygwin\home\username\.ssh (create if necessary), and save it to the file “identity.” Voila.

svn prob

so…you check it out and it says svn: Failed to load module for FS type ‘bdb’

I believe that means ‘the svnadmin that created that had berkeley db compiled into it, and your client does not!” So..GL with that!

ssh tunnelling

This is how to ssh so that your local port ‘maps’ to a port on the remote computer (man ssh).

ssh -L 8084:localhost:8080 [my port 8084 goes to their port 8080 –i.e. localhost:8084 is served by]

ssh server cygwin setup

So you want to be able to ssh into your windows box? Don’t know your windows password, but have admin rights? Here’s how: use the “net” command to create a user with a password. Then install openssl-server from cygwin setup, then sync the users

mkpasswd -cl >/etc/passwd
mkgroup --local > /etc/group

Then fire up the server net start sshd and it should work. See for more tips (most of which may not be necessary).

If you want to be able to actually edit files, etc. then you are going to want to login as your ‘normal’ login name.  So <code>passwd normalusername</code> and enter a new password.  Now you don’t need to know the windows password 🙂 .  Next if you want to not have to type in a password, create a key pair which allows you to authenticate with it.  Download putty, run puttygen, click generate, move the mouse to create a new key pair, click “save private key” (give it a passphrase–this protects you if a bad guy gets it), next copy the text from the topmost window (in grey).  Now login to localhost <code> ssh user@localhost</code>, create a ‘.ssh/authorized_keys’ file <code>mkdir .ssh; cd .ssh;</code> and put that stuff in it (here’s one way <code> echo “paste it in here” >> authorized_keys</code>.  Now explore to where you put your private key, double click on it (fires up the ‘key manager’), and now logging in to username@localhost should be automatic when you supply the username.  (Putty can apply the username automatically, if desired, see options).  Now to get it really automatic then put a link to that private key in your startup folder, and then never worry about it again 🙂 Good luck!

Now you can make it so

Roger's meanderings, notes to himself, bug reports, and other things