mod_fcgid tips

Make sure you set IPCCommTimeout to at least 45 to allow enough startup
time.
Set DefaultMaxClassProcessCount to 2 unless your benchmarks tell you to
change.
Set IdleTimeout to 3600 or higher since your only have 2 dispatch.fcgi.
Set ProcessLifeTime to a multiple of IdleTimeout.
Set MaxProcessCount > DefaultMaxClassProcessCount so you can use
mod_fcgid for other things than rails.

mod_fcgid religiously kills idle or old processes so keep IdleTimeout
and ProcessLifeTime to high values.

Here is an example ‘starter’ /etc/apache2/mods-enabled/fcgid.conf


AddHandler fcgid-script .fcgi
SocketPath /var/lib/apache2/fcgid/sock
IdleTimeout 3600
ProcessLifeTime 7200
MaxProcessCount 8
DefaultMaxClassProcessCount 2
IPCConnectTimeout 8
IPCCommTimeout 60
DefaultInitEnv RAILS_ENV production

If you have plenty of RAM, then increase DefaultMaxClassProcessCount to
about 2*CPU–assume each instance will eat 20-30MB RAM.

Tamil Unicode fonts in OS X

Since the release of the latest Mac OS version 10.4 (Tiger), Tamil Unicode support is available at the operating system level for Apple computers. The system software comes with a Tamil Unicode font called InaiMathi, which can display all Tamil characters. The OS provides two keyboard layout options: Murasu Anjal (somewhat phonetically based) and Tamilnet99.

Tamil Unicode webpages should display correctly by default. To enable Tamil Unicode keyboard support on Mac OS 10.4, do the following:

  1. Open “System Preferences…” (available under the Apple sign)
  2. Select “International” (under Personal)
  3. Select “Edit List…” (under Language)
  4. Click “Show” (next to Tamil)
  5. Click “OK”
  6. Select “Input Menu” (under International)
  7. Click “ON” next to Murasu Anjal Tamil
  8. Confirm that Anjal and Tamil99 are selected (under Murasu Anjal Tamil)
  9. Close the window (press red button)
  10. To input in Tamil, click on the national flag menu (likely US flag) on the vertical bar at the top of the screen and select one of the keyboards. The font will by default be InaiMathi.

Technorati Tags: , ,

Expect/Bash script with timeout

A friend of mine wanted a script (in bash), which would try to mount/cd to an NFS (mounted share). But he had problems when the the NFS share was not mounted or the cd command timed out. He wanted certain actions to be done when the command succeeded or when it timed out. Here is the script which I cooked up for him (could make it better, but this gives an overall picture of using expect and bash together in a single script)


#!/bin/bash

# change this to the actual command that needs to run.
# Two Sample command have been given here

cmd="mount -t nfs hotmail.com:/mailbox/easwar/ /easwar/"
#cmd="cd /usr/sap/trans/"

# how long should I wait ?
cmd_timeout=5

# dont edit this
cmd_status=`/usr/bin/expect <

Using Fedora Install DVD as Yum repository

It’s particularly useful to set up a local [core] repository in Fedora Core 6 to take files from local repository instead of having to go to the Internet to get them.

In Fedora Core 5 and above, the installer is based on yum and so there is actually yum repository metadata present on the DVD.

1. Create a directory for your repository and mount the DVD ISO there:

# mkdir -p /path/to/your/repo
# mount -r -o loop /path/to/FC-6-i386-DVD.iso /path/to/your/repo

3. Configure yum to use your new repository

edit /etc/yum.repos.d/fedora-core.repo. Comment out any line starting with baseurl or mirrorlist in the [core] repository section at the top and add a new line: baseurl=file:///path/to/your/repo