Posterous
cvk is using Posterous to post everything online. Shouldn't you?
Me_cup_thumb
 

cvk | nc -l -p 80

Both scp and rsync have bandwidth limit control

I was talking to someone today who knew about rsync's bandwidth control, but not about scp's. Yep, they both have it.

rsync

For rsync, you specify the bandwidth limit it KB/s.

rsync --bwlimit 200 foo server:bar

My common usage is:

rsync -avz -e ssh --bwlimit 200 --progress foo server:bar

scp

For scp, you specify the limit in Kb/s (kilobits vs. kiloBytes).

scp -l 1600 foo server:bar

Filed under  //   linux ssh rsync  
Posted November 19, 2009
// 0 Comments

Speeding up SSH with ControlMaster connections

You can make SSH much faster with the ControlMaster configuration
directive. When enabled, only the first SSH connection to a server
will incur slow connection overhead. Each additional connection will
simply reuse the first connection via a tunnel.

This is especially useful when using command-line completion over SSH
(using zsh, for example). Using tab completion on a predicate like
scp gibson:www/ht will result in a multi-second delay
each time, but with SSH ControlMaster connections, the delay is
sub-second.

Just add this to your ~/.ssh/config:

Host * 
ControlPath /tmp/%r@%h:%p
ControlMaster auto

That's it. Now your first SSH connection will automatically act as a
ControlMaster. Each subsequent connection will be almost
instantaneous. In my extremely scientific sample size of one
host-server pair, this make subsequent connections take about 0.1
seconds instead of 1.6.

Filed under  //   linux   protips   ssh  
Posted November 10, 2009
// 0 Comments

Watching my ill-gotten Twitter followers dwindle

About a year ago I wrote a script that crawled my Twitter network and made me follow lots of new people. Then it waited 24 hours to see if they followed me. If they did, I kept them in my list; otherwise, I chopped them. After a couple of days I had almost 600 followers. I just did this for fun, and I knocked it off after a couple of days for fear of being banned.

I wish I'd recorded stats from the beginning of the experiment, but I only started recording them in August (2009). This is what it looks like so far.

Filed under  //   idiocy   twitter  
Posted November 4, 2009
// 0 Comments

Caching a slow block of Ruby code with almost no effort

This is a method I use when working with slow ruby scripts that operate on huge datasets.

It caches the return value of a block of extremely slow code in a file so that subsequent runs are fast.

It's indispensable to me when doing edit-debug-edit-debug-edit cycles on giant datasets.

Filed under  //   programming   ruby  
Posted November 4, 2009
// 0 Comments

This really is dead simple.

Posted from my mobile phone (SMS)

Posted November 4, 2009
// 0 Comments