SmartLogic Logo (443) 451-3001

The SmartLogic Blog

SmartLogic is a web and mobile product development studio based in Baltimore. Contact us for help building your product or visit our website to learn more about what we do.

Installing PostGIS 1.5 on PostgreSQL 8.4 on Ubuntu

March 4th, 2010 by

I had a bit of trouble installing the latest PostGIS 1.5 under PostgreSQL 8.4. Here are my instructions. These work on Ubuntu 8.04, 9.04, 9.10, 10.04, and 10.10.

Read the rest of this entry »

Setting Up Ubuntu 9.10 for Ruby On Rails Development

February 1st, 2010 by

This is a document I put together at the beginning of 2010 while building yet another Ubuntu VM, digging through our internal documentation to try and find out what I needed. We’ve got the answers, and generally Ruby, Rails, and Ubuntu are pretty good about telling you how to install tools if you don’t have them yet.

But the answers are spread out and distributed randomly. Plus, I can only see “The program ‘______’ is currently not installed. You can install it by typing: sudo apt-get install ______” so many times before I lose interest and put off the task.

Read the rest of this entry »

Using Byobu and Landscape to improve remote Ubuntu sessions

January 22nd, 2010 by

SSHing into remote servers can be an awkward experience, but it doesn’t have to be. You can turn your ssh console into a terminal-style window manager with Byobu, and get more system information via landscape.
Read the rest of this entry »

Mount options to improve ext4 file system performance

June 4th, 2009 by

I recently boosted my rails test suite running time by around 30% by adding certain mount options for my ext4 partition (works for ext3 too). I thought I’d blog about it because the first time I tried my system wouldn’t boot! So here are the step by step instructions:

Read the rest of this entry »

Find the Unique Sessions for a Rails Application

May 4th, 2009 by

Today we’re going to look at how to find the number of unique sessions over a specific time frame for a rails application. We’ll be using the slow-actions gem.

Read the rest of this entry »

Using Sanitize Email to Preview HTML Emails Locally

April 30th, 2009 by

John Trupiano has a great post to get you started with sanitize_email for Ruby on Rails.

I wanted to preview my HTML emails without having to fill up my online email inboxes with tons of email (and then I’d have to make filters too). I also didn’t want to manage actually sending real email. So, I set up my machine for local delivery. Read on for instructions.
Read the rest of this entry »

Integrity CI on Passenger 2.2.2 with Ruby Enterprise Edition on Ubuntu 8.04

April 26th, 2009 by

I just spent a few hours trying to get this configuration sorted out, so I thought I’d share my notes. My goal was to get Integrity running on Passenger with Ruby Enterprise Edition. However, I couldn’t get the user Integrity/Apache was running as to use the proper PATH.

Whenever Integrity would try to build my project, I’d get an error about rake not being able to be found: sh: rake: not found

Read the rest of this entry »

EXT4 On Ubuntu 9.04

January 16th, 2009 by

Ext4 got some attention recently because it was able to boot ubuntu to the login screen in about 20 seconds. However, the current daily release doesn’t support installing with Ext4. Here are the instructions for installing Ext4 onto the Ubuntu 9.04 (Jaunty Jackalope) daily-live cd.
Read the rest of this entry »

Benchmark Ruby Code with R, rsruby and better-benchmark

October 8th, 2008 by

I’ve found myself on a benchmarking kick these last couple of weeks. Sometime last week, I dug up the better-benchmark library written by Pistos. Pistos’ library is basically just a wrapper for the rsruby gem, which is more or less an interface to R (similar to what rmagick is to ImageMagick).

Combining these tools together, we can do some pretty nifty code performance analysis in very few lines of code, e.g.

require 'rubygems'
require 'better-benchmark'

result = Benchmark.compare_realtime(:iterations => 10) { |iteration|
  save_the_world()
}.with { |iteration|
  save_the_world_and_save_the_girl()
}
Benchmark.report_on result

I have forked better-benchmark and wrapped the library up into a RubyGem.

Read the rest of this entry »

I can’t upgrade RubyGems from 1.1.1 to 1.2.0 on Ubuntu

July 7th, 2008 by

Just a quick little snippet here. RubyGems 1.2.0 dropped roughly two weeks ago….however, I’d been having trouble getting my 1.1.1 installs on Ubuntu to update properly.

john@john-ubuntu:~/passenger-recipes$ gem -v
1.1.1
john@john-ubuntu:~/passenger-recipes$ sudo gem update --system
Updating RubyGems
Nothing to update
john@john-ubuntu:~/passenger-recipes$ gem -v
1.1.1
john@john-ubuntu:~/passenger-recipes$ sudo gem update --system
Updating RubyGems
Nothing to update

The first few times I ran into this, I was too busy to figure out what was wrong and ignored it. However, there is one HUGE TIME SAVER in 1.2.0 that I just couldn’t wait for any longer. Up through 1.1.1, gem update and gem install calls both updated all locally cached gemspec’s from your gem sources. This not only led to large memory consumption (anyone on a VPS got a horror story?), but was also just a plain waste of time. If I know which gem I want to update, it should just update that gem. The onus should be on me specify that I want to fully update my cache.

That said, I finally came across Eric Hodel’s notice addressing this very problem. The solution:

john@john-ubuntu:~/passenger-recipes$ <strong>sudo gem install rubygems-update -v 1.1.1</strong>
Bulk updating Gem source index for: http://gems.rubyforge.org/
Successfully installed rubygems-update-1.1.1
1 gem installed
john@john-ubuntu:~/passenger-recipes$ <strong>sudo gem update --system</strong>
Updating RubyGems
Updating rubygems-update
Successfully installed rubygems-update-1.2.0
Updating version of RubyGems to 1.2.0
Installing RubyGems 1.2.0
...
... (success)
...
john@john-ubuntu:~/passenger-recipes$ <strong>gem -v</strong>
1.2.0

Happy upgrading.

  • You are currently browsing the archives for the Linux category.