Yum: Cannot find a valid baseurl for repo: core

I went to update my Fedora Core 5 machine today, and received the following error:
[root ~] yum check-update
Loading "installonlyn" plugin
Setting up repositories
core [1/3]
Cannot find a valid baseurl for repo: core
Error: Cannot find a valid baseurl for repo: core

I tried running yum clean all but it didn’t help. After looking around I found that all of my repo files in /etc/yum.repos.d/ had their baseurl values commented out. Don’t ask me how that happened, I have no idea. Simply un-commenting all the baseurl values in all my repo files fixed the problem, and yum is once again running as expected. So if you run into this problem, make sure everything is set up right in /etc/yum.repos.d/*.repo

Installing PDFlib Lite as a PHP module on Fedora Core 4

The instructions for doing so (here) seemed straightforward enough, but I ran into a few problems. So here’s how I got PDFLib working with my PHP install on Fedora Core 4.

First we need to build PDFlib Lite from Source. Download it from here. Unpack it, then:
./configure
make
make install

Easy enough. Now:
yum install automake
yum install php-devel
pecl install pdflib

(Note: php-devel is required because we need phpize which is used by the pecl command.)

The PECL install will ask you a question: “Path to PDFlib installation?” This is where I ran into problems. You must put /usr/local/ and NOT /usr/local/include because the script is hardcoded to look inside the include directory automatically. Once PECL finds pdflib.h it will continue and finish compiling our shared object, pdf.so. The script will install it for us in /usr/lib/php/modules/
Now we just have to tell PHP to load the SO. Open up php.ini and add the following line:
extension=pdf.so
Save & exit, and restart your Apache with apachectl graceful. Now browse to a file containing the phpinfo() function and check to see if PDFlib is now active. If you see it, you’re good to go!

NOTE: I ran into a problem with RPM GPG Keys at the automake install step. I was getting the following error:
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID db42a60e
public key not available for autoconf-2.59-5.noarch.rpm
Retrieving GPG key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
The GPG key at file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora (0x4F2A6FD2)
is already installed but is not the correct key for this package.
Check that this is the correct key for the "Fedora Core 4 - i386 - Base" repository.

To get around this we need to import all the keys by run the following command:
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*
I found this solution in this thread.

Serving up a Windows Media Video (WMV) with Apache.

When trying to serve up a Windows Media Video file from my Apache webserver, I ran into the problem of Firefox being unable to handle the file properly. It would simply load it as a plain text file, resulting in a bunch of jibberish representing the machine code of the video (as if you had opened the video with Notepad). It turns out that with a stock install, Apache does not know how to serve this type of file, so it serves it as the default, which is plain text. It’s an easy fix, you simply have to tell Apache how to serve these types of files. Open up /etc/mime.types and add the following line:
video/x-ms-wmv wmv
You will also need to add the following to your httpd.conf file:
AddType video/x-ms-wmv .wmv
Save and exit, restart Apache, and your browser should now prompt you for how you want to handle the file (Open/Save).

phpList with crontab: Permission denied.

When processing your phpList queue with a crontab, you may get the following error:
bash: /home/yourname/phplist: Permission denied
This happens if your phplist script is not executable. It is an easy fix. Simply make the phplist script executable and it will run as expected:
chmod u+x /home/yourname/phplist

PostgreSQL: DB Error: constraint violation.

When inserting a row into a PostgreSQL database table, PHP’s PEAR DB class was giving me the following error:
DB Error: constraint violation
After some research I found out that when we moved the tables to a new database server, the SEQUENCE values were not updated, causing this problem. Sequences are the equivalent of MySQL’s auto-increment and are used to generate a unique identity value for newly inserted rows.

Because our table already had plenty of rows in it and the sequence value was not in sync, the insert would fail because the ID generated for it by the sequence already existed in the database. This is an easy fix, all you have to do is update the sequence value to be back in sync with your data. Simply run the following command in psql to bring everything back into sync:
select setval('your_table_id_seq', (SELECT max(id) FROM your_table) + 1);
Of course you will want to substitute your own sequence, table, and field values into this command. Once you’ve done this everything will be back in sync and you’ll be able to insert new rows into your DB once again.

Red Hat Fedora Linux: Add an additional IP to your network card.

Adding an additional IP or IPs to your network card in Linux is easy. Here’s how I did it in my Fedora Core 4 installation:
cd /etc/sysconfig/network-scripts/
cp ifcfg-eth0 ifcfg-eth0:0

Now you will need to open your newly created ifcfg-eth0:0 file in your favorite editor and modify it to fit your needs. The two lines you MUST change are the following, the rest are optional:
DEVICE=eth0:0
IPADDR=192.x.x.x

Of course you will want to fill in the IPADDR value to fit your needs.

Now, to make the changes take effect, you will need to bring your new IP up by issuing the following command:
./ifup eth0:0
Or if you want you can just restart the entire network:
/etc/rc.d/init.d/network reload
There you go! Run ifconfig and you should see your new IP assigned to eth0:0. It should look something like this:
eth0:0 Link encap:Ethernet HWaddr 00:D0:B7:B7:XX:XX
inet addr:192.168.1.XX Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

You can add even more IPs by repeating this process and incrementing the value of eth0:0, for example you can add eth0:1, eth0:2, etc.

Retrospect Express HD for Maxtor OneTouch: “Can’t save setup…”

I was receiving the following error after completing the setup for Retrospect Express HD with my Maxtor OneTouch External Hard Drive:
Can't save setup, check the selected drive to make sure there is enough free space.
I had plenty of space on the drive, so I knew this couldn’t be accurate. After some research I found out that my config file was corrupt and it was an easy fix: Remove or rename the RestorePoint.rbc file in the Retrospect Restore Points folder on your external drive. Open up Retrospect Express HD and it will re-create a new config file, as well as re-create all your restore points. This can take a very long time (hours) but once it’s done you’ll be back up and running like new.

(Source: http://forums.dantz.com/)