Archive for the ‘How to’ Category

how to – enable spell check in firefox on fedora 12

Tuesday, April 27th, 2010

Quick fix:

$sudo yum install hunspell-en

Further reading:

Firefox does not spell check at Redhat’s Bugzilla

dhclient triggers / hooks with dhclient-script

Thursday, February 18th, 2010

dhclient overwrites custom network configuration (read routes) with the defaults provided from the dhcp server. dhclient-script can be used to set custom rules for dhclient. It provides a way to hook into dhclient before and after updating network configuration.

Application specific DHCP options can be handled by creating a script with two functions and placing it in /etc/dhcp/dhclient.d

The script must follow a specific form:

  1. The script must be named NAME.sh. NAME can be anything, but it makes sense to name it for the service it handles. e.g., network_routes.sh
  2. The script must provide a NAME_config() function to read the options and do whatever it takes to put those options in place
  3. The script must provide a NAME_restore() function to restore original configuration state when dhclient stops
  4. The script must be ‘chmod +x’ or dhclient-script will ignore it

The scripts execute in the same environment as dhclient-script. That means all of the functions and variables available to it are available to your NAME.sh script.

Things of note:

  1. ${SAVEDIR} is where original configuration files are saved. Save your  original configuration files here before you take the DHCP provided values and generate new files
  2. Variables set in /etc/sysconfig/network, /etc/sysconfig/networking/network, and /etc/sysconfig/network-scripts/ifcfg-$interface are available to you

Took me a while to find this documentation. No more surprises from now on when dhclient updates the lease

phplist 2.10.10 : fixing FCK editor’s image upload problem

Wednesday, September 16th, 2009

I spent the last hour fixing this trivial bug. Posting it so that it helps save someone’s time

Open file :

PHPListRoot/admin/FCKeditor/editor/filemanager/connectors/phplist/config.php 

on line number 28 change:

} elseif (is_file('../../../../../../../../config/config.php')) {  

to:

} elseif (is_file('../../../../../../config/config.php')) { 

and on line number 29, change:

  include "../../../../../../../../config/config.php"; 

to

  include "../../../../../../config/config.php"; 

Thats it! Save the file and you should be able to instantly upload images using the FCK editor

vsftpd : Allowing access to folders outside home when “chroot_local_user=YES”

Tuesday, December 2nd, 2008

With ‘chroot_local_users=YES’ vsftpd locks a user to his/her home directory, but every now and then you have a few users who need access to more that one user’s home for some reason or other

Getting around chroot

For the record “ls -s /home/user1 /home/user2″ does not work. chroot will not allow you to get out

Starting for kernel 2.4.Something a filesystem could be mounted on multiple mount points using the –bind option. hence:

$sudo mount --bind /home/user1/ /home/user2/user1

That’s it, log in as user2 and you should be able to see user1’s home. Add it to rc.local so that its mounted on reboot

Set display name of outgoing Emails send by phpBB311

Thursday, November 13th, 2008

phpBB3 [version 3.0.3] by default cannot set the display name in the headers of outgoing emails. You could try all you want from the administration control panel but a look under the hood in the source code will tell you its almost impossible.

Fixing it is pretty easy.

open file phpBB3_root_path/includes/functions_messenger.php
find:
$headers[] = 'From: ' . $this->;from;
replace with:
$headers[] = 'From: Display Name ' . $this->;from;
find:
$headers[] = 'Reply-To: ' . $this->;replyto;
replace with:
headers[] = 'Reply-To: Display Name ' . $this->;replyto;
find:
$headers[] = 'Return-Path: <' . $config['board_email'] . '>;';
replace with:
$headers[] = 'Return-Path: Display Name <' . $config['board_email'] . '>;';
find:
$headers[] = 'Sender: <' . $config['board_email'] . '>;';
replace with:
$headers[] = 'Sender: Display Name <' . $config['board_email'] . '>;';

That should do the trick. Did it work for you ?

ip_conntrack: table full, dropping packet

Friday, September 19th, 2008

Looking at syslog from my load balancing server that runs Linux LVS I noticed something that I had never seen before:
server2 kernel: [43206369.830000] ip_conntrack: table full, dropping packet.
It appears that my server has hit the maximum number of concurrent connections that can be tracked

Increasing the table size

The maximum number of connections tracked can be found by:

$sudo cat /proc/sys/net/ipv4/netfilter/ip_conntrack_max
65536

Time to double to number of connections that the table can track:

$sudo nano /etc/sysctl.conf

and add the line

net.ipv4.netfilter.ip_conntrack_max = 131072

reload the sysctl.conf

$sudo sysctl -p

Further Reading:

Netfilter conntrack performance tweaking

How to connect PyS60 Bluetooth console and Ubuntu 8.04

Saturday, August 23rd, 2008

python bluetooth console There appears to be a bug in Ubuntu 8.04’s bluetooth packages, because of which when someone trying to connect to the serial port of the computer from the mobile phone running Python receives an error message saying “No Serial ports found”. This article provides a quick fix for connecting Python Bluetooth console to a computer running Ubuntu




Diving in

The bug only exist in Ubuntu 8.04’s bluetooth packages. Two packages (bluez-utils and libbluetooth2) have to be updated from debian sid’s repository

  • Download and Install:
  1. bluez-utils from http://packages.debian.org/unstable/admin/bluez-utils for your architecture
  2. libbluetooth2 from http://packages.debian.org/sid/libbluetooth2 for your architecture

In a terminal as normal user:

  1. Reset the HCI device:
    $ hciconfig reset
  2. Check that the device exists:
    $ hcitool dev
  3. Register a serial port (use channel 2. For some reason, channel 1 and channel 3 might not let the connection through)
    $ sdptool add --channel=2 SP
  4. Now listen to the channel:
    $ rfcomm listen rfcomm2 2

In your phone, make sure bluetooth is on, then go to the Python application and then select the Bluetooth Console. Select from the list of available devices your computer’s bluetooth adapter (you might need to select search even if you think you have already defined the pairing). If the operation is successful, you should see something similar to the following on your computer’s shell:

Waiting for connection on channel 2
Connection from 00:1D:FD:EE:86:38 to /dev/rfcomm2
Press CTRL-C for hangup

Now open a new shell terminal and execute:

$ cu -l /dev/rfcomm2

You’re now in control of your mobile’s python console.
Happy hacking !