Saturday, February 13, 2010

Adjust Sensitive Area of Synaptics Touchpad - Karmic Koala Ubuntu 9.10

Sometimes you may want to adjust the sensitive area (or other settings) of your touchpad. To do so type "synclient -l" in a terminal and you will get a list of options. At the bottom you should see AreaLeftEdge AreaRightEdge AreaTopEdge AreaBottomEdge which are probably set to 0. If you change these to a nonzero value the you it will define the edge of the touchpad. Use your LeftEdge RightEdge TopEdge BottomEdge values as references because they are close to the edge of your touchpad.
After you determine the values you need then you can put them in your HAL configuration file:
/etc/hal/fdi/policy$ cat 11-x11-synaptics.fdi

<deviceinfo version="0.2">
<device>
<match key="info.capabilities" contains="input.touchpad">
<merge key="input.x11_driver" type="string">synaptics</merge>
<merge key="input.x11_options.SHMConfig" type="string">On</merge>

<merge key="input.x11_options.EmulateTwoFingerMinZ" type="string">40</merge>

<merge key="input.x11_options.VertTwoFingerScroll" type="string">true</merge>
<merge key="input.x11_options.HorizTwoFingerScroll" type="string">false</merge>
<merge key="input.x11_options.JumpyCursorThreshold" type="string">300</merge>
<merge key="input.x11_options.AreaBottomEdge" type="string">5000</merge>
<merge key="input.x11_options.TapButton1" type="string">1</merge>
<merge key="input.x11_options.TapButton2" type="string">3</merge> <!--two finger tap -> middle click(3) -->
<merge key="input.x11_options.TapButton3" type="string">2</merge> <!--three finger tap -> right click(2). almost impossible to click -->
</match>
</device>
</deviceinfo>

Getting Fn Buttons Working in Karmic Koala Ubuntu 9.10

Sometimes things like Fn buttons don't work properly in Linux. This can be fixed sometimes by adding "noapic" to the end of the linux line in Grub. Do not confuse this with "noacpi"... they are very different things.

Friday, February 12, 2010

USB Flash Drive Read-Only in GNU/Linux

One reason your USB Flash Drive may be showing up as read-only in GNU/Linux is it may have been removed from a Windows PC without first choosing "Safely Remove Hardware." If this is the cause, simply put it into a Windows PC, then choose "Safely Remove Hardware," then remove and use in GNU/Linux.

It may also work to run a filesystem check in Linux using something like fsck or Gparted.

Boot with Bluetooth Turned Off - GNU/Linux

To boot with bluetooth turned off in GNU/Linux (specifically Ubuntu 9.10 Karmic Koala) add the following to /etc/rc.local :

rfkill block bluetooth

Validate an E-Mail Address with PHP, the Right Way

Jun 01, 2007 By Douglas Lovell

Listing 9. A Complete E-mail Validation Function


Spread the word! There is some danger that common usage and widespread sloppy coding will establish a de facto standard for e-mail addresses that is more restrictive than the recorded formal standard. If you want to fool the spambots, adopt an e-mail address like, {^c\@**Dog^}@cartoon.com. Unfortunately, you might fool some legitimate e-commerce sites as well. Which do you suppose will adapt more quickly?

Douglas Lovell is a software engineer with IBM Research, author of The XSL Formatting Objects Developer's Handbook published by Sams, and Web site editor for iac52.org.

Login to FreeNAS via Passwordless SSH - GNU/Linux

I found this solution on the FreeNAS forums. It's not very straightforward, in my opinion, to setup SSH passwordless login on FreeNAS.

Taken from FreeNAS forums:

What you need to do to customize your server for passwordless authentication:
  1. From WebGUI|Advanced|Execute command or shell
    1. protect the /mnt directory by setting the mode to 755(we don't want users to write on /mnt, that can fill up the RAM disk and crash the system.

      You must change the mod as startup command, after each reboot.

      Code:

      chmod 755 /mnt
    2. For your safety change the mode for each mount, or at least one "mount".

      Code:

      chmod 755 /mnt/mount
    3. Create the user(A) home directory /mnt/mount/userA

      Code:

      mkdir /mnt/mount/userAdir
    4. Make userA the owner of his home directory

      Code:

      chown userA /mnt/mount/userAdir
    5. Secure userA home directory

      Code:

      chmod 700 /mnt/mount/userAdir
  2. Set userA home directory on WebGUI|Access|Users|Edit|Home directory to point to /mnt/mount/userAdir

  3. From your remote client(ssh/PuTTy)
    1. Check if home directory is set corectly for userA. The output should be /mnt/mount/userAdir

      Code:

      ssh -p 22 userA@FreeNASip 'pwd'
    2. Create the .ssh directory

      Code:

      ssh -p 22 userA@FreeNASip 'mkdir .ssh'
    3. Upload your id_rsa.pub or id_dsa.pub to remote .ssh directory.

      Code:

      cat id_rsa.pub | ssh -p 22 userA@FreeNASip 'cat >> .ssh/authorized_keys'
    4. Change the .ssh dir mode

      Code:

      ssh -p 22 userA@FreeNASip 'chmod -R 700 ~/.ssh'
  4. Now try to login passwordless.

Replace Spaces with Underscores - GNU/Linux

rename -v 's/\ /\_/g' *