I have a number of Ruby-on-Rails apps on my little Ubuntu server, each one accessible using a sub URI. For example, the home controller of the homework application is accessed with:
http://bravo.local/homework/home
Where homework is the sub URI configured to serve my application. The Apache/Passenger configuration for this set up is documented here.
Continued…
Posted in Linux, Ruby-on-Rails.
Tagged with apache, decorator, draper, helper, mod_rails, paperclip, passenger, programming, request, ruby-on-rails.
By martin
– January 18, 2012
The whole Internet-of-things idea has really captured my imagination. DIY Sensors and Machine-2-machine computing are becoming a reality thanks to open source projects like Arduino.
Today I stumbled upon a podcast interview on MQ Telemetry Transport, or MQTT, with Andy Piper from IBM. MQTT is an M2M/Internet of things connectivity protocol developed at IBM. Much of the podcast talks about how this technology is being used in home DIY sensor projects. MQTT is based on a “Publish and Subscribe” architecture and requires a Broker to handle the messaging. Although IBM have a few different MQTT Broker implementations, there is an open source implementation of the broker server called Mosquitto that looks worth experimenting with.
If that wasn’t enough to wet your appetite, Andy Stanford-Clark (also from IBM) gave a presentation called “The house that Twitters” which explains how he has used MQTT to create a number of interesting home sensor projects.
Posted in Internet of things, Linux, Podcasts.
Tagged with IT Conversations, programming, sensor, twitter.
By martin
– January 18, 2012
Today I needed to update my nginx server to support serving of static gzipped asset files alongside Passenger (Rails 3.1 asset pipeline – server configuration). My install was already a bit of a hack after trying various ways to originally get it installed. This update needed the whole thing to be re-built from source so I decided to get the latest source and write myself some notes so that it won’t be so hard next time.
Continued…
Posted in Linux, Ruby-on-Rails.
Tagged with Linux, mod_rails, nginx, passenger, ruby-on-rails, ubuntu.
By martin
– October 4, 2011
I have been researching the technologies behind the Semantic Web for a rather interesting project. Having read as much as I could (none of it great), I manged to created a RDF model and a very basic ontology to do some experiments using SPARQL and the Jena tool kit. I really struggled to get the inferencing to work on Jena so I thought I’d give it a try in Oracle instead.
Continued…
Posted in Oracle.
Tagged with database, oracle, rdf, semantics, triples.
By martin
– May 17, 2011
Although I’m a massive fan of Rails, my background (and my professional life) is Java and Oracle. It was inevitable that I would try to bring these worlds together at some point. The following is a description of how I took and existing Rails 3 app, which was developed on SQLite and runs in production on MySQL, and got it to work on Weblogic 10.3.4.0 and Oracle 11g R2 database.
Continued…
Posted in Oracle, Ruby-on-Rails, Software.
Tagged with CentOS, java, jruby, oracle, programming, ruby-on-rails, warble, weblogic.
By martin
– April 28, 2011
A little aide-mémoire to remind me how to prepare my Rails database environment for either MySQL or SQLite on Ubuntu Linux.
MySQL
$ sudo apt-get install mysql-server libmysqlclient-dev
...
$ gem install mysql
...
SQLite
$ sudo apt-get install sqlite3 libsqlite3-dev
...
$ gem install sqlite3-ruby
...
Posted in Linux, Ruby-on-Rails.
Tagged with Linux, mysql, ruby-on-rails, sqlite, ubuntu.
By martin
– November 28, 2010
I have just done a fresh install of Oracle 11g R2 on a Linux VM running on my little server. Install was a breeze, it even auto generated a script to set all the necessary operating system parameters. However, after the installation I could not get SQL*Plus to start due to a SELinux problem. Continued…
Posted in Linux, Oracle.
Tagged with database, Linux, oracle.
By martin
– November 9, 2010
Took me a few minutes using SketchPath to work this out. It’s the xpath expression to pull out all the location elements from the iTunes Music Library.xml file.
/plist/dict/dict/dict/key[text()='Location']/following-sibling::string[1]
The resultant string still needs to be URL decoded.
Posted in Software, Windows.
Tagged with iTunes, xml, xpath.
By martin
– February 14, 2010
This article applies to:
Rails 2.3.4, Ruby 1.8.6, soap4r gem 1.5.8, ebay4r 1.1
I have been taking a look at ways to integrate a Rails application with eBay. They support a number of different programming interfaces and, if you are using Javascript, PHP, Java or .Net, have some good examples to follow. I managed to get a Javascript interface working quite easily from inside a Rails _form view, but it just does not feel like the most elegant solution to me.
Since eBay provide a well documented SOAP API I thought it would be a good opportunity to investigate Ruby’s support for SOAP. SOAP support is a standard feature of Ruby and is provided by a library called soap4r. I tried implementing my own call to eBay’s GetItem interface, but I encountered a few problems and soap4r’s documentation didn’t help much either. Then I discovered a library called ebay4r which is built on top of soap4r. The rest of this article describes how I successfully integrated my Rails application with eBay using ebay4r.
Continued…
Posted in Ruby-on-Rails.
Tagged with ebay, ebay4r, ruby-on-rails, soap, soap4r.
By martin
– October 2, 2009
There’s no denying that Rails’ built-in Forms Helpers are incredibly good. However if they have one flaw, it is the way error messages from validations are handled. The default messages generated by Rails are terse to say the least! If you provide your own message (with :message=>”blah blah”, Rails automatically appends the name of the underlying field to the front of the message, which is restrictive and looks ugly.
I spent some time looking around for a good solution to this problem. I assumed it would be a simple configuration issue but it turns out the format of these messages is hard baked into the ActiveRecord::Errors.full_messages method.
Continued…
Posted in Ruby-on-Rails.
Tagged with i18n, ruby-on-rails, validation.
By martin
– September 29, 2009