sandip's blog

Ironing out FC5 to FC6 upgrade...

After reading much about and seeing screen-captures of the new Fedora Core 6, I decided to upgrade to it. Unfortunately, when FC6 booted up nothing mentioned or shown in the reviews came up by default. I had to go around finding out what was missing and installing the applications that would have otherwise been installed by default (if it were a new install instead of an upgrade).

Here is a quick recap of what I did:

Explore Open Source

Ohloh collects software metrics from a variety of sources including the project’s source code and the software development infrastructure used by the project’s development team and analyzes it to produce very interesting reports such as PHP Eats Rails for Breakfast.

Sendmail config regeneration

Regenerate sendmail config:

# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

Regenerate access file:

# makemap hash /etc/mail/access.db < /etc/mail/access

Generate new aliases:

# newaliases

Firefox2.0 Tips...

This is going to consist of tips on Firefox2.0 usage. If you have any good tips please leave it in the comments.

Hide Go Button

Type in "about:config" in the address bar, then do a search for "hideGoButton" and toggle the value to "true".

Tailing several files...

I wasn't aware you could tail several files until I had to find a way to track what was going on all the virtual web sites:

$ tail -f /home/virtual/*.*/var/log/httpd/*log

If you only want to see the 404 errors:

$ tail -f /home/virtual/*.*/var/log/httpd/*log | grep " 404 "

Ironing out Ubuntu Dapper to Edgy upgrade...

I took the jump from Dapper (6.06) to Edgy (6.10) with quite a flawless upgrade initiated by:

$ gksu "update-manager -c"

Had to comment out the PLF repositories before I could do the upgrade.

## PLF REPOSITORY
# deb http://packages.freecontrib.org/ubuntu/plf dapper free non-free
# deb-src http://packages.freecontrib.org/ubuntu/plf dapper free non-free

The first thing I did after the upgrade was to enable the universe and multiverse repositories via Synaptics and run an upgrade and autoclean via aptitude to clean out any unused and downloaded packages:

$ sudo aptitude upgrade
$ sudo aptitude autoclean

Also noticed that the default shell had been changed to dash instead of the familiar bash on linux distros, so I removed the symbolic link for "/bin/sh" from dash to bash:

$ sudo rm -rf /bin/sh
$ sudo ln -s /bin/bash /bin/sh

The default video driver didn't quite work too well with my nvidia card and so installed nvidia-glx and enabled it.

$ sudo aptitude install nvidia-glx
$ sudo  nvidia-glx-config enable
$ sudo nvidia-xconfig

With the nvidia glx driver and the new kernel installed, I edited "/etc/grub/grub.conf" to point to the new kernel:

title Ubuntu Edgy 386
        root (hd0,2)
        kernel /vmlinuz-2.6.17-10-386 ro root=/dev/mapper/vg00-lv00
        initrd /initrd.img-2.6.17-10-386

Gave the system a reboot and everything seemed to be back to normal... but not until I opened up firefox and noticed the font rendering was blurred and ugly, unlike the crisp fonts on other application. Checked on some of the bug reports at launchpad.net and indeed found a fix there. The fix mentioned was to create a ".font.conf" file with the below contents in the home directory:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font" >
  <edit mode="assign" name="rgba" >
   <const>rgb</const>
  </edit>
</match>
<match target="font" >
  <edit mode="assign" name="hinting" >
   <bool>true</bool>
  </edit>
</match>
<match target="font" >
  <edit mode="assign" name="hintstyle" >
   <const>hintfull</const>
  </edit>
</match>
<match target="font" >
  <edit mode="assign" name="antialias" >
   <bool>true</bool>
  </edit>
</match>
</fontconfig>

Tomboy -- a wiki for the desktop had been made available by default with Edgy but did not show up anywhere in the Applications list so added it to the top panel from the list of Accessories available.

Last but not the least my boot time is now about 12 seconds on a 1.75Ghz cpu laptop with 1Gig of memory... all due to the new init system, upstart which is now the default.

Reducing Spam with milter-greylist

milter-greylist is a sendmail milter which implements the greylist filtering method, as proposed by Evan Harris.

Greylisting works by assuming that, unlike legitimate MTA, spam engines will not retry sending their junk mail on a temporary error. The filter will always reject mail temporarily on a first attempt, then accept it after some time has elapsed.

So this method of greylisting works very well if used with a combination of DNS-Based Blacklisting as the spammer would have gotten blacklisted in several real-time distributed black lists before the second attempt and effectively reducing spam emails.

Below is an outline of quickly building and installing the greylist milter and configuring sendmail to use the milter. This was done on a RHEL3 box.

Check mail server for open relay

If you are new to setting up a mail server be cautious that you do not open your server accidently and relay mail...

One very simple way of testing it is to run:

$ telnet relay-test.mail-abuse.org

This will attempt to connect back to your machine and run a series of mail relaying tests against it. The success or failure will be printed at the end.

You may need to turn off firewall temporarily during the test or allow for outgoing connection through the firewall.

Tab pages in vim

Window tabs are everywhere and you will find this in the curret version of vim too, which as of this writing is 7.0.042-0.fc5 on fedora-core-5.

Below are notes on how you can quickly navigate between open tabs:

  • Open several fies for editing in seperate tab pages:
    $ vi -p file1 file2 file3...
    
  • Goto next tab:
    gt
    

    or

    :tabn
    
  • Goto previous tab:
    gT
    

    or

    :tabp
    
  • Got to a numbered tab where "#" is a number:
    #gt
    

    or

    :#tabn
    
  • Rewind to the first tab:
    :tabr
    
  • Open new tab page. Optionally you can provide a filename:
    :tabnew [filename]
    
  • Edit an existing file:
    :tabe {filename} 
    
  • Split the tab page:
    :tab split
    
  • Close all other tab pages:
    :tabo[!]
    
  • Close current tab page:
    :tabc[!]
    
  • To get help using tabpages:
    :tab help tabpages
    

See other related posts on vi.

Swap fails to mount at boot -- resolved!

At some point of my regular yum updates, I noticed there was no swapspace being mounted at boot time. I was however able to manually mount it after booting via, `swapon -a`.

The failure was caused due to SELinux policy and "/etc/fstab" file context settings. I was getting the below message in my logs:

Sep 17 12:12:36 localhost kernel: audit(1158509512.509:51): avc:  denied  
{ read } for  pid=1429 comm="swapon" name="fstab" dev=dm-0 ino=899639 
scontext=system_u:system_r:fsadm_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file

I found my solution in the SELinux FAQ

Syndicate content
Comment