Fancy Effects with Emerald

Posted by John
on Monday, 19 May 2008

After the kr0w commented on my Ubuntu install post about the Emerald Theme Manager I had to try it out myself.

Installing

To get emerald and it's dependencies do,

sudo aptitude install emerald

Enabling

Emerald isn't enabled by default in Hardy, but you can enable it in the command line to try it out,

emerald --replace &

To keep it, edit the compiz-decorator file,

sudo nano /usr/bin/compiz-decorator

Look for the line...

USE_EMERALD="no"

Change this to yes, save and next time you boot you'll be using the Emerald Theme Engine.

Keep losing top of windows?

After install Emerald and playing around with it I noticed I kept losing the top bar to my windows and corners, making things pretty unusable.

Found out I needed the Xgl Server which was missing in my build, you can check if this is the problem by,

compiz --replace

This runs checks to see whats available and the health of your compiz setup, mine told me I was missing Xgl.

Which was rectified by,

sudo aptitude install xserver-xgl

And a reboot, after which things started to work right.

Restarting X Server

If things start to break up you can restart the X windowing system with CTRL-ALT-BACKSPACE.

Avant Window Manager

You can also get the Leopard-like dashboard by installing the AWN,

sudo aptitude install avant-window-navigator

This'll really make people green with envy, however after installing that my double-tap issue came back with the touchpad, but that was quickly rectified by editing my xorg.conf file,

sudo gedit /etc/X11/xorg.conf

And adding,

Option          "MaxTapTime"            "0"

Under the options for the Synaptics Touchpad, after a reboot I was back up and running,

'Thin' Rails Server + Fedora Cleanup

Posted by John
on Wednesday, 27 February 2008

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.