Posted by jpb
Wed, 21 Jun 2006 12:57:00 GMT
SSHKeychain is a GUI replacement for ssh-agent. It’ll take care of locking and unlocking your ssh keys as you sleep your machine in addition to all the stuff you expect from ssh-agent. Will also let you create tunnels from the menu it adds to your menubar.
Posted in OS X | Tags menubar, OSX, ssh, tunnel | no comments
Posted by jpb
Tue, 20 Jun 2006 18:10:00 GMT
Visor provides a systemwide terminal window accessible via a hotkey, much like the consoles found in games such as Quake. Visor requires elements of Quartz only found in 10.4. Visor is compatible with 10.4 and higher only
Find it here.
Posted in OS X | Tags Hack, OSX, Terminal | 1 comment
Posted by jpb
Mon, 19 Jun 2006 21:24:00 GMT
Check out sloth, it’ll show what programs have which files or sockets open on your system. Nice little OS X utility.
Posted in OS X | Tags cocoa, OSX, utility | no comments | no trackbacks
Posted by jpb
Fri, 16 Jun 2006 06:54:00 GMT
Switched to using Typo for the blog. Copied some of the old postings over, but can’t be bothered to move the rest.
Posted in Miscellaneous | Tags Typo | no comments
Posted by jpb
Thu, 15 Jun 2006 06:16:00 GMT
I kept having typos in my migrations, and it turned out to be easier to just zap all the tables and re-run rake migrate than to undo just enough of the migration to get the db back to the way the migration was expecting.
Anyway, so I wrote this wipedb script that reads database.yml so you don’t need to maintain the database user & password in multiple places.
#! /usr/bin/env ruby
#
# $Id: wipedb 1171 2006-06-10 16:36:57Z jpb $
#
# Copyright 2006 J. P. Block <jpb@ApesSeekingKnowledge.net>
require 'ostruct'
require 'optparse'
require 'yaml'
class MyArgs
MODENAMES = %w[development test production]
# return structure showing what opts were picked
def self.parse(args)
options = OpenStruct.new
options.mode = 'development'
options.debug = 0
opts = OptionParser.new do |opts|
opts.banner = "Usage: script/wipedb [options]"
opts.separator ""
opts.separator "Specific options:"
mode_list = MODENAMES.join(',')
opts.on("-m MODENAME", "--mode MODENAME", MODENAMES, "Select mode",
" (#{mode_list})") do |the_mode|
options.mode = the_mode
end
opts.on("-d", "--debug", "Turn on debug") do
options.debug = 1
end
opts.on_tail("-h", "--help", "Show this message") do
puts opts
exit
end
opts.on_tail("--version", "Show version") do
puts "$Id: wipedb 1171 2006-06-10 16:36:57Z jpb $"
exit
end
end
opts.parse!(args)
options
end # parse()
end
options = MyArgs.parse(ARGV)
mode = options.mode
config = YAML.load_file('config/database.yml')
database = config[options.mode]['database']
host = config[options.mode]['host']
password = config[options.mode]['password']
username = config[options.mode]['username']
if options.debug == 1:
puts "mode: #{mode}"
puts "database: #{database}"
puts "host: #{host}"
puts "username: #{username}"
puts "password: #{password}"
end
zap_list = `mysqldump -u #{username} -p#{password} --complete-insert --add-drop-table --quick --single-transaction #{database} | grep DROP`
zapper = IO.popen("mysql -u #{username} -p#{password} #{database}", "w+")
zap_list.each do |z|
zapper.puts(z)
end
zapper.close_write
Posted in Ruby on Rails, Ruby, MySQL | Tags migrations, MySQL, Rails, script | no comments
Posted by jpb
Thu, 30 Mar 2006 11:02:00 GMT
Quick howto on installing & running Rails applications on OS X Server. Read the details.
Posted in OS X, Ruby on Rails | Tags OSX, OSXS, Rails | 1 comment
Posted by jpb
Wed, 22 Mar 2006 12:54:00 GMT
Kevin Clark posted a nice Rails overview for designers here. It’s a nice (and brief) intro about how things work in Rails that’s useful reading for anyone beginning to use Rails, not just designers.
And since 1.1 is just around the corner, it’s a good time to start reading up.
Posted in Ruby on Rails | Tags Rails | no comments
Posted by jpb
Thu, 16 Mar 2006 18:48:00 GMT
Dan Benjamin announced Enkoder on his Hivelogic blog.
Enkoder translates email addresses into javascript, so humans can use them but scumbag scammers can’t scrape them off of your pages for their databases. Read more details at Dan’s blog.
Thanks Dan!
Posted in Ruby on Rails | Tags Enkoder, Plugin, Rails | no comments
Posted by jpb
Sat, 11 Mar 2006 13:28:00 GMT
There’s a neat little Rails application at http://keyref.octopod.info/ that you can paste TextMate’s shortcut list into (command-option-control-k from an edit window) and it’ll let you pick a group of bundles and then email you a PDF cheatsheet.
I keep wanting to switch to TextMate, but my fingers still want to use vi.
Posted in OS X, Ruby on Rails | Tags OSX, TextMate | no comments
Posted by jpb
Tue, 28 Feb 2006 01:43:00 GMT
Apple has a quick introduction to using Ruby on Rails on OS X at http://developer.apple.com/tools/rubyonrails.html.
Covers everything from installation of the toolchain to a nice tutorial that includes using migrations to create and update the database schema.
Overall, a great article for Rails n00bs, even non-Apple using ones.
Posted in OS X, Ruby on Rails | Tags OSX, Rails | 1 comment