Matt Connolly's Blog

my brain dumps here…

Monthly Archives: April 2012

OpenIndiana – installing ImageMagick and Rmagick gem

I found that the Rmagic gem wouldn’t install with the standard OpenIndiana package for ImageMagick because it was too old, and the one installed from the SFE repository didn’t seem to work. But installing ImageMagick from source (version 6.7.6) was pretty straight forward.

Only catch here was that because I installed it in /opt/local, the Magick-config tool couldn’t find its package config (.pc) files. i.e., I was getting this:

$ /opt/local/bin/Magick-config --cflags
Package MagickCore was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickCore.pc'
to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found

The Rmagick extension needs to find `Magick-config` in PATH, and that needs to find it’s package config files. So:

$ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/local/lib/pkgconfig
$ export PATH=$PATH:/opt/local/bin
$ gem install rmagick -v '2.13.1'
Building native extensions. This could take a while...
Successfully installed rmagick-2.13.1
1 gem installed
Installing ri documentation for rmagick-2.13.1...
Installing RDoc documentation for rmagick-2.13.1...


OpenIndiana – running openvpn as a service

Here’s a gist for the XML manifest to run openvpn as a service:

It expects that there is an openvpn config file at /etc/openvpn/config which, you’ll need to configure with your settings, certificates, etc.

If you configure it to run a tap interface then bonjour advertising will work over the link, which is great if you want time machine or other bonjour services to work to an OpenIndiana server from a mac connecting from anywhere with openvpn.

Passenger apache module for OpenIndiana

I did a bit of hunting and made some patches to the ‘passenger’ gem so that it’s apache module would compile for OpenIndiana. Changes are in my github fork:

And I just noticed that one of the fixes was in a patch in Joyent’s SmartOSĀ instructions for using passenger.

I tested this also on a VM guest installation of Solaris 11 Express, and it worked too. I’d be interested to hear if it works for others on OpenIndiana, Solaris or SmartOS.

So with updates to rvm, latest version of ruby and with this patched version of passenger, I’m finally good to go to deploy rails apps on OpenIndiana. Woot!

Amazon EC2: Amazon Linux vs Ubuntu Linux

Just for curiosity’s sake, I decided to boot up an instance of each, install apache, mysql, ruby and ruby gems and see how much disk and memory was used by each.

Using the preset 32-bit installs (each on an 8GB EBS volume), the disk usage was:

Ubuntu: 1.1GB / Amazon-Linux: 1.2GB

And after a clean boot, free memory was:

Ubuntu: 560128k free / Amazon-Linux: 541844k free.

Not much in it, but Ubuntu wins on both.

Only other thing I noticed so far as was the repositories for Amazon linux seemed faster to access than Ubuntu’s ones. Not a big deal though, once everything is installed.

I’m very interested to see if Ubuntu’s Landscape offers better insights into an Ubuntu instance than Amazon’s own cloud watch metrics… I’ll have a play soon.

Installing mysql2 gem on OpenIndiana

Quick one, with mysql 5.1 installed from standard OpenIndiana package repository, the ruby mysql2 gem can be installed with this command:

$ gem install mysql2 -v '0.2.18' -- --with-mysql-dir=/usr/mysql/5.1 --with-mysql-include=/usr/mysql/5.1/include/mysql

This one requires /usr/gnu/bin in the front(ish) of your path, so you may need an `export PATH=/usr/gnu/bin:$PATH` before you do this.




This also works for the latest version ‘0.3.11’:

$ gem install mysql2 -v '0.3.11' -- --with-mysql-dir=/usr/mysql/5.1 --with-mysql-include=/usr/mysql/5.1/include/mysql

[UPDATE 2 – ruby-2.0.0]

Ruby 2.0.0 compiles as a 64-bit executable, which means another bit needs to be added to the command line options:

$ gem install mysql2 -v '0.3.11'-- --with-mysql-dir=/usr/mysql/5.1/ --with-mysql-include=/usr/mysql/5.1/include/mysql --with-mysql-lib=/usr/mysql/5.1/lib/amd64/mysql

Rubymine theme convert into Xcode theme

Rubymine has lots of great themes. Xcode doesn’t have so many. So I made a gem to to convert them.

Install like so:

$ gem install rubymine2xcode-theme

Save or find your rubymine theme, and run the gem like so:

$ rubymine2xcode theme.xml

Where ‘theme.xml’ is a path to the rubymine theme. The resulting Xcode theme file will be saved in the user’s Library where Xcode can find it. Relaunch Xcode and it should appear in the theme list!