how to write email in php

Use the default “mail” command, but make sure you include a “from” address in the last parameter!

// The message
$message = "Line 1nLine 2nLine 3";

// In case any of our lines are larger than 70 characters, we should use wordwrap()
$message = wordwrap($message, 70);
mail('', 'My Subject', $message, "From:");
// Send
//mail("", "sub", "msg")
// mailx -s "subject"

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]

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