Common Web Banner Sizes

I never can find this information when I need it so I am writing it down:

Here are the common web banner sizes:

  • Banner - 468px X 60px
  • Leaderboard - 728px X 90px
  • Skyscraper - 120px X 600px
  • Wide Skyscraper - 160px X 600px
  • Large Rectangle - 336px X 280px
  • Rectangle - 300px X 250px
  • Square - 250px X 250px
  • Small Square - 200px X 200px

I took the name of these sizes from google as they were kind enough to name them

Search and Replace in Files

Here is how to do a search and replace using Perl regex over a set of files:


perl -pi -e 's/source/destination/g' *.ext



Web Development Links

Playing MP3 Files in Fedora 8 using KDE

To play MP3 files in Fedora 8 with KDE you need to add software to your default installation. This software does not come “stock” with KDE because the software is not free and RedHat is required to filter it — therefore if you download this update make sure you check the licensing agreements:

  1. First, add Livna sources using rpm
    rpm -ivh http://rpm.livna.org/livna-release-8.rpm
  2. Next, Install kdemultimedia-extras-nonfree** using yum
    yum install kdemultimedia-extras-nonfree
  3. That is it, next launch Amarok as an example and hello MP3 music!
    Amarok Launching
    Q: Hey Chris, why does the kdemultimedia-extras package end in “-nonfree”
    A: Good question, tough answer, the kdemultimedia-extras-nonfree package contains plug-ins which cannot be shipped by Red Hat / Fedora because the license is not LGPL. Please note the the license of the entire library is not LGPL! So of course you shouldn’t install it unless you pay the owners for licensing rights.

Playing MP3 Files in Fedora 8 using Gnome

To play MP3 files in Fedora 8 you need to add software to your default installation:

  1. First, add Livna sources using rpm
    rpm -ivh http://rpm.livna.org/livna-release-8.rpm
  2. Next, Install Rhythmbox (assuming you are using Gnome) using yum
    yum install rhythmbox
  3. Next, Install gstreamer-plugins-ugly** using yum
    yum install gstreamer-plugins-ugly
  4. That is it, next launch Rythmbox and hello music!
    Rythmbox Launch

    Q: Hey Chris, why does the gstreamer-plugins end in “-ugly”
    A: Good question, tough answer, the GStreamer is a streaming media library which contains plug-ins which cannot be shipped in gstreamer-plugins-good because the license is not LGPL. Please note the the license of the entire library is not LGPL! So of course you shouldn’t install it unless you pay the owners for licensing rights.

The Ultimate ‘vi’ Shortcut List

I am in the process of building the ultimate ‘vi’ shortcut list:

  • Remove Every Other Line:
    :g/.*/norm jdd

rpmdb: Lock table is out of available locker entries

If while using ‘yum’ or ‘rpm’ you receive the following error:

rpmdb: Lock table is out of available locker entries

Your RPM dB files are screwed up… here is how you unscrew them!

This error tell you the Berkley database files which RPM uses are damaged and in order to clear the error you must rebuild the Berkley dB files from scratch.

Here is how you fix this error:

  1. Make a backup of your current files
  2. Remove the damaged files
  3. Rebuild your RPM Berkley dB files
  4. Use yum again

Here is the command walk through:

  1. As root, execute this:
    cd /root; tar cvzf rpm-backup.tar.gz /var/lib/rpm
  2. Remove the Berkeley dB files which yum and rpm use:
    rm /var/lib/rpm/__db.00*
  3. Instruct rpm to rebuild the databases files:
    rpm --rebuilddb
  4. Test your yum command again:
    yum install somepackage

Setting Environment Variables in Perl

If you ever have to set an environment variable you may run into the same reality I ran into.

A simple call to system using export (as you might do on the command line)…

system( "export MYVAR=somevalue" );

…does not work!

You have to use the Perl ENV hash variable:

$ENV{'MYVAR'} = "somevalue";

Changes to $ENV{’SOMEVAR’} will be available to the current process and children processes only. Thus, if you change an environment variable for an upcoming system() call the process started due to the system() call will see the environment variable change.

Here is an example:

.
.
.
$ENV{'http_proxy'} = "192.168.0.10";
system( "wget --tries=2 --timeout=8 $url" );
.
.
.

Parsing Out Specific Values In a Text File

Another task which hits my desk often is getting “data” out of text files. Such as names, email addresses, phone numbers, ID numbers, etc. Here is a quick way to parse or rip out “data” from a text file.

I suggest using ‘grep’ — grep is one of those applications which is more powerful than the casual user realizes. And let’s face it, if you use or know what grep is you probably do not consider yourself a casual user.

grep -o -P "[regex_pattern]" [filename]

The -o tells grep to only output what it matched in your pattern where your [regex_pattern] is your pattern.
The -P tells grep to use Perl Regular Expressions

Playing MP3 files in Fedora 7

To play MP3 files in Fedora 7 you need to add software to your default installation:

  1. First, add Livna sources using rpm
    rpm -ivh http://rpm.livna.org/livna-release-6.rpm
  2. Next, Install Rhythmbox using yum
    yum install rhythmbox
  3. Next, Install gstreamer-plugins-ugly** using yum
    yum install gstreamer-plugins-ugly
  4. That is it, next launch Rythmbox and hello music!
    Rythmbox Launch

    Q: Hey Chris, why does the gstreamer-plugins end in “-ugly”
    A: Good question, tough answer, the GStreamer is a streaming media library which contains plug-ins which cannot be shipped in gstreamer-plugins-good because the license is not LGPL. Please note the the license of the entire library is not LGPL! So of course you shouldn’t install it unless you pay the owners for licensing rights.