OpenGL Matrix as Desktop Background

For the last month or so I’ve been using the GL Matrix screensaver built into Gnome as my desktop background, and I’m probably not ever going back to a standard background. Other then the fact that it only takes up 10~15 megabytes to run, it doubles as a screensaver. Finding good 1680×1050 backgrounds isn’t an easy task either..

At any rate, if you would like to use the GL Matrix screensaver as your background you must first disable the nautilus desktop:

gconftool-2 --type bool --set /apps/nautilus/preferences/show_desktop false

Now let’s make the desktop entry for our xserver autostart:

gedit ~/.config/autostart/glmatrix.desktop

Just paste the following into your editor and then save it:

[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=No name
Name[en_IN]=Desktop matrix
Exec=/usr/lib/xscreensaver/glmatrix -root
X-GNOME-Autostart-enabled=true

Once you have done that, restart Gnome by hitting Ctrl+Alt+Backspace.

Going back to the original nautlius desktop is simple:

gconftool-2 --type bool --set /apps/nautlius/preferences/show_desktop true && nautilus
Posted on September 28, 2008 at 8:35 pm

Preliminary Data with Migrations in Rails

At one time or another, you will most likely want your application to set-up with some preliminary data. One common example is a settings or options table within your database, or a default admin user that will be created upon install.

To get this done, is actually a lot easier then you may think..

Simply create a new migration such as:

script/generate migration add_default_user

Now all you need to do is add the data into the migration.

class AddDefaultUser < ActiveRecord::Migration
  def self.up
      User.create(
        :username => 'default', 
        :password => 'password'
       )
  end
 
  def self.down
  end
end

Once you have your migrations the way you like just run

rake db:migrate

to finish the job.

One thing to consider is deleting any records you have added to this migration in the self.down method, depending on your applications requirements. However, I think that this may also be accomplished when the (user) migration is removed.

Posted on at 8:20 pm