<?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>TOCPCs - The Elite Geeks Blog &#187; Linux</title>
	<atom:link href="http://www.tocpcs.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tocpcs.com</link>
	<description>Impossible? You Lie!</description>
	<lastBuildDate>Tue, 17 Aug 2010 11:31:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1-alpha</generator>
		<item>
		<title>Broadcasting over the LAN</title>
		<link>http://www.tocpcs.com/broadcasting-over-the-lan/</link>
		<comments>http://www.tocpcs.com/broadcasting-over-the-lan/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 12:25:02 +0000</pubDate>
		<dc:creator>The Elite Geek</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.tocpcs.com/?p=816</guid>
		<description><![CDATA[I had an issue recently where I wanted some data to get to all machines, all at the same time. The data would not be requested &#8211; I needed the data as it came in &#8211; from my CurrentCost meter &#8211; for purposes of testing around the house on the laptop. The solution was to [...]]]></description>
			<content:encoded><![CDATA[<p>I had an issue recently where I wanted some data to get to all machines, all at the same time. The data would not be requested &#8211; I needed the data as it came in &#8211; from my CurrentCost meter &#8211; for purposes of testing around the house on the laptop.</p>
<p>The solution was to setup the bash script to echo the data it was collecting (for MRTG purposes), to go out as a UDP broadcast packet to the network.</p>
<p>It was annoying to setup, because current versions of netcat differ to those I was using originally, and eventually found the need for a timeout wait on the netcat command.</p>
<p>It works great tho, and spawned the next idea of an Applet to monitor the Aurora output, the CC128 consumption, and anything else I want to spit out on any part of our local network.</p>
<p>It&#8217;d work great as a file copy mechanism too &#8211; base64 encode each file, and send that way. Each machine on a network typically receives broadcast packets, and so it&#8217;s no issue to spread the same data to all machines at the same time (instead of sending it to one machine at a time).</p>
<p>I like the idea of it &#8211; and am amazed I didn&#8217;t come across that before. It gives me the data on as many machines as I care to have listening for it &#8211; and is relatively reliable (if I wanted guaranteed, I&#8217;d not be using wireless..).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tocpcs.com/broadcasting-over-the-lan/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The consequences of root</title>
		<link>http://www.tocpcs.com/the-consequences-of-root/</link>
		<comments>http://www.tocpcs.com/the-consequences-of-root/#comments</comments>
		<pubDate>Sun, 27 Jun 2010 08:21:18 +0000</pubDate>
		<dc:creator>The Elite Geek</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.tocpcs.com/?p=782</guid>
		<description><![CDATA[Babies, and babies and more babies. I&#8217;m actually referring to Linux and my continual abuse of root for tasks that don&#8217;t belong to root. Recently, at work I&#8217;ve been working on a few minor tasks, however, because the system is locked down, I&#8217;ve ran into issues &#8211; for example, recently, I hit an issue with [...]]]></description>
			<content:encoded><![CDATA[<p>Babies, and babies and more babies.</p>
<p>I&#8217;m actually referring to Linux and my continual abuse of root for tasks that don&#8217;t belong to root.</p>
<p>Recently, at work I&#8217;ve been working on a few minor tasks, however, because the system is locked down, I&#8217;ve ran into issues &#8211; for example, recently, I hit an issue with trying to copy files from one directory to another. They are owned by seperate users, and so I couldn&#8217;t read from one to the other.</p>
<p>On my own setup, I&#8217;d have already been root, because that&#8217;s how I&#8217;ve done things for the last several years. This abuse of the root login has the consequence that sure, I can piece software together, and get things to work, but take away the root login, and all of a sudden the security that was always bypassed gets in the way.</p>
<p>I&#8217;m progressively avoiding the root login altogether, and using one of my own, it&#8217;s easier to avoid since root is no longer allowed to login, but it&#8217;s still the permissions issues that will get in the way doing their job.</p>
<p>I&#8217;ve previously abused cron for much of my tasks, but a few weeks back when I wrote mysql_monitor, I wrote that and it is started using an init script, instead of cron.</p>
<p>I&#8217;ll keep at it, and hopefully it&#8217;s not so much of a huge issue to pick up on the issues that were always avoided using root.</p>
<p>I&#8217;m also lazy though, so will likely resort to using root when something gets difficult for the normal user. One thing I did learn is that the execute permission, is needed for other users to list a directory, nuts to that (execute a directory.. wtf?)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tocpcs.com/the-consequences-of-root/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Serial over wireless</title>
		<link>http://www.tocpcs.com/serial-over-wireless/</link>
		<comments>http://www.tocpcs.com/serial-over-wireless/#comments</comments>
		<pubDate>Sat, 19 Jun 2010 00:38:55 +0000</pubDate>
		<dc:creator>The Elite Geek</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.tocpcs.com/?p=764</guid>
		<description><![CDATA[I spent much of yesterday afternoon and night trying to locate a RS232 or RS485 to bluetooth circuit that needed to be, cheaper than $50 (the cost of running the cable myself), could be powered by a 9V battery or a combination of AA batteries, and the result at the other end had to be [...]]]></description>
			<content:encoded><![CDATA[<p>I spent much of yesterday afternoon and night trying to locate a RS232 or RS485 to bluetooth circuit that needed to be, cheaper than $50 (the cost of running the cable myself), could be powered by a 9V battery or a combination of AA batteries, and the result at the other end had to be serial.</p>
<p>The idea being that the inverter I have can output RS485 which gives us details about how much it&#8217;s putting out, the temperature, and we can then measure efficiency and make any further adjustments to it to improve efficiency.</p>
<p>I&#8217;m not installing anything yet, as I&#8217;m still waiting on the gross meter to be installed (been a bit of time actually, getting impatient). The company contracted to do it claimed 2 weeks last week, so hopefully in the next 7 days we are grid connected.</p>
<p>Back to the serial idea though, I can take RS485, use an RS232 converter and that gives us the ability to get the data to the PC. A wireless transmitter and receiver is what would be needed, and Bluetooth being the most common, used in industrial applications for monitoring / controlling various machinery.</p>
<p>I&#8217;ve found a few candidates in my search yesterday:</p>
<p>This <a href="http://www.rfmodules.com.au/sena/ds/ps110w-g01.htm">PS110W Wi-Fi Serial Device Server &#8211; 1 Port</a> offers much of what is needed, including RJ45 if we later abandon wireless. Not sure on price though.</p>
<p>I then looked into the <a href="http://www.rfmodules.com.au/sena/bt/ltc100_serial_converter.htm">LTC100</a> which seems a better device. Pricing internationally puts it at about $50 AUD, but I&#8217;ve asked RF modules if they can provide a price and then I might get it via them.</p>
<p>The advantages of the LTC100 are that it can be port powered, which means I can supply it 9V via the serial port. Getting the data from it should be relatively easy, I&#8217;d need a bluetooth adapter, paired to it, and then using the SPP (Serial Port Profile) to create a virtual serial port. Attach that to my Virtual Server 2005 or VirtualBox virtual machine, and then probe the serial port in the virtual machine for the data.</p>
<p>Then, place that data into RRD Graphs and use that for comparison of day and seasonal changes, and to detect performance issues. Think MRTG Threshold alerts &#8211; &#8220;Your Solar System is performing worse than a drained AA battery&#8221;.</p>
<p>The hardware isn&#8217;t going to be IP65 rated like the inverter is, so I&#8217;ll pick up a IP65 enclosure from Jaycar, use that to hide the Cat6 cabling from the inverter, the bluetooth adapter. Whilst I&#8217;m getting the enclosure, I&#8217;ll get a battery terminal so that the wires don&#8217;t get damaged from replacing the battery.</p>
<p>I&#8217;ll have to figure out how much power it uses, considering the continual probes &#8211; although.. it won&#8217;t be continual if we shut it down after 9pm and wake it up around 5am, so that&#8217;ll save some of the battery.</p>
<p>I&#8217;m half tempted to get a Linutop or similar low powered PC to replace the current server, but the offerings out there so far are from $400 to $700 for something very low powered (1Ghz). Due to the virtual machine, it&#8217;d need two to be effective &#8211; which makes a new server all of a sudden worth while (extra computing power for the same price).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tocpcs.com/serial-over-wireless/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Monitor bash script</title>
		<link>http://www.tocpcs.com/mysql-monitor-bash-script/</link>
		<comments>http://www.tocpcs.com/mysql-monitor-bash-script/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 11:16:37 +0000</pubDate>
		<dc:creator>The Elite Geek</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.tocpcs.com/?p=760</guid>
		<description><![CDATA[I decided to use some of today to resolve an issue with MySQL Slave setup, where statements fail for various reasons. I could ignore the statements that fail &#8211; but that could be potentially dangerous &#8211; leaving with no slave backup at all. The next best option to ensure the database is up to date [...]]]></description>
			<content:encoded><![CDATA[<p>I decided to use some of today to resolve an issue with MySQL Slave setup, where statements fail for various reasons.</p>
<p>I could ignore the statements that fail &#8211; but that could be potentially dangerous &#8211; leaving with no slave backup at all.</p>
<p>The next best option to ensure the database is up to date is simple, monitor mysql for slave errors, which is what I do now &#8211; on my home server, I have it querying the 4 services, and checking if the two &#8220;Yes&#8221; options are ever &#8220;No&#8221;.</p>
<p>I created the script to run in bash, I usually heavily use PHP for all sorts of tasks (yep, many years ago, I did a PHP script for simple ping monitoring, and just stuck with it).</p>
<p>Using bash doesn&#8217;t require as many resources (not that PHP is resource intensive).</p>
<p>The script is probably pretty simple, but it was a bit of a learning curve for me (with my minimal bash experience).</p>
<p>/usr/sbin/mysql_monitor:</p>
<blockquote><p>#!/bin/bash<br />
EMAIL=&#8221;admin@email.address&#8221;<br />
HOSTS=&#8221;192.168.x.x 192.168.x.x x.x.x.x x.x.x.x&#8221;<br />
while :<br />
do<br />
for host in $HOSTS;<br />
do<br />
result=`mysql -h $host -u root &#8211;password=x &#8211;execute=&#8221;SHOW SLAVE STATUS\G&#8221; 2&gt;&amp;1`<br />
slave_result=`printf &#8220;%s\n&#8221; &#8220;$result&#8221; | grep -i running`<br />
connect_result=`printf &#8220;%s\n&#8221; &#8220;$result&#8221; | grep -i Error`<br />
if [[ $slave_result == *No* ]]<br />
then<br />
echo &#8220;$host &#8211; $result&#8221; | mail -s &#8220;SLAVE OUT OF SYNC&#8221;  &#8220;$EMAIL&#8221;<br />
fi</p>
<p>if [[ $connect_result == *connect* ]]<br />
then<br />
echo &#8220;$host &#8211; $result&#8221; | mail -s &#8220;MySQL Connection Issue&#8221; &#8220;$EMAIL&#8221;<br />
fi<br />
done<br />
sleep 1800<br />
done</p></blockquote>
<p>HOSTS is a variable which contains the IPs of the hosts to be monitored.  EMAIL is self explanatory.</p>
<p>The script sleeps for 30 minutes so that it&#8217;s not hammering, yet will check more often then my random every so often, sometimes weeks between follow up.</p>
<p>It&#8217;s added bonus is it&#8217;ll also tell me if a MySQL instance isn&#8217;t running by chance to ensure I am alerted to that.</p>
<p>I created an init script too to make sure it runs on startup on my home CentOS box.</p>
<p>/etc/init.d/mysql_monitor:</p>
<blockquote><p>#!/bin/sh<br />
# chkconfig: 2345 95 20<br />
# description: MySQL Monitor<br />
# Monitors MySQL Slave Status<br />
# processname: mysql_monitor<br />
APP=/usr/sbin/mysql_monitor<br />
PIDFILE=/tmp/mysql_monitor.pid<br />
case &#8220;$1&#8243; in<br />
start)<br />
echo -n &#8220;Starting $APP: &#8221;<br />
$APP &amp; pid=$!<br />
echo $pid &gt; $PIDFILE<br />
echo &#8220;Done.&#8221;<br />
;;<br />
stop)<br />
echo -n &#8220;Stopping $APP: &#8221;<br />
PID=`cat $PIDFILE`<br />
kill -9 $PID<br />
rm -f $PIDFILE<br />
echo &#8220;Done.&#8221;<br />
;;<br />
restart)<br />
echo -n &#8220;Restarting $APP: &#8221;<br />
PID=`cat $PIDFILE`<br />
kill -9 $PID<br />
rm -f $PIDFILE<br />
sleep 1<br />
$APP &amp; pid=$!<br />
echo $pid &gt; $PIDFILE<br />
echo &#8220;Done.&#8221;<br />
;;<br />
esac<br />
exit 0</p></blockquote>
<p>I&#8217;ll have to make more of my monitoring tools run using init scripts and rely less on cron.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tocpcs.com/mysql-monitor-bash-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Controlling ALSA&#8217;s output</title>
		<link>http://www.tocpcs.com/controlling-alsas-output/</link>
		<comments>http://www.tocpcs.com/controlling-alsas-output/#comments</comments>
		<pubDate>Sun, 13 Jun 2010 02:15:58 +0000</pubDate>
		<dc:creator>The Elite Geek</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[VoIP]]></category>

		<guid isPermaLink="false">http://www.tocpcs.com/?p=756</guid>
		<description><![CDATA[I use &#8220;Twinkle&#8221; on my Ubuntu PC, for receiving and making VoIP calls. After testing Linphone, Wengo, and several others, Twinkle seemed to be the one which seemed to be pretty robust. I like to have music going when I&#8217;m not on the phone, but that proves to be quiet the distraction during a voice [...]]]></description>
			<content:encoded><![CDATA[<p>I use &#8220;Twinkle&#8221; on my Ubuntu PC, for receiving and making VoIP calls.</p>
<p>After testing Linphone, Wengo, and several others, Twinkle seemed to be the one which seemed to be pretty robust.</p>
<p>I like to have music going when I&#8217;m not on the phone, but that proves to be quiet the distraction during a voice call, as well, I ran into problems with having the headphones in, and the speakers turned on at the same time (microphone feedback, for example).</p>
<p>Twinkle has the ability to run scripts on call incoming, call answered, call hang up, call missed, etc.  I put that to good use and created some scripts.</p>
<p>callincoming.sh</p>
<blockquote><p>#!/bin/bash<br />
/usr/bin/amixer set &#8220;Front&#8221; 100%<br />
/usr/bin/amixer set &#8220;Side&#8221; 100%<br />
/usr/bin/amixer set &#8220;Master&#8221; 75%</p></blockquote>
<p>That script would turn the main speakers up, and the headphones (which I&#8217;ve got into the &#8220;side&#8221; speaker plug in the back), to 100% &#8211; so we can hear the ringing if I&#8217;m away from the keyboard.</p>
<p>The Master is also turned up to 75% which is where I find it&#8217;s &#8216;loud enough&#8217; to be heard, but not deafening that the kids would get significantly disturbed if they were having a day time sleep.</p>
<p>The script can be expanded to kill the radio, or rhythmbox. I&#8217;d love to be able to stop the music streaming online, but I can&#8217;t get application control that the Sound Preferences offers just yet.</p>
<p>callanswered.sh</p>
<blockquote><p>#!/bin/bash<br />
/usr/bin/amixer set &#8220;Front&#8221; 0%<br />
/usr/bin/amixer set &#8220;Side&#8221; 100%<br />
/usr/bin/amixer set &#8220;Mic&#8221; 48%<br />
/usr/bin/amixer set &#8220;Mic Boost&#8221; 0%<br />
/usr/bin/amixer set &#8220;Front Mic&#8221; 0%<br />
/usr/bin/amixer set &#8220;Master&#8221; 60%<br />
/usr/bin/amixer set &#8220;Input Source&#8221;,0 &#8220;Mic&#8221;</p></blockquote>
<p>What this script does is turn the &#8220;Front&#8221; speakers (my primary ones) off &#8211; so the caller / callee doesn&#8217;t hear themselves. Turns the headphones up to 100% (it&#8217;s actually got a control on the cord to the PC, that I turn it down and leave it). Turns the mic to 48% &#8211; this is a good level that doesn&#8217;t give the kids in the background into the call, but allows good level of voice, without echo.</p>
<p>Mic Boost &#8211; this was awful, picture a poorly mixed MP3, like 64k, turned right up, with emphasis on bass, it &#8216;crackles&#8217; and &#8216;distorts&#8217; heavily.  So, I kill that because I believe amixer resets after a reboot and setting it down is desired.</p>
<p>Front Mic is not used, but gets turned up to 100% for some reason, so I leave that off! Finally, I set the Input Source to &#8220;Mic&#8221; to ensure it doesn&#8217;t capture from the radio card for example.</p>
<p>callend.sh</p>
<blockquote><p>#!/bin/bash<br />
/usr/bin/amixer set &#8220;Front&#8221; 100%<br />
/usr/bin/amixer set &#8220;Mic&#8221; 0%<br />
/usr/bin/amixer set &#8220;Side&#8221; 0%<br />
/usr/bin/amixer set &#8220;Front Mic&#8221; 0%<br />
/usr/bin/amixer set &#8220;Mic Boost&#8221; 0%<br />
/usr/bin/amixer set &#8220;Master&#8221; 75%</p></blockquote>
<p>This script resets the music back to a usable level, kills the mic to stop that awful feedback through the speakers. As the others, can be expanded to start the radio, or rhythmbox for example.</p>
<p>This ability is also useful if we later want to expand the sound to other sound sources &#8211; like to the TV for MP3s in the lounge room!</p>
<p>After the scripts are created, chmod them a+x so that they are executable.</p>
<p>Adding the scripts to Twinkle was as easy as opening User Settings, going to &#8220;Scripts&#8221; and pointing &#8220;Outgoing Call, Outgoing Call Answered, Incoming Call Answered&#8221; to &#8220;callanswered.sh&#8221;. Set Incoming Call to &#8220;callincoming.sh&#8221;, and the call ended options and call failed options to callended.sh.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tocpcs.com/controlling-alsas-output/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Upgrade 5.0 to 5.1</title>
		<link>http://www.tocpcs.com/mysql-upgrade-5-0-to-5-1/</link>
		<comments>http://www.tocpcs.com/mysql-upgrade-5-0-to-5-1/#comments</comments>
		<pubDate>Fri, 11 Jun 2010 08:22:13 +0000</pubDate>
		<dc:creator>The Elite Geek</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.tocpcs.com/?p=736</guid>
		<description><![CDATA[A boo-boo! (See the end, I found a solution). I was testing an upgrade for MySQL, from 5.0 to 5.1, to gain Row Based Replication instead of Statement based replication (as statements are a cause of SBR breaking, and it doesn&#8217;t proceed til I tell it to). So, in my usual lazy, just do it, [...]]]></description>
			<content:encoded><![CDATA[<p>A boo-boo! (See the end, I found a solution).</p>
<p>I was testing an upgrade for MySQL, from 5.0 to 5.1, to gain Row Based Replication instead of Statement based replication (as statements are a cause of SBR breaking, and it doesn&#8217;t proceed til I tell it to).</p>
<p>So, in my usual lazy, just do it, manner, installed MySQL Server 5.1, pointed the datadir at the old so that I&#8217;d have my data pretty quickly up and running.</p>
<p>And the installation worked, until I started MySQL.</p>
<p>I use hMailserver for email on my box, this uses MySQL for it&#8217;s settings and database storage (which is good actually, a config file is inflexible for multi domain environments).</p>
<p>The database used by hMailserver is InnoDB, most of my needs are well serviced with MyISAM.</p>
<p>In my rush, I didn&#8217;t do a backup. I didn&#8217;t copy the data folders, just went right over it, started, and got an error:</p>
<p>﻿100610 22:15:32  InnoDB: Database was not shut down normally!<br />
InnoDB: Starting crash recovery.<br />
InnoDB: Reading tablespace information from the .ibd files&#8230;<br />
InnoDB: Restoring possible half-written data pages from the doublewrite<br />
InnoDB: buffer&#8230;<br />
100610 22:15:32  InnoDB: Starting log scan based on checkpoint at<br />
InnoDB: log sequence number 0 1204538731.<br />
InnoDB: Doing recovery: scanned up to log sequence number 0 1204538731<br />
InnoDB: Page directory corruption: supremum not pointed to</p>
<p>It was shut down normally &#8211; using the Windows Service, the issue is that the MySQL database won&#8217;t work with the log files from the previous database for some weird reason.</p>
<p>I&#8217;m still yet to determine if any recovery can be done on the log files, making them usable again, however I have doubts.</p>
<p>I reinstalled my mailserver and did a quick setup on it today to get us operational again. And learnt a lesson &#8211; always backup.</p>
<p>Actually, I should have had a database backup of recent, I don&#8217;t. I have no database backup &#8211; I only have the datafiles as they are.</p>
<p>That instance of MySQL is rarely used, it&#8217;s most usage would be the mailserver, followed shortly by the replication I get it to do from the server in Newcastle. It is my home windows test server, I also have a linux one that I planned similar for &#8211; except that does much, much more and data loss there would very much annoy me.</p>
<p>So, I ask myself &#8211; why is there no backup of it then? Because, there isn&#8217;t.</p>
<p>I MUST use this weekend (which thankfully is a long one), to:<br />
A) Figure out if that log is recoverable, and move back to it, then onward to MySQL 5.1 using a mysqldump.<br />
B) Upgrade To MySQL 5.1 for the windows and Linux box here, and the box in Newcastle.<br />
C) Setup replication using Row Based Replication for those databases I have that need it.<br />
D) Design a regular backup script which backs up the databases locally, something like weekly (With email reporting).<br />
E) Update regularly. 5.0 is really old now.</p>
<p>Reconsider using hMailserver is also on the cards, it&#8217;s not it&#8217;s fault, in fact, it has the ability to use it&#8217;s own seperate instance of MySQL (and does by default, and that&#8217;s what I currently have in Newcastle).  But, I want the ability to access that data &#8211; later for user purposes, greylisting statistics and so forth.</p>
<p><strong>UPDATE: </strong>I found the issue! It turns out the ibdata1 file I needed, was in C:\MySQL Datafiles. In the Program Files folder was a 10MB ibdata1 file, which is why the error messages were occurring.</p>
<p>The Database came right back to life the very moment I shut it down. Copied the file from C:\MySQL Datafiles to the version 5.0 program files folder, and started the version 5.0.45 MySQL server with that file, and the log files intact.</p>
<p>Remember to remove the innodb_force_recovery option if it was added, and it can help to change default-storage-engine=INNODB to default-storage-engine=MyISAM &#8211; so that the server starts with MyISAM instead of INNODB.</p>
<p>This will not work if you don&#8217;t have consistent logfiles and data files &#8211; but otherwise, it&#8217;s a save!</p>
<p>Now, the plan is to dump all that data using mysqldump, and then go forth and better my lazy processes for database server management.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tocpcs.com/mysql-upgrade-5-0-to-5-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hardware Failures</title>
		<link>http://www.tocpcs.com/hardware-failures/</link>
		<comments>http://www.tocpcs.com/hardware-failures/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 12:26:07 +0000</pubDate>
		<dc:creator>The Elite Geek</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.tocpcs.com/?p=574</guid>
		<description><![CDATA[After travelling 460KM today, I&#8217;ve discovered how annoying a hardware failure can be. My colocation box is a HP DL360, G3, so it&#8217;s not exactly bleeding edge, but it&#8217;s a fantastic server, does it&#8217;s job and does it reliably. Last night, we had a planned outage for just a short time to move the box [...]]]></description>
			<content:encoded><![CDATA[<p>After travelling 460KM today, I&#8217;ve discovered how annoying a hardware failure can be.</p>
<p>My colocation box is a HP DL360, G3, so it&#8217;s not exactly bleeding edge, but it&#8217;s a fantastic server, does it&#8217;s job and does it reliably.</p>
<p>Last night, we had a planned outage for just a short time to move the box to a different power situation, this was done and the box came back online.</p>
<p>It dropped off 6.30pm, came back 6.45pm. Then, 7.15pm there was notices coming through &#8211; I&#8217;ve began to ignore the warnings for a while now, so I failed there but it wasn&#8217;t too bad, because..</p>
<p>.. My colo provider, Inticon detected the port was flapping 20 minutes later, and went back to have a look, at 8pm he had advised that the issue was with the processor fan assembly, only one fan was spinning &#8211; strange, it was OK for a while before hand.</p>
<p>He went out and about to find a replacement part, and tried to find alternative measures, but came up empty. Considering the nature of the part &#8211; it&#8217;s pretty server specific, so it was understandable that we had no alternatives.</p>
<p>I then began hunting around for the part &#8211; found one, $185 online. I thought, wow, this must be a pretty premium part..</p>
<p>The contact at the colo provider went even further, and actually advised me there was a box on eBay for $250 &#8211; no kidding.</p>
<p>I looked at it, considered it&#8217;s marginally more expensive, but gives us a lot more hardware to play with as well. I contacted the eBay seller, asked if he could accommodate pickup for tomorrow &#8211; he was OK with it, fantastic I thought..</p>
<p>So, I head to bed &#8211; we can&#8217;t pick it up at night, it&#8217;s just not THAT important (and I had started work 8am, so by that point I was very tired). I think about this for a while in bed, then somehow drift off to sleep.</p>
<p>One of the kids is sick, so they crawl into bed beside me and annoy me, so I get up at 6am, head to sleep on the lounge, peaceful.</p>
<p>The next morning, I get up, sort out a pending PC related issue for somebody (it was arranged already), then the seller was interstate for the morning, not back to 1pm, so that was as good as we could get.</p>
<p>He then contacted us, advising he wouldn&#8217;t be back til 3.30pm &#8211; considering we were getting ready to leave around then, that&#8217;d work out perfectly. We got near the address in the southern Sydney area, but he calls and advises 4.30 &#8211; he was delayed. No problem, can&#8217;t do much if he isn&#8217;t there..</p>
<p>So, 4.30pm, he arrives, we have a look at the box, it works, he upgrades the CPU and RAM and throws in a 15K 36GB SCSI drive &#8211; fantastic I thought, more spare parts. The box worked, so in the boot with it, time to hit the highway for Newcastle.</p>
<p>We hit Newcastle at 7pm (after litterally, racing down the freeway to Newcastle), and the colo provider contact was already there &#8211; fantastic.</p>
<p>I take the server into the colo room, upgrade the box with what good parts I could &#8211; extra 1GB of RAM, 3.06 to 3.2Ghz Xeon, swapped over the fan assembly.. Power it on, it takes some time to boot, unusual, it eventually does boot.</p>
<p>Then, I enter into windows, get a ping going, get task manager up &#8211; make sure the virtual machine kicks over, it does. Box stays up stable.</p>
<p>Pack up the changed parts into the &#8216;new&#8217; box, and get the colo provider to hold those incase something else fails down the track &#8211; pretty much a fully working machine with exception the front panel &#8211; which shouldn&#8217;t fail again.</p>
<p>Then, head back home approximately 30 minutes later, by this time the kid who is sick complains about pain, ends up needing a toilet break, all sorted.</p>
<p>Hit the highway to go back home, arrive at 9.30pm.</p>
<p>Wait for the colo provider contact to remove some trickery done to assist with the downtime, and I modify the SMTP route I put in place to redirect the affected domains to my router.</p>
<p>The outcome &#8211; all mail leaves, some spam shows, delete this, and I update the database, all in sync.. fantastic..</p>
<p>All up, nearly a full day, 460KM&#8217;s travelled, $14 spent on food at Aldi in Sydney, $22 spent at Maccas in Newcastle, $250 spent on a pretty darn good deal (compared to $185 for the processor fan assembly) &#8211; and we are all back and operational.</p>
<p>Hardware failures are REALLY annoying &#8211; especially when you can&#8217;t just call HP and say fix it in 4 hours.. &#8211; but we did pretty good for a 23 hour restore time (and still managed to keep some essential services up anyway).</p>
<p>And the dedication of Inticon is outstanding.</p>
<p>Had this been Servers Australia, I have no idea where we&#8217;d be. Part of me says &#8216;online sooner, cause they have HP DL360&#8242;s (or had them)&#8217;, the other says &#8216;getting Jared to get off his arse and take some damned action&#8217;. I&#8217;m leaning towards the latter, it&#8217;s just typical of previous experiences.</p>
<p>Note to self: work harder on high availability.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tocpcs.com/hardware-failures/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Squid: Intercept traffic</title>
		<link>http://www.tocpcs.com/squid-intercept-traffic/</link>
		<comments>http://www.tocpcs.com/squid-intercept-traffic/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 09:01:15 +0000</pubDate>
		<dc:creator>The Elite Geek</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://www.tocpcs.com/?p=563</guid>
		<description><![CDATA[I was bored this weekend, so after finding some YouTube traffic occurring from one of the PCs on the network, I decided that I&#8217;d play with Squid, which is a very powerful, and flexible proxy server. It has many different methods of operation, and can be used in different ways, such as a simple proxy, [...]]]></description>
			<content:encoded><![CDATA[<p>I was bored this weekend, so after finding some YouTube traffic occurring from one of the PCs on the network, I decided that I&#8217;d play with Squid, which is a very powerful, and flexible proxy server.</p>
<p>It has many different methods of operation, and can be used in different ways, such as a simple proxy, where you set it up, only allow your traffic, and set your browser to use it.</p>
<p>A reverse proxy, so that it caches traffic for busy websites and therefore removes load.</p>
<p>A transparent proxy, so that users don&#8217;t have a definite idea they are being proxied, and this is the method I used &#8211; purely so we didn&#8217;t have to set it up on the client machine, and that&#8217;d just be boring anyway.</p>
<p>So, I setup the access list in my wonderful Cisco 871. The access list is set such that any traffic that is not web traffic, goes out directly, the PCs that matter are also not routed to the access list, and every other machine is.</p>
<p>Then, I setup squid, I configured it as a transparent proxy, and then enabled the rewrite_program option, then I setup the rewrite script to rewrite the urls for youtube.com to xtube.com &#8211; so, any request for youtube, results in xtube &#8211; a more explicit knock off of youtube.</p>
<p>Unfortunately, the desired effect of having the traffic decrease was not the case, they indeed viewed the xtube traffic instead.</p>
<p>So, the next step (a later on thing), will be to setup a virtual host in apache on that server, mirror the youtube website content, and then replace the area where a video would normally appear with a singular cached video. I&#8217;ll have to find one worthy of such a task.</p>
<p>Then, any requests for youtube videos shall be met with a repeat video. Or, we could confuse things, and swap the code in the youtube video page, with one from another site, so when they next seek out the latest Black Eyed Pea (s)hit video on YouTube, they are met with a very, very different black, eyed, pea.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tocpcs.com/squid-intercept-traffic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What I say, and what I do may not be in a 1:1 ratio</title>
		<link>http://www.tocpcs.com/what-i-say-and-what-i-do-may-not-be-in-a-11-ratio/</link>
		<comments>http://www.tocpcs.com/what-i-say-and-what-i-do-may-not-be-in-a-11-ratio/#comments</comments>
		<pubDate>Sat, 29 Aug 2009 14:02:30 +0000</pubDate>
		<dc:creator>The Elite Geek</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.tocpcs.com/?p=554</guid>
		<description><![CDATA[I usually state the importance of backup, and reply to those who lose something &#8216;should have backed up&#8217;. Since the change from Windows to Ubuntu, my email backup has been pretty lax &#8211; as in, it&#8217;s not a job for cron. I&#8217;ll have to work on this soon. I find the subject to be somewhat [...]]]></description>
			<content:encoded><![CDATA[<p>I usually state the importance of backup, and reply to those who lose something &#8216;should have backed up&#8217;.</p>
<p>Since the change from Windows to Ubuntu, my email backup has been pretty lax &#8211; as in, it&#8217;s not a job for cron. I&#8217;ll have to work on this soon.</p>
<p>I find the subject to be somewhat true. I&#8217;ll say something, but I may not necessarily do that. Maybe it&#8217;s because that sense that &#8220;I can probably fix whatever it is&#8221; that promotes it..</p>
<p>I was having problems, randomly, my system would choose to have a &#8216;read only filesystem&#8217; error appear, and all the labels on the windows would lockup, and the graphics would randomly offset somewhere in the order of + / &#8211; 150px, making using them difficult.</p>
<p>I tried to troubleshoot this, and despite the very obvious error message, I ignored that and went off suspecting gdm was the cause.</p>
<p>At some point between there and last week, I found the issue may have been in my face all along &#8211; I was forced a fsck by Ubuntu&#8217;s startup and this revealed many errors in the file system. So, I piped the output to &#8216;yes&#8217;, and let it do its thing.</p>
<p>After doing this, and switching to GNOME via KDM, I haven&#8217;t had the issue. I do suspect the issue as being the file system errors, as the system boots with &#8216;remount-ro&#8217; &#8211; which explains would explain the problem.</p>
<p>Back to the spam problem, I got blocked once, dang virus. Anyway, unblocked, I thought nothing of it until recently, where I came across some more reports &#8211; I looked at the date / time, and sure enough, they were recent. I then looked at the router to see where port 25 clients came from and found the server IP there &#8211; that was OK, it runs an SMTP server I thought, then I considered they were client connections.</p>
<p>Remote desktopped, and I found IE opened with spam pages &#8211; the calling card of a virus. Checked task manager, ended an imposter process, and now running an online virus scan.</p>
<p>There&#8217;s a few things to consider here, in order of importance:<br />
1. This would never happen if it was a linux system.<br />
2. The system running a mail server goes a long way to promoting the ignorance of port 25 sessions.</p>
<p>However, being a &#8216;server&#8217; there shouldn&#8217;t be many client connections, so now, I&#8217;ve changed the monitoring slightly &#8211; I now get alerts when a SMTP threshold is exceeded. One might consider installing an AV, but that just adds to load, the likelihood of a virus is actually, zero in normal conditions. Having users susceptible to viruses (gullible is the word), is not a normal situation here.</p>
<p>So, back on goes the firewall, a bash script is in place to grep the output of expect&#8217;s telnet checks, and email the domain about any large numbers of SMTP client sessions. I had checked ntop for the availability of this &#8211; it doesn&#8217;t have it. Cisco&#8217;s &#8216;kron&#8217; doesn&#8217;t seem capable of sending the output out to a URL (I was initially going to write a PHP script to count the sessions and create an email).</p>
<p>Netflow is feeding ntop, but I couldn&#8217;t identify any quick way to get those sessions, so the &#8216;least&#8217; intense method of checking is in fact, telnet, expect, and grep.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tocpcs.com/what-i-say-and-what-i-do-may-not-be-in-a-11-ratio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spammers? Where are you..</title>
		<link>http://www.tocpcs.com/spammers-where-are-you/</link>
		<comments>http://www.tocpcs.com/spammers-where-are-you/#comments</comments>
		<pubDate>Fri, 16 Jan 2009 09:50:33 +0000</pubDate>
		<dc:creator>The Elite Geek</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.tocpcs.com/?p=517</guid>
		<description><![CDATA[Ooops.. Apache was configured wrong. You can resume spamming now, apologies for the misconfiguration. (Comments are fixed now).]]></description>
			<content:encoded><![CDATA[<p>Ooops.. Apache was configured wrong.</p>
<p>You can resume spamming now, apologies for the misconfiguration.</p>
<p>(Comments are fixed now).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tocpcs.com/spammers-where-are-you/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>It&#8217;s gone!! Gone-diddly-gone.</title>
		<link>http://www.tocpcs.com/crap-be-gone/</link>
		<comments>http://www.tocpcs.com/crap-be-gone/#comments</comments>
		<pubDate>Sat, 10 Jan 2009 12:56:03 +0000</pubDate>
		<dc:creator>The Elite Geek</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.tocpcs.com/?p=515</guid>
		<description><![CDATA[It&#8217;s a bit late &#8211; but, hopefully everyone had a Merry Christmas, and also is enjoying the new year. For years I was glued to it, and couldn&#8217;t find enough drive to get rid of a really bad problem of mine. But, just as last year was coming to an end, I managed to get [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s a bit late &#8211; but, hopefully everyone had a Merry Christmas, and also is enjoying the new year.</p>
<p>For years I was glued to it, and couldn&#8217;t find enough drive to get rid of a really bad problem of mine. But, just as last year was coming to an end, I managed to get rid of the bad rubbish.</p>
<p>I finally, after years of contemplating it, made the change from a Windows Desktop to a Linux based Desktop. I loaded up the mirror site, found the ISO, downloaded it, burnt it, and installed it. Ubuntu for x64.</p>
<p>I was concerned mainly about my RAID setup (2 x 250GB configured as 500GB). I am capable of recovering data off a partition, or off a drive in many (not all) cases where there&#8217;s been no to low physical damage. Spreading the data across two drives, isn&#8217;t very good for a recovery aspect &#8211; if one fails, the data could well be gone!</p>
<p>So, I reinstalled Windows, as I was going to anyway to drop the RAID. After windows was installed, I also thought about the second drive and concluded I should place Linux on the other drive.</p>
<p>I didn&#8217;t place much thought into software replacements for my regular applications, such as Outlook, Office, and Dreamweaver. I also placed little consideration into hardware compatibility. I figured &#8211; if it doesn&#8217;t work, I&#8217;ll use Windows some more and work Ubuntu out later &#8211; at the very least, I&#8217;d have the fall back environment for work.</p>
<p>Much to my extreme amazement &#8211; Ubuntu was really quick to install, around 15 minutes to XP&#8217;s 1 hour. I then tested my hardware &#8211; video is a key aspect, as I use a dual head video card, and have 2x 19&#8243; monitors attached to this. It wasn&#8217;t difficult to set that up at all. Then, sound &#8211; can&#8217;t really listen to anything or do anything without sound &#8211; so I tested &#8211; it works!</p>
<p>I also have a TV / FM Tuner &#8211; I figured, if anything was going to be difficult for it, this WILL be it.. I fired it up, configured TV Time, and &#8230; it worked! FM Tuner &#8211; &#8220;gnomeradio&#8221;, works.</p>
<p>Compatibility is vastly improved from the years ago when I was attempting Red Hat 3! Now, that was an awful experience. Ubuntu have really done a great job at making Desktop Linux absolutely user friendly.</p>
<p>Software replacements &#8211; I couldn&#8217;t port my PST files from Outlook, and since Email is a key function, I investigated an alternative. It just so happens the good folk behind Mozilla Thunderbird import emails automatically &#8211; and I did exactly this. Now, I run Thunderbird, works MUCH (i can&#8217;t stress this enough) faster than Outlook.</p>
<p>I have all my rules established, and where Outlook failed &#8216;randomly&#8217;, Thunderbird is very efficient at filtering the thousands of emails a month automatically.</p>
<p>There is only one &#8216;minor&#8217; issue with, I suspect, Thunderbird, which relates to the mouse no longer able to click anything when a certain activity occurs (not sure yet), but it&#8217;s survivable.</p>
<p>I then looked for an alternative FTP program, and an alternative PHP editor. PHP editor came quickly &#8211; gPHPEdit, a nice light replacement for dreamweaver &#8211; it&#8217;s not as integrated &#8216;site&#8217; based as it is, but I don&#8217;t really mind this anyway.</p>
<p>Browser is of course, Firefox. And this works really well.</p>
<p>Currently, I&#8217;m using aMSN for MSN messenging. It&#8217;s also not without it&#8217;s setbacks (unable to change sounds for messages and online / offline) but, again, I can adapt to it.</p>
<p>The system itself is great &#8211; performs fine. I&#8217;ll admit &#8211; there&#8217;s an issue with the TV Tuner card, when I try and place the system in a &#8216;suspend&#8217; state &#8211; the system comes back, but a repeat flashing &#8216;shutdown&#8217; applet window appears.</p>
<p>I&#8217;ve managed to isolate this, with help from the Ubuntu forums to my TV Tuner card, because it doesn&#8217;t occur when unloading the kernel module, but I can recover the system and work around this for the time being by unloading and reloading the radio module.</p>
<p>I have had to go back to Windows TWICE after the installation. The first, to export emails from Outlook to Thunderbird for use in Thunderbird on Ubuntu. The second, was to recompile a VB application for someone. The Windows install is still not completed, and I&#8217;m not sure I will spend the somewhat day and a bit to fully restore all applications. Ubuntu is ready for me now, and has taken very little time to get running.</p>
<p>I also recompiled my own kernel to use the performance enhancements available to Core2Duo (in an effort to see if the suspend issue was going to be easily resolved).</p>
<p>Windows isn&#8217;t all bad though &#8211; it&#8217;s got support for some games, but I&#8217;m hardly a hard core gamer. I found new Ubuntu games, and now play more Poker and BZFlag (great game).</p>
<p>The initial impressions before install were &#8216;expect a challenge&#8217; &#8211; after install, I found it&#8217;s actually relatively easy for MOST, if not ALL users to move to. If I were Microsoft, I would be scared &#8211; the OS, after the short install, comes with everything you need (even an Office application). There&#8217;s really not much that Windows does, that Ubuntu can&#8217;t do as easy, if not easier, and the mountain of entertaining games (I&#8217;m really tired of Solitaire) makes the switch just that much more worth it.</p>
<p>Back to Ubuntu 8.10.<br />
Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tocpcs.com/crap-be-gone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Asterisk Debug Gotcha</title>
		<link>http://www.tocpcs.com/asterisk-debug-gotcha/</link>
		<comments>http://www.tocpcs.com/asterisk-debug-gotcha/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 11:25:49 +0000</pubDate>
		<dc:creator>The Elite Geek</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.tocpcs.com/?p=503</guid>
		<description><![CDATA[I was working on an issue being experienced by someone remotely attached to my asterisk machine, and found an abnormality. I use a realtime implementation to allow for easy addition of users and to have the data I want in MySQL (makes it easier to monitor activity in CDR, etc). The problem recently was as [...]]]></description>
			<content:encoded><![CDATA[<p>I was working on an issue being experienced by someone remotely attached to my asterisk machine, and found an abnormality.</p>
<p>I use a realtime implementation to allow for easy addition of users and to have the data I want in MySQL (makes it easier to monitor activity in CDR, etc). The problem recently was as a result of an upgrade, there appears to be changing to Asterisk&#8217;s debug log. Previously, Asterisk debug output would end up in the full log.</p>
<p>This made it easy to review the traces of an issue being experienced, and follow them back to the source &#8211; the log would simply contain the full sequence of issues leading up to the &#8216;issue&#8217;, and what happened after.</p>
<p>The newer version of asterisk however doesn&#8217;t enable debugging unless the startup option &#8216;-d&#8217; is specified. safe_asterisk restarts asterisk in the event it bombs out &#8211; and one has to admit &#8211; crashing doesn&#8217;t happen often with asterisk, it&#8217;s &#8216;reliable&#8217;.</p>
<p>So, whilst I was reading the log, I was seeing messages such as:<br />
&#8221; res_config_mysql.c: MySQL RealTime: Failed to query database. Check debug for more info.&#8221;</p>
<p>That&#8217;s a nice warning, it tells me to find the source of the issue, check into asterisk debug log. So we open the seperate file appointed to debug (it removes clutter), and it&#8217;s empty.</p>
<p>So, I look into the asterisk configuration file &#8211; is debug enabled? Of course it is. Spelt correctly? Yep. Where&#8217;s the debug &#8211; how can you debug a bug without debug?</p>
<p>I check Asterisk &#8216;logger show channels&#8217; &#8211; this is described to show logging channels.</p>
<p>Sure enough, there is a line that states my &#8216;debug&#8217; log is of &#8220;File&#8221; type, and is &#8220;Enabled&#8221; and is configured to be &#8220;Debug&#8221;. Asterisk isn&#8217;t doing anything wrong there.</p>
<p>Then I look into &#8216;help&#8217; &#8211; core set debug. Could it really be, asterisk requires the debug option to be set? It does. You can set it there, or alternatively, you can have it enabled on startup in using safe_asterisk.</p>
<p>In the safe_asterisk script (nano -w /usr/sbin/safe_asterisk) &#8211; find &#8220;ASTARGS&#8221; and edit it to include a &#8220;-d&#8221; &#8211; this enables asterisk debugging information to a log file, by default, asterisk doesn&#8217;t log debug information.</p>
<p>This is confusing. The problem turns out that real-time now has an additional field required &#8211; &#8216;regserver&#8217;, adding that field seems to have caused asterisk to stop spewing the error message.</p>
<p>The issue may be &#8216;better&#8217; managed by asterisk real time mysql having a seperate SQL based log for any errors it experiences. In a production system, you might not have so many errors.</p>
<p>Although, another point to note is the mysql realtime module is very chatty:<br />
 res_config_mysql.c: MySQL RealTime: Connection okay.<br />
res_config_mysql.c: MySQL RealTime: Retrieve SQL: SELECT * FROM sip_buddies WHERE name = &#8221;<br />
res_config_mysql.c: MySQL RealTime: Connection okay.<br />
res_config_mysql.c: MySQL RealTime: Retrieve SQL: SELECT * FROM sip_buddies WHERE name = &#8221; AND host = &#8216;dynamic&#8217;<br />
res_config_mysql.c: MySQL RealTime: Connection okay.<br />
This query might return no results, so it begs to question why is it even executed?</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tocpcs.com/asterisk-debug-gotcha/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Asterisk Reinvite Improved</title>
		<link>http://www.tocpcs.com/asterisk-reinvite-improved/</link>
		<comments>http://www.tocpcs.com/asterisk-reinvite-improved/#comments</comments>
		<pubDate>Mon, 06 Oct 2008 11:10:29 +0000</pubDate>
		<dc:creator>The Elite Geek</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.tocpcs.com/?p=500</guid>
		<description><![CDATA[Looking into the docs for Asterisk 1.6.0 for a solution to a NAT issue, you can find that asterisk reinvite has improved significantly in the later versions. Previously, you had to turn it off for peers stuck behind NAT, this is resolved in newer versions of Asterisk which attempt to determine if a peer is [...]]]></description>
			<content:encoded><![CDATA[<p>Looking into the docs for Asterisk 1.6.0 for a solution to a NAT issue, you can find that asterisk reinvite has improved significantly in the later versions.</p>
<p>Previously, you had to turn it off for peers stuck behind NAT, this is resolved in newer versions of Asterisk which attempt to determine if a peer is behind NAT, or if the peer is connectable.</p>
<p>The method is simple, for the peers affected or unsure, set the canreinvite option to &#8216;nonat&#8217; &#8211; this will cause the audio to be connected directly to the peer if possible, otherwise, it will packet2packet bridge the audio.</p>
<p>It is important to have the right mix of codecs on the server and specified in the ATA settings also &#8211; without it, you&#8217;ll just have a mess to sort out.</p>
<p>NAT is a big problem for VoIP &#8211; nearly every gateway / router will implement NAT differently from what I have been told. The BEST configuration is to have the ports forwarded. This isn&#8217;t hard for many people &#8211; it&#8217;s just a matter of finding what your router calls it, and then forward the ports. Once the ports are forwarded, there should be only codec mismatches to worry about &#8211; and of course, if your codecs are specified right &#8211; well, there is no problem &#8211; the audio should be connected directly, rather than bridged.</p>
<p>Asterisk 1.4 and 1.6 have had many advancements to SIP and RTP implementation. T.38 support is at a strong point now &#8211; not completely tested by me, however with T.38 support, it greatly reduces the errors you may experience trying to transmit fax over ulaw / alaw.</p>
<p>Check out the <a href="http://svn.digium.com/view/asterisk/tags/1.6.0/UPGRADE.txt?view=markup" target="_blank">UPGRADE.txt </a>for Asterisk 1.6 &#8211; the list is massive and impressive.<br />
Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tocpcs.com/asterisk-reinvite-improved/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Asterisk Context Control</title>
		<link>http://www.tocpcs.com/asterisk-context-control/</link>
		<comments>http://www.tocpcs.com/asterisk-context-control/#comments</comments>
		<pubDate>Sun, 05 Oct 2008 03:37:54 +0000</pubDate>
		<dc:creator>The Elite Geek</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.tocpcs.com/?p=497</guid>
		<description><![CDATA[Recently, I have been toying with Asterisk 1.6.0 to work in some new internal features that I want to leverage. One of the key features I took advantage of is the context option for each SIP peer. It is possible to exclude one group of users from calling another group by using contexts. Let&#8217;s say [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I have been toying with Asterisk 1.6.0 to work in some new internal features that I want to leverage.</p>
<p>One of the key features I took advantage of is the context option for each SIP peer. It is possible to exclude one group of users from calling another group by using contexts.</p>
<p>Let&#8217;s say I want user 300 to never be able to call two users, 400 and 420. 420 and 400 can call each other, and call 300. User 300 is simply someone who will get bullied by 400 &amp; 420, but won&#8217;t be able to get back at them.</p>
<p>This is accomplished easily through the use of extensions and SIP peer contexts.</p>
<p>I set the context for 300 to &#8216;victim&#8217;. I set the context for 400 and 420 to &#8216;attack&#8217;.</p>
<p>Then, in extensions.conf I create the appropriate configurations.</p>
<p>[victim]<br />
exten =&gt; _310X.,1,Dial(SIP/${EXTEN})<br />
exten =&gt; _310X.,n,Hangup</p>
<p>[attack]<br />
exten =&gt; _4X.,1,Dial(SIP/${EXTEN})<br />
exten =&gt; _4X.,n,Hangup<br />
exten =&gt; _3X.,n,Dial(SIP/${EXTEN})<br />
exten =&gt; _3X.,n,Hangup</p>
<p>The sip configuration for each is similar to the below:<br />
[310]<br />
type=friend<br />
username=310<br />
secret=yamomma<br />
allow=all<br />
context=victim</p>
<p>[400]<br />
type=friend<br />
username=400<br />
secret=md5<br />
allow=all<br />
context=attack</p>
<p>[420]<br />
type=friend<br />
username=420<br />
secret=secret<br />
allow=all<br />
context=attack</p>
<p>Try as 310 might, there is no way they can call via the system to 400, however, 400 and 420 can ring 310 as often as they wish.</p>
<p>You can of course add the 4X route to the extensions, and playback a message to the user.</p>
<p>This method can be used to restrict calls to certain areas, such as 1900, or international numbers. It can also be used as a call control method, in the event you don&#8217;t want a specific extension calling someone.</p>
<p>It is important to have a peer and user definition. After upgrading to Asterisk 1.6.0 on my test server, I found my test development server (used for simulation) running Trixbox 1.1 (yep, ancient crap), would not accept calls.</p>
<p>I upgraded to 1.4.22 on the test development server, and found the same issue. This was resolved by changing the sip definitions used for interserver communication to be &#8216;friend&#8217; type, rather than &#8216;user&#8217; type that appears to have been automatically created by Trixbox &#8211; no longer used.</p>
<p>Oh well, back to enjoying a long weekend here in NSW. Another day for me to experiment some more and try and push forward with the updates planned for OzVoIPStatus!</p>
<p>Speaking of OzVoIPStatus &#8211; one of the areas I&#8217;m having difficulties enhancing is the method in which providers may specify plan data &#8211; some have included calls, others have none. Some have unlimited calls, and others have untimed call rates. It&#8217;s not so much a difficulty designing this &#8211; it&#8217;s more in the way of presentation on the page.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tocpcs.com/asterisk-context-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Virtual Disk Space fixed!</title>
		<link>http://www.tocpcs.com/virtual-disk-space-fixed/</link>
		<comments>http://www.tocpcs.com/virtual-disk-space-fixed/#comments</comments>
		<pubDate>Wed, 30 Jan 2008 15:30:00 +0000</pubDate>
		<dc:creator>The Elite Geek</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.tocpcs.com/virtual-disk-space-fixed/</guid>
		<description><![CDATA[I fixed my virtual hard drive . Now has a brillant (yet imaginary) 116GB of Free Space. Fantastic. The fix was to simply run resize2fs with it mounted in read/write mode, I kept assuming it&#8217;d need them not mounted, so was trying to resize it, when it wasn&#8217;t existing. I got some sweet speeds on [...]]]></description>
			<content:encoded><![CDATA[<p>I fixed my virtual hard drive . Now has a brillant (yet imaginary) 116GB of Free Space. Fantastic.</p>
<p>The fix was to simply run resize2fs with it mounted in read/write mode, I kept assuming it&#8217;d need them not mounted, so was trying to resize it, when it wasn&#8217;t existing.</p>
<p>I got some sweet speeds on the Exetel mirror today too, leeching CentOS 5 ISO (650MB) in just 12Mins  (around 998KB/sec).</p>
<p>The line drop out situation isn&#8217;t improving however, and I&#8217;m not certain I want to drop the speed profile down to the ADSL2 or ADSL1 mode for the sake of making the connection stay up more. A drop out every 24 hours or so is OK, sure, its better to have none, but, well, that&#8217;s not gonna happen sometime soon, here&#8217;s why.</p>
<p>A news article today reveals Telstra technicians have resorted to taping cables together with plastic bags to keep them dry, due to staff shortages resulting from the sacking of 12,000 Telstra employees (says the union).</p>
<p>So, what will happen when the plastic bags cop a good dose of lightning, and end up welded to the copper wire (or welding copper wires together). Will Telstra accept responsibility for the crossed wires and pay compensation due to breach of privacy on some mass scale (all those copper wires being welded together by lightning would result in much a case of people listening to other peoples conversations).</p>
<p>Who knows&#8230;  What will be the result of all this plastic bag repair work? What happens when the destruction comes too much to bear and the copper cables start requiring full replacement?</p>
<p>Or, is this some elaborate plan to derail the PSTN network to make FTTN a near requirement?</p>
<p>I found the news story amazing, at the same time disturbing, shouldn&#8217;t they have their cabling licenses removed for doing unsatisfactory work (surely, plastic bag repairs aren&#8217;t AUSTEL certified).</p>
<p>It&#8217;s a good thing we don&#8217;t live in Sydney though, where most of this seems to be the problem!</p>
<p>As per usual though, it pays to keep a second service (mobile phone) on standby incase of phone line issues, etc.</p>
<p>The Virtual Server issue being fixed meant that I could proceed to getting the next task on the list done,  updating it, which went through nicely, and allowed me to do something else, get asterisk running on it &#8211; yes, probably heaps quicker to setup a second VM, but I wanted one machine for many reasons, server load is one.</p>
<p>Our juice bill came today, and it was a good result, with the bill dropping on average 4KWH/day.</p>
<p>We just removed our off peak hot water systems equivilent load from the bill, and after todays measurement, looks like it could be dipping down some more with the new washing machine in place (larger washer, but less loads needed to meet demand).</p>
<p>I&#8217;m happy with the results, and hopefully we can see a natural progression in the drop for another bill, before we might either dip to the bottom, or find new ways to reduce consumption even further.</p>
<p>It&#8217;s good at least, that we have removed the equivilent of a hot water system from our bill. For the savings, we could be running 2 split system air conditioners (or, keep the savings).</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tocpcs.com/virtual-disk-space-fixed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LVM: Lucky Volume Management</title>
		<link>http://www.tocpcs.com/lvm-lucky-volume-management/</link>
		<comments>http://www.tocpcs.com/lvm-lucky-volume-management/#comments</comments>
		<pubDate>Tue, 29 Jan 2008 15:21:35 +0000</pubDate>
		<dc:creator>The Elite Geek</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.tocpcs.com/lvm-lucky-volume-management/</guid>
		<description><![CDATA[I&#8217;m in the process of resizing a virtual machines hard drive to get some updates on it (hasn&#8217;t been updated in oh&#8230; several months), the issue is when I set many virtual machines up, I used to enter a limit for its dynamically expanding disk. Not considering the consequences of doing so, I figure it&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m in the process of resizing a virtual machines hard drive to get some updates on it (hasn&#8217;t been updated in oh&#8230; several months), the issue is when I set many virtual machines up, I used to enter a limit for its dynamically expanding disk.</p>
<p>Not considering the consequences of doing so, I figure it&#8217;ll be able to be resized at a later date (or, dynamically expand), but unless you leave the maximum size at some huge amount (even if you dont have it), you do have to create another disk and migrate your data over to it.</p>
<p>Luckily, dd is our friend, and can migrate bit by bit, byte by byte from one virtual disk to another.</p>
<p>I tried to find a way to resize the volume so that the drive is able to be dynamically expanded using LVM (the installation was done a long time ago, I think with a CentOS server CD), the installation chose LVM by default, which I figure is OK &#8211; so long as I get a command line, what do I care.</p>
<p>Unfortuantely, that&#8217;s a bad move, LVM is great for managing volumes (like Windows&#8217; Disk Manager), but when faced with something such as a resize task, you make the job exponentially more difficult by using LVM.</p>
<p>Simply, unless LVM has already told Linux about the disks, you can&#8217;t execute resize2fs to resize the drive to the new size!</p>
<p>So, the task that remains is to figure out how we can get that LVM drive in a rescue type mode, so we can execute resize2fs, and get moving on with the original task, updating the server and then installing more software.</p>
<p>Note to self: Never, never setup a VM with a hard drive limit. It&#8217;s a pain in the butt.</p>
<p>Anyway, I refer to it as &#8220;Lucky&#8221; volume management, because LVM has many features, including expanding over two partitions (yep), so whilst I was trying to find a way to simply resize the /dev/hda2 partition, it made it all so much easier by simply adding /dev/hda3 to the volume group, and then expanding the logical volume over the top of it as well (feels good having an imaginary 100GB drive).</p>
<p>If only the resize process was a little easier.</p>
<p>It should be fine, tomorrow, outside of the &#8216;uncounted period&#8217; we should be able to source a CentOS ISO, boot that into rescue mode and the latest versions should have support for the LVM, otherwise, we are going to have to find another way.</p>
<p>Yes, I realise it might have been easier to simply move the larger folders onto a second virtual hard drive and worked with that, but that runs counter to my plans, eventually I&#8217;m going to migrate that server, so don&#8217;t want to be finding myself missing a second virtual disk or something else.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tocpcs.com/lvm-lucky-volume-management/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Virtual Machines &#8211; Lowering the rise.</title>
		<link>http://www.tocpcs.com/virtual-machines-lowering-the-rise/</link>
		<comments>http://www.tocpcs.com/virtual-machines-lowering-the-rise/#comments</comments>
		<pubDate>Wed, 23 Jan 2008 15:23:56 +0000</pubDate>
		<dc:creator>The Elite Geek</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.tocpcs.com/virtual-machines-lowering-the-rise/</guid>
		<description><![CDATA[Virtual Machines are a great way at hosting multiple services, and keeping your overall costs low. Computers have become very much so beefed up that the grunt they have spends a lot of time idle, and only peak loads when you are doing intensive tasks, even then, they generally keep within 50% of the processors [...]]]></description>
			<content:encoded><![CDATA[<p>Virtual Machines are a great way at hosting multiple services, and keeping your overall costs low.</p>
<p>Computers have become very much so beefed up that the grunt they have spends a lot of time idle, and only peak loads when you are doing intensive tasks, even then, they generally keep within 50% of the processors full capacity.</p>
<p>Game play will use more of that processor usage, but that doesn&#8217;t really come into question in the server environment.</p>
<p>So, just about many of the servers out there are very capable of having additional virtual servers added to them, and with the price of disk space falling, virtualization technologies are very much viable.</p>
<p>I run Virtual Server here at my home, and it hosts my linux test environment, this is to save me booting between OS and also allows me to have computing resources available to me simultaneously.</p>
<p>So, I don&#8217;t need a second server running, I don&#8217;t need to pay for extra hardware, power, or anything like that, when I want to run the linux machine (and we use it often enough anyway).</p>
<p>One common issue with Virtual Server Linux Virtual Machines is the clock being out of sync and audio style resources skipping ahead or behind in the established virtual machine.</p>
<p>The fix to that is a combination of setting &#8216;clock=pit&#8217; as a boot parameter, and also installing virtual machine additions.</p>
<p>If you run a CentOS distro though, installing Virtual Machine additions as recommended doesn&#8217;t work as expected.</p>
<p>The reason for this is, the ./install.sh script looks for a string in the /etc/redhat-release file.</p>
<p>The string it is looking for is the third one. So, on Red Hat (where CentOS is derived) it would be &#8220;release&#8221; - Red Hat Release.</p>
<p>On CentOS however, it is &#8220;final&#8221; &#8211; CentOS release final.</p>
<p>The fix to this? Couldn&#8217;t be simpler.</p>
<p>nano into /etc/redhat-release, and between CentOS, add a space, so it might read Cent OS release.</p>
<p>Make sure you have the kernel sources (yum install kernel-devel), and that will allow the virtual machine additions to install, and once installed, leave as is, or just change it back.</p>
<p>Use Virtual Machines, there really isn&#8217;t much going against them, they save power, they allow you to have the extra resource available (ie. Linux system) as well as your Windows machine.</p>
<p>And, Virtual Server is one of Microsoft&#8217;s good releases, it&#8217;s a great setup for virtualization, nothing silly like VMWare, just straight forward virtual machines.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tocpcs.com/virtual-machines-lowering-the-rise/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What a fun day!</title>
		<link>http://www.tocpcs.com/what-a-fun-day/</link>
		<comments>http://www.tocpcs.com/what-a-fun-day/#comments</comments>
		<pubDate>Fri, 04 Jan 2008 14:33:23 +0000</pubDate>
		<dc:creator>The Elite Geek</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.tocpcs.com/what-a-fun-day/</guid>
		<description><![CDATA[This morning I woke up intent on a lot more progress with my work on a server. And, it happened. I set out to complete something, and for the most part, it is completed. I started today from yesterday, working on fattening a linux partition. The process was pretty much where my thoughts were yesterday. [...]]]></description>
			<content:encoded><![CDATA[<p>This morning I woke up intent on a lot more progress with my work on a server.</p>
<p>And, it happened. I set out to complete something, and for the most part, it is completed.</p>
<p>I started today from yesterday, working on fattening a linux partition.</p>
<p>The process was pretty much where my thoughts were yesterday.</p>
<p>dd the drive (so dd /dev/hda to /dev/hdb), then remove /dev/hda, leaving only /dev/hdb (as /dev/hda).</p>
<p>I played around with fdisk and parted to resize the partition, but had no joy.</p>
<p>I googled at this point really quickly, and came across a blog post which suggested using resize2fs, to get the volume resized.</p>
<p>The problem for me was the virtual disk, which has a capacity limit beyond the bounds of actual disk space.</p>
<p>So, I resorted to trying to specify a limit, but gave up waiting after a while, and killed the command.</p>
<p>Rebooted it (hey, it&#8217;s a virtual box, worst case scenario, insert rescue disk, salvage any valued data, and insert rescue ISO).</p>
<p>Then, as the system came back, it complained about fsck (heh, that looks like an interesting command, considering the damage it is capable of), and so, I ran it. Answered yes to everything (like I care what inodes are worthy of bashing), so I then got back in the system.</p>
<p>And, ran a &#8216;df&#8217;, and what do you know, it&#8217;s gone and given us stacks of space. Exactly what I wanted.</p>
<p>Now, you know why I had to do this? Of course not.<br />
I had to issue a yum upgrade to upgrade software on the box.<br />
The yum upgrade seemed to suggest it had to have 30GB of disk space for 200Mb of downloaded packages.</p>
<p>You and I, and the world knows that it&#8217;s full of &#8216;it suggesting it can pull 30GB out of 200Mb.<br />
But, none the less, I perservered and we came to a success!</p>
<p>Then, I got on with the rest of what I wanted to do yesterday. Install various software services, and get the system up.<br />
Oh, and Elastix developers, I commend you for your creativity, but, alas, poor managed dependancies are enough  to drive me nuts. No longer shall I bother with any of the Trixbox, Elastix, FreePBX style distros. Plain and simple waste of time.</p>
<p>You want the job done, format, install raw CentOS. Get the packages from digium. Smack those on (that&#8217;s right, compile the suckers), and configure it manually.</p>
<p>It works as expected, it does all that you tell it to. And it doesn&#8217;t screw around with kernel dependancies, installing the xen kernel, or oslec modules, or zaptel where its not wanted.</p>
<p>It gives you exactly what you tell it to, without all the stuff around. You want a system that works, you definitely want to get rid of the slapped together distros (no offence to the Elastix crew, they are leaps ahead of Trixbox!), and do the configuration directly.</p>
<p>Anyway, moving on, the rest of the day was filled with migrating, DNS checking, and so forth.</p>
<p>Now, I just need to set about finding myself a few larger SCSI drives! Any offers? 73GB+, leave a comment.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tocpcs.com/what-a-fun-day/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sucker for entertainment</title>
		<link>http://www.tocpcs.com/sucker-for-entertainment/</link>
		<comments>http://www.tocpcs.com/sucker-for-entertainment/#comments</comments>
		<pubDate>Thu, 03 Jan 2008 15:07:47 +0000</pubDate>
		<dc:creator>The Elite Geek</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.tocpcs.com/sucker-for-entertainment/</guid>
		<description><![CDATA[There&#8217;s a few ways to do things. The first is the right way, the second is the wrong way, and the third, is perhaps a combination of both in a more interesting combination. When the right way doesn&#8217;t (or can&#8217;t) work, and the wrong way is not an option, you then need to figure out [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a few ways to do things.</p>
<p>The first is the right way, the second is the wrong way, and the third, is perhaps a combination of both in a more interesting combination.</p>
<p>When the right way doesn&#8217;t (or can&#8217;t) work, and the wrong way is not an option, you then need to figure out a way of making the right way work, or the wrong way right.</p>
<p>I&#8217;m such a sucker for this kind of entertainment at times.</p>
<p>I&#8217;ve just spent the better part of today reorganising a linux filesystem, and using virtual drives to get space, in a space poor environment, I came across an issue.</p>
<p>I need to move the entire OS off one drive, onto another, due to partition size constraints.</p>
<p>How do I best do this, when the virtual drive cannot be resized?</p>
<p>Well, my solution thus far has been to add a second drive, which is capable of large growth, and then, dd all the files, and swap out the old for the new.</p>
<p>I originally planned on just moving /, and that&#8217;d work, but, I&#8217;ll admit, I&#8217;m not as proficient in the setup part of linux, to move partitions like that.</p>
<p>Being the sucker for an entertaining scenario such as that though, I tried to do it anyway.</p>
<p>So, I added the additional drive. That worked fine. Mounted it. Worked fine. Partitioned it. Yep, that worked fine.</p>
<p>Executed:&#8221;dd if=/dev/hda2 of=/dev/hdb1&#8243;, being carbon copy all of the partition of /dev/hda2, to /dev/hdb1.</p>
<p>It finished successfully. Sweet I thought. I thought that out, guessed and got it right so far.</p>
<p>Now, we have the next problem. Switching the OS to the new root and booting from it.</p>
<p>So I figure, ok, I can just open /etc/fstab, and change LABEL=/, to /dev/hdb1, and point that as the / partition.</p>
<p>Apparently, the kernel panic afterwards says no.</p>
<p>So, I go back to the ISO, boot into rescue, and change back to the old line, reboot, still no joy.</p>
<p>Hmm k, now we have a problem. So, I resolved it temporarily by removing the second virtual drive from the system.</p>
<p>Now, I must figure out a solution. At a guess, it&#8217;s still finding /dev/hda2, and sees it labelled as / and is doing some kinky stuff with it.</p>
<p>I probably need to find a way to Label /dev/hdb1 as &#8220;/&#8221;, so LABEL=/ works, then, find a non-destructive way of hiding /dev/hda2, so that we can go forward in the other much larger task.</p>
<p>Or, maybe it is more wise, to instead, dd /dev/hda /dev/hdb, thus replicating the full system.</p>
<p>I did have a concern about hitting /dev/random, and /dev/null, but figure, perhaps it won&#8217;t hit those and we won&#8217;t have a problem (and we didn&#8217;t).</p>
<p>Task for tomorrow will be to figure out how to do this copy successfully, otherwise, it&#8217;s off to find some DOS based clone software and use that to do the job.</p>
<p>Though, I should learn how to do it with dd, can&#8217;t be that difficult!</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tocpcs.com/sucker-for-entertainment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RAIDed the Internet for RAID info, and came up light.</title>
		<link>http://www.tocpcs.com/raided-the-internet-for-raid-info-and-came-up-light/</link>
		<comments>http://www.tocpcs.com/raided-the-internet-for-raid-info-and-came-up-light/#comments</comments>
		<pubDate>Fri, 28 Dec 2007 14:37:10 +0000</pubDate>
		<dc:creator>The Elite Geek</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.tocpcs.com/raided-the-internet-for-raid-info-and-came-up-light/</guid>
		<description><![CDATA[I spent a bit of today RAIDing through the internets and digging for RAID info. Specifically what I want to do is upgrade the physical disks on my RAID array. Unfortunately, I can only have 2 physical disks, and both are used by my RAID setup, which mirrors data. So I sorted through some Google [...]]]></description>
			<content:encoded><![CDATA[<p>I spent a bit of today RAIDing through the internets and digging for RAID info.</p>
<p>Specifically what I want to do is upgrade the physical disks on my RAID array.</p>
<p>Unfortunately, I can only have 2 physical disks, and both are used by my RAID setup, which mirrors data.</p>
<p>So I sorted through some Google posts on RAID. RAIDing through all the various RAID information, I found a post that was concentrating on a larger array, and one which wasn&#8217;t a system drive.</p>
<p>But it was in some sense, useful. The suggestions they had were, adding the larger drives, and letting them rebuild, do it for set A, then set B.</p>
<p>Once you have that rebuild, keep the process moving with other disks.</p>
<p>That doesn&#8217;t work 100%, because when you have a RAID disk, the RAID controller configures the logical drive sizing. </p>
<p>In the case of non system drives, you would upgrade the drive to the larger disk, the RAID controller should hopefully already use the full extent of the Physical drive, and extend the logical drive (or do this yourself), then, you would just use your operating system to extend the partition to span the full drive.</p>
<p>In the case of system drives though, that are hosting the OS as well.<br />
You are essentially required to reinstall.<br />
At least, I thought so.</p>
<p>I imagine you could instead, do a GHOST between drives. Split your RAID out of mirroring, go into single mode.<br />
Once in single mode, add your second SCSI disk.<br />
With the SCSI disk in place, ghost the partition over.<br />
Use partition tools to resize the partition outside of the operating system.</p>
<p>Viola, one parent drive done.</p>
<p>Plug that in, remove the other drive. </p>
<p>Add your second mirror drive.</p>
<p>Configure your controller to enter into mirroring mode again.</p>
<p>Start a rebuild of the second drive in your array.</p>
<p>And that should be it.<br />
Keep the other two drives as backups of the data at that point.</p>
<p>All sounds good in theory right? Low downtime (the copy operation might take a bit), and safe enough to avoid any reinstall issues.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tocpcs.com/raided-the-internet-for-raid-info-and-came-up-light/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why do I code?</title>
		<link>http://www.tocpcs.com/why-do-i-code/</link>
		<comments>http://www.tocpcs.com/why-do-i-code/#comments</comments>
		<pubDate>Tue, 18 Dec 2007 13:57:56 +0000</pubDate>
		<dc:creator>The Elite Geek</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.tocpcs.com/why-do-i-code/</guid>
		<description><![CDATA[That was a question put to me today. Well not exactly that, but a version of it. I got thinking. Do I code simply because its &#8216;something to do&#8217;? Nah. Not really. There&#8217;s plenty of other stuff I could do. Locally, I could do more and earn more, surely. So it&#8217;s not &#8220;something to do&#8221;. [...]]]></description>
			<content:encoded><![CDATA[<p>That was a question put to me today. Well not exactly that, but a version of it.</p>
<p>I got thinking.</p>
<p>Do I code simply because its &#8216;something to do&#8217;? Nah. Not really. There&#8217;s plenty of other stuff I could do. Locally, I could do more and earn more, surely.</p>
<p>So it&#8217;s not &#8220;something to do&#8221;.</p>
<p>Maybe it&#8217;s because I love a good challenge? Yeh.<br />
I&#8217;m generally a problem solver. I love finding solutions to problems. When in the right state of mind, I like to find a solution to something complex.</p>
<p>I love data mining as well. It&#8217;s fun playing with data. I like to match columns and rows of data, and work on ways to automate data matching.</p>
<p>And the echo to that statement, I can hear an echo from my partner saying &#8220;You sure do!&#8221;.</p>
<p>So, that describes me to some extent. I&#8217;m a problem solver. I like to find problems, and solve them.<br />
I can sit on an issue for hours upon hours and have fun reaching a solution that meets all requirements to solving a problem.</p>
<p>And I think thats a quality that is somewhat required to do what I do. Solve problems. </p>
<p>I&#8217;m not completely lazy in solving problems that I might get enjoyment out of solving. It&#8217;s something that I find fun, I enjoy, and probably the reason I do code.</p>
<p>I code to solve problems. I code to create, and implement problem solving stategies.</p>
<p>The downside to it? First there must be a problem to solve to get my attention. Otherwise I don&#8217;t generally take much interest in what I am doing. </p>
<p>I find the most fun in solving a complex issue, or implementing something that solves a problem for someone else. Most of what I do is web based, and not a lot centers on PC based issues, but I do not say that, without first realising the numerous amounts of software and PC issues that I also solve.</p>
<p>I solve dial up issues for people with dial up modems occassionally.<br />
I troubleshoot broadband connection issues for broadband connections occasionally.</p>
<p>I solve issues with Linux for a few people I know.</p>
<p>I solve problems with Excel related VB code. I solve PHP issues. I solve ASP issues. I solve Windows issues.</p>
<p>There&#8217;s a few requirements to solving a problem, for example, depending on the extent of the issue, or the complexity of it, I might want to see it in front of me to solve it. It could be that it&#8217;s unfamiliar and in seeing the problem, I would be best placed to solve it.</p>
<p>Or, it could be asking a question on a forum, sure I&#8217;ll read it. If its not descriptive enough, or provokes enough thought in my mind about an issue to spark a solution, I probably can&#8217;t solve an issue.</p>
<p>I&#8217;m curious, what other industries would use a problem solver? </p>
<p>There&#8217;s plenty out there, I&#8217;m sure, such as Police Officers and Lawyers, and Fire crew, and well, to a much lesser extent, our government (they still do solve SOME problems, right?).</p>
<p>But on a serious note, there&#8217;s something driving me to code over being a police officer, lawyer, fireman, or politician.</p>
<p>It must be something specific about coding that drives me to enjoy solving problems! The answer to that isn&#8217;t immediately known, and I can&#8217;t seem to consider why I enjoy solving problems, with PCs. Maybe that&#8217;s just my specialty, when you consider that I enjoy solving problems, and I have HEAPS of experience with computers.</p>
<p>Anyway, my point is, I enjoy solving problems, and I enjoy working with data, so out of everything I could do on a PC, the best is working with code and data to solve a problem.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tocpcs.com/why-do-i-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flawless system changeover</title>
		<link>http://www.tocpcs.com/flawless-system-changeover/</link>
		<comments>http://www.tocpcs.com/flawless-system-changeover/#comments</comments>
		<pubDate>Mon, 19 Nov 2007 13:25:50 +0000</pubDate>
		<dc:creator>The Elite Geek</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.tocpcs.com/flawless-system-changeover/</guid>
		<description><![CDATA[The excellent part of having identical (or near identical) hardware is when something cops a nice drink of Sprite, you can simply swap the components over, and power it up and your good to go again. You can&#8217;t generally do that when swapping between say an Intel 865PE chipset, and an Intel P35 chipset, simply [...]]]></description>
			<content:encoded><![CDATA[<p>The excellent part of having identical (or near identical) hardware is when something cops a nice drink of Sprite, you can simply swap the components over, and power it up and your good to go again.</p>
<p>You can&#8217;t generally do that when swapping between say an Intel 865PE chipset, and an Intel P35 chipset, simply because Windows will vomit so badly, you&#8217;ll be mopping the floors of the mess for weeks or even months after.</p>
<p>Once its tried to change over as a result of detecting a hardware change (ie change in Chipset) windows will literally end up in a blue screen crash fest.</p>
<p>Luckily for me I don&#8217;t get caught up in that trap either. </p>
<p>I generally take the working windows drive out, and any drives containing important data. Get the system running on a new HDD. Insert the old HDD afterwards, and then copy data freely about until you have the desired effect.</p>
<p>Next, if there is no room (or it seems wasteful), you generally take the drive out and that&#8217;s it really. </p>
<p>Unless of course, you come to the situation I now have.<br />
We have in the server:<br />
2 x 80GB drives &#8211; bought em years ago, off eBay.<br />
1 x 160GB SATA drive.<br />
1 x 250GB SATA drive.<br />
1 x 320GB IDE drive.<br />
1 x 120GB IDE drive.</p>
<p>The 320GB was out of my partners system, which we bought because she had a failed 120GB years back, and I still haven&#8217;t got around to doing the head swapover on that drive. We&#8217;d love to recover the data though.</p>
<p>Anyway, the 320GB is an IDE drive, and her system is SATA (which I planned for, I purchased a 250GB SATA to replace it).</p>
<p>So, now out of the above list, it&#8217;s pretty obvious I am in a position to perhaps do a merge of some of those drives onto the 320GB IDE, and therefore realise some power savings (costs more to have 3 drives running than just one bigger drive). </p>
<p>The problem of course, comes down to adjusting the server, and the network to suit the modified conditions. For example, the second 80GB drive serves as my internal updating server (BIG PLUS, seriously, if you upgrade machines, or change machines, and still use XP for some machines, that&#8217;s a BIG saving, it updates them without the need to go online and fetch updates, therefore saving your net connection).</p>
<p>So, to get rid of two or three drives (and make room so I can put the 250GB that was in it, back in it), I have to take all the data off the update services drive, dump it in a temporary folder, do the same for the 120GB drive, which has all the installers for all my applications and one of my longer running clients data on it, and that brings it to 200GB, leaving 120GB of room, so maybe consider taking out the 160GB SATA, though I am not in a hurry to do that drive just yet.</p>
<p>The server here has access to around 1010GB of data, of that, it&#8217;s used much less than half.</p>
<p>Might be time to rip some drives out and chuck em on eBay! The problem of course is trying to manage the data movement without upsetting things too much, and getting the drive letters back in the right place. Nothing too bad.</p>
<p>In other news, I went online to Jaycar just recently and decided I might just see how much juice some of the house sucks down the power lines, at least we can then decide where we want to apply even more downward pressure on our power consumption.</p>
<p>They only cost $39.95, and from what I have heard are pretty good devices, measuring power intake and reporting on usage statistics, in fact, I heard you can even calculate the bill for that particular power point.</p>
<p>Seriously though, I support timed based billing and not the use of Off Peak metering, since you aren&#8217;t allowed to have power points designated as Off Peak (obviously due to the problems associated with the supply nature).</p>
<p>Some of the meters available can even determine Time Of Use, which is a great feature, so that they can hopefully start time of use billing. Burn the power at 6pm and pay the standard rates, burn it at 1am and give a cheaper rate (since the network is cheapest in the earlier hours of the morning).</p>
<p>Anyway, the new system for my partner is also up and running nice and smoothly, still in that process known as &#8220;Software Installation&#8221; &#8211; where you repeatedly find programs you are missing and reinstall them, and to cap that off you have the settings to adjust, such as wallpaper, screen savers, and program specific settings (IE Home Page, etc).</p>
<p>All a royal pain, and its probably why many would instead setup an Active Directory server so that profiles are portable! Makes sense. But then, the data is on the server and not the workstation, so that raises more issues.</p>
<p>It was actually a smooth day with the transfer, and my little one was a perfect assistant to the task, helping wherever he could (you&#8217;d be amazed at just how smart a young child can be!!!).</p>
<p>I also got another practice driving test in today, and it was better considerably, with just 2 fail items (so a 50% improvement). The drive itself was smooth, and the only real issues focused on those pesky things they call reverse parallel parks, and my way of taking turns (too fast, so I&#8217;m crossing white lines). All seems likely however that we can improve again to top that and come out with a great score equal to a pass and no fails.</p>
<p>Interesting, I&#8217;ve avoided the Telstra supplied Broadband Services suck issue for a bit now. Maybe because they are priced to suck, and that&#8217;s already a well known fact? Maybe we are just tired of Telstra&#8217;s greed, yet also tired of searching for an alternative solution..</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tocpcs.com/flawless-system-changeover/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OzVoIPStatus: Update Delayed</title>
		<link>http://www.tocpcs.com/ozvoipstatus-update-delayed/</link>
		<comments>http://www.tocpcs.com/ozvoipstatus-update-delayed/#comments</comments>
		<pubDate>Sun, 18 Nov 2007 13:29:14 +0000</pubDate>
		<dc:creator>The Elite Geek</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[VoIP]]></category>

		<guid isPermaLink="false">http://www.tocpcs.com/ozvoipstatus-update-delayed/</guid>
		<description><![CDATA[Unfortunately (and its very unfortunate), the update I planned to release tonight isn&#8217;t going to go ahead as planned due to an issue with a particular provider. The particular provider issue wasn&#8217;t determined until just recently, but has been fixed. The reason for the delay? Well, I was investigating that issue and the time it [...]]]></description>
			<content:encoded><![CDATA[<p>Unfortunately (and its very unfortunate), the update I planned to release tonight isn&#8217;t going to go ahead as planned due to an issue with a particular provider.</p>
<p>The particular provider issue wasn&#8217;t determined until just recently, but has been fixed.</p>
<p>The reason for the delay? Well, I was investigating that issue and the time it took to isolate and correct it, was the time that should have gone into finishing off a last few lines of code, and then taking the site offline so I could integrate it all.</p>
<p>The changes are all backend, but they will affect the front end to some extent as a direct result.</p>
<p>I also took the time today to do a few other things, like watch a movie &#8211; nothing entertaining, was &#8220;Santa Clause 3&#8243;, pretty plain really, none the less, it was a break away.</p>
<p>Then, I got my night driving section ticked off in my log book in a nice long drive towards Budgewoi and back &#8211; it&#8217;s more of a highway stretch of road, so wasn&#8217;t town style night driving, and therefore made a little more complex, than that experienced in the suburban streets I&#8217;d rarely find myself on at a night.</p>
<p>So, therefore, it wasn&#8217;t completely error free, with a few instances exceeding the speed limit (it&#8217;s a 90K street, I kept dropping back to 80K- my limited limit, but continually found myself over the limit a few times), and a little distraction caused me to nearly touch the kerb, pulled away and corrected though.</p>
<p>But indeed, it is made more complex in darker highway conditions, when compared to that of regular streets, such as the well lit up Wyong Road. </p>
<p>Aside from that, I was pretty much error free, mainly due to the time, and the stretch of road being a straight ahead drive really, so no real blind spots to check, no turns to make, no giving way, no stop signs, no entering traffic, &#8230; none of the standard traffic conditions you&#8217;d be exposed to on a general mix of road conditions.</p>
<p>But, it got the night drive ticked off, so that works for me. </p>
<p>This week is an exciting week! I have a few things I am taking care of, such as the finalisation of a released website, the new system for my partner, getting my internal server back online, hopefully finding time to finish off what I was doing today, a few other projects and some more excitement.</p>
<p>All in the lead up to the most exciting weekend you&#8217;ll find in around 3 years, the federal election on Saturday, which really is looking for a Labor win, and my thoughts recently suggest voting Labor, because the way Howard is going against drugs, our crime rate is likely to increase.</p>
<p>He plans to withhold Centrelink funds from those who are convicted of drug offences and only allow vital purchasing.</p>
<p>The problem with that is a drug addict or not, they&#8217;ll get the drugs. They&#8217;ll resort to lives of crimes, crimes that will harm innocent members of the public. </p>
<p>Better having them shooting themselves up, then causing more work for our police indirectly, by withholding Centrelink funds.</p>
<p>It&#8217;s a disaster if they take the drugs away from them, because, they&#8217;ll steal to get the drugs. Drug dealing and drug usage affect the selected individuals only (generally), and with the supply being taken away, they&#8217;ll simply find a new way of getting their supply. Crime will become the answer. And instead of select individuals being affected, members of the public will also suffer.</p>
<p>I agree with his stance on intervening on Child Abuse in NT, fantastic move to clean the area up of Child Abuse. Children were affected.</p>
<p>This move however? Seems to be more about winning votes, by being seen as doing something about drugs.</p>
<p>Indirectly, creating more problems. </p>
<p>A vote for Rudd will see some good dollars spent over the nation, that&#8217;s probably what&#8217;s going to win me over at this rate, though I can see Labor State governments have bad debts, so perhaps we can instead later, put Costello back in if they do push the nation into a defecit, and the Liberals will again save the nation.</p>
<p>Better having a debt than having a nation of crime, pushed by poorly thought out drug policies.</p>
<p>A whirlpool poll reveals a 77% Labor win, when asked &#8220;What sort of Government will Australia have&#8221; &#8211; with notes that state not necessarily who you will vote for.</p>
<p>77% believe we will have a Labor government. Just 18% believe it will be Coalition.</p>
<p>Of course, that&#8217;s only 174 users, and the polls in main stream generic media suggest that its more close, and might even see a Coalition win.. It has happened, it can happen.</p>
<p>Here&#8217;s hoping that not necessarily the Coalition or Labor, but &#8220;The Best Party&#8221; wins.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tocpcs.com/ozvoipstatus-update-delayed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Server Hardware &#8220;Failure&#8221; causes delays</title>
		<link>http://www.tocpcs.com/server-hardware-failure-causes-delays/</link>
		<comments>http://www.tocpcs.com/server-hardware-failure-causes-delays/#comments</comments>
		<pubDate>Sat, 17 Nov 2007 12:42:12 +0000</pubDate>
		<dc:creator>The Elite Geek</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[VoIP]]></category>

		<guid isPermaLink="false">http://www.tocpcs.com/server-hardware-failure-causes-delays/</guid>
		<description><![CDATA[Recently, we had a item of hardware fail in my internal server (my in house server). Essentially that was just my older 2 year old machine, which unfortunately, had an accident. It wasn&#8217;t the servers fault however. Unfortunately, a Pop Top bottle filled with a bit of Sprite came into contact with the Zalman fan [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, we had a item of hardware fail in my internal server (my in house server).</p>
<p>Essentially that was just my older 2 year old machine, which unfortunately, had an accident. It wasn&#8217;t the servers fault however.<br />
Unfortunately, a Pop Top bottle filled with a bit of Sprite came into contact with the Zalman fan after being knocked on to the case, laying on its side, resting on the two servers that superseded it.</p>
<p>Unfortunately for that motherboard, it didn&#8217;t seem to want to come back on after suffering numerous injuries as a result of the soft drink being quickly propelled around the case by the Zalman fan (which I just put into that case not so long ago, upgrading my own fan due to copper fin &#8216;bendage&#8217;).</p>
<p>Anyway, so the time has come to solve two problems, one, my partners thirst for more computational power to process tasks faster, and the newly invented problem, my server suffering from liquid near the brain (CPU).</p>
<p>The good news for me is my habit of buying parts nearly identical for my machine and my partners, and the end result of my older machine becoming the new server means I don&#8217;t have to do any formatting or reinstall.</p>
<p>It&#8217;s simply take her high spec P4 3.0Ghz 531 Processor, 4GB of RAM, and the same model motherboard, and place that in the server case, plug the HDDs back in the same order, and fire them up, and we should be good to go again.</p>
<p>Unfortunately however, for me and my server (and the projects I maintain on it), they have to sit back a bit whilst we hack data from the Linux Virtual Hard Drive (we use Linux Virtual Machines over Virtual Server, on a Windows Server 2003 base), from the hard drive on that machine, so that I can continue finishing some updates to OzVoIPStatus, or, wait until next weekend, when the hardware for my partners machine, is to arrive (they were supposed to be here Friday, but the distributors can&#8217;t tell the difference between Sydney and Melbourne &#8211; strange, I can, one has a highly problematic public transport network, and its not Melbourne).</p>
<p>Anyway, due to the delay from Melbourne, I have to wait until at least Monday to get the gear, which means probably taking Monday (which I would usually use to put towards focusing on websites of clients) to build the server and get it back online, just so I can get somewhere, otherwise the whole week will be nearly spent doing little at all in the way of development (lack of test area).</p>
<p>The new gear will see a performance improvement for my partner, who long has been stifled by the Hyper Threading artifical dual CPU technoloy, and will almost definitely love the ultimate responsiveness of a dual core machine!</p>
<p>I was planning the upgrade, but not so soon, after Christmas.</p>
<p>The next item on her upgrade list is two LCD monitors to help trim down the fat on the power bill her two CRTs generate.<br />
Although trimming fat shouldn&#8217;t be something we have to do, instead, power solutions should be worked on that are friendly to the environment and reduce costs to consumers. Such examples exist in GeoThermal power. Truly amazing idea (figures quoted as 5c a KWH, compared to the ~12c KWH we pay now (and the 15c KWH after XX kWH).</p>
<p>My plan to release a key update to OzVoIPStatus is likely to go ahead, with thanks to Virtual PC 2007, which works just like Virtual Server, except its desktop oriented, which will do now for the time being.</p>
<p>My updates aren&#8217;t much on the web side, and more in the back, though some of the changes I imagine will be visible to viewers, as this essentially will fix a bug with outages being logged every 60 seconds due to the more passive nature of the tests currently being done.</p>
<p>It sort of sucks to lose a machine that isn&#8217;t so hardly worked yet! Many of my machines get around 5 years or so before I take them out, simply due to aged hardware, leaky capacitors, warping due to CPU heat, etc. But then, it was originally my workstation, and I do work them pretty hard.</p>
<p>So, tomorrow, hopefully, assuming I complete it, we&#8217;ll have a OzVoIPStatus fix up that solves outages being logged incorrectly, and can (but won&#8217;t for a little while) provide data back out as to what was found at the cause of each outage.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tocpcs.com/server-hardware-failure-causes-delays/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Expensive Shopping</title>
		<link>http://www.tocpcs.com/expensive-shopping/</link>
		<comments>http://www.tocpcs.com/expensive-shopping/#comments</comments>
		<pubDate>Tue, 21 Aug 2007 03:16:02 +0000</pubDate>
		<dc:creator>The Elite Geek</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.tocpcs.com/expensive-shopping/</guid>
		<description><![CDATA[It&#8217;s not every so often you go shopping for higher priced items, such as new servers, or cars, but well, both of our new purchases are both coming together at around the same time! 1. A new machine I&#8217;ve got myself my new machine up and running in the last 2 weeks, and I&#8217;m still [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s not every so often you go shopping for higher priced items, such as new servers, or cars, but well, both of our new purchases are both coming together at around the same time!</p>
<p>1. A new machine</p>
<p>I&#8217;ve got myself my new machine up and running in the last 2 weeks, and I&#8217;m still loving it!<br />
It wasn&#8217;t expensive like the those who buy Idiots By Me (IBM) or Dill (Dell), but it wasn&#8217;t cheap like my previous new builds that come in a little more less than 1K. The better side of this is it&#8217;s future proof, and is a great purchase.</p>
<p>2. Another server</p>
<p>No, I&#8217;m not replacing the OzVoIPStatus server, which has been running fantastically fine since it&#8217;s BIOS upgrade which cured a memory incompatibility issue causing linux crashes several months ago. In fact, I looked the other day and it had 40 something days on it. Rock solid.</p>
<p>This server is for a different operation, and will give me much more control over some problems that have been happening, and at least allow us to pinpoint and solve these more readily. </p>
<p>3. A car</p>
<p>I&#8217;m somewhat lazy when it comes to getting my P&#8217;s license, mainly because I don&#8217;t really go anywhere that often, generally just the regular food shop and that&#8217;s roughly it. Not that we don&#8217;t enjoy our home lifestyle however.</p>
<p>Anyway, the goal with the car is obviously to become less of a big spender on public transport, and instead drive myself, and it also opens a few more oppourtunities for us, and so will be a worthwhile purchase.</p>
<p>It&#8217;s such a tricky task entering a private used car buyer market though, buying from a dealer you are sure its not hot, but on the other hand, you can&#8217;t be sure its mechanically sound either, as there are a lot of poor dealers being exposed.</p>
<p>So, buying privately you can at least ask questions and measure the nerves of the seller to see if he is obviously sure of himself and the sale.</p>
<p>Ask for obviously papers to prove ownership, check license and then go do a REVS check to be 100% certain. Can&#8217;t go too wrong.</p>
<p>Another issue with private buys though is arranging a mechanic to check the car (or an NRMA check), from what I understand the wait times for that is something like 10 days. That&#8217;s a fair wait to ask for someone keen (or not) on a sale.</p>
<p>All that shopping however, is very worthwhile and money well spent, compared to spending money on Telstra services!</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tocpcs.com/expensive-shopping/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Partition Resize = Bad</title>
		<link>http://www.tocpcs.com/partition-resize-bad/</link>
		<comments>http://www.tocpcs.com/partition-resize-bad/#comments</comments>
		<pubDate>Mon, 13 Aug 2007 03:18:42 +0000</pubDate>
		<dc:creator>The Elite Geek</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.tocpcs.com/2007/08/13/partition-resize-bad/</guid>
		<description><![CDATA[I was working with someone else on a system today that had an issue with a lack of disk space. This machine was loaded with a fair bit of software, and I don&#8217;t think the user was keen on dropping all the software to save on space, and I imagine rightly so too. You install [...]]]></description>
			<content:encoded><![CDATA[<p>I was working with someone else on a system today that had an issue with a lack of disk space.</p>
<p>This machine was loaded with a fair bit of software, and I don&#8217;t think the user was keen on dropping all the software to save on space, and I imagine rightly so too. You install items of software because you use (or plan to) utilise them in many ways.</p>
<p>And this user is very remote, as remote as remote gets, the other side of the country, in a regional area, running on a BigPond satelitte connection, and pays more than $600 for it.</p>
<p>So, what I had before me was basically some way of guiding a user through resizing his hard drive using partitioning tools (hey, he knew what a drive and a partition were, and what RAM is!, can&#8217;t go too wrong!).</p>
<p>The solution was that I basically was guiding the user through, and the user did everything to the letter.</p>
<p>Resize the last partition down 10GB to make an extra 10GB free at the end of the drive.<br />
With that same partition, move it to the end of the disk, placing the 10GB of &#8220;space&#8221; at the end of the partition we wanted to resize.<br />
Resize the middle partition an additional 10GB to swallow the space in the middle, and viola, resize complete.</p>
<p>So the theory goes.</p>
<p>Partition Commander was the software we were using, and it finished the 1st resize step just fine.<br />
At the 2nd step, where you would wait for a partition to be moved on the disk to make the free space in the right position available, the system locked up. </p>
<p>Now, I know some IDE actions can produce that same issue, been there, done that, many times, but the user checked the HDD light and he concluded the system had locked up.</p>
<p>Great, just what I needed with the many hours of time that was spare that I would have been able to use &#8230; differently.</p>
<p>So, I was somewhat stuck on how to resolve this.</p>
<p>My immediate reaction was a rather annoyed &#8216;ohhhhhh!!! <img src='http://www.tocpcs.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> &#8216;, realising that the user&#8217;s emails and data was on this partition. I wasn&#8217;t going to panic or give up on it, so in the hours that followed, were many checks of software items to find something that would do the job of:</p>
<p>1. Getting the system booting again (apparently, Partition Commander writes an MBR and then replaces it, I believe, when it does any actions, so that if it fails, it can recover in some way), so the system wouldn&#8217;t boot when trying to get back into Windows.</p>
<p>2. Get that partition assigned as an NTFS partition and recognised the data on that drive, so he can function as normal.</p>
<p>In the 6 hours that followed this, I was very much annoyed.</p>
<p>I tried Partition Magic, Smart FDISK, EasyRecover, Seatools, anything I could throw at this in search of an option to assign the partition it&#8217;s System ID of 07.</p>
<p>We ended up getting Winternals to recognise the missing volume, but.. but..</p>
<p>It didn&#8217;t have any valid destination to copy to, A: ? For 20GB ? yeh right. C: (ram disk ? well, if he had 20GB of RAM, and a dang good UPS, maybe), R: (another ram disk, not likely).</p>
<p>So, that was put back out as useless at recovering the stuff up caused by Partition Commander, which locked the machine during a partition move and caused the Partition Table to be in a state of confusion over whether it is or is not a partition, and whether the data is recognisable.</p>
<p>But, we made a breakthrough, through all the testing we did to try and get a boot, or a recovered partition, we got the drive to boot back into Windows.</p>
<p>And I knew just the tool for the job at that point.<br />
Nothing beats Runtime Software&#8217;s GetDataBack for NTFS.</p>
<p>This item of software was shown to me a few years back when I had a drive that just was being a pain, and it didn&#8217;t get much to recover, but it did recover data then.</p>
<p>So, with just a screwed partition table, but a drive that has 2 fresh formatted partitions at hand as well,  the solution was obvious, recover data off the hidden partition, and place the recovered data on the formatted drive, sure beats rewriting a partition table and risking losing data.</p>
<p>But, the whole process could almost certainly be done completely different.</p>
<p>We went in ready to resize partitions, when it should have been that we used ghost to ghost the partition to the new drive, and then deleted the other partition and resized the original partition and recreated the second.</p>
<p>That would have saved.. well, many hours.</p>
<p>I have used Partition Commander for a while and it normally performs well, but I doubt I have plans to do any resizing of drives with it again soon, I think I would rather use the ghost method, and a larger HDD (they are cheap anyway).</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tocpcs.com/partition-resize-bad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spam Prevention &#8211; A different view</title>
		<link>http://www.tocpcs.com/spam-prevention-a-different-view/</link>
		<comments>http://www.tocpcs.com/spam-prevention-a-different-view/#comments</comments>
		<pubDate>Mon, 23 Jul 2007 03:02:52 +0000</pubDate>
		<dc:creator>The Elite Geek</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.tocpcs.com/2007/07/23/spam-prevention-a-different-view/</guid>
		<description><![CDATA[I was recently tackling a spam issue today. A domain I have (no, its not this one, and its not the other popular one), has been getting spam sent to it at a not so low rate. The domain doesn&#8217;t have a link in the search engines, and hasn&#8217;t been published anywhere. But the spammers [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently tackling a spam issue today.</p>
<p>A domain I have (no, its not this one, and its not the other popular one), has been getting spam sent to it at a not so low rate.</p>
<p>The domain doesn&#8217;t have a link in the search engines, and hasn&#8217;t been published anywhere.</p>
<p>But the spammers still have a go don&#8217;t they.</p>
<p>Anyway, the catch all was doing just that, catching it all. So the spammers were having a party sending spam to a catch all address that is unmonitored really, unless I manually decide to go and check it for anything lost (rarely ever).</p>
<p>So I investigated a few options. And decided I would see if I could sort out another issue that was bugging me recently, relaying mail via the ISP. A pain when you want mail to originate from your own server.</p>
<p>The solutions were all centered around ISPConfig, however, the setup I run doesn&#8217;t use MySQL. So, I tried to skim those for anything obvious that was stopping me relaying email directly.</p>
<p>I didn&#8217;t want to use mynetworks, as this isn&#8217;t ideal for the situation, I wanted something specific that would do the trick.</p>
<p>And then it came to me.</p>
<p>The spam emails are all just guesses at domains and don&#8217;t even come close to the right domain that I am running on.</p>
<p>The addresses they came from all were from seemingly existent domains.</p>
<p>So I added a regexp to kill all the email to the address they were attacking at, and viola. Bye spam. I also implemented a DNSBL, however, I remain under testing on this one because, just like Telstra with a national telecommunications network, you can&#8217;t trust one person to provide you with a service consistently and with good service.</p>
<p>The mail has been flowing through nicely, and it seems to have reduced the issues to start with, of spam, at the same time, allow me the access for relaying messages directly through the server, without turning it into an open mail relay, and doesn&#8217;t use Sorbs for their blocking (all dynamic IPs? Come on!), and seems to handle all email thus far rather nicely.</p>
<p>I&#8217;ll keep monitoring the logs though and if anything seems out of whack, will be able to revert the changes or update them. </p>
<p>SMTP servers are absolutely not the easiest to configure. They aren&#8217;t out of this world, but the particular one I was configuring this time was a little more difficult and the information, and the logging messages weren&#8217;t very helpful!</p>
<p>But through those hours of chopping into it, i&#8217;ve got the setup that is great, I get emails in and out, the spam is down to.. well, assumably 0.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tocpcs.com/spam-prevention-a-different-view/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Server Moves &#8211; Time Consuming!</title>
		<link>http://www.tocpcs.com/server-moves-time-consuming/</link>
		<comments>http://www.tocpcs.com/server-moves-time-consuming/#comments</comments>
		<pubDate>Mon, 02 Jul 2007 03:25:15 +0000</pubDate>
		<dc:creator>The Elite Geek</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[VoIP]]></category>

		<guid isPermaLink="false">http://www.tocpcs.com/2007/07/02/server-moves-time-consuming/</guid>
		<description><![CDATA[I&#8217;ve recently moved server (again). I&#8217;ve had to move between servers for a little while now because of a few issues that were causing software issues. Those issues have been focused on and solved, however, each time I move server, and begin reconfiguring, I always consider each one could be done a little differently. Each [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently moved server (again).</p>
<p>I&#8217;ve had to move between servers for a little while now because of a few issues that were causing software issues.</p>
<p>Those issues have been focused on and solved, however, each time I move server, and begin reconfiguring, I always consider each one could be done a little differently.</p>
<p>Each different software item we run could be configured a little differently for a better result.</p>
<p>It&#8217;s seriously an artform, the art of configuring a linux server from scratch.</p>
<p>Of course, I didn&#8217;t sit there and manually reconfigure the box each time, that&#8217;d be a big waste. Instead, we use the power of scp to copy data over, have all the processes on the server tested and running, implement the configuration files and add the data and let it run, after some testing of course.</p>
<p>Now, each time I do this, not everything works 100%, for example, email might act a little funny, or we&#8217;ll lose the ability to receive or make calls.</p>
<p>Actually, just while on that note, I&#8217;m &#8220;VERY&#8221; tired of the inconsistent programming by a particular coder, I won&#8217;t name them here, but it&#8217;s just &#8220;silly&#8221;.</p>
<p>For example, the first update, they used a variable like &#8220;get-this&#8221;, they then changed it in the next version, assumably to make it shorter, to &#8220;get&#8221;, and this time we fetch the next update, and it&#8217;s changed back to &#8220;get-this&#8221;.</p>
<p>Very much annoying, as if you use a direct call to that, you end up having more issues, like fixing the issue. </p>
<p>I wrote about this a while back, basically, the person should be using an alias to the function, and not simply &#8220;renaming&#8221;, other coders use the same, and it&#8217;s just inconsiderate to be changing it so much.</p>
<p>Anyway, with the move near complete again (and a nice 9days uptime in the data centre! <img src='http://www.tocpcs.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ), we are on top of it all and screaming along to finding my weekend time free again for OzVoIPStatus maintenance.</p>
<p>I originally planned this weekend for it, however, moving from a underpowered loan server to my beast was much, much more of a priority, and moving a dynamic site like OzVoIPStatus does take a fair bit of thought. It&#8217;s not a simple one line command, though, I am sure I could make it so, it takes a fair bit of thought into what part of it slots into what area of move, and basically everything is live before data is even migrated to ensure that we always have the providers monitored, one server is on top of it, the other is getting data and staying up to date, and keeping on top of it.</p>
<p>Eventually the two are split, and we see if the configuration was successful.</p>
<p>Assuming all goes well for OzVoIPStatus, we move on to setting up mail for it, and test that its successful, and eventually we land with the setup configured.</p>
<p>It&#8217;s certainly not a walk in the park, and takes a fair bit of time, and in nearly every case, I am sure I could have configured it all differently and got a different result!</p>
<p>As I mentioned earlier, there&#8217;s gotta be some sort of artform to it. You really have to find the time each time to manually configure and compile software and optimise it to your requirements, and adjust configuration settings to tweak them to the peak.</p>
<p>That&#8217;s not a quick task, and I guess the only thing that can be said is.. Thanks a heap for yum and the open source gurus that will happily compile these packages and a configuration file that makes it simple to configure and tweak each option to your needs.</p>
<p>Trixbox and systems like that just basically have a script that runs (and breaks in several scenarios) after install and writes out configuration the way you want. It&#8217;s just another compilation of packages really.</p>
<p>Trixbox could have been better done in my opinion too. </p>
<p>It would have been far easier to not rely on a &#8220;trixboxload&#8221; folder, and instead, use a repo, then it&#8217;s a simple yum install trixbox to get it and all its dependancies. For a CD install, the same thing, just a repo that points at the cd <img src='http://www.tocpcs.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .</p>
<p>The script they use is generally buggy from my testing, breaking for various reasons, like yum not installed (the first case <img src='http://www.tocpcs.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ), all could be easily checked for and error handled (but its not).</p>
<p>And the other let down for Trixbox: It installs a dang IRCd for no apparent (or related) reason, therefore opening the system to a security exploit, and besides, it takes up resources, needlessly.</p>
<p>Back to the topic: Building a linux server, building a distro, it&#8217;s all a very unique artform to get a server from command prompt to your chosen ideal configuration, very fun, if you can find the time.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tocpcs.com/server-moves-time-consuming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up ChilliSpot with FreeRadius on Tomato Part IV</title>
		<link>http://www.tocpcs.com/setting-up-chillispot-with-freeradius-on-tomato-part-iv/</link>
		<comments>http://www.tocpcs.com/setting-up-chillispot-with-freeradius-on-tomato-part-iv/#comments</comments>
		<pubDate>Fri, 15 Jun 2007 02:31:51 +0000</pubDate>
		<dc:creator>The Elite Geek</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.tocpcs.com/2007/06/14/setting-up-chillispot-with-freeradius-on-tomato-part-iv/</guid>
		<description><![CDATA[This is part four of the series on setting up ChilliSpot with FreeRadius, using MySQL, on Tomato. The final part is to get ChilliSpot running on the Tomato router, which includes modifying its firewall to block packets. The first step tonight is to modify the firewall script. Tomato is a bit different in how the [...]]]></description>
			<content:encoded><![CDATA[<p>This is part four of the series on setting up ChilliSpot with FreeRadius, using MySQL, on Tomato.</p>
<p>The final part is to get ChilliSpot running on the Tomato router, which includes modifying its firewall to block packets.</p>
<p>The first step tonight is to modify the firewall script. Tomato is a bit different in how the firewall is setup.<br />
Open the file in the network share, etc/firewall.openwrt with your favourite editor.</p>
<p>We only need to make a few changes to this file for tomato to work.</p>
<p>The file starts with defining the WANIF. This is generally needing to be changed to:</p>
<p>WANIF=`nvram get wan_ifname`</p>
<p>The next two lines:<br />
WLANIF=&#8221;eth1&#8243;<br />
LANIF=&#8221;br0&#8243;<br />
.. are fine.</p>
<p>The definition of IPTABLES is correct, as &#8220;/usr/sbin/iptables&#8221;</p>
<p>Delete the next 4 lines, which are:<br />
for T in filter nat mangle ; do<br />
  $IPTABLES -t $T -F<br />
  $IPTABLES -t $T -X<br />
done</p>
<p>The next lines change the behaviour of the firewall, let&#8217;s not confuse anyone, and leave them alone.</p>
<p>The next lines are all OK, to the point where we get to the end, which is Enable Nat on the output device.<br />
It&#8217;s generally already enabled, so delete that line from the file, save the file.</p>
<p>Now, with that done, we are all set to set to start the application on the router.</p>
<p>We start with:<br />
/cifs1/usr/sbin/chilli &#8211;conf=/cifs1/etc/chilli.conf</p>
<p>And, unfortunately, with debug on, we get:</p>
<p>ChilliSpot version 1.0RC3 started.<br />
chillispot[5490]: tun.c: 673: 2 (No such file or directory) open() failed<br />
chillispot[5490]: chilli.c: 3437: Failed to create tun</p>
<p>What is the issue here is, we need to get the tun.o module loaded for this kernel. I&#8217;ve tried loading one from a different kernel, in the hour I&#8217;ve taken since starting this post, to now, to find out, and unfortunately, we&#8217;ve hit a deadend. </p>
<p>We can alternatively, recompile the firmware with mknod support, and that should set us on the right track to running ChilliSpot on Tomato.</p>
<p>Either way, that&#8217;s a very time consuming operation. If anyone has a tun.o module for the 2.4.20 kernel, I&#8217;m keen to get my hands on it and give that a go.</p>
<p>I&#8217;ve also asked Tomato&#8217;s developer if he was able to provide some input.</p>
<p>The task of recompiling the firmware involves downloading the Tomato Source, done.<br />
Downloading a 180MB Linksys Source file, not done.<br />
And having a feel around to find out what we need to fix to make ChilliSpot run on Tomato&#8217;s OS.</p>
<p>Hopefully we get some more information on this soon, and I can finish this off.</p>
<p>Believe it or not, the total time this blog post took was 2 hours, and around 90 minutes of that was spent researching and finding a tun.o module.</p>
<p>You can always look at Open WRT, but you lose the decent QoS that Tomato offers.</p>
<p>Maybe a merge of the both would be ideal? Not sure what we are up for, will certainly look when I get time to open this up again!</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tocpcs.com/setting-up-chillispot-with-freeradius-on-tomato-part-iv/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Setting up ChilliSpot with FreeRadius on Tomato Part III</title>
		<link>http://www.tocpcs.com/setting-up-chillispot-with-freeradius-on-tomato-part-iii/</link>
		<comments>http://www.tocpcs.com/setting-up-chillispot-with-freeradius-on-tomato-part-iii/#comments</comments>
		<pubDate>Thu, 14 Jun 2007 04:00:38 +0000</pubDate>
		<dc:creator>The Elite Geek</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.tocpcs.com/2007/06/13/setting-up-chillispot-with-freeradius-on-tomato-part-iii/</guid>
		<description><![CDATA[With the previous two completed, that is, setting up FreeRadius, MySQL, and sourcing the ChilliSpot package, and having this on your now setup CIFS network share. What we need to do now is look at the configuration, and make it suit our requirements. Open your network share, and edit the file &#8216;chilli.conf&#8217; in your favourite [...]]]></description>
			<content:encoded><![CDATA[<p>With the previous two completed, that is, setting up FreeRadius, MySQL, and sourcing the ChilliSpot package, and having this on your now setup CIFS network share.</p>
<p>What we need to do now is look at the configuration, and make it suit our requirements.</p>
<p>Open your network share, and edit the file &#8216;chilli.conf&#8217; in your favourite (or not) editor. Chilli.conf is located in the /etc/ folder.</p>
<p>Find &#8220;radiusserver1&#8243;, edit this to the LAN IP of your Linux server running FreeRadius.</p>
<p>Make the same edit to radiusserver2.</p>
<p>Find radiussecret, set it to the value of the secret you specified in /etc/raddb/clients.conf yesterday, we chose &#8220;mypass&#8221;.</p>
<p>Find dhcpif, change it to &#8220;eth1&#8243; (should already be set to this).</p>
<p>We haven&#8217;t yet created a webpage to handle requests as yet, either. Chillispot (the regular package), comes with a script called &#8220;hotspotlogin&#8221;, download the regular chillispot Source Code, from chillispot.org, open the file with WinRAR, and inside, find the &#8220;doc/&#8221; folder, which is inside the chillispot-1.1.0 folder, inside the archive. Extract the &#8220;hotspotlogin.cgi&#8221; file to a place where you can get to it.</p>
<p>Rename hotspotlogin.cgi to &#8220;hotspotlogin&#8221;.</p>
<p>This is relatively simple to implement on most apache servers, you do also require SSL for this to function. The parameter in the configuration file has https://radius.chillispot.org/hotspotlogin, we want to edit this to be the IP address of the radius server, eg.</p>
<p>https://192.168.1.103/hotspotlogin</p>
<p>Find &#8220;uamsecret&#8221;, and set a secret, remember this, it has to be specified in the &#8220;hotspotlogin&#8221; file.</p>
<p>This guide is going to assume you already have Apache setup with SSL, and perl, and configured correctly. If you don&#8217;t, you should refer to Google for assistance, it&#8217;s relatively simple, but can be a little confusing for some.</p>
<p>You can place the hotspotlogin file in any folder on your webserver you like, but it should be in the location that would match the uamserver we specified in chilli.conf. Essentially, you should try and access the uamserver URL in your browser. If you see a Page Cannot Be Found error, you haven&#8217;t placed it in the right location, or your server isn&#8217;t configured correctly.</p>
<p>For most, the location needed is /var/www/html/. </p>
<p>Permissions on the &#8220;hotspotlogin&#8221; file should be set to read and execute for the apache user on your system.</p>
<p>The next part of this, is to edit the hotspotlogin file, with the uamsecret, and other settings.</p>
<p>Open the hotspotlogin file with your favourite editor, and locate the &#8220;$uamsecret&#8221; line, remove the # at the front of this line, and set the secret to whatever you set the uamsecret to in chillispot.</p>
<p>Uncomment the next line also, which is the &#8220;#$userpassword&#8221; line.</p>
<p>With those lines setup, we now only have edit the iptables script to work with Tomato, and ensure we don&#8217;t destroy its fantastic QoS changes in the process. </p>
<p>I am yet to dig this up, so that will come another time. To start chillispot tho (without the blocking of internet access that it does), we can simply telnet into the router, and start chilli, but that would be pretty pointless right now.</p>
<p>Again, I remind all this information is provided on an all care, 0 responsibility basis. Don&#8217;t come crying to me if it doesn&#8217;t work for you, I very well might have not tested this information myself, and it would serve you right for taking information off the internet, instead of investigating what you are doing. Of course, the information provided isn&#8217;t intended to do harm (and of course isn&#8217;t likely to cause harm), so use it at your own risk, if in doubt, hire a professional. This should be a little more scary compared to the last one <img src='http://www.tocpcs.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tocpcs.com/setting-up-chillispot-with-freeradius-on-tomato-part-iii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
