vanutsteen.nl => nerds only » Ruby http://v3.vanutsteen.nl A blog on rails, php, computing, my bass guitar and stuff Thu, 20 Sep 2012 06:26:30 +0000 en-US hourly 1 http://wordpress.org/?v=3.5 Gitlab reque & supervisord http://v3.vanutsteen.nl/2012/08/07/gitlab-reque-supervisord/ http://v3.vanutsteen.nl/2012/08/07/gitlab-reque-supervisord/#comments Tue, 07 Aug 2012 08:38:16 +0000 LeonB http://www.vanutsteen.nl/?p=765 Gitlab needs at least one resque daemon. I always forget to start it when I boot the (virtual) pc where gitlab resides. So I installed supervisord an set up this conf file:
/etc/supervisor/conf.d/resque.conf:

[program:resque]
command=bundle exec rake environment resque:work
# Do not use BACKGROUND=No, it only checks if BACKGROUND is set
environment=QUEUE="post_receive,mailer,system_hook",RAILS_ENV="production"
process_name=resque
numprocs=1
directory=/home/gitlab.tim-online.nl/public_html
autostart=true
autorestart=true
user=gitlab.tim-online.nl
]]>
http://v3.vanutsteen.nl/2012/08/07/gitlab-reque-supervisord/feed/ 0
Upgrading gitlab to the new stable http://v3.vanutsteen.nl/2012/07/22/upgrading-gitlab-to-the-new-stable/ http://v3.vanutsteen.nl/2012/07/22/upgrading-gitlab-to-the-new-stable/#comments Sun, 22 Jul 2012 16:20:18 +0000 LeonB http://www.vanutsteen.nl/?p=722 cd ~/public_html/ git checkout stable RAILS_ENV=production rake db:migrate bundle install --without development test --deployment sudo service nginx restart ]]> http://v3.vanutsteen.nl/2012/07/22/upgrading-gitlab-to-the-new-stable/feed/ 0 How to install gitlab on Ubuntu Server 12.04 (precise) the right way http://v3.vanutsteen.nl/2012/07/09/how-to-install-gitlab-on-ubuntu-server-12-04-precise-the-right-way/ http://v3.vanutsteen.nl/2012/07/09/how-to-install-gitlab-on-ubuntu-server-12-04-precise-the-right-way/#comments Mon, 09 Jul 2012 19:21:08 +0000 LeonB http://www.vanutsteen.nl/?p=705 This weekend I’ve been installing Gitlab on a LXC guest. The host is running Ubuntu 12.04 and so is the guest. I tried to document my steps the best I could so I could share my experiences with it. Sometimes I had to go back a few steps so maybe something are garbled up but I believe this is still a good starting point on setting up gitlab on a Ubuntu server.

My main goals were:

  • use as much software from the Ubuntu repositories as possible so I don’t have to worry about security updates et cetera
  • keep the installation as simple as possible so I know when I look at it over 6 months
  • keep the software (gitolite) in the default Ubuntu location(s)
This tutorial assumes you have some good knowledge about Linux (servers) so I doesn’t spell out everything.

The steps found on the Gitlab website are quite accurate so keep them in mind:

  1. login as user, install git & generate ssh key
  2. Install ruby 1.9.2
  3. Install gitolite with umask 0007 and add your user to git group
  4. logout & login again
  5. Clone & setup gitlab (checkout project wiki on github)
  6. Start server. Enjoy!

My global setup

  • Installed Gitolite, Redis and Ruby from the default Ubuntu repositories
  • Installed Nginx (nginx-full) with Ruby/Phusion Passenger support from the Brightbox testing repositories (stable didn’t yet support Ubuntu 12.04 Precise)
  • Gitlab + dependencies are managed by bundler (build from source)
  • Nginx is running as the gitlab user

Step 1: installing Nginx with Phusion Passenger (mod_rails) support on Ubuntu 12.04

add-apt-repository ppa:brightbox/passenger-nginx-testing
apt-get update
apt-get install nginx-full
cat <<EOF > /etc/nginx/conf.d/passenger.conf
passenger_root /usr/lib/phusion-passenger;
EOF

I had some troubles with this version of Nginx from Brightbox because of some missing mime-type config file. That was quickly solved by copying it from another server.

The configuration file of my gitlab virtual host I put in: /etc/nginx/sites-available/gitlab.host.tld.

The contents of that file can be found here.

Step 2: installing dependencies from Ubuntu sources

apt-get install gitolite ruby1.9.3 redis-server ruby-budler rake

For the gitolite configure screens: just keep hitting enter

Step 3: installing build dependencies for ruby gems needed by gitlab

apt-get install make libxml2-dev g++ libicu-dev ruby2.9.1-dev libmysqlclient-dev libsqlite3-dev

Step 4: setting up your gitlab user: creating it, giving it permissions and generating a ssh key

adduser --disabled-login --disabled-password --force-badname gitlab.host.tld
usermod --append --groups gitolite gitlab.host.tld
su -s /bin/bash gitlab.host.tld
ssh-keygen
exit

Step 5: configuring gitolite with the ssh public key of your gitlab user

(as root)

dpkg-reconfigure gitolite

The question about the public key can be answered with the contents of `/home/gitlab.host.tld/.ssh/id_rsa.pub`

Step 6: loosening the permissions so the gitlab user can reach the gitolite files

Only do this when you know what you’re doing!

chmod g+rw /var/lib/gitolite/repositories --recursive
chmod g+rw /var/lib/gitolite/.gitolite.rc

This works because we added our user gitlab.host.tld to the gitolite group remember?

Next: edit /var/lib/gitolite/.gitolite.rc and change this line:

$REPO_UMASK = 0077; # gets you 'rwx------'

to:

$REPO_UMASK = 0007; # rwxrwx---

This makes sure newly created files/directories by gitolite are also writable by the gitolite group.

Step 7: installing gitlab itself

If everything worked out the system is ready and gitlab itself can be installed:

su -s /bin/bash gitlab.host.tld
cd ~/public_html
git clone git://github.com/gitlabhq/gitlabhq.git .

Step 8: Install the gitlab dependencies

This one is tricky. Maybe I forgot to list some build dependencies or maybe the added some extra dependencies since I wrote this. If this doesn’t succeed: read the logs (especially mkfm.log).

bundle install --deployment

Step 9: configure gitlab

cp config/database.yml.example config/database.yml
cp config/gitlab.yml.example config/gitlab.yml

Here is my gitlab.yml

It has admin_uri defined twice because of bug #1052
If you wouldn’t define it twice (in git_host and git) the rake task `gitlab:app:status` would always fail when you run gitolite under the user `gitolite`.

You can find out the contents of your own database.yml :)

Step 10: installing the database and compiling the assets

bundle exec rake db:setup RAILS_ENV=production
bundle exec rake db:seed_fu RAILS_ENV=production
rake assets:precompile

Step 11: check if your gitlab user has access to gitolite

RAILS_ENV=production rake gitlab:app:status

Rembember bug #1052!

Step 12: starting resque workers

Start at least one resque worker:

./resque.sh

And maybe another one:

./resque.sh

The resque workers are background workers that do `stuff` in the background. I believe for example the adding of ssh keys to gitolite and the parsing of a commit and putting that in the database.

At first I forget to start the resque workers and my keys weren’t properly added to gitolite. The solution to that was in my case:

RAILS_ENV=production rake gitlab:gitolite:update_hooks
RAILS_ENV=production rake gitlab:gitolite:update_keys
RAILS_ENV=production rake gitlab:gitolite:update_repos

Step 13: restart nginx & surf to http://gitlab.host.tld

The title says it all :)

Finally

I copied all the commands from the servers’ bash history command. The order of the commands I wrote down on top of my head so there could be some mistakes there. If you spot something wrong or missing: just contact me of leave a comment.

Some excellent resources:

]]>
http://v3.vanutsteen.nl/2012/07/09/how-to-install-gitlab-on-ubuntu-server-12-04-precise-the-right-way/feed/ 2
Sublime Text 2 http://v3.vanutsteen.nl/2011/10/26/sublime-text-2/ http://v3.vanutsteen.nl/2011/10/26/sublime-text-2/#comments Wed, 26 Oct 2011 21:36:30 +0000 LeonB http://www.vanutsteen.nl/?p=562 I installed sublime text on my Ubuntu 11.10 box but I had some troubled loading external python modules:

loaded 937 snippets
&gt;&gt;&gt; import distutils
Traceback (most recent call last):
  File "&lt;string&gt;", line 1, in &lt;module&gt;
ImportError: No module named distutils

This is how I solved it:

Edited ~/.local/share/applications/sublime.desktop
Especially this line:

Exec="/home/leon/Software/bin/sublime" %U

/home/leon/Software/bin/sublime contains this:

#!/bin/bash
cd /usr/lib/python2.7
/home/leon/Software/SublimeText2/sublime_text

Then I installed some excellent plugins:

]]>
http://v3.vanutsteen.nl/2011/10/26/sublime-text-2/feed/ 0
Choosing a new editor: Emacs vs. Vim http://v3.vanutsteen.nl/2009/10/15/choosing-a-new-editor-emacs-vs-vim/ http://v3.vanutsteen.nl/2009/10/15/choosing-a-new-editor-emacs-vs-vim/#comments Thu, 15 Oct 2009 07:27:49 +0000 LeonB http://www.vanutsteen.nl/?p=393 For php I use Zend Studio for Linux. We have a license at work for it and it is in my opinion the best editor for php. It’s relatively fast and you can use it to quickfix php over an ftp connection.

For Ruby I use netbeans. I would also like to use it for php but it doesn’t allow to quicly open a file via ftp/scp or whatever. And it can sometimes be sloooooowwww. I’ve  seen netbeans used on a Windows platform and there it is much faster.

When I right-click on a project in netbeans for the first time, it takes 5 seconds (not lying!) to render the popup-menu. Come onm take forever!

And because I was now developing with Python I decided to try a new editor. Something more hardcore and lighter. Something nerdy :) So ofcourse I only have two decent options: Vim & Emacs.

I already had try them with Ruby. But I found good Ruby (& Rails) support rather lacking by both of them. I believe that the python comminity is more hardcore and therefore are using more arcane editors :) And maybe because they aren’t afraid to hack away in another language than their own (lisp, vimscript).

I think I have been comparing the two editors for nearly two weeks now. I have spent hours and hours comparing, trying and browsing for blog posts about the two. At the end, I really didn’t know which one to choose. I really suck at deciding something :) So I made a little list of what I find to be strong points of each editor:

VIM:

  • Better syntax highlighting/theming supprt (wombat ftw!!)
  • Faster/smaller
  • No weird handling of new buffers like with emacsclient
  • No daemon like: emacs –daemon
  • Better python integration
  • Easier to make extensions
  • Preview of docstrings when using omni completion

EMACS:

  • Better python-mode
  • No commandmode/normalmode
  • Directory browser/editor
  • Debugger (better integration with external tools)
  • easier to begin
  • Everyting is a buffer™

And now I have chosen to be the editor with which I am going to work is…… (drum roll please) …….:

Gedit!

No, it’s (g)Vim :)

And while writing this article I was looking for a WordPress/blog plugin for Vim and Emacs. At a glance it looked like the wordpress plugin for Emacs was a little bit better. So already I was doubting my decision… So it could be that I switch editor in the next few months :) But I’m first going to really use gvim to see if it fits with my workflow and is really useable for me.

As cherry on the pie, a nice screenshot of my gvim in action:

Vim with python-mode

[update]
I’ve installed Netneans 6.8m2 and it feels a lot faster than 6.7 but python completion is as bad as in 6.7.
[/update]

[update2]
Found out about Vim’s netrw. So Emacs no longer got “Directory browser/editor” as a strong point.
[/update2]

]]>
http://v3.vanutsteen.nl/2009/10/15/choosing-a-new-editor-emacs-vs-vim/feed/ 2
Rmp -> Pmpd http://v3.vanutsteen.nl/2009/09/24/rmp-pmpd/ http://v3.vanutsteen.nl/2009/09/24/rmp-pmpd/#comments Thu, 24 Sep 2009 05:40:00 +0000 LeonB http://www.vanutsteen.nl/?p=362 monty-pythonI’ve ditched Ruby for my mpd project and started using Python. Not that I like python that much more but the Gstreamer library for python is much more complete. I really wanted gapless playback and the Ruby Gstreamer libray just doesn’t support that. If it does by the time you read this: please let me know :)

The new Pmpd project (looking for a better name) can be found on github. The hardest part so far is having to restructure the sources. Python is not a difficult language to master at all but I’m very picky on how everything fits together. My ruby project felt right on that part. But the python equivelant has some things I just don’t like enough up to now.

]]>
http://v3.vanutsteen.nl/2009/09/24/rmp-pmpd/feed/ 0
Ruby on Rails: custom fields on a per-user basis http://v3.vanutsteen.nl/2008/11/12/ruby-on-rails-custom-fields-on-a-per-user-basis/ http://v3.vanutsteen.nl/2008/11/12/ruby-on-rails-custom-fields-on-a-per-user-basis/#comments Wed, 12 Nov 2008 16:42:01 +0000 LeonB http://www.vanutsteen.nl/?p=259 I’m now developing a flexible car database for a couple of hours per week. Our first customer, a Beemer dealer, has a lot of fancy requests. Well, the hired-in Flash developer has these requests actually.

One of them is that they want to save a field in the database that contains a unique identification number for the secondhand cars they sell. But this number is set-up in a way that is unique to BMW’s. So actually, I didn’t want to add this column to the database, ’cause that will mess up my clean database tables.

But then I came up with the idea to add functionality to the website where users (dealers in this case) can add custom columns to their cars / profiles.

Instead of creating this functionality from scratch, I first wanted to know if there are any plugins that have this functionality already. I found these three:

  1. acts_as_free_form
  2. has-magic-columns
  3. acts_as_customizable

I haven’t decided (yet) which is best.

And if you want to roll your own, here’s a nice article about choosing the best structure for dynamic fields.

I realize that the story above is written in truly horrible English. But I really didn’t have the energy to make something nice of it…

]]>
http://v3.vanutsteen.nl/2008/11/12/ruby-on-rails-custom-fields-on-a-per-user-basis/feed/ 4
Compiling jruby from source in Ubuntu Intrepid Ibex http://v3.vanutsteen.nl/2008/11/05/compiling-jruby-from-source-in-ubuntu-intrepid-ibex/ http://v3.vanutsteen.nl/2008/11/05/compiling-jruby-from-source-in-ubuntu-intrepid-ibex/#comments Wed, 05 Nov 2008 06:34:55 +0000 LeonB http://www.vanutsteen.nl/?p=256
Very easy to do:

sudo aptitude install ant openjdk-6-jdk
cd ~/src
svn co http://svn.codehaus.org/jruby/trunk/jruby/
cd jruby
ant
bin/jruby --version
]]>
http://v3.vanutsteen.nl/2008/11/05/compiling-jruby-from-source-in-ubuntu-intrepid-ibex/feed/ 0
Installing fcgid with suexec AND phusion passenger http://v3.vanutsteen.nl/2008/10/28/installing-fcgid-with-suexec-and-phusion-passenger/ http://v3.vanutsteen.nl/2008/10/28/installing-fcgid-with-suexec-and-phusion-passenger/#comments Tue, 28 Oct 2008 19:44:39 +0000 LeonB http://www.vanutsteen.nl/?p=250
It was a troublesome day today. All did not go as planned.

I had to install fcgid + suexec on one of our servers, I had delayed it too long. So I used my how-to and it still worked flawless. But I noticed I hadn’t mentioned what the right were of the suexec binary. So here it goes:

chown root:www-data suexec
chmod 4754 suexec

After the install I restarted Apache and looked at one of the sites. And it worked! I was baffled. That’s the first time I installed fcgid without hours long of searching where the flaw was.

But then I looked at our support system (Redmine) and it didn’t work too well :)

All controllers were being executed ‘n stuff. But the stylesheets, images and javascripts were not loaded. When requesting an image in the browser I got Rails 404-error page. Huh? Apache should have handled that request. At first I thought it was because of some changes I made to the virtualserver configuration of an other Rails site. But after some trial and error I couldn’t find anything that was wrong.

Then I removed the .htaccess from the public directory of Redmine. That once worked for one of my rails sites. But no cigar. Then I noticed that there were a lot of dispatch*example.rb’s in the public directory. And: after removing them, the stuff worked. So it seems like Rails or Phusion Passenger uses some kind of fuzzy matching when searching for a dispatch.rb. And it first just worked because fcgid was not installed. So I don’t know who’s to blame. But the problem is solved. Phew!

]]>
http://v3.vanutsteen.nl/2008/10/28/installing-fcgid-with-suexec-and-phusion-passenger/feed/ 0
Rails vs. Merb http://v3.vanutsteen.nl/2008/09/24/rails-vs-merb/ http://v3.vanutsteen.nl/2008/09/24/rails-vs-merb/#comments Wed, 24 Sep 2008 21:25:12 +0000 LeonB http://www.vanutsteen.nl/?p=236 This will be a short post: I like merb/datamapper better. It’s cleaner and faster.

But, I have to finish a project this week and merb/datamapper is not just stable yet, has less documentation, less plugins, less helpers and less features.

For example, the “has and belongs to many” association in datamapper isn’t fully implemented (look a the tests). There are some nice backend generators for Rails. And if you have to finish a project in too little time, it’s a quick decision.

I know, I could also make/fix this stuff for merb and datamapper myself and I would love to. But there just isn’t enough time! Aaarghhh…

]]>
http://v3.vanutsteen.nl/2008/09/24/rails-vs-merb/feed/ 0
Asset directories and capistrano http://v3.vanutsteen.nl/2008/09/15/asset-directories-and-capistrano/ http://v3.vanutsteen.nl/2008/09/15/asset-directories-and-capistrano/#comments Mon, 15 Sep 2008 20:46:03 +0000 LeonB http://www.vanutsteen.nl/?p=213 I have this public/images/cars directory but it gets overwritten everytime I use “cap deploy”. So in order to have my images/cars directory saved every time, I used this addon for capistrano:

set :assets, ['images/cars']

namespace :deploy do
  task :after_deploy do
    copy_assets
  end
end

namespace :deploy do
  desc "Link in the production database.yml"
  task :copy_assets do
  self.assets ||= []
    assets.each do |asset|
      run "cp -r #{previous_release}/public/#{asset} #{release_path}/public/#{asset}"
    end
  end
end

Worked like a charm for me!

]]>
http://v3.vanutsteen.nl/2008/09/15/asset-directories-and-capistrano/feed/ 0
Deploying, merb, capistrano & passenger http://v3.vanutsteen.nl/2008/09/10/deploying-merb-capistrano-passenger/ http://v3.vanutsteen.nl/2008/09/10/deploying-merb-capistrano-passenger/#comments Wed, 10 Sep 2008 12:38:08 +0000 LeonB http://www.vanutsteen.nl/?p=196 First of all I did a:

capify .

And used this deploy.rb

Then to setup the current, releases, etc. directories:

cap deploy:setup

Then, when I tried to login via ssh with shared key: nothing!
After some searching I found out that capistrano messed up the permissions on the .ssh directory :(

To fix it:

chmod 755 $HOME
chmod 755 $HOME/.ssh
chmod 644 $HOME/.ssh/authorized_keys
]]>
http://v3.vanutsteen.nl/2008/09/10/deploying-merb-capistrano-passenger/feed/ 0
Installing merb on phusion passenger http://v3.vanutsteen.nl/2008/09/08/installing-merb-on-phusion-passenger/ http://v3.vanutsteen.nl/2008/09/08/installing-merb-on-phusion-passenger/#comments Mon, 08 Sep 2008 12:42:50 +0000 LeonB http://www.vanutsteen.nl/?p=192
I’ve created a little merb app for a customer. The reason I chose merb because I really like the :provides-api. The app had to generate a lot of xml, so using Merb was really nice.

But the installation on the server was a little troublesome. I had to install some gems (which I of course forgot to do) and I had to figure out how the file permissions had to be.

First step: installing software

aptitude install build-essential ruby1.8-dev libxml2-dev libmysql++-dev
gem install merb datamapper do_mysql merb_datamapper --include-dependencies --no-ri --no-rdoc
gem update --include-dependencies
passenger-install-apache2-module

Step two: project’s dependency packages

aptitude install libmagick9-dev libtidy-0.99-0
gem install orderedhash shared-mime-info rmagick tidy

But the big problem here was libtidy! All the packages keep segfaulting. So I had to use the Gutsy or Feisty package (don’t remember which one exactly. One of the two :) ).

Step three: config.ru

Because I wanted to run Merb on apache2 with Phusion passenger I had to create a config.ru file. The contents of the file can be found on the merbivore wiki.

Last step: Adjusting permissions

I was ready to start merb, but when I tried to start it, it kept complaining about permission errors. So after a little fiddling I chmod’ed the whole shebang to 750. I think it will be solved if I install suexec on the server.

]]>
http://v3.vanutsteen.nl/2008/09/08/installing-merb-on-phusion-passenger/feed/ 0
Just some stuff http://v3.vanutsteen.nl/2008/07/21/just-some-stuff/ http://v3.vanutsteen.nl/2008/07/21/just-some-stuff/#comments Mon, 21 Jul 2008 20:54:16 +0000 LeonB http://www.vanutsteen.nl/?p=145 Just some quick links!

This links describes how to manage multiple databases with Capistrano. That’s not why I picked it though. I liked it because it shows the “<<: *” syntax of yaml.

And a repository of Ubuntu Hardy Heron debs for mod_rails/Phusion passenger. At this time I installed mod_rails via rubygems. But if the guys at brighbox make the package so it builds/installs the Apache module automatically (without human intervention and pressing Y two times) I will install that one. Much, much nicer to use with Puppet.

]]>
http://v3.vanutsteen.nl/2008/07/21/just-some-stuff/feed/ 0
Installed passenger a.k.a. mod_rails http://v3.vanutsteen.nl/2008/07/16/installed-passenger-aka-mod_rails/ http://v3.vanutsteen.nl/2008/07/16/installed-passenger-aka-mod_rails/#comments Wed, 16 Jul 2008 19:43:24 +0000 LeonB http://www.vanutsteen.nl/?p=139
Today I’ve installed Phusion passenger on one of our servers. I wanted Redmine for one of our projects so this seemede a nice opportunity to install it.

Installation was a breeze. For mod_rails as well Redmine.

So I was thinking: we have mod_rails installed, we could offer some rails hosting to attract new customers.

But I see three bears on the road with using mod_rails in a shared hosting environment.

1. Same user

Every mod_rails site runs on the same user :( I’ve spent hours on configuring fastcgi and suexec. But now every hosting custommer’s scripts run under their own user. Would be nice if mod_rails supported something like that.

2. Memory

I couldn’t find an option to limit the memory usage per mod_rails site. And I know how memory hungry rails can be :(

3. Aliases

Mod_rails doesn’t support host aliases. This is overcomable but feels like a hack. Wouldn’t it be nice if mod_rails supported aliases :) Pleeeeeeaaaaase?

Maybe I haven’t read the documentation to well and are my points useless :) In that case: please let me know!

]]>
http://v3.vanutsteen.nl/2008/07/16/installed-passenger-aka-mod_rails/feed/ 0
Installing ruby 1.8.7 (and guessnet) on Hardy http://v3.vanutsteen.nl/2008/06/29/installing-ruby-187-and-guessnet-on-hardy/ http://v3.vanutsteen.nl/2008/06/29/installing-ruby-187-and-guessnet-on-hardy/#comments Sun, 29 Jun 2008 11:52:04 +0000 LeonB http://www.vanutsteen.nl/?p=111 There were some vulnerabilities in Ruby which are supposedly fixed in ruby 1.8.7. Because of that and because it’s always nice to have the latest, I installed ruby from Ubuntu Intrepid on Hardy Herron.

And while I was doing that I also decided to install guessnet from Intrepid. So I don’t have to compile guessnet anymore.

It involves two steps:

  1. Updating you apt sources
  2. Making sure only ruby and guessnet are going to be installed from the new sources. Not all the packages!

1. Updating your sources

Create /etc/apt/sources.list.d/intrepid.list and copy the following code into it:

deb http://nl.archive.ubuntu.com/ubuntu/ intrepid main restricted multiverse
deb-src http://nl.archive.ubuntu.com/ubuntu/ intrepid main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://nl.archive.ubuntu.com/ubuntu/ intrepid-updates main restricted multiverse
deb-src http://nl.archive.ubuntu.com/ubuntu/ intrepid-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
deb http://nl.archive.ubuntu.com/ubuntu/ intrepid universe
deb-src http://nl.archive.ubuntu.com/ubuntu/ intrepid universe
deb http://nl.archive.ubuntu.com/ubuntu/ intrepid-updates universe
deb-src http://nl.archive.ubuntu.com/ubuntu/ intrepid-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.

## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://nl.archive.ubuntu.com/ubuntu/ intrepid-backports main restricted universe multiverse
# deb-src http://nl.archive.ubuntu.com/ubuntu/ intrepid-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository. This software is not part of Ubuntu, but is
## offered by Canonical and the respective vendors as a service to Ubuntu
## users.
deb http://archive.canonical.com/ubuntu intrepid partner
# deb-src http://archive.canonical.com/ubuntu intrepid partner

deb http://security.ubuntu.com/ubuntu intrepid-security main restricted multiverse
deb-src http://security.ubuntu.com/ubuntu intrepid-security main restricted
deb http://security.ubuntu.com/ubuntu intrepid-security universe
deb-src http://security.ubuntu.com/ubuntu intrepid-security universe

2. Apt preferences

If /etc/apt/preferences does not exist, touch it!

Then copy this code into it:

Package: *
Pin: release v=8.10
Pin-Priority: -1
Package: ruby
Pin: release v=8.10
Pin-Priority: 500

Package: ruby1.8
Pin: release v=8.10
Pin-Priority: 500

Package: libruby
Pin: release v=8.10
Pin-Priority: 500

Package: libruby1.8
Pin: release v=8.10
Pin-Priority: 500

Package: rdoc
Pin: release v=8.10
Pin-Priority: 500

Package: rdoc1.8
Pin: release v=8.10
Pin-Priority: 500

Package: ri
Pin: release v=8.10
Pin-Priority: 500

Package: ri1.8
Pin: release v=8.10
Pin-Priority: 500

Package: irb
Pin: release v=8.10
Pin-Priority: 500

Package: irb1.8
Pin: release v=8.10
Pin-Priority: 500

Package: libopenssl-ruby
Pin: release v=8.10
Pin-Priority: 500

Package: libreadline-ruby
Pin: release v=8.10
Pin-Priority: 500

Package: libreadline-ruby1.8
Pin: release v=8.10
Pin-Priority: 500

Package: ruby-dev
Pin: release v=8.10
Pin-Priority: 500

Package: ruby1.8-dev
Pin: release v=8.10
Pin-Priority: 500
Package: guessnet
Pin: release v=8.10
Pin-Priority: 501

That’s all! “Aptitude update” & “aptitude install ruby guessnet” and you are good to go.

I tried using the “Package” keyword with wildcards, but that’s a no-go :(

]]>
http://v3.vanutsteen.nl/2008/06/29/installing-ruby-187-and-guessnet-on-hardy/feed/ 16
Puppet troubles http://v3.vanutsteen.nl/2008/06/20/puppet-troubles/ http://v3.vanutsteen.nl/2008/06/20/puppet-troubles/#comments Fri, 20 Jun 2008 20:17:41 +0000 LeonB http://www.vanutsteen.nl/?p=100 I’ve installed puppet recently and I’m know trying to understand how it works and make use of it :)

If that’s not difficult enough, I encountered this weird behaviour that the –noop argument didn’t do anything. After an hour of searching I realized it was my own stupid fault!

I had to puppet configuration files: /etc/puppet/puppetd.conf (old way) and /etc/puppet/puppet.conf (new way). I browsed throught the source code and it looks like puppet first checks the old file, if it is found it parses that one. If it’s not found, the new file is parsed. I don’t know why, but if the old file is used, the –noop argument isn’t parsed by puppet. So removing /etc/puppet/puppetd.conf was all I had to do. Pffff….

But why did I create the puppetd.conf file? Because I’v read the “Pulling strings with puppet”-book. And althought it’s fairly new, puppet is advancing at a very high rate. So the book is becoming out-of-date already.

]]>
http://v3.vanutsteen.nl/2008/06/20/puppet-troubles/feed/ 2
Released callbacks 0.0.1 http://v3.vanutsteen.nl/2008/05/20/released-callbacks-001/ http://v3.vanutsteen.nl/2008/05/20/released-callbacks-001/#comments Tue, 20 May 2008 20:20:49 +0000 LeonB http://www.vanutsteen.nl/?p=70 Hi all! I’ve released my first project on rubyforge. The sourcecode is on github though. For the  simple reason that my git repository on rubyforge doesn’t work (yet). I hope they will fix it soon.

I’ve setup the project with the wonderful bones of Tim Pease.

I’ve got some reasonable documentation about it, a kick-ass website (stolen from Dr. Nic’s newgem) and some nice unit tests. I’m now integrating the gem in one of my own projects. If that’s succesfull I’m gonna release a version 0.1. The version after 0.1 will have new features.

The website ws generated with webby. A really nice way to create static websites in ruby. Maybe I’ll dedicate a post/tutorial to webby.

So please look at the website, install the gem and give me some feedback. It will be very appreciated!

]]>
http://v3.vanutsteen.nl/2008/05/20/released-callbacks-001/feed/ 0
Interactive/inline editor in irb http://v3.vanutsteen.nl/2008/05/12/interactiveinline-editor-in-irb/ http://v3.vanutsteen.nl/2008/05/12/interactiveinline-editor-in-irb/#comments Mon, 12 May 2008 13:26:13 +0000 LeonB http://www.vanutsteen.nl/?p=62

I saw the MountainWest Ruby conference video: code generation: safety scissors of metaprogramming. And the speaker (Giles Bowkett) used vi from inside irb. And I’ve never liked Vi, but using an editor from within irb is nice! Especially if you’re testing a big chunk of code.

So I began crawling the Internet for how he did this and I found the utility_belt gem. The utility belt contains the file I needed. So I installed the gem, edited my .irbrc and now I can use nano/gedit (or any other editor) from withing IRB!

These were the steps:

gem install utility_belt

My .irbrc:

require 'utility_belt/interactive_editor'
module InteractiveEditing
def nano
edit_interactively(:nano)
end
end

Now to use nano in irb, just type: nano

And the bonus: a nice screencast that shows this feature in action. I tried to edit it with pitivi. But that really sucked. After I finally found it out how I could cut pieces I tried to save it and the whole program crashed. “apt-get remove pitivi”!

]]>
http://v3.vanutsteen.nl/2008/05/12/interactiveinline-editor-in-irb/feed/ 0
Up to date on GIT http://v3.vanutsteen.nl/2008/04/08/up-to-date-on-git/ http://v3.vanutsteen.nl/2008/04/08/up-to-date-on-git/#comments Tue, 08 Apr 2008 20:14:14 +0000 LeonB http://www.vanutsteen.nl/?p=26 GithubI’ve been using GIT now some weeks (for my ultra-secret ruby project) and I must say it’s nice. Nothing more than nice. Just like svn was nice to use (compared to old-school full backups). When I first saw the GIT commands I was dazzling with confusion. But after two days you get the hang of it. I haven’t done anything special like branching so I can’t tell you about the advanced features. But the base is solid.

Ow, and github is really nice. I read somewhere that rubyforge now has git support too. Gonna check that out. But beating github will be difficult. Well, at least for now when Github is still free of charge!

]]>
http://v3.vanutsteen.nl/2008/04/08/up-to-date-on-git/feed/ 0
testing and Rails http://v3.vanutsteen.nl/2008/02/26/testing-and-rails/ http://v3.vanutsteen.nl/2008/02/26/testing-and-rails/#comments Tue, 26 Feb 2008 14:45:59 +0000 LeonB http://www.vanutsteen.nl/2008/02/26/testing-and-rails/ Ratatouille

As a “professional” webdesigner I know how much testing sucks and how it, at the same time, is one of the most important things to do (besides coding the stuff). That’s why I appreciate Rails’ very complete testsuite so much. And now with Rspec user stories (a nice tutorial here and here) and webrat it’s getting even better!

]]>
http://v3.vanutsteen.nl/2008/02/26/testing-and-rails/feed/ 0
Installing jruby http://v3.vanutsteen.nl/2008/02/25/installing-jruby/ http://v3.vanutsteen.nl/2008/02/25/installing-jruby/#comments Mon, 25 Feb 2008 09:42:36 +0000 LeonB http://www.vanutsteen.nl/2008/02/25/installing-jruby/ I used this resource:

http://rorblog.techcfl.com/2008/02/19/create-and-deploy-a-jruby-app-to-the-glassfish-gem-in-10-minutes-or-less-on-mac-os-x/

How to install jruby on Ubuntu:

sudo -i
mdir -p ~/src/jruby/trunk
cd ~/src/jruby/trunk
svn svn.codehaus.org/jruby/trunk/jruby/ .
ant
~/src/jruby/trunk/bin/jruby --version

The current version doesn’t work to well with rails’ script/console. It is very, very, very slow. So I keep using Yarv until this is fixed. It seems really promising though. Can’t wait for Rubinius to become stable!

]]>
http://v3.vanutsteen.nl/2008/02/25/installing-jruby/feed/ 0
Rdoc and Rails http://v3.vanutsteen.nl/2008/02/06/rdoc-and-rails/ http://v3.vanutsteen.nl/2008/02/06/rdoc-and-rails/#comments Wed, 06 Feb 2008 22:38:05 +0000 LeonB http://www.vanutsteen.nl/?p=6 With my fabulous new project: mpd_radio I’m trying to everything right: tests, documentation, the whole shebang. So I was surfing tonight for some tutorials on rdoc. But I couldn’t find a lot. Some useful links:

When I learn some more about it I’ll post it here!

]]>
http://v3.vanutsteen.nl/2008/02/06/rdoc-and-rails/feed/ 0
What’s all this git stuff anyway? http://v3.vanutsteen.nl/2008/02/05/whats-all-this-git-stuff-anyway/ http://v3.vanutsteen.nl/2008/02/05/whats-all-this-git-stuff-anyway/#comments Tue, 05 Feb 2008 20:57:27 +0000 LeonB http://www.vanutsteen.nl/?p=5 I’m reading a lot about git lately. Supposedly it’s the next greatest revision control software. It’s faster, better and doesn’t take the enormous amount of space subversion does. Maybe I’ll try it anytime soon but I don’t see any obvious advantages for using git over subversion.

I think using git’s a lot more trouble. Does capistrano work? Where am I going to host my project? Does netbeans support git? Is there enough git documentation for dumb people like me?

]]>
http://v3.vanutsteen.nl/2008/02/05/whats-all-this-git-stuff-anyway/feed/ 0