spork with ruby 1.9 and Test::Unit
If you do testing in your Rails apps (which, you do, of course), you’ll get tired of waiting 45 seconds for poor little rake to run and load the entire Rack and Rails stack each time you want to test a tiny change. Spork makes things much more snappy. And snappy is good, it might [...]
keep it safe with Blowfish in vim 7.3
Late last year, everyone’s favorite editor saw version 7.3 come to light. One of the interesting new features is built-in and easy-to-use Blowfish file encryption, a powerful and much-needed upgrade from the old UNIX crypt function available in older versions. crypt() is an old and very breakable algorithm, not suitable for anything except protecting plain [...]
setting up a postgreSQL user for testing in Rails
When testing a Rails app backed by a postgreSQL DB, rake db:test:load and the unit tests drop and re-creates the entire database. As such, the database user used in the testing environment needs to be able to drop and create databases. In postgres, you do that by assigning the CREATEDB privilege directly to the testing [...]
read and convert 3GP video using FFmpeg
Something I found out today when I decided to make a quick edit to a video taken on my cellphone: Newer GSM cell phones and devices (such as my now-dated Android G1) now tend to save video in 3GP format. This shiny new multimedia format may have many advantages, but it is not widely supported [...]
saving image dimensions with file_column
A minor UI detail in development required that we include the width and height of certain images in the HTML and XML views. Since we were using the file_column plugin, which doesn’t normally save any image information besides the file name, this turned out to require some hacking.
What’s the best page size for a web design? Long answer…
I get questions a lot from designers about not only optimal page width for layouts but what height to use to ‘keep everything above the fold’. Here is one answer I gave recently – For width, I’m not a designer but I’ve read that 960px width is the way to go these days, because it [...]
jail time: chroot’ed sftp with rssh
Installing rssh to allow scp/sftp sessions only for user accounts is a breeze. Getting them into a chroot jail took a bit more reseach, but in the end turned out to be pretty easy. This is on CentOS 4.6, but this technique should work almost identically for any Linux system thanks to the l2chroot script.
a really easy migration to github from subversion
Yep, I’m trying to git on the bandwagon too. Last fall I dropped a small set of plugin files into github as a test, which was easy enough. But never had the time to figure out how to get all the other plugins, libraries and frameworks we use in there without moving everything over, including [...]
Making little things out of big things
As proof that sometimes randomly browsing the web while procrastinating from boring work (Saturday night year-end accounting and tax organizing, for instance) can sometimes be useful, a web trick: Flickr engineer “schill” found out that in order to natively re-size images on the client side without making them look like 8-bit dog vomit in MSIE7, [...]
rotate and auto-level video with mencoder
The proper CLI incantation to get mplayer/mencoder to clockwise rotate, apply an autolevels filter and re-sample an AVI video is: mencoder dscf5432.avi -vf rotate=1,pp=al -ovc xvid -xvidencopts pass=1:bitrate=687 -oac copy -o out.avi