sandip's blog

nVidia Display Driver with Fedora Core 5 -- Upgrade Notes

The upgrade from fedora core 4 to fedora core 5 went fairly well ( using the upgrade method mentioned here... ) except for a hiccup with the X display using the current nVidia driver. Luckily Stanton Finley maintains an upto date FC5 installation notes with which I was able to quickly troubleshoot the nvidia display driver.

Here is a synopsis of what I did to fix it:

updated nvidia driver 1.0-8178 on 2.6.16-1.2069 kernel for Linux/x86

If you have updated to the latest FC4 kernel -- kernel-2.6.16-1.2069_FC4 and the nvidia driver will not compile with this version ( errors out while trying to compile a kernel module with NVIDIA-Linux-x86-1.0-8178-pkg1.run ) then head over to nvnews.net and apply the cumulative patch mentioned there.

I have repackaged the updated 1.0-8178 driver into a custom .run package and can be downloaded here -- NVIDIA-Linux-x86-1.0-8178-pkg0-custom.run

md5sum: 4a6afb103e18a9263df71861752133f0

Reset MySQL root Password

Recently, I forgot the root password for MySQL and went about resetting it as below:

  1. Stop mysqld and restart it with:
    # service mysqld stop
    # mysqld_safe --skip-grant-tables --user=root
    
  2. Connect to the mysqld server with this command:
    sql> mysql -u root
    
  3. Issue the following statements in the mysql client:
    mysql> UPDATE mysql.user SET Password=PASSWORD('newpassword') WHERE User='root';
    mysql> FLUSH PRIVILEGES;
    

    Replace “newpassword

Drifting Mouse problem on Dells - Solution for Linux Fedora Core 4

I have had a Dell Latitude D800 for over a year now and recently had the dreaded "Drifting Mouse" problem as discussed in the Dell Support Forum.

Fortunately, I also came across a linux solution which talks about disabling the "Stick Pointer" using the "Synaptics Driver" which comes default with FC4.

Here is the gist of it which worked for me:

How to fix _Can't open file: 'sessions.MYI'_ in Drupal

This seems to occur if mysql crashes for some reason and corrupts the sessions table for Drupal.
Here is a quick way to resolve this and I have used it in the past...

mysql> REPAIR TABLE sessions QUICK;

You can also use phpmyadmin to repair the table.

Related Reading: MySQL Database Repair

Eliminate Command Line Histories with chattr (change attribute)...

If you use bash as the default shell, it keeps a history of commands accessed via the `history` command for convenience. This could end up being a security problem if someone were able to compromise a users' home directory. In some cases, this could expose improperly used passwords or special privileges available to the user such as sudo.

Consider disabling this by changing the attribute of the file to lock out the ability to update the file. As root:

# cat /dev/null > ~user/.bash_history
# chattr +i ~user/.bash_history

The user will still have a command line history, but it will only apply to the current session. When the user logs out, the information will not be saved. To have this apply to all future users, make the changes in the "/etc/skel" directory.

Compiling support for XSLT in PHP

XSLT, Extensible Stylesheet Language (XSL) Transformations is a language for transforming XML documents into other XML documents. It is a standard defined by The World Wide Web Consortium (W3C). Information about XSLT and related technologies can be found at http://www.w3.org/TR/xslt.

PHP XSLT extension only supports the Sablotron library from the Ginger Alliance. The extension does not come standard with Redhat Enterprise... and the compilation was a bit tricky. So if you are having difficulty, theses notes may help you some...

Training SpamAssassin

I use SquirrelMail and seperate out my missed spam email to a "Train/SPAM" folder and the wrongly tagged ones to "Train/HAM" folder and automate the process of training SpamAssassin via a daily cron.

Put the "SAtrain.sh" file in "/etc/cron.daily" directory.

  #!/bin/bash
  # SAtrain.sh

  # Trains SpamAssassin with Spam and Ham mbox feeds...
  # Put this file in "/etc/cron.daily" directory.
  # chmod 700 "/etc/cron.daily/SAtrain.sh"

  echo "Training SpamAssassin Begin:"
  echo "Learning from Spam..."
  /usr/bin/sa-learn --spam --configpath=/etc/mail/spamassassin --showdots --mbox /home/user/mail/Train/Spam
  sleep 10
  echo "Learning from Ham..."
  /usr/bin/sa-learn --ham --configpath=/etc/mail/spamassassin --showdots --mbox /home/user/mail/Train/Ham
  sleep 10
  echo "Clearing Spam Feed..."
  cat /dev/null > /home/user/mail/Train/Spam
  echo "Clearning Ham Feed..."
  cat /dev/null > /home/user/mail/Train/Ham
  echo "Training SpamAssassin Completed!"
  

With spamassassin trained daily and my "required_hits set to 1.9" in my "~/.spamassassin/user_prefs" file, I have been able to get an accuracy of emails being tagged as spam for about 99.9% of my emails... Woohooo!!

Related Reading:

Bayes In SpamAssassin
Bayes FAQ

AutoReject Rogue Virus / Worm Mail generating infected IP via sendmail access list

MailScanner is good at filtering out the emails with attached worms and viruses. However, it does this at the expense of a high server cpu load when there is a sudden influx of auto-generated email bombardment from an IP that has been infected.

Most recent of which causing havoc is the Nyxem.E (aliases: Email-Worm.Win32.Nyxem.e, Kama Sutra, W32/MyWife.d@MM) worm set to execute on the third of each month (e.g. February 3, 2006).

Here is a quick documentaion of what I have done to autoreject emails from ISPs that are generating rogue emails.

How to create a favicon (icon displayed in the browsers location bar) with Gimp

If you notice your http error logs with a lot of messages such as "File does not exist: ... favicon.ico". You are missing an icon for your website which is displayed in the browsers location bar and also within the browser bookmarks.

Here's an easy way to create one with Gimp:

  1. Open the image you want to create the icon for, with Gimp.
  2. Resize the image to a 16x16 pixel.
  3. When you go to save, "Select File Type (By Extension)".
  4. Save as "Microsoft Windows Icon" -- ico .
  5. Name it "favicon.ico".
  6. Upload the favicon.ico file to the websites home directory.

When you visit your website, you should now have a cool new icon displayed within the browsers location bar!!

Comment