<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Musings of a *IX guy</title>
	<atom:link href="http://www.tuqix.org/wordpress/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.tuqix.org/wordpress</link>
	<description>All things Unixy and not Unixy</description>
	<lastBuildDate>Fri, 11 Jun 2010 12:15:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>AIX not showing the correct oslevel after patching</title>
		<link>http://www.tuqix.org/wordpress/?p=219</link>
		<comments>http://www.tuqix.org/wordpress/?p=219#comments</comments>
		<pubDate>Fri, 11 Jun 2010 12:13:31 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[AIX]]></category>

		<guid isPermaLink="false">http://www.tuqix.org/wordpress/?p=219</guid>
		<description><![CDATA[After patching AIX oslevel does not show the correct TL level]]></description>
			<content:encoded><![CDATA[<p>After patching AIX to 5.2 TL11 SP3 oslevel -r still showed the OS at TL 09 :-</p>
<p># oslevel -r<br />
# 5300-09</p>
<p>To check what filesets are below the TL you patched to first find all TL levels you have installed :-</p>
<p># oslevel -r -q<br />
Known Recommended Maintenance Levels<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
5300-11<br />
5300-10<br />
5300-09<br />
5300-08<br />
5300-07<br />
5300-06<br />
5300-05<br />
5300-04<br />
5300-03<br />
5300-02<br />
5300-01<br />
5300-00</p>
<p>Next check what filesets are below our highest level e.g. TL11</p>
<p># oslevel -r -l 5300-11<br />
Fileset                                 Actual Level           Recommended ML<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Java5.sdk                               5.0.0.1                5.0.0.235<br />
ifor_ls.html.en_US.base.cli             5.3.7.0                5.3.8.0<br />
#</p>
<p>Here you can see two filesets are at the wrong level. So we need to fix this. Java is a seperate download for AIX you can get it here <a title="AIX Java downloads" href="http://www.ibm.com/developerworks/java/jdk/aix/service.html">http://www.ibm.com/developerworks/java/jdk/aix/service.html</a></p>
<p>Check if you have the 32 or 64 bit version with lslpp -l | grep -i java and download the latest fix &#8211; select your highest TL level you have installed when you download. Install using the usual  installp / smiity method.</p>
<p>Re run oslevel -r -l 5300-11<br />
Fileset                                 Actual Level           Recommended ML<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
ifor_ls.html.en_US.base.cli             5.3.7.0                5.3.8.0</p>
<p>Now only one fileset is below level. A Google shows that there is a bug with the update process for this fileset &#8211; simply run the patch process again and it will update to the correct level.</p>
<p>Now oslevel is correct :-</p>
<p># oslevel -r<br />
5300-11<br />
#</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tuqix.org/wordpress/?feed=rss2&amp;p=219</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Yum hangs when checking updates with epel repo</title>
		<link>http://www.tuqix.org/wordpress/?p=217</link>
		<comments>http://www.tuqix.org/wordpress/?p=217#comments</comments>
		<pubDate>Thu, 20 May 2010 14:18:56 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.tuqix.org/wordpress/?p=217</guid>
		<description><![CDATA[Yum hangs , error getting update info: Cannot retrieve repository metadata (repomd.xml) for repository: epel. Please verify its path and try again]]></description>
			<content:encoded><![CDATA[<p>Redhat 5</p>
<p>In /var/log/mesages lots of :-</p>
<p>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</p>
<p>If I run yum -d 9 check-update it hangs at Setting up Package Sacks</p>
<p>Found out that another admin had added epel.repo in /etc/yum.repos.d</p>
<p>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</p>
<p>Adding proxy=http://proxy.mydomain.co.uk:8080  to /etc/yum.conf soleved the problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tuqix.org/wordpress/?feed=rss2&amp;p=217</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stop Spam in Wordpress Comments &#8211; Install CAPTCHA</title>
		<link>http://www.tuqix.org/wordpress/?p=211</link>
		<comments>http://www.tuqix.org/wordpress/?p=211#comments</comments>
		<pubDate>Sun, 02 May 2010 15:01:53 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.tuqix.org/wordpress/?p=211</guid>
		<description><![CDATA[Installing CAPTCHA plugin in Wordpress to stop Spam comments]]></description>
			<content:encoded><![CDATA[<p>This Wordpress blog has been targeted by Spam bots since it started but recently it has got a lot worse and it is getting tedious to go through all the pending comments and delete the Spam ones.</p>
<p>I&#8217;ve seen<a title="Wikipedia article on CAPTCHA" href="http://en.wikipedia.org/wiki/CAPTCHA"> CAPTCHA</a> used on other sites as a means to distinguish between humans and Spam bots so a quick Google for Wordpress CAPTCHA plugins found a few. I wanted one that is updated regularly so it will still work when a new Wordpress update is available. The plugin I chose was <a title="Si CAPTCHA Wordpress plugin" href="http://wordpress.org/extend/plugins/si-captcha-for-wordpress/">SI CAPTCHA </a>. This seems to be regularly updated , looks very good, has audio and it works fine &#8211; I have had no Spam bot comments since installing. The plugin is free but if you find it useful and want to fund further development then there is a Paypal link &#8211; if you think how much time this plugin will save you a donation is highly recommended.</p>
<p>The<a title="Si CAPTCHA Wordpress plugin" href="http://wordpress.org/extend/plugins/si-captcha-for-wordpress/"> link</a> on the Wordpress plugins site has all the information needed to install. ( Note for Centos check you have php-gd installed &#8211; see below ).  Basically you unzip it into wp-contents/plugins directory then go to your Admin page , select plugins ,  then activate the SI Captcha plugin.</p>
<p>There is a nice Captcha support test link to check all is well &#8211; my setup failed first time &#8211; I got :-</p>
<p>ERROR: GD image support not detected in PHP</p>
<p>ERROR: imagepng function not detected in PHP</p>
<p>This was resolved by installing php-gd RPM. For Centos you would do</p>
<p>yum install php-gd</p>
<p>service httpd restart</p>
<p>Now if anyone wants to add a comment they have to pass the CAPTCHA test which Spam bots are no good at.</p>
<p>Note by default it won&#8217;t add the CAPTCHA box to users who are logged in so ensure you have logged out if you want to test it for yourself.</p>
<p>You should see the CAPTCHA at the bottom of this entry.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tuqix.org/wordpress/?feed=rss2&amp;p=211</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Checking when a SSL/TLS certificate for an email server expires</title>
		<link>http://www.tuqix.org/wordpress/?p=209</link>
		<comments>http://www.tuqix.org/wordpress/?p=209#comments</comments>
		<pubDate>Tue, 09 Feb 2010 20:46:35 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Centos]]></category>
		<category><![CDATA[Email]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.tuqix.org/wordpress/?p=209</guid>
		<description><![CDATA[Check if the SSL/TLS certificate for SMTP email has expired on the server]]></description>
			<content:encoded><![CDATA[<p>Check if the SSL/TLS certificate for SMTP email has expired on the local server</p>
<p>echo &#8216;&#8221;&#8216; | openssl s_client -connect localhost:25 -starttls smtp &gt; /var/tmp/jik</p>
<p>depth=0 /C=GB/ST=Hampshire/L=Farnborough/O=Tuqix/CN=mail.tuqix.org<br />
verify error:num=18:self signed certificate<br />
verify return:1<br />
depth=0 /C=GB/ST=Hampshire/L=Farnborough/O=Tuqix/CN=mail.tuqix.org<br />
verify error:num=10:certificate has expired<br />
notAfter=Feb  9 16:03:39 2010 GMT<br />
verify return:1<br />
depth=0 /C=GB/ST=Hampshire/L=Farnborough/O=Tuqix/CN=mail.tuqix.org<br />
notAfter=Feb  9 16:03:39 2010 GMT<br />
verify return:1<br />
250 DSN<br />
DONE<br />
-  As you can see it has! After making a new one with genken &#8211;days 1825 mail.tuqix.org  and restarting dovecot ; service dovecot restart:-<br />
-bash-3.2# echo &#8216;&#8221;&#8216; | openssl s_client -connect localhost:25 -starttls smtp &gt; /var/tmp/jik<br />
depth=0 /C=GB/ST=Hampshire/L=Farnborough/O=Tuqix/CN=mail.tuqix.org<br />
verify error:num=18:self signed certificate<br />
verify return:1<br />
depth=0 /C=GB/ST=Hampshire/L=Farnborough/O=Tuqix/CN=mail.tuqix.org<br />
verify return:1<br />
250 DSN</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tuqix.org/wordpress/?feed=rss2&amp;p=209</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installing Verisign SSL certificate on IBM HTTP server</title>
		<link>http://www.tuqix.org/wordpress/?p=196</link>
		<comments>http://www.tuqix.org/wordpress/?p=196#comments</comments>
		<pubDate>Thu, 04 Feb 2010 13:07:52 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[AIX]]></category>
		<category><![CDATA[Websphere]]></category>

		<guid isPermaLink="false">http://www.tuqix.org/wordpress/?p=196</guid>
		<description><![CDATA[How to install a Verisign SSL certificate on IBMHTTPServer
How to convert a Verisign SSL certificate created for Apache to be imported into IBM HTTP server]]></description>
			<content:encoded><![CDATA[<p><strong>Installing a Verisign SSL site certificate on IBM HTTP server</strong></p>
<p>If you have an Apache certificate e.g. it was requested with an openssl  signing request rather than using ikeyman then you first need to convert  it to PKCS12 format which can then be imported into the IBMHTTPServer6  keystore.</p>
<p>openssl pkcs12 -export -out new_key_pair_filename.p12 -inkey  private_key_filename.key -in certificate_filename.crt</p>
<p>You will get prompted for a password &#8211; you must use the same password as  you have on the keystore you want to import it into.</p>
<p>Move the file to /usr/IBMHTTPServer6/bin<br />
If you used strong encryption to generate the signing key request (  and you would have done ) then you may have to install the unrestricted  JCE policy files.</p>
<p>To check :-</p>
<p>/usr/IBMHTTPServer6/java/jre/bin/keytool -list -v -keystore  /usr/IBMHTTPServer6/bin/wbis104m.p12 -storetype pkcs12 -storepass passwd</p>
<p>If it barfs with java errors like :-</p>
<p>keytool error (likely untranslated): java.io.IOException: Private key  decryption error: (java.security.InvalidKeyException: Illegal key size)</p>
<p>keytool error (likely untranslated): java.io.IOException: Private key  decryption error: (java.lang.SecurityException: Unsupported keysize or  algorithm parameter<br />
s)</p>
<p>You need to install the unrestricted JCE policy files.</p>
<p>Download the zip file from <a href="https://www14.software.ibm.com/webapp/iwm/web/preLogin.do?source=jcesdk" target="_top">https://www14.software.ibm.com/webapp/iwm/web/preLogin.do?source=jcesdk</a> ( you need an IBM ID &#8211; this is a free registration )</p>
<p>unzip and after making copies of the orginals copy over the new  local_policy.jar US_export_policy.jar files to  /usr/IBMHTTPServer6/java/jre/lib/security</p>
<p>Rerun the keytool command above ( ensuring you use the full path to the  keytool command ) to confirm it lists the certificate details without  Java errors.</p>
<p>Now add it into the keystore</p>
<p>You need to be able to use X as the ikeyman program is GUI only.</p>
<p>su to root , export XAUTHORITY and DISPLAY to those of the user you su&#8217;d  from.</p>
<p>e.g.</p>
<p>export XAUTHORITY=/home/fred/.Xauthority</p>
<p>export DISPLAY=localhost:10.0</p>
<p>cd /usr/IBMHTTPServer6/bin</p>
<p>./ikeyman</p>
<p>Key Database File &#8211; Open</p>
<p>Key Database type CMS</p>
<p>Location /usr/IBMHTTPServer6/keys/</p>
<p>File Name key.kdb</p>
<p>You will be prompted for the password</p>
<p>Now import the certificate you converted to pkcs12 format above</p>
<p>Ensure Personal Certificates is selected then click on Export/Import</p>
<p>Select Import Key</p>
<p>Key file type PKCS12</p>
<p>File Name the file name of the converted pkcs12 format above</p>
<p>Location where you put the file</p>
<p>Click OK &#8211; you will be prompted for a password &#8211; use the one you set  when you did the conversion ( which should also be the same as the  keystore password you are putting it in )</p>
<p>If you get a message &#8220;The specified database has been corrupted&#8221; ensure  you have installed the unrestricted JCE policy files above. If you have  to install them you need to exit ikeyman and restart it again.</p>
<p>You should now get a dialog asking if you would like to change any of  these labels before completeing the import process</p>
<p>Click on the label ( which is probably a very long string ) and then  change it to something like prod-cert ( this is the name you will use  in the httpd.conf file )</p>
<p>Click apply</p>
<p>Click OK ( you may have to scroll to the right to see the OK button )</p>
<p>If you now get an error An attempt to import the certificate has failed.</p>
<p>All the signer certificates must exist in the key database</p>
<p>This probably means that you need to install the Verisign intermediate  signers certificate.</p>
<p><a href="https://knowledge.verisign.com/support/ssl-certificates-support/index?page=content&amp;id=AR657" target="_top">https://knowledge.verisign.com/support/ssl-certificates-support/index?page=content&amp;id=AR657</a></p>
<p>Assuming it is a standard Verisign site certifiacate ( class 3 ) then go  here :-</p>
<p><a href="http://www.verisign.com/support/verisign-intermediate-ca/secure-site-intermediate/index.html" target="_top">http://www.verisign.com/support/verisign-intermediate-ca/secure-site-intermediate/index.html</a></p>
<p>Cut and paste the certificate into a file and save with a .arm extension</p>
<p>Go into ikeyman and open the keystore as above</p>
<p>Select Signer Certificates</p>
<p>Click add</p>
<p>Data type Base64-encoded ASCII data</p>
<p>Certificate file name the name of the arm file you created above</p>
<p>Location the location of the arm file</p>
<p>Click OK</p>
<p>Enter a label for the certificate &#8211; choose something like Verisign  intermediate CA cert</p>
<p>Click OK</p>
<p>Now select Personal Certificates and import the converted PKCS12 SSL  certificate using the intructions as before.</p>
<p><strong>Adding the certificate to the httpd.conf file</strong></p>
<p>vi /usr/IBMHTTPServer6/conf/httpd.conf</p>
<p>search for SSLServerCert and change the  name of the certificate to the name you chose when you added the  certificate to the key store e.g. prod-cert</p>
<p>Restart apache</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tuqix.org/wordpress/?feed=rss2&amp;p=196</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Upgrading Ubuntu to 9.10 &#8211; Squeezebox no longer connects to music library</title>
		<link>http://www.tuqix.org/wordpress/?p=193</link>
		<comments>http://www.tuqix.org/wordpress/?p=193#comments</comments>
		<pubDate>Sat, 31 Oct 2009 15:44:56 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Hi-Fi]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.tuqix.org/wordpress/?p=193</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<p>After I upgraded Ubuntu to 9.10 my Squeezebox Duet could not see my music library on my Ubuntu server.</p>
<p>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 &#8211; 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.</p>
<p><strong>Reverting back to a static IP address after upgrading Ubuntu</strong></p>
<p>From the tool bar &#8211; System &#8211; Preferences &#8211; Network Connections</p>
<p>Select  Wired connection 1 &#8211; Edit</p>
<p>Check the IPV4 Settings tab for the correct IP address then click apply.</p>
<p>Open up a terminal and restart the network</p>
<p>sudo /etc/init.d/networking restart</p>
<p>Check with ifconfig -a that the required static IP address has been applied.</p>
<p><strong>Squeezebox stil not finding my music library</strong></p>
<p>Now I had the right IP address on my Ubuntu server the Squeezebox still would not find the music library.</p>
<p>I checked on the Ubuntu server if the squeecenter daemon was running ( ps -ef | grep squee ) &#8211; it was not. I attempted to restart it :-</p>
<p>sudo /etc/init.d/squeezecenter restart<br />
Restarting squeezecenterNo squeezecenter_s found running; none killed.<br />
start-stop-daemon: stat /usr/sbin/squeezecenter_safe: No such file or directory (No such file or directory)</p>
<p>Oh dear &#8211; 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</p>
<p><a title="Squeezecenter downloads" href="http://downloads.slimdevices.com/nightly/?ver=7.4">http://downloads.slimdevices.com/nightly/?ver=7.4</a></p>
<p>In Ubuntu if you click on the Debian installer package link then an installer will start up &#8211; 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 :-</p>
<p>sudo /etc/init.d/squeezeboxserver start</p>
<p>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&#8217;t have one ) and then follow the instructions to point to your music and playlist files.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tuqix.org/wordpress/?feed=rss2&amp;p=193</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>No space available when upgrading Ubuntu</title>
		<link>http://www.tuqix.org/wordpress/?p=190</link>
		<comments>http://www.tuqix.org/wordpress/?p=190#comments</comments>
		<pubDate>Sat, 31 Oct 2009 15:16:37 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.tuqix.org/wordpress/?p=190</guid>
		<description><![CDATA[Ubuntu upgrade not enough free space]]></description>
			<content:encoded><![CDATA[<p>When I tried to upgrade my system to the latest Ubuntu version the checks for free space failed &#8211; I needed to free up more space.</p>
<p>I did not have enough free space in the OS partition but had lots on another partition.</p>
<p>Ubuntu downloads new versions of programs to a cache area :-  /var/cache/apt/archives</p>
<p>All you need to do is to move this to another filesystem with enough free space and then link to it.</p>
<p>cd /var/cache/apt</p>
<p>sudo mv archives  /newfilesytem</p>
<p>sudo ln -s /newfilesystem/archives</p>
<p>Now your Ubuntu upgrade should have enough free space</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tuqix.org/wordpress/?feed=rss2&amp;p=190</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Finding the date x number of days ago in the shell</title>
		<link>http://www.tuqix.org/wordpress/?p=187</link>
		<comments>http://www.tuqix.org/wordpress/?p=187#comments</comments>
		<pubDate>Wed, 08 Jul 2009 08:49:17 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[AIX]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.tuqix.org/wordpress/?p=187</guid>
		<description><![CDATA[How to get the date for X number of days ago in a shell for AIX and Linux.
How to check if a user has not logged in for gretaer than 90 days ago]]></description>
			<content:encoded><![CDATA[<p>If you need to find what the date was X number of days ago in AIX ( 5.3 or greater ), or Linux  :-</p>
<p>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</p>
<p>echo `TZ=GMT+2160 date +%d/%m/%y`</p>
<p>You can of course use any of the % formats to get the output you require.</p>
<p>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 :-</p>
<p>echo `TZ=GMT+2160 date +%s`</p>
<p>lsuser  -a time_last_login username   ( needs to run as root )</p>
<p>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</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tuqix.org/wordpress/?feed=rss2&amp;p=187</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Weather Station Display</title>
		<link>http://www.tuqix.org/wordpress/?p=179</link>
		<comments>http://www.tuqix.org/wordpress/?p=179#comments</comments>
		<pubDate>Sun, 21 Jun 2009 18:28:57 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Applications to install on a personal web site]]></category>
		<category><![CDATA[VPS server]]></category>

		<guid isPermaLink="false">http://www.tuqix.org/wordpress/?p=179</guid>
		<description><![CDATA[How to display the output of a weather station on a web page using wview open source software]]></description>
			<content:encoded><![CDATA[<p><strong>Display weather on a web page</strong></p>
<p>I wanted to have my own weather station and output the weather on a web page on my VPS server. There are plenty of weather stations available that will output data to a PC and several applications that will display that data on a web page. Most weather stations come with software but it is Windoze based and not Linux. Looking around for weather display software that will run on Linux I found<a title="Weather Display software" href="http://www.weather-display.com/index.php"> Weather Display </a>this supports a large range of stations , has lots of nice features , runs on Linux ( as well as Mac OSX and Windoze ) but costs around $70.</p>
<p>Looking for free software I found <a href="http://www.lavrsen.dk/twiki/bin/view/Open2300/WebHome">open2300 </a>, this will get data from a La crosse WS2300/WS2305/WS2310/WS2315 Weather Station as well as sending data to Weather Underground and Citizen Weather. There are some <a href="http://www.lavrsen.dk/foswiki/bin/view/Open2300/OpenWSLinks">very nice web sites</a> using this software as a base for some extra coding. It will also run on a <a href="http://en.wikipedia.org/wiki/NSLU2">Linksys NSLU2</a>.</p>
<p>Next I found <a href="http://www.wviewweather.com/">wview </a>, this supports a number of weather stations :-</p>
<li>Davis Vantage Pro/Pro2</li>
<li>Vaisala WXT510</li>
<li>La Crosse WS-2300/2308/2310/2315</li>
<li>Oregon Scientific WMR918/968</li>
<p>This produces a nice <a href="http://tuqix.org/weather">web page as on my server.</a> The software will also run on a <a href="http://en.wikipedia.org/wiki/NSLU2">Linksys NSLU2</a> which has been modified to run a full version of Linux which means I don&#8217;t have to leave my main PC on all the time to collect the data. I happen to have a NSLU2 which I modifed to run a full version of Linux which I was using as a media streamer ( Firefly ) to stream audio to a Roku Soundbridge and as a backup server  &#8211; I have now bought a SqueezeBox Duet and the NSLU2 is a bit too weedy for the SqueezeCenter software so I decided to run <a href="http://www.wviewweather.com/">wview</a> on this and send the generated HTML over to my VPS server on the net.</p>
<p><strong>Weather Station choice</strong></p>
<p>Having decided on <a href="http://www.wviewweather.com/">wview </a>the supported weather stations currently available in the UK are  the La Crosse WS2300 series and the Davis Vantage Pro, as the Davis Vantage Pro with a PC cable is around four times the price of the La Crosse I decided to buy a La Crosse WS2308. This weather station will also work with the <a href="http://www.lavrsen.dk/twiki/bin/view/Open2300/WebHome">open2300</a> and <a href="http://www.weather-display.com/index.php">WeatherDisplay </a>software mentioned above. It measures indoor/outdoor temperature and humidity ,dew point, wind chill, wind speed and direction, atmospheric pressure and has a rain gauge to measure rain fall. It has a large LCD display unit that can either receive the data from the instruments via cable or wireless &#8211; I chose the wireless option as It is the most convenient although it can be less reliable and if you do lose contact with the sensors the PC output will show the outside temperature as 80 degrees C which buggers up your graphs !</p>
<p>The outside instruments are housed in three units connected together by cable. I mounted the wind anemometer on a TV aerial mast and the rain gauge on a simple L bracket. See the picture below. The TV mast and the bracket to mount it on the wall came from Maplin Electronics.</p>
<div id="attachment_181" class="wp-caption alignnone" style="width: 400px"><a rel="attachment wp-att-181" href="http://www.tuqix.org/wordpress/?attachment_id=181"><img class="size-full wp-image-181" title="weather-station" src="http://www.tuqix.org/wordpress/wp-content/uploads/2009/06/weather-station.jpg" alt="WS2308 weather station instruments" width="390" height="521" /></a><p class="wp-caption-text">WS2308 weather station instruments</p></div>
<p><strong>Prepare the NSLU2 for the Wview software</strong></p>
<p>As noted above I wanted to install <a href="http://www.wviewweather.com/">wview </a>on my Linksys NSLU2, the version of Linux I had on there was too old to install wview and so I had to install a new version. To do this the instructions are on the <a href="http://www.nslu2-linux.org/wiki/Main/HomePage">NSLU2 Wiki site</a>. Initially I installed the latest SlugOS ( 5.3 Beta ) but the wview packages ( I decided against compiling the latest version from source as I wanted to get something up and running quickly )  had dependency problems so I installed SlugOS 4.8 Beta as suggested in the manual. As I already had a version of Linux on the NSLU2 ( Unslung ) it was easy to do and it even kept all my data on the USB disk attached. I used sudo upslug2 &#8211;image=&#8221;slugosbe-4.8-beta-nslu2.bin&#8221; from by Ubuntu desktop to flash the new image onto the NSLU2 and once rebooted df showed :-</p>
<p>root@nslug:~$ df<br />
Filesystem           1k-blocks      Used Available Use% Mounted on<br />
/dev/mtdblock4            6528      4948      1580  76% /<br />
/dev/mtdblock4            6528      4948      1580  76% /dev/.static/dev<br />
tmpfs                     2048        28      2020   1% /dev<br />
tmpfs                    15188        20     15168   0% /var/volatile<br />
tmpfs                    15188         0     15188   0% /dev/shm<br />
/dev/sda2               116661     18664     91973  17% /media/sda2<br />
/dev/sda1            240190052  33692576 204057284  14% /media/sda1</p>
<p>and fdisk /dev/sda :-</p>
<p>Disk /dev/sda: 250.0 GB, 250059350016 bytes<br />
255 heads, 63 sectors/track, 30401 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes</p>
<p>Device Boot      Start         End      Blocks  Id System<br />
/dev/sda1               1       30379   244019286  83 Linux<br />
/dev/sda2           30380       30394      120487+ 83 Linux<br />
/dev/sda3           30395       30401       56227+ 82 Linux swap</p>
<p>/media/sda2 was the Unslung root partition so I made it the SlugOS one :-<br />
root@nslug:~$  umount /media/sda2<br />
root@nslug:~$ mkfs.ext3 /dev/sda2<br />
root@nslug:~$ turnup disk -i /dev/sda2 -t ext3</p>
<p>Rebooted the NSLU2</p>
<p>I already had swap on sda3 but it was the wrong version so I remade it :-</p>
<p>root@nslug:~# mkswap /dev/sda3<br />
Setting up swapspace version 1, size = 57572864 bytes<br />
vi /etc/fstab<br />
/dev/sda3       swap    swap    defaults        0       0<br />
root@nslug:~# swapon -a</p>
<p>The NSLU2 does not have an accessible serial port to connect to the weather station. To use a serial connection to the NSLU2 see the Linux NSLU2 Wiki page <a href="http://www.nslu2-linux.org/wiki/HowTo/AddASerialPort">here.</a></p>
<p>I choose the easy option to use a serial to USB converter cable ( from Maplin Electronics code ZP43 ).</p>
<p>root@nslug:~$ ipkg update<br />
Downloading http://ipkg.nslu2-linux.org/feeds/slugosbe/cross/4.8-beta/Packages.g<br />
z<br />
Inflating http://ipkg.nslu2-linux.org/feeds/slugosbe/cross/4.8-beta/Packages.gz<br />
Updated list of available packages in /var/lib/ipkg/cross<br />
Downloading http://ipkg.nslu2-linux.org/feeds/slugosbe/native/4.8-beta/Packages.gz<br />
Inflating http://ipkg.nslu2-linux.org/feeds/slugosbe/native/4.8-beta/Packages.gz<br />
Updated list of available packages in /var/lib/ipkg/native<br />
root@nslug:~$</p>
<p>root@nslug:~$ ipkg install kernel-module-pl2303<br />
Installing kernel-module-pl2303 (2.6.21.7+svnr927-r0) to root&#8230;<br />
Downloading http://ipkg.nslu2-linux.org/feeds/slugosbe/cross/4.8-beta/kernel-module-pl2303_2.6.21.7+svnr927-r0_nslu2be.ipk<br />
Configuring kernel-module-pl2303<br />
root@nslug:~$ depmod -a<br />
root@nslug:~$ echo usbserial &gt;&gt; /etc/modutils/modules<br />
root@nslug:~$ echo pl2303 &gt;&gt; /etc/modutils/modules</p>
<p>shutdown and plug in the Serial to USB cable</p>
<p>root@nslug:~$ dmesg<br />
&lt;6&gt;usbcore: registered new interface driver usbserial<br />
&lt;6&gt;drivers/usb/serial/usb-serial.c: USB Serial support registered for generic<br />
&lt;6&gt;usbcore: registered new interface driver usbserial_generic<br />
&lt;6&gt;drivers/usb/serial/usb-serial.c: USB Serial Driver core<br />
&lt;6&gt;drivers/usb/serial/usb-serial.c: USB Serial support registered for pl2303<br />
&lt;6&gt;pl2303 2-1:1.0: pl2303 converter detected<br />
&lt;6&gt;usb 2-1: pl2303 converter now attached to ttyUSB0<br />
&lt;6&gt;usbcore: registered new interface driver pl2303</p>
<p>Set the timezone and date :-</p>
<p>root@nslug:~$ ipkg install tzdata<br />
Installing tzdata (2007e-r1) to root&#8230;<br />
Downloading http://ipkg.nslu2-linux.org/feeds/slugosbe/cross/4.8-beta/tzdata_2007e-r1_armv5teb.ipk<br />
Configuring tzdata<br />
root@nslug:~$ ln -s /usr/share/zoneinfo/Europe/London   /etc/localtime<br />
logout and back in again<br />
Set the date MMDDHHMM</p>
<p><strong>Installing Wview on the NSLU2</strong></p>
<p>root@nslug:~$ cd /etc/ipkg<br />
root@nslug:/etc/ipkg$ wget http://www.wviewweather.com/ipkg/wview.conf<br />
Connecting to www.wviewweather.com[209.55.119.70]:80<br />
wview.conf           100% |*****************************|    59    &#8211;:&#8211;:&#8211; ETA<br />
root@nslug:/etc/ipkg$<br />
root@nslug:/etc/ipkg$ ipkg update<br />
Downloading http://ipkg.nslu2-linux.org/feeds/slugosbe/cross/4.8-beta/Packages.gz<br />
Inflating http://ipkg.nslu2-linux.org/feeds/slugosbe/cross/4.8-beta/Packages.gz<br />
Updated list of available packages in /var/lib/ipkg/cross<br />
Downloading http://ipkg.nslu2-linux.org/feeds/slugosbe/native/4.8-beta/Packages.gz<br />
Inflating http://ipkg.nslu2-linux.org/feeds/slugosbe/native/4.8-beta/Packages.gz<br />
Updated list of available packages in /var/lib/ipkg/native<br />
Downloading http://www.scorpiocomputing.com/weather/ipk/Packages.gz<br />
Inflating http://www.scorpiocomputing.com/weather/ipk/Packages.gz<br />
Updated list of available packages in /var/lib/ipkg/_wview<br />
root@nslug:/etc/ipkg$ ipkg list | grep wview</p>
<p>Look for your weather station model &#8211; in my case ws2300 :-</p>
<p>wview-ws2300-mysql &#8211; 4.0.1-r0 &#8211; wview is a weather site generator and more for a variety of weather stations</p>
<p>root@nslug:/etc/ipkg$ ipkg install wview-ws2300-mysql<br />
Installing wview-ws2300-mysql (4.0.1-r0) to root&#8230;<br />
downloads lots of dependent libraries etc.</p>
<p>Make the archive directory go to disk rather than in /var ( which is memory on the NSLU2 )</p>
<p>root@nslug:~$ mkdir /media/sda1/wview<br />
root@nslug:~$ mkdir /media/sda1/wview/archive<br />
root@nslug:~$ rmdir /var/wview/archive<br />
root@nslug:~$ ln -s /media/sda1/wview/archive /var/wview/archive<br />
root@nslug:~$</p>
<p>Next run the setup script wviewconfig. In most cases I accepted the defaults except as below</p>
<p>wviewconfig</p>
<p>Serial port device &#8211; check with dmesg what in is &#8211; in my case it is /dev/ttyUSB0</p>
<p>Use metric measures<br />
Weather station elevation (feet above sea level ) you can get this information from various sites on the Internet &#8211; I used <a href="http://www.earthtools.org/">http://www.earthtools.org/</a></p>
<p>This site will also give you latitude and longitude</p>
<p>Local Radar use Google to find a site that you can link to for a radar display or look at other weather sites to see what other people have used.</p>
<p>Ditto for local forcast</p>
<p>Run the rsync/ssh daemon wviewsshd?<br />
1<br />
As I wanted to use my VPS server on the Internet I use the wviewsshd daemon which does rsync over ssh to get the data to the external server &#8211; more about this below.</p>
<p>After wviewconfig has finished run the script wviewhtmlconfig &#8211; I accepted defaults.</p>
<p>You can always change settings getnerated by the above two scripts at a later date by editing /etc/wview/wview.conf or /etc/wview/htmlgen.conf and restarting wview.</p>
<p><strong>Setting up rsync to send the data to an external web server</strong></p>
<p>On the NSLU2</p>
<p>root@nslug:/etc/ipkg$ ipkg install rsync</p>
<p>ssh-keygen -t rsa           don&#8217;t set a passphrase and accept the defaults</p>
<p>cat /root/id_rsa.pub</p>
<p>On your external server</p>
<p>-bash-3.2# useradd -m -d /home/wview -c &#8220;Wview weather&#8221; wview<br />
-bash-3.2# cd ~wview<br />
-bash-3.2# mkdir .ssh<br />
-bash-3.2# vi .ssh/authorized_keys</p>
<p>paste in the output of the cat /root/id_rsa.pub command you ran on the NSLU2 above</p>
<p>-bash-3.2# chown -R wview:wview /home/wview/.ssh<br />
-bash-3.2# chmod 700 /home/wview/.ssh<br />
-bash-3.2# mkdir /var/www/html/weather         (replace /var/www/html with your web server&#8217;s document root )</p>
<p>-bash-3.2# chown wview:wview /var/www/html/weather</p>
<p>-bash-3.2# ln -s /var/www/html/weather data</p>
<p>If rsync is not installed then install it :-</p>
<p>yum install rsync</p>
<p>On the NSLU2</p>
<p>Test the ssh connection :-</p>
<p>root@nslug:-$ ssh -l wview yourextserver.org ls -l /home</p>
<p>Answer yes to the question about if you want to connect and you should get a listing of the external server&#8217;s /home without being prompted for a password.</p>
<p>root@nslug:-$ vi /root/.ssh/config</p>
<p>Host yourextserver.org</p>
<p>User wview</p>
<p>This means that root will always ssh as user wview when going to your external server.</p>
<p>Test rsync</p>
<p>root@nslug:-$ rsync -aqz &#8211;rsh=ssh /var/wview/img/ tuqix.org:data<br />
root@nslug:-$  ssh yourextserver.org ls -l data</p>
<p>root@nslug:-$  vi /etc/wview/wviewssh.conf<br />
#Interval Source                        Remote Host               Remote Destination<br />
#&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;  &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-         &#8212;&#8212;&#8212;&#8212;&#8211;<br />
1         /var/wview/img                yourextserver.org                                 data</p>
<p>Plug in the weather station LCD control panel to the serial to USB cable using the serial cable that comes with the weather station.</p>
<p>Start up wview and monitor the mesages file:-</p>
<p>root@nslug:-$ /etc/init.d/wview start</p>
<p>root@nslug:-$ tail -f /var/log/messages</p>
<p>You should see messages like :-</p>
<p>Jun 20 16:36:59 (none) user.info wviewd[949]: &lt;1245512219362&gt; : station pollinginterval set to 15 seconds<br />
Jun 20 16:36:59 (none) user.info wviewd[949]: &lt;1245512219409&gt; : &#8212; Station Init<br />
Start &#8211;<br />
Jun 20 16:36:59 (none) user.info wviewd[949]: &lt;1245512219479&gt; : WS-2300 on /dev/ttyUSB0 opened &#8230;<br />
Jun 20 16:36:59 (none) user.info wviewd[949]: &lt;1245512219555&gt; : station archiveinterval: 5 minutes<br />
Jun 20 16:37:00 (none) user.info wviewsqld[953]: &lt;1245512220422&gt; : radlib: wview sqld started as a daemon &#8230;<br />
Jun 20 16:37:00 (none) user.warn wviewsqld[953]: &lt;1245512220438&gt; : SQL archiving disabled in wview.conf &#8211; exiting&#8230;<br />
Jun 20 16:37:00 (none) user.info htmlgend[956]: &lt;1245512220520&gt; : radlib: htmlgend started as a daemon &#8230;<br />
Jun 20 16:37:00 (none) user.info htmlgend[956]: &lt;1245512220552&gt; : !! configured for metric units/conversion !!<br />
Jun 20 16:37:00 (none) user.info htmlgend[956]: &lt;1245512220554&gt; : !! Rain units will be mm !!<br />
Jun 20 16:37:00 (none) user.info htmlgend[956]: &lt;1245512220556&gt; : generating to /var/wview/img<br />
Jun 20 16:37:00 (none) user.alert wvalarmd[958]: &lt;1245512220579&gt; : /etc/wview/wv alarm.conf does not exist &#8211; exiting&#8230;<br />
Jun 20 16:37:00 (none) user.info wviewsshd[963]: &lt;1245512220979&gt; : rsync: updating /var/wview/img ==&gt; yourextserver.org:data every 1 minutes<br />
Jun 20 16:37:00 (none) user.crit wviewsshd[963]: &lt;1245512220981&gt; : rsync: starting updates in 4 mins 15 secs<br />
Jun 20 16:40:11 (none) user.info htmlgend[956]: &lt;1245512411515&gt; : Generated: 124<br />
5Jun 20 16:41:11 (none) user.info htmlgend[956]: &lt;1245512471160&gt; : Generated: 890 ms: 17 images, 14 template files<br />
Jun 20 16:41:15 (none) user.info wviewsshd[963]: &lt;1245512475271&gt; : Updating: /var/wview/img ==&gt; yourextserver.org:data<br />
ms: 25 images, 14 template files</p>
<p>Once you see messages about Generated images and template files followed by wviewsshd updating /var/view/img ==&gt; yourextserver.org then you should get a nice web page at yourextserver.org/weather</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tuqix.org/wordpress/?feed=rss2&amp;p=179</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AIX making the identification light flash on a PCI card</title>
		<link>http://www.tuqix.org/wordpress/?p=173</link>
		<comments>http://www.tuqix.org/wordpress/?p=173#comments</comments>
		<pubDate>Tue, 09 Jun 2009 15:11:53 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[AIX]]></category>

		<guid isPermaLink="false">http://www.tuqix.org/wordpress/?p=173</guid>
		<description><![CDATA[When you need to check a cable on a PCI card or even replace a PCI card on an IBM Pseries running AIX it is helpful to identify the card by flashing the identification light on the card to distinguish it from the others.]]></description>
			<content:encoded><![CDATA[<p><strong>AIX making the identification light flash on a PCI card</strong></p>
<p>When you need to check a cable on a PCI card or even replace a PCI card on an IBM Pseries running AIX it is helpful to identify the card by flashing the identification light on the card to distinguish it from the others.<br />
First find the slot with the card in :-</p>
<p>lsslot -c pci<br />
# Slot                   Description                         Device(s)<br />
U7879.001.DQQQWTY-P1-C1  PCI-X capable, 64 bit, 133MHz slot  fcs1<br />
U7879.001.DQQQWTY-P1-C3  PCI-X capable, 64 bit, 133MHz slot  ent0<br />
U7879.001.DQQQWTY-P1-C4  PCI-X capable, 64 bit, 133MHz slot  ent1<br />
U7879.001.DQQQWTY-P1-C5  PCI-X capable, 64 bit, 133MHz slot  fcs0</p>
<p>diag<br />
enter to continue<br />
Task Selection<br />
Scroll down to Identify and attention Indicators<br />
Scroll down until you get to the slot of the PCi card then hit enter and you get<br />
a + besides the slot, hit F7 and then you get an I , this means the<br />
indicator light on the card is flashing, use F7 enter to toggle it on and off.</p>
<p><strong><br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tuqix.org/wordpress/?feed=rss2&amp;p=173</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
