Firefox 2 on SimplyMEPIS 6.0

Would you believe it? This is the first time I’m using Firefox 2 on a Linux distro.

My previous attempts (in FC6) to use the binary, just untar and gunzip to /usr/local/firefox failed as there was some library missing, can’t remember the error now when I ran:

$ /usr/local/firefox/firefox

MEPIS however was nice. It worked right out of the box, no configuration required. :)

#debian-linux, #firefox

Ruby/RubyGems on SimplyMEPIS 6.0

# whoami
# gunzip -dc ruby-1.8.5-p12.tar.gz | tar -xof -
# cd ruby-1.8.5-p12
# ./configure
# make
# make test
# sudo make install
# gunzip -dc rubygems-0.9.2.tgz | tar -xof -
# cd rubygems-0.9.2
# ruby setup.rb
Successfully built RubyGem
Name: sources
Version: 0.0.1
File: sources-0.0.1.gem
Removing old RubyGems RDoc and ri...
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- rdoc/rdoc (LoadError)
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from /home/belle/Desktop/rubygems-0.9.2/./post-install.rb:103:in `install_rdoc'
from /home/belle/Desktop/rubygems-0.9.2/./post-install.rb:118:in `try_run_hook'
from setup.rb:584:in `run_hook'
from setup.rb:1322:in `exec_task_traverse'
from setup.rb:1175:in `exec_install'
from setup.rb:894:in `exec_install'
from setup.rb:712:in `invoke'
from setup.rb:681:in `invoke'
from setup.rb:1359

Hmmm. Let’s see what MEPIS is missing. It built perfectly on an unpatched version of FC6 the last time. Its probably got something to do with rdoc:

# apt-get install rdoc
# ruby setup.rb
# apt-get install libyaml-ruby
# apt-get install libzlib-ruby
# gem install rails

There’s probably more; e.g. activerecord and all but that’s enough for today. I shall get Subversion up and running soon too, so this can become my development platform.

Adapted from

#debian-linux, #ruby

Demystifying rc*.d — startup scripts for everybody

First you gotta have some kind of shell script that you want to run on startup; say /etc/init.d/httpd.

Apache2 should run on boot, so we make a symbolic link to it in one (or more) run levels; e.g. /etc/rc5.d/.

# whoami
# cd /etc/rc5.d/
# ln -s ../init.d/httpd S85httpd
# ls -la | grep httpd
lrwxrwxrwx  1 root root   15 Mar 12 10:11 S85httpd -> ../init.d/httpd

Now the /etc/init.d/httpd script will run the next time the system boots to run level 5.


Recursive chmod

When considering the chmod -R command, you may actually be wanting to descend, from some directory into all of its subdirectories to set the file permissions for a particular type of file. Directories should be 755, of course.

Try using:

$ find . -type f -print
$ find . -type f -name *.php -print

#1 will search the present working directory (.) for documents of type file (f) and print onto the standard output.
#2 will search the present working directory (.) for documents of type file (f), with filename ending with “.php” and print onto the standard output.

When you are satisfied that your find command is correct, add the xargs parameter to the end:

$ find -type f -print | xargs chmod 644

This will set file permissions in ALL subdirectories to be 644 or -rw-r–r–.



Javascript error in IE6/7, no complains in Firefox though

Expected identifier, string or number
Object expected

These errors may occur when browsing a JavaScript enabled website using IE (6 or 7, it doesn’t matter). Where Firefox is happily rendering the page, IE will complain, and generally these two come in tandem, because the script has defined a list or group of functions, and the writer has blithely forgotten that you can’t include a comma at the end of the list; e.g.

var list = { some-value: 0.5, some-value-2: 0.5, }

That innocuous comma at the end results in two errors, because the last comma is a syntax error, and later, when using list you’ll find that is undefined. Perfect. Any decent parser should be able to ignore the bloody comma!