Archive for the ‘rails’ category

Puppet Forge in beta!

May 27th, 2010

The Forge AKA the Puppet Module Repository is live and operational.  It’s a store of modules (and types and providers) that allows you to share your awesome code and modules with others.

It also comes with the -module tool that allows you to build modules for, manage and install modules from the forge.  You can install -module via a gem:

$ sudo gem install -module

Both the site and tool are in public beta right now so hammer away at it and tell us what you think!

RPM and DEB packages available for Puppet Dashboard

April 6th, 2010

I’ve created RPM and DEB packages for the Dashboard 1.0.0rc1.  These are available via APT and Yum repositories hosted by Labs.  Here are some simple instructions for grabbing the packages.  These are “first release” packages and I am by no means a packaging expert with either DEBs or RPMs so any feedback or comments are welcomed.  I’ll continue to update the packages as updates to the Dashboard are released.

Overall instructions for installing and running the Dashboard can be found here.

1.  Get DEB Packages via APT

a. Add the following to your /etc/apt/sources.list file:

deb http://apt.puppetlabs.com/ubuntu lucid main
deb-src http://apt.puppetlabs.com/ubuntu lucid main

b. Add the Labs repository key to APT.

$ gpg --recv-key 8347A27F
$ gpg -a --export 8347A27F | sudo apt-key add -

c. Run apt-get update

$ sudo apt-get update

d. Install Dashboard package

$ sudo apt-get install -dashboard

The Dashboard will be installed in /usr/share/-dashboard and you run the server from here or create a Passenger configuration.

2.  Get RPM packages via Yum

a.  Create a Yum entry for Labs

$ vi /etc/yum.repos.d/puppetlabs.
[puppetlabs]
name= Labs Packages
baseurl=http://yum.puppetlabs.com/base/
enabled=1
gpgcheck=1
gpgkey=http://yum.puppetlabs.com/RPM-GPG-KEY-reductive

b.  Install via yum

$ sudo yum install -dashboard

You will be prompted to install the Labs release key as part of the installation process.

The Dashboard will be installed in /usr/share/-dashboard and you run the server from here or create a Passenger configuration.

Haven’t had a dream in a long time

March 18th, 2009

So the latest , Pro Linux System Administration, is almost done.  One chapter to submit and then the copy-edits and proofs and it’s a done deal.

Must admit this was a lot of hard work.  Incredibly unmotivated a few occasions and whilst I think I need a little break from writing I’ve got another project to finish this year.

I’ve worked out I’ve written somewhere in the region of a thousand pages in the last five years.  Which is quite a bit really – somewhere in the region of 500,000 words.  Just thinking about it makes me tired.

Migrating a Rails database from Sqlite3 to MySQL

August 25th, 2008

So when I first looked at Redmine I ran it up and used Sqlite3 as the database back-end. Then when I migrated our Trac data I just left Sqlite3 as the back-end database and migrated our data to that. With that startling lack of forethought aside, I always had the view the database should be MySQL because well:

a) I know it
b) I like it
c) It’s probably more scalable (IMHO)

So today I actually sat down to do the migration piece. I dumped out the sqlite3 database and tried to do some manual/scripted edits to convert it to something MySQL would import. Epic Fail.

So I tried the YAMLdb that abstracts database exports using YAML. A quick installation, some edits to config/database.yml, a rake db:dump and rake db:load and the data was moved:

… Create our database …

$ sudo mysql -p
mysql> create database redmine character set utf8;

… Grant privs to your chosen user …

mysql> GRANT ...

… Configure a test database for our new MySQL database …

$ vim config/database.yml

.. for Rails version 2.1 and later install the plugin …

$ sudo script/plugin install
://.com/adamwiggins/yaml_db.

.. for Rails versions less than 2.1 use …

$ sudo script/plugin install http://.com/adamwiggins/yaml_db.

… Dump out the current production database …

$ sudo rake db:dump RAILS_ENV=production

… Load the freshly created db/data.yml file into our test database …

$ sudo rake db:load RAILS_ENV=test

… Reconfigure the application to point to the new MySQL database as production …

$ vim config/database.yml

… Start Redmine …

$ sudo /etc/init.d/mongrel_cluster start

Had one bad field I had to do some manual editing too – still not quite sure what was wrong with the field but whatever I did fixed it – but otherwise very smooth.

Started up and now Redmine runs perfectly with MySQL as the back-end!