Initial Ubuntu 8.04 Linux Setup 1

Posted by John Sun, 11 May 2008 20:53:00 GMT

After grabbing and installing Ubuntu 8.04 I then had to put together and setup the baby, luckily I wrote down most of everything I did in case I’d have to do it again and to help out you guys.

What follows are my findings and what I did to fix them. The machine I used is an HP Pavillion dv2000 model dv2742 special edition. It’s got a built-in intel graphics card, 3gb memory, sata 250gb drive, wifi, bluetooth and an intel dual core 2 processor.

I installed the o/s using the 64-bit edition of Ubuntu 8.04 Hardy Heron, all what you see below are workable settings which provided the right setup; hope they help your situation if you go down this route.

Update System

First port of call, check for any new updates post-install,

sudo aptitude update
sudo aptitude upgrade

Dependencies / Software / Setup

Next, install Ruby, FlashPlayer, GCC Compiler, MySQL, JAVA, SqlLite,

sudo aptitude install mysql-server flashplugin-nonfree ruby-full libsqlite3-dev build-essential libmysqlclient15-dev sun-java6-jdk

Volume Mixer,

sudo aptitude install gnome-alsamixer

ImageMagick,

sudo aptitude install imagemagick

Ruby Gem Handler

I could get GEM from the repositories but because with each new update it breaks away from the in-built Linux installer it’s best to install it from source,

wget http://rubyforge.org/frs/download.php/34638/rubygems-1.1.0.tgz 
tar xzvf rubygems-1.1.0.tgz
cd rubygems-1.1.0
sudo ruby setup.rb
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem

Had problems updating the GEM system initally, so logged in as root to finish it off,

su root 
sudo gem update --system

Now when you type gem –version you should see GEM ready to roll,

Gem Libraries

The slow bit, ran this as root just to make sure it worked,

gem install rails
gem install rake
gem install mongrel
gem install mongrel_cluster
gem install thin
gem install capistrano
gem install mysql
gem install termios
gem install sqlite3-ruby
gem install mini_magick

VLC + GIT

Next VLC to play videos,

sudo aptitude install vlc

Transmission for torrents, most important bit,

sudo aptitude install transmission

And GIT to handle code versioning,

sudo aptitude install git-core

Firefox + MS Fonts

Next I need Firebug for Firefox 3. Ubuntu 8.04 comes with Firefox 3 beta 5, the one available thru Tools / Add-ons won’t work with it; but thankfully it’s in the repositories

sudo aptitude install firebug

And you’ll probably need Microsoft Fonts later down the line,

sudo aptitude install msttcorefonts

Pimp GEDIT

The default Gnome Text Editor Isn’t bad but let’s add some extra’s to really kick it in gear,

sudo aptitude install gedit-plugins

And tweak it,

wget http://robzon.kapati.net/rails/rhtml.lang && sudo mv rhtml.lang /usr/share/gtksourceview-2.0/language-specs/
wget http://robzon.kapati.net/rails/rails.xml && sudo mv rails.xml /usr/share/mime/packages
sudo update-mime-database /usr/share/mime

Follow the guide here to get the TextMate look,

Now when you open rails source files they’ll actually look right, thanks Grigio.

PostGreSql + Thunderbird

Pretty easy to install the most powerful db system, and the better email handler

sudo aptitude install postgresql thunderbird

Wine for Windows

Thanks to Google for their support the Wine project is going great, to get Windows software running natively on your machine,

First add the key,

wget -q http://wine.budgetdedicated.com/apt/387EE263.gpg -O- | sudo apt-key add -

Then add the repository to your default repository list,

sudo wget http://wine.budgetdedicated.com/apt/sources.list.d/hardy.list -O /etc/apt/sources.list.d/winehq.list

And finally install it,

sudo apt-get install wine

Effects

To enable compiz effects make sure Appearance / Visual Effects is set to ‘Extra’, then install the Advanced Effects Manager,

sudo aptitude install compizconfig-settings-manager

This will give you access to the 3d cube, skydome effect and a host of other cool addons.

My desktop dpi is set to 100dpi, fonts set to ‘Bitstream Vera Sans Roman 8pt’, with ‘Bitstream Vera Sans Bold 8pt’ for Windows Title; and ‘Liberation Mono 8pt’ for fixed width font. Using subpixel smoothing for LCD.

Sound

For my laptop (hp pavillion dv2000 / dv2742se model), i had to use a different sound mixer to make sure the quickplay volume and mute buttons talked to the sound system.

So from the top menu bar, System / Preferences / Sounds, then set the Default Mixer Tracks hander device to: Conexant CX20561 (hermosa) (oss mixer).

Cleanup

To get any temp files carried on from the install, clean with,

sudo aptitude clean

Job done, however I had a problem with Hibernate & Suspend which was lucky fixed with some advice from here

Building ImageMagick 6.3.8 from source 2

Posted by John Sun, 02 Mar 2008 22:22:00 GMT

Because Ubuntu 7.10 repositories don’t have the latest version of ImageMagick, stopping you install the latest RMagick Ruby Gem; here’s a guide to help you build it from source.

What had Gone Before

Before all this, I had installed the old version of ImageMagick by,

sudo apt-get install imagemagick
sudo apt-get install libmagick9-dev

So as you know before you start.

Remove ImageMagick

First off you’re gonna have to remove your old copy of ImageMagick…

sudo apt-get remove imagemagick

Building & Installing ImageMagick 6.3.8

Now we’re going to get the latest source files for ImageMagick and configure them correctly.

wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-6.3.8-11.tar.gz
tar xvvzf ImageMagick-6.3.8-11.tar.gz
cd ImageMagick-6.3.8-11

Now we’re in the source directory, G

./configure --prefix=/usr

Excellent, let’s build…

sudo make

This will take a while, you may get a few warning pop up but hopefully no show-stoppers; afterwards lets install…

sudo make install

Rmagick Gem

And finally the latest RMagick Gem..

sudo gem install rmagick

If this still fails, you can install the old gem with..

sudo gem install rmagick -v=1.15.12

But fingers crossed let hope the new one works

Did it work?

Yes it all installed, and I’ve now got the RMagick 2.2.2 gem running on Ubuntu 7.10

So, What does it support?

Simple to find out, run the command below to see what version of ImageMagick you’ve got and what it can support.

identify -list format

'Thin' Rails Server + Fedora Cleanup 1

Posted by John Wed, 27 Feb 2008 10:18:00 GMT

Thin

Thanks to Thomas Glasgow, I’ve been told of a new lighter Mongrel web server called THIN. It’s more-so a cut-down version of the Mongrel Web Server, with the added power of an Event machine and Rack parser.

Haven’t tested it out, but intend to try it out on one of my apps, install it with…

sudo gem install thin

Thin - Rake Task

With the above I found a startup script similar to Monrel’s .yml config file.

namespace :thin do
  namespace :cluster do

    desc 'Start thin cluster'
    task :start => :environment do
      `cd #{RAILS_ROOT}`
      port_range = RAILS_ENV == 'development' ? 3 : 8
      (ENV['SIZE'] ? ENV['SIZE'].to_i : 4).times do |i|
        Thread.new do
           port = ENV['PORT'] ? ENV['PORT'].to_i + i : ("#{port_range}
%03d" % i)
          str  = "thin start -d -p#{port} -Ptmp/pids/thin-#{port}.pid"
          str += " -e#{RAILS_ENV}"
          puts "Starting server on port #{port}..."
          `#{str}`
        end
      end
    end

    desc 'Stop all thin clusters'
    task :stop => :environment do
      `cd #{RAILS_ROOT}`
      Dir.new("#{RAILS_ROOT}/tmp/pids").each do |file|
        Thread.new do
          if file.starts_with?("thin-")
            str  = "thin stop -Ptmp/pids/#{file}"
            puts "Stopping server on port #{file[/\d+/]}..."
            `#{str}`
          end
        end
      end
    end

  end
end

copy and paste it into a .rake task in your apps /lib/tasks directory.

then fire with…

rake thin:cluster:start
rake thin:cluster:stop

and…

rake thin:cluster:start RAILS_ENV=production SIZE=10 PORT=8000
  • SIZE = cluster size (2 is usually enough)
  • RAILS_ENV = environment (production, development or test)
  • PORT = port range to start from (for 2 clusters it’ll be 8000 and 8001)

Thanks to Stephen Celis for this.

Fedora Package Errors and Cleanups

Lately i’ve run into some problems with my Fedora package manager, inconsistent files and dropped repositories. However I think I’ve managed to cleanup this problem by first cleaning up my package managers metadata, db cache and doing a general tidyup with…

sudo yum clean all
sudo yum clean metadata
sudo yum clean dbcache

Then giving the once-over of my RPM repository,

sudo rpm -vv --initdb

This looked ok, but I wanted to make sure so I rebuilt my RPM repository,

sudo rm -f /var/lib/rpm/__db*
sudo rpmdb -vv --rebuilddb

Now looking a little better,

Want to install Beryl + Compiz to get the 3D effects and cubed desktop next.

Update on Beryl

After hunting around I found that Beryl has been dropped in favour of Compiz, so don’t go hunting for it because you won’t find it.

Freezing Rails

Posted by John Tue, 18 Dec 2007 00:23:00 GMT

Sometimes with remote server’s you may have to supply the files relating to the current version of rails your writing for in order to run your app on someone else’s server, like mosso.com.

Freezing Rails

So in Terminal, while in your Rails apps directory run:

rake rails:freeze:gems

This will unpack the rails version your using into the /vendor/rails directory of your app.

From there you can upload it to your server and it should just work.

Thawing Out

To reverse the process…

rake rails:unfreeze

This removes the frozen version from your vendor/rails directory.

Picking Up Changes

Also note new rails versions come with config file changes, to pick these up run:

rake rails:update:configs

Freezing to the Edge

You can also freeze (or grab a local development copy) of rails via…

rake rails:freeze:edge

Or Freeze to a specific release with…

rake rails:freeze:edge TAG=rel_2-0-2

This freezes to Rails 2.0.2

Also for…

You can also do this for individual gems, by first grabbing the gemsonrails gem…

sudo gem install gemsonrails

Then moving to your Rails app directory and running…

gemsonrails

This installs some extra RAKE tasks into your app, so now you can freeze a local copy of say the RedCloth gem into your app via…

rake gems:freeze GEM=RedCloth

Rails 2.0.2 from elsewhere

Posted by John Mon, 17 Dec 2007 17:15:00 GMT

Rails 2.0.2 has just been released, more bugfixes than new addons, but worth the download (running it here now).

However it’s only available from http://gems.rubyonrails.org at the moment, but to get it do:

sudo gem install rails --source http://gems.rubyonrails.org

Here, your actually specifying which repository to use to find the gem.

To see what your default source location is:

sudo gem sources

Enjoy,

Older posts: 1 2