Yum hangs when checking updates with epel repo

Redhat 5

In /var/log/mesages lots of :-

May 20 09:50:01 Server1 : error getting update info: Cannot retrieve repository metadata (repomd.xml) for repository: epel. Please verify its path and try again

If I run yum -d 9 check-update it hangs at Setting up Package Sacks

Found out that another admin had added epel.repo in /etc/yum.repos.d

As we use a proxy to connect to Redhat it appears there is a feature that if you add repos then you need to update /etc/yum.conf  yum will not pick up the proxy settings from /etc/sysconfig/rhn/up2date

Adding proxy=http://proxy.mydomain.co.uk:8080  to /etc/yum.conf soleved the problem.

Checking when a SSL/TLS certificate for an email server expires

Check if the SSL/TLS certificate for SMTP email has expired on the local server

echo ‘”‘ | openssl s_client -connect localhost:25 -starttls smtp > /var/tmp/jik

depth=0 /C=GB/ST=Hampshire/L=Farnborough/O=Tuqix/CN=mail.tuqix.org
verify error:num=18:self signed certificate
verify return:1
depth=0 /C=GB/ST=Hampshire/L=Farnborough/O=Tuqix/CN=mail.tuqix.org
verify error:num=10:certificate has expired
notAfter=Feb  9 16:03:39 2010 GMT
verify return:1
depth=0 /C=GB/ST=Hampshire/L=Farnborough/O=Tuqix/CN=mail.tuqix.org
notAfter=Feb  9 16:03:39 2010 GMT
verify return:1
250 DSN
DONE
–  As you can see it has! After making a new one with genken –days 1825 mail.tuqix.org  and restarting dovecot ; service dovecot restart:-
-bash-3.2# echo ‘”‘ | openssl s_client -connect localhost:25 -starttls smtp > /var/tmp/jik
depth=0 /C=GB/ST=Hampshire/L=Farnborough/O=Tuqix/CN=mail.tuqix.org
verify error:num=18:self signed certificate
verify return:1
depth=0 /C=GB/ST=Hampshire/L=Farnborough/O=Tuqix/CN=mail.tuqix.org
verify return:1
250 DSN

Upgrading Ubuntu to 9.10 – Squeezebox no longer connects to music library

After I upgraded Ubuntu to 9.10 my Squeezebox Duet could not see my music library on my Ubuntu server.

I checked my router for DHCP clients to confirm the Squeebox Duet and controller were connected and I was surprised to see a DHCP connection from my newly upgraded Ubuntu server as it should have been a static IP. I seem to remember I had the same problem last time I upgraded – anyway as the Squeezebox expects to see the Ubuntu server running the  music library daemon on a static IP I assumed this was the problem.

Reverting back to a static IP address after upgrading Ubuntu

From the tool bar – System – Preferences – Network Connections

Select  Wired connection 1 – Edit

Check the IPV4 Settings tab for the correct IP address then click apply.

Open up a terminal and restart the network

sudo /etc/init.d/networking restart

Check with ifconfig -a that the required static IP address has been applied.

Squeezebox stil not finding my music library

Now I had the right IP address on my Ubuntu server the Squeezebox still would not find the music library.

I checked on the Ubuntu server if the squeecenter daemon was running ( ps -ef | grep squee ) – it was not. I attempted to restart it :-

sudo /etc/init.d/squeezecenter restart
Restarting squeezecenterNo squeezecenter_s found running; none killed.
start-stop-daemon: stat /usr/sbin/squeezecenter_safe: No such file or directory (No such file or directory)

Oh dear – time for a Google search. Apparently the 9.10 upgrade to MySql broke it and I needed to download the latest ( beta ) version 7.4.2 of squeeboxserver ( the new name for squeezecenter ). You can get it from

http://downloads.slimdevices.com/nightly/?ver=7.4

In Ubuntu if you click on the Debian installer package link then an installer will start up – ask you confirm you want it installed and warn about an older version available in the repository which would be more stable. After installer I started it up :-

sudo /etc/init.d/squeezeboxserver start

As I was using squeezecenter rather than squeezeboxserver I had to configure it to tell it where my music files and play list were. To do this connect to http://localhost:9000 , type in your squuebox network login ( or register if you don’t have one ) and then follow the instructions to point to your music and playlist files.

No space available when upgrading Ubuntu

When I tried to upgrade my system to the latest Ubuntu version the checks for free space failed – I needed to free up more space.

I did not have enough free space in the OS partition but had lots on another partition.

Ubuntu downloads new versions of programs to a cache area :-  /var/cache/apt/archives

All you need to do is to move this to another filesystem with enough free space and then link to it.

cd /var/cache/apt

sudo mv archives  /newfilesytem

sudo ln -s /newfilesystem/archives

Now your Ubuntu upgrade should have enough free space

Finding the date x number of days ago in the shell

If you need to find what the date was X number of days ago in AIX ( 5.3 or greater ), or Linux  :-

First convert the number of days to hours e.g. if you want to find the date 90 days ago you need 90 * 24 = 2160

echo `TZ=GMT+2160 date +%d/%m/%y`

You can of course use any of the % formats to get the output you require.

To compare two dates ( very useful in AIX to see if a user has not logged in for 90 days for example ) use the %s to get the number of seconds since 1st Jan 1970 :-

echo `TZ=GMT+2160 date +%s`

lsuser  -a time_last_login username   ( needs to run as root )

Then compare the two numbers and if the 90 days ago number is gretaer than the output of the lsuer command then that user has not logged in for gretaer than 90 days