Twitterrific from the command line using ruby 0

Posted by jro
on Tuesday, March 18

I caught this Ruby Inside post about using ruby as an applescript replacement earlier today, and started reading the associated links, and searching for something I could try to do with ruby and applescript that might actually make my life a little easier.

Thanks to my friend Dave, I’ve been giving twitter a 2nd chance. So, I created a tiny script to let me tweet from the command line. It’ll either take arguments and use them as the input, or standard input. I’m sure I could have done it without using applescript or the wonderful Twitterrific, but that wouldn’t have been as much fun. This way I get Twitterrific’s niceties, and besides I always have it running anyway.

#!/usr/bin/env ruby

require 'rubygems'
require 'appscript'

str = ARGV.join(" ")
if str.length == 0
 $stdin.each {|l| str << l}
end

Appscript.app('Twitterrific').post_update(str[0..139])

Usage:

jro@fireant:~$ tweet Having a great old time
jro@fireant:~$ tweet @someone that sounds like fun!
jro@fireant:~$ uptime | tweet 

Mozy for the headless Mac 0

Posted by jro
on Saturday, March 15

Frequently mentioned on Lifehacker, Mozy Home is an incredibly economical network backup option at $5 a month. The online backup service will store an unlimited amount of data, and has Mac and Windows clients. The big caveat there is that you don’t have unlimited throughput, so it can still take a while to backup a large fileserver, say. In that case it’s especially important to be able to manage it effectively.

I’m currently using an old PPC-based Mac Mini, running Tiger, with a couple (or more) USB attached drives, as my home fileserver. For a long time I ran a Linux box with an internal RAID5 disk array, but with the advent of mozy and 5$ a month offsite backup, I’ve made the switch. It hasn’t been completely painless, however, so here are a couple notes about effectively using Mozy on a headless Mac.

  • You still probably need VNC or that fancy new Leopard desktop-sharing feature, especially to install.

  • Mozy has a command line interface! Enable SSH on your Mac and check this out

bombe:~ jro$ /Applications/Mozy.app/Contents/Resources/MozyBackup help
Commands: start|cancel|auth|rescan|status|tempdir

bombe:~ jro$ /Applications/Mozy.app/Contents/Resources/MozyBackup status
Status: Backing up files...

Preparing (0.0 B/s): 
   70.9% 4925415586 of 6943326336

 Sending   (46.3 KB/s): blah_blah_20061012.tgz
    0.9% 87851008 of 9257768960

You can probably guess what most of the commands do. It’s great being able to start and cancel a backup on a whim, say when I upload more data to the server, or stop it when it’s messing with my VOIP call quality. I definitely recommend still having Mozy backup on a regular schedule, even if you’re doing a fair bit by hand. You never know if you’ll forget!

  • Mozy has a very useful log.
bombe:~ jro$ sudo less /Library/Logs/Mozy.log

2008-03-15 12:43:55.229 MozyBackup[31] (backup) Starting backup
2008-03-15 12:43:55.231 MozyBackup[31] (backup) Checking for update
2008-03-15 12:43:56.821 MozyBackup[31] (backup) Connecting to r4165.mozy.client.ut2.berkeleydata.com (66.133.112.25)
2008-03-15 12:43:57.277 MozyBackup[31] (backup) Version is up-to-date (0.9.1.0)
...
2008-03-15 12:46:01.028 MozyBackup[31] (backup) Building backup set
2008-03-15 12:46:03.278 MozyBackup[31] (backup) Processing files in scan cache
2008-03-15 12:46:09.704 MozyBackup[31] (backup) Processing files in manifest but not in scan cache
2008-03-15 12:46:19.569 MozyBackup[31] (backup) Preparing 4 files (6943326336 bytes)
2008-03-15 12:46:19.570 MozyBackup[31] (backup) Unlocking cache...
2008-03-15 12:46:19.570 MozyBackup[31] (backup) Unlocked cache
2008-03-15 12:46:19.570 MozyBackup[31] (prepare) Starting
2008-03-15 12:46:19.575 MozyBackup[31] (send) Starting
2008-03-15 12:46:19.575 MozyBackup[31] (send) Getting files from queue
2008-03-15 12:51:12.245 MozyBackup[31] (send) Offering 1 files (0 are removes)
  • Mozy can use your your encryption key. If you don’t want the guys at EMC/Mozy to know what kind of ahem data you’re storing on their machines, you can configure Mozy to use your own encryption key. This definitely increases the security of your data, just make sure you don’t lose that key, or you’ll be in a world of hurt come restore time.

Soldering HOWTO 0

Posted by jro
on Friday, October 26

Hack-A-Day has a great little article on the basics of soldering. Check it out, here

embed shared documents with edocr 0

Posted by jro
on Friday, October 19

I’m not much for re-canning Techcrunch posts, but edocr seems pretty neat. Check out this Vi cheat sheet.

Photo Carving for Dummies 0

Posted by jro
on Tuesday, October 09

Go about 1/3 of the way in and watch the remove a person from the photo example. It’s not perfect, but it’s impressive how easy it is to do. I just tried it on the site, and it is really that easy to remove stuff from a photo. While it’s not undetectable, it definitely makes for a printable picture without that guy you didn’t invite to the party.