<?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>codetorment &#187; howto</title>
	<atom:link href="http://www.codetorment.com/tag/howto/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codetorment.com</link>
	<description>code, tech, random stuff</description>
	<lastBuildDate>Tue, 04 May 2010 21:04:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4715</generator>
		<item>
		<title>Arduino temperature data logger</title>
		<link>http://www.codetorment.com/2009/11/12/arduino-temperature-and-light-data-logging-and-chartplotting-webmonitor/</link>
		<comments>http://www.codetorment.com/2009/11/12/arduino-temperature-and-light-data-logging-and-chartplotting-webmonitor/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 16:27:09 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[chart]]></category>
		<category><![CDATA[ethernet]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[log]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.codetorment.com/?p=672</guid>
		<description><![CDATA[An arduino, a DB18S20 one-wire temperature sensor and an LDR (Light Dependent Resistor) are hooked up with some resistors and an ethernet shield to make a datalogger and webmonitor. Notes : for this setup the connections are made on the ethernet shield instead of directly on the arduino. Since Fritzing misses a library with external [...]]]></description>
			<content:encoded><![CDATA[<p>An arduino, a DB18S20 one-wire temperature sensor and an LDR (<em>Light Dependent Resistor</em>) are hooked up with some resistors and an ethernet shield to make a datalogger and webmonitor.</p>
<p><a href="http://www.codetorment.com/wp-content/uploads/DSCN9593-1.JPG"><img class="size-full wp-image-718 alignnone" title="DSCN9593-1" src="http://www.codetorment.com/wp-content/uploads/DSCN9593-1.JPG" alt=" Arduino temperature data logger" width="448" height="335" /></a></p>
<p><span id="more-672"></span>Notes :</p>
<ul>
<li>for this setup the connections are made on the ethernet shield instead of directly on the arduino. Since <a title="Fritzing" href="http://fritzing.org/" target="_blank">Fritzing</a> misses a library with external shield I used the arduino, the pinout stays the same either way.</li>
<li>check the <a title="DS18B20 datasheet" href="http://www.google.be/url?sa=t&amp;source=web&amp;ct=res&amp;cd=1&amp;ved=0CAsQFjAA&amp;url=http%3A%2F%2Fdatasheets.maxim-ic.com%2Fen%2Fds%2FDS18B20.pdf&amp;rct=j&amp;q=ds18b20+datasheet&amp;ei=pSr8SqLvOtTX-Qaf5pSIAg&amp;usg=AFQjCNEA19aScsvJEYz5A_daB2kpye2SiA" target="_blank">DS18B20 datasheet </a>for the specifications on hooking up the sensor in parasite or powered mode</li>
</ul>
<p>Schematics :</p>
<p><a href="http://www.codetorment.com/wp-content/uploads/temp_light_monitor_tiny_bb.png"><img class="alignnone size-full wp-image-712" title="Arduino DS18B20 temperature sensor and LDR schematics" src="http://www.codetorment.com/wp-content/uploads/temp_light_monitor_tiny_bb.png" alt="Arduino DS18B20 temperature sensor and LDR schematics" width="526" height="246" /></a></p>
<p>The arduino reads the sensors every 10 seconds and passes the data to a php script on your website; which then stores the data in a text file. A second script generates a line chart of the collected data.</p>
<div id="attachment_729" class="wp-caption alignnone" style="width: 458px"><a href="http://www.codetorment.com/wp-content/uploads/tempgraph.php.png"><img class="size-full wp-image-729   " title="tempgraph.php" src="http://www.codetorment.com/wp-content/uploads/tempgraph.php.png" alt="22 hours of temperature data" width="448" height="233" /></a><p class="wp-caption-text">22 hours of temperature data</p></div>
<p>I started from <a title="Cyberspice's blog" href="http://www.cyberspice.org.uk/blog/2009/10/29/boarduino-vivarium-temperature-monitor/" target="_blank">Cyberspice&#8217;s</a> code and changed the arduino code to make use of the DB18S20 and the ethernet shield.</p>
<p>A variable was added to the upload php script in order to store the light intensity in addition to the temperature.</p>
<p>The graphing script was altered to also display the minimum temperature, the maximum temperature, the current temperature and the average temperature. A raster was added for a better interpretation of the plotted data and a green line is showing the average temperature  troughout the chart.</p>
<p>You need to alter your ip, domain and path as I explained in the post <a title="Arduino wireless motion detector" href="http://www.codetorment.com/2009/10/25/arduino-wireless-motion-detector-part-2/" target="_self">Arduino Wireless motion detector</a> so I won&#8217;t go into those details here.</p>
<p>The arduino sketch :</p>
<pre class="brush: cpp;">
#include &lt;OneWire.h&gt;
#include &lt;string.h&gt;
#include &lt;Ethernet.h&gt;

int count = 0;
OneWire ds(8);
int HighByte, LowByte, TReading, SignBit, Tc_100, Tf_100, Whole, Fract;
int Tcount = 1;
int W[6];
int F[6];
int photocellPin = 0;     // the cell and 10K pulldown are connected to a0
int light;     // the analog reading from the sensor divider

byte mac[] = {
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = {
  192, 168, 1, 36};
byte server[] = { 77, 222, 78, 32};
// String buffer
char buffer[256];

Client client(server, 80);

void setup()
{
  Ethernet.begin(mac, ip);
  Serial.begin(9600);

  delay(1000);

  // Serial.println(&quot;connecting...&quot;);

}

void loop()
{
  byte i;
  byte present = 0;
  byte data[12];
  byte addr[8];

  if ( !ds.search(addr)) {
    ds.reset_search();
    return;
  }

  ds.reset();
  ds.select(addr);
  ds.write(0x44,1);         // start conversion, with parasite power on at the end

  delay(1000);            

  present = ds.reset();
  ds.select(addr);
  ds.write(0xBE);         // Read Scratchpad

  light = analogRead(photocellPin);
  Serial.print(&quot;light intensity = &quot;);
  Serial.print(light);
  Serial.print(&quot;\n&quot;);
  for ( i = 0; i &lt; 9; i++) {           // we need 9 bytes
    data[i] = ds.read();
  }

  LowByte = data[0];
  HighByte = data[1];
  TReading = (HighByte &lt;&lt; 8) + LowByte;
  SignBit = TReading &amp; 0x8000;  // test most sig bit
  if (SignBit) // negative
  {
    TReading = (TReading ^ 0xffff) + 1; // 2's comp
  }
  Tc_100 = (6 * TReading) + TReading / 4;    // multiply by (100 * 0.0625) or 6.25

  Whole = Tc_100 / 100;  // separate off the whole and fractional portions
  Fract = Tc_100 % 100;

  if (SignBit) // If its negative
  {
    Serial.print(&quot;-&quot;);
  }
  Serial.print(Whole);
  Serial.print(&quot;.&quot;);
  if (Fract &lt; 10)
  {
    Serial.print(&quot;0&quot;);
  }
  Serial.print(Fract);
  Serial.print(&quot; C\n&quot;);

  if (client.connect()) {
    Serial.println(&quot;connected&quot;);
 sprintf(buffer, &quot;HEAD /path/to/script/newtemp.php?count=%d&amp;temp=%d.%d&amp;light=%d HTTP/1.1&quot;, Tcount, Whole, Fract, photocell);
 client.println(buffer);
 client.println(&quot;Host: yourdomain.com&quot;);
 client.println(&quot;Connection: close&quot;);
 client.println();
 client.stop();
 Tcount++;
 }
 else {
 Serial.println(&quot;connection failed&quot;);
 }
 delay(60000);  // wait 1 minute before sending new data
}
</pre>
<p>The upload script  &#8216;newtemp.php&#8217; :</p>
<pre class="brush: php;">
&lt;?php

if ($_SERVER['REQUEST_METHOD'] == 'HEAD') {

	$fields = explode(&quot;&amp;&quot;, $_SERVER['QUERY_STRING']);
	$values = array();

	foreach ($fields as $field) {
		$keyval = explode(&quot;=&quot;, $field);
		$values[$keyval[0]] = $keyval[1];
	}

	$file = fopen('./tempdata.txt','a+');
	if ($file) {
		fwrite($file, time() . ':' . $values['count'] . ':' . $values['temp'] . ':' . $values['light']);
		fwrite($file, &quot;\n&quot;);
		fclose($file);
	}
}

?&gt;
</pre>
<p>The graphing script &#8216;tempgraph.php&#8217; :</p>
<pre class="brush: php;">
&lt;?php

define('WIDTH', 1000);
define('HEIGHT', 520);
define('FONT', 1);
 define('FONT2',2);

// Get the temperature data
$data = array();
$file = fopen(&quot;./tempdata.txt&quot;,&quot;r&quot;);
if ($file) {
	while (!feof($file)) {
		$line = trim(fgets($file));
		if (strlen($line)) {
			$fields = explode(&quot;:&quot;, $line);
			$keyval = array();
			$keyval['time']        = $fields[0];
			$keyval['count']       = $fields[1];
			$keyval['temperature'] = $fields[2];
			$keyval['light'] 	   = $fields[3];
			$data[] = $keyval;
		}
	}

	fclose($file);
}

// Get the number of data points
$datapoints = count($data);

// Lines are chronological
$mintime = $data[0]['time'];
$maxtime = $data[$datapoints - 1]['time'];

// Temperatures need to be processed.
$mintemp = $data[0]['temperature'];
$maxtemp = $data[0]['temperature'];

foreach ($data as $datapoint) {
	$mintemp = $mintemp &lt; $datapoint['temperature'] ?
	           $mintemp : $datapoint['temperature'];
	$maxtemp = $maxtemp &gt; $datapoint['temperature'] ?
	           $maxtemp : $datapoint['temperature'];
	$avgtemp += $datapoint['temperature'];
	$curtemp = $datapoint['temperature'];
}
 $avgtemp = round(($avgtemp / $datapoints),2);

// Get the axis dimensions.  Round up and down to the nearest
// degree C and hour.
$lowtime  = intval($mintime / 3600) * 3600;
$hightime = (intval($maxtime / 3600) + 1) * 3600;
$difftime = $hightime - $lowtime;

$lowtemp  = intval($mintemp);
$hightemp = intval($maxtemp) + 1;
$difftemp = $hightemp - $lowtemp;

// Create the image
$image = imagecreate(WIDTH, HEIGHT);
if ($image) {
	$background = imagecolorallocate($image, 255, 255, 255);
	$black      = imagecolorallocate($image, 0, 0, 0);
	$red        = imagecolorallocate($image, 255, 0, 0);
	$blue       = imagecolorallocate($image, 0, 0, 255);
	$green		= imagecolorallocate($image, 0, 204, 5);
	$grey		= imagecolorallocate($image, 210,210,210);

	// Draw the axes
	imageline($image, 20, 20, 20, 485, $black);
	imageline($image, 15, 480, 980, 480, $black);
	imageline($image, 15, 20, 20, 20, $black);
	imageline($image, 980, 480, 980, 485, $black);

	// Draw top horizontal line
	imageline($image, 20, 20, 980, 20, $grey);

	// Draw right most vertical line
	imageline($image, 980, 20, 980, 479, $grey);

	for ($i = 3600; $i &lt; $difftime; $i += 3600) {
		$x = 20 + (($i * 960) / $difftime);
		// Draw ticks on horizontal axis
		imageline($image, $x, 480, $x, 483, $black);
		// Draw horizontal guides
		imageline($image, $x, 479, $x, 20, $grey);
	}
	$temp = intval($lowtemp);
	for ($i = 1; $i &lt; $difftemp; $i++) {
	    $y = 480 - (($i * 460) / $difftemp);
		// Draw ticks on vertical axis
		imageline($image, 17, $y, 20, $y, $black);

		// Draw vertical guides
		imageline($image, 21, $y, 980, $y, $grey);
		$temp = intval($temp) + 1;
		$ytemp = intval($y) - 5;
		//if($temp % 2 == 0){
			imagestring($image, FONT, 0, $ytemp, $temp . 'C', $black);
		//}
	}

	// Draw the labels
	imagestring($image, FONT, 8, 490, date(&quot;H:i&quot;, $lowtime), $black);
	imagestring($image, FONT, 970, 490, date(&quot;H:i&quot;, $hightime), $black);
	imagestring($image, FONT, 0, 475, $lowtemp . 'C', $black);
	imagestring($image, FONT, 0, 15, $hightemp . 'C', $black);

	// Draw min, max and avg
	imagestring($image, FONT2, 700, 430, &quot;Cur. temp : &quot; . $curtemp . &quot; °C&quot;,$black);
	imagestring($image, FONT2, 700, 450, &quot;Avg. temp : &quot; . $avgtemp . &quot; °C&quot;,$green);
	imagestring($image, FONT2, 850, 430, &quot;Min. temp : &quot; . $mintemp . &quot; °C&quot;,$blue);
	imagestring($image, FONT2, 850, 450, &quot;Max. temp : &quot; . $maxtemp . &quot; °C&quot;,$red);

	// Draw avg line

	$avgtemp = 480 - ((($avgtemp - $lowtemp) * 460) / $difftemp);
	imageline($image,20, $avgtemp, 980, $avgtemp, $green);

	// Draw the temperature points

	// Position of the first point
	$prevx = (($data[0]['time'] - $lowtime) * 960) / $difftime;
	$prevy = (($data[0]['temperature'] - $lowtemp) * 460) / $difftemp;

	// Draw line from previous point to current point
	for ($i = 1; $i &lt; $datapoints; $i++) {
		$x = (($data[$i]['time'] - $lowtime) * 960) / $difftime;
		$y = (($data[$i]['temperature'] - $lowtemp) * 460) / $difftemp;
		imageline($image, $prevx + 20, 480 - $prevy, $x + 20, 480 - $y, $red);
		$prevx = $x;
		$prevy = $y;
	}

	// Finally time and date stamp
	$generated = 'Generated: ' . date(&quot;r&quot;);
	imagestring($image,
	            FONT,
	            WIDTH - 15 - (imagefontwidth(FONT) * strlen($generated)),
	            HEIGHT - 15,
	            $generated,
	            $blue);

	// Output the image
	header('Content-Type: image/png');
	imagepng($image);

	// Destroy it
	imagedestroy($image);
}

?&gt;
</pre>
<p>I will soon post some improvements on the scripts :</p>
<ul>
<li>averaging 6 readings ( 1 minute ) to 1 datapoint to get rid of the noise</li>
<li>let the script fill one text file for each day, so you can look at a history over several days</li>
<li>split up data into different charts</li>
<li>last but not least, trying to add the S65 in the game : showing the current sensor readings or a graph</li>
</ul>
<p><a href="http://www.codetorment.com/wp-content/uploads/DSCN9596.JPG"><img class="alignnone size-full wp-image-786" title="DSCN9596" src="http://www.codetorment.com/wp-content/uploads/DSCN9596.JPG" alt=" Arduino temperature data logger" width="454" height="341" /></a></p>
<p>Please leave a comment or send me a link to show your arduino projects!</p>
<p><a title="Home" href="http://www.codetorment.com/" target="_self">Back to homepage</a></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.codetorment.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.codetorment.com/2009/11/12/arduino-temperature-and-light-data-logging-and-chartplotting-webmonitor/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Tutorial : Change user password in Ubuntu 9.10 ( to something simple )</title>
		<link>http://www.codetorment.com/2009/11/03/tutorial-change-user-password-in-ubuntu-9-10/</link>
		<comments>http://www.codetorment.com/2009/11/03/tutorial-change-user-password-in-ubuntu-9-10/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 12:16:11 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[user]]></category>

		<guid isPermaLink="false">http://www.codetorment.com/?p=524</guid>
		<description><![CDATA[Last time I installed Ubuntu 9.10 I said to myself, let&#8217;s use a good&#8217;ol secure password for my user. Two days later I was already regretting my decision.. I&#8217;m not saying a password shouldn&#8217;t be secure, but a 10 digit password 5 of which are numbers just starts to get annoying when having to type [...]]]></description>
			<content:encoded><![CDATA[<p>Last time I installed Ubuntu 9.10 I said to myself, let&#8217;s use a good&#8217;ol secure password for my user. Two days later I was already  regretting my decision.. I&#8217;m not saying a password shouldn&#8217;t be secure, but a 10 digit password 5 of which are numbers just starts to get annoying when having to type it every time you want to sudo this or sudo that.</p>
<p>No problem thusfar, you just wander to System &gt; Administration &gt; Users and Groups</p>
<p><a href="http://www.codetorment.com/wp-content/uploads/Screenshot-Users-Settings.png"><img class="alignnone size-full wp-image-525" title="Screenshot-Users Settings" src="http://www.codetorment.com/wp-content/uploads/Screenshot-Users-Settings.png" alt="Screenshot-Users Settings" width="498" height="262" /></a><span id="more-524"></span></p>
<p><span style="color: #ffffff;">Note: You might want to skip changing your users&#8217; password when during installation  you&#8217;ve selected to also use the users&#8217; password to decrypt your home folder. I&#8217;m not saying it will, but it could cause problems when the configuration of your login password and the decrypt password don&#8217;t match.</span></p>
<p>You click the user who&#8217;s password you wish to change, click properties and enter your current (long and typo-prone) password</p>
<p><a href="http://www.codetorment.com/wp-content/uploads/Screenshot-Change-password.png"><img class="alignnone size-full wp-image-528" title="Screenshot-Change password" src="http://www.codetorment.com/wp-content/uploads/Screenshot-Change-password.png" alt="Screenshot-Change password" width="420" height="265" /></a></p>
<p>Next you enter a finger-friendly password, and confirm before you hit &#8216;Change password&#8217;&#8230;</p>
<p>Instead of getting a message that reads &#8216;Your password has been changed&#8217; you get &#8230;</p>
<p><a href="http://www.codetorment.com/wp-content/uploads/Screenshot-Change-password-1.png"><img class="alignnone size-full wp-image-529" title="Screenshot-Change password-1" src="http://www.codetorment.com/wp-content/uploads/Screenshot-Change-password-1.png" alt="Screenshot-Change password-1" width="420" height="265" /></a></p>
<p>Well I know it&#8217;s simple, that&#8217;s kind of where I&#8217;m getting at!</p>
<p>After some swearing I realised I might as well use the command line to get things done&#8230;</p>
<p>Open a terminal and enter</p>
<pre style="border: 1px inset; margin: 5px; padding: 6px; overflow: auto; width: 680px; height: 25px; text-align: left;" dir="ltr">sudo passwd yourusername</pre>
<p>You will be asked to enter the current password, enter a new password and confirm.</p>
<p>Thataa! Easy as 123! Damn now I have to go and change my password again&#8230;</p>
<p><a title="Home" href="http://www.codetorment.com/" target="_self">Back to homepage</a></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.codetorment.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.codetorment.com/2009/11/03/tutorial-change-user-password-in-ubuntu-9-10/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Tutorial : Getting started with Arduino on Ubuntu 9.10</title>
		<link>http://www.codetorment.com/2009/11/02/tutorial-getting-started-with-arduino-ide-on-linux-ubuntu-9-10/</link>
		<comments>http://www.codetorment.com/2009/11/02/tutorial-getting-started-with-arduino-ide-on-linux-ubuntu-9-10/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 20:53:40 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[ide]]></category>
		<category><![CDATA[launcher]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.codetorment.com/?p=439</guid>
		<description><![CDATA[In this tutorial I will show you how to setup the Arduino IDE on Ubuntu 9.10 32-bit. I&#8217;ll also show you how to add an Application Launcher to quickstart the Arduino IDE I&#8217;ll assume you haven&#8217;t already installed any of the necessary packages to run the Arduino IDE. 1. First open a terminal ( Applications [...]]]></description>
			<content:encoded><![CDATA[<p><strong>In this tutorial I will show you how to setup the Arduino IDE on Ubuntu 9.10 32-bit. I&#8217;ll also show you how to add an Application Launcher to quickstart the Arduino IDE</strong></p>
<p><a href="http://www.codetorment.com/wp-content/uploads/Screenshot-sketch_nov02a-Arduino-0017.png"><img class="alignnone size-full wp-image-515" title="Screenshot-sketch_nov02a | Arduino 0017" src="http://www.codetorment.com/wp-content/uploads/Screenshot-sketch_nov02a-Arduino-0017.png" alt="Screenshot-sketch_nov02a | Arduino 0017" width="500" height="600" /></a></p>
<p>I&#8217;ll assume you haven&#8217;t already installed any of the necessary packages to run the Arduino IDE.</p>
<p>1. First open a terminal ( Applications &gt; Accesories &gt; Terminal ), paste the following code and hit enter :<span id="more-439"></span></p>
<pre style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 580px; height: 54px; text-align: left;" dir="ltr">sudo apt-get install sun-java6-jre sun-java6-bin sun-java6-jdk
sun-java6-fonts sun-java6-plugin gcc-avr avr-libc</pre>
<p>&nbsp;<br />
2. Next we need to uninstall Ubuntu&#8217;s braille support as it is known to cause <a title="Arduino on Ubuntu" href="http://www.arduino.cc/playground/Linux/Ubuntu" target="_blank">conflicts</a> with the Arduino IDE.</p>
<p>To do so go back to the terminal and enter :</p>
<pre style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 580px; height: 24px; text-align: left;" dir="ltr">sudo apt-get remove brltty</pre>
<p>&nbsp;<br />
3. Now we need to setup Java<br />
GNU&#8217;s Java doesn&#8217;t support the Arduino so to fix this run the command</p>
<pre style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 580px; height: 24px; text-align: left;" dir="ltr">sudo update-alternatives --config java</pre>
<p>&nbsp;<br />
This will show you a list of java alternatives installed on the machine.<br />
Select the entry &#8216;java-6-sun&#8217;</p>
<p>4. Now we are ready to download and install the arduino environment</p>
<p>Click <a title="Arduino IDE version 17" href="http://arduino.googlecode.com/files/arduino-0017.tgz" target="_blank">here</a> to download version 17 of the Arduino IDE. Alternatively go <a title="Arduino software" href="http://arduino.cc/en/Main/Software" target="_blank">here</a> to download a specific version.</p>
<p>5. Copy the downloaded file to your home directory ( saved by default in /home/username/downloads )</p>
<p>Extract the downloaded file into your home directory ( right-click &gt; extract here ).</p>
<p>6. To start the Arduino IDE open the arduino-0017 folder and double click the arduino file, when prompted choose Run.</p>
<p>If you want to start the Arduino IDE from the command line, cd into the folder</p>
<pre style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 580px; height: 24px; text-align: left;" dir="ltr">cd /home/username/arduino-0017</pre>
<p>&nbsp;<br />
and start the IDE with the command</p>
<pre style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 580px; height: 24px; text-align: left;" dir="ltr">./arduino</pre>
<p>&nbsp;</p>
<h3>I however prefer to have a launcher to quickstart applications.</h3>
<p>1. Download this icon to your desktop ( right-click &gt; Save image as&#8230; )</p>
<p><a href="http://www.codetorment.com/wp-content/uploads/arduino.png"><img class="alignnone size-full wp-image-483" title="arduino" src="http://www.codetorment.com/wp-content/uploads/arduino.png" alt="arduino Tutorial : Getting started with Arduino on Ubuntu 9.10" width="131" height="131" /></a></p>
<p>2. Open a terminal, go to your desktop and copy the image to /usr/share/icons</p>
<pre style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 580px; height: 48px; text-align: left;" dir="ltr">cd Desktop/
sudo cp arduino.png /usr/share/icons/</pre>
<p>&nbsp;<br />
3. Next right click the top panel and select Add to panel&#8230;</p>
<p><a href="http://www.codetorment.com/wp-content/uploads/Screenshot-Add-to-Panel.png"><img class="alignnone size-full wp-image-482" title="Screenshot-Add to Panel" src="http://www.codetorment.com/wp-content/uploads/Screenshot-Add-to-Panel.png" alt="Screenshot-Add to Panel" width="562" height="518" /></a></p>
<p>5. Select the first entry &#8216;Custom Application Launcher&#8217; and hit Add</p>
<p>6.In the Create Launcher window enter</p>
<p>A name for the launcher :</p>
<pre style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 580px; height: 24px; text-align: left;" dir="ltr">Arduino</pre>
<p>&nbsp;<br />
The command to be executed when the launcher is clicked :</p>
<pre style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 580px; height: 24px; text-align: left;" dir="ltr">bash -c "cd /home/yourusername/arduino-0017/; ./arduino"</pre>
<p>&nbsp;<br />
And any comment you want to add :</p>
<pre style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto;  width: 580px; height: 24px; text-align: left;" dir="ltr">starts the Arduino IDE</pre>
<p>&nbsp;<br />
Now click on the spring icon and go to the /usr/share/icons/ folder and select the arduino.png image.</p>
<p>Your Launcher should look like this</p>
<p><a href="http://www.codetorment.com/wp-content/uploads/Screenshot-Launcher-Properties-1.png"><img class="alignnone size-full wp-image-493" title="Screenshot-Launcher Properties-1" src="http://www.codetorment.com/wp-content/uploads/Screenshot-Launcher-Properties-1.png" alt="Screenshot-Launcher Properties-1" width="434" height="225" /></a></p>
<p>That was it! You&#8217;re all setup to hack and thinker with your Arduino on Ubuntu 9.10.</p>
<p>Now run along a go blink some LEDs.</p>
<p><a title="Home" href="http://www.codetorment.com/" target="_self">Back to homepage</a></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.codetorment.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.codetorment.com/2009/11/02/tutorial-getting-started-with-arduino-ide-on-linux-ubuntu-9-10/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Tutorial : Installing and securing XAMPP on Ubuntu 9.10</title>
		<link>http://www.codetorment.com/2009/10/20/guide-install-xampp-on-ubuntu/</link>
		<comments>http://www.codetorment.com/2009/10/20/guide-install-xampp-on-ubuntu/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 14:12:04 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[webdev]]></category>
		<category><![CDATA[xampp]]></category>

		<guid isPermaLink="false">http://codetorment.com/?p=3</guid>
		<description><![CDATA[<a href="http://codetorment.com/wp-content/uploads/Screenshot-XAMPP-Mozilla-Firefox.png"><img class="alignnone size-medium wp-image-28" title="Language selection page" src="http://codetorment.com/wp-content/uploads/Screenshot-XAMPP-Mozilla-Firefox-300x180.png" alt="Language selection page" width="300" height="180" /></a>

This page shows ...]]></description>
			<content:encoded><![CDATA[<p><strong>This tutorial will explain how to install XAMPP 1.7.1 in Ubuntu 9.10</strong></p>
<p><a href="http://www.codetorment.com/wp-content/uploads/Screenshot-XAMPP-for-Linux-1.7.1-Mozilla-Firefox.png"><img class="alignnone size-full wp-image-30" title="Welcome page" src="http://www.codetorment.com/wp-content/uploads/Screenshot-XAMPP-for-Linux-1.7.1-Mozilla-Firefox.png" alt="Welcome page" width="353" height="212" /></a></p>
<h3>Introduction</h3>
<p>This is a step by step guide for installing and setting up a webdev server on a ubuntu machine. I will show you how to install the lampp stack using XAMPP version 1.7.1 on Ubuntu 9.10.</p>
<p><span style="color: #ffcc33;">You can follow the exact same steps for setting up XAMPP version 1.7.2</span></p>
<h3>Follow these steps to install XAMPP:</h3>
<p>1. For starters you need to go to the official XAMPP website and download XAMPP for Linux version 1.7.1,  <a title="Download XAMPP" href="http://sourceforge.net/projects/xampp/files/XAMPP%20Linux/1.7.1/xampp-linux-1.7.1.tar.gz/download">click here</a> to download XAMPP for Linux version 1.7.1</p>
<p><span style="color: #ffcc33;">Make sure you download </span><span style="color: #ffcc33;">XAMPP</span><span style="color: #ffcc33;"> 1.7.1  if you want to use it together with wordpress.  XAMPP 1.7.2 uses PHP 5.3.0 which causes some problems when used in combination with wordpress 2.8.4</span></p>
<p>2. Place the downloaded .tar.gz archive on your desktop if it wasn&#8217;t already saved there by default.</p>
<p>3. Open a terminal ( Applications &gt; Accessoires &gt; Terminal )</p>
<p><span id="more-3"></span></p>
<p>4. Go to your desktop (or any other location where you placed the downloaded file)</p>
<pre><code style="color: white;">
cd Dekstop
</code></pre>
<p>&nbsp;<br />
5. Login as the super admin</p>
<pre><code style="color: white;">
sudo -s
</code></pre>
<p>&nbsp;<br />
6. Untarball the compressed file to the /opt directory</p>
<pre><code style="color: white;">
tar xvfz xampp-linux-1.7.1.tar.gz -C /opt
</code></pre>
<p>&nbsp;<br />
The above command installs xampp in the /opt/lampp directory</p>
<p>7. Start xampp by giving the command</p>
<pre><code style="color: white;">
/opt/lampp/lampp start
</code></pre>
<p>&nbsp;<br />
8. After starting xampp open a browserwindow and go to <a href="http://localhost/">localhost</a></p>
<p>If all went well you’ll see this page</p>
<p><a href="http://codetorment.com/wp-content/uploads/Screenshot-XAMPP-Mozilla-Firefox.png"><img class="alignnone size-medium wp-image-28" title="Language selection page" src="http://codetorment.com/wp-content/uploads/Screenshot-XAMPP-Mozilla-Firefox-300x180.png" alt="Language selection page" width="300" height="180" /></a></p>
<p>9. After choosing your language you’ll be forwarded to the welcome page</p>
<p><a href="http://codetorment.com/wp-content/uploads/Screenshot-XAMPP-for-Linux-1.7.1-Mozilla-Firefox.png"><img class="alignnone size-medium wp-image-30" title="Welcome page" src="http://codetorment.com/wp-content/uploads/Screenshot-XAMPP-for-Linux-1.7.1-Mozilla-Firefox-300x180.png" alt="Welcome page" width="300" height="180" /></a></p>
<p>10. Go to the security page by clicking Security in the left menu.</p>
<p>You’ll see that everything is unsecured at the moment</p>
<p><a href="http://codetorment.com/wp-content/uploads/Screenshot-XAMPP-for-Linux-1.7.1-Mozilla-Firefox-1.png"><img class="alignnone size-medium wp-image-31" title="Security page" src="http://codetorment.com/wp-content/uploads/Screenshot-XAMPP-for-Linux-1.7.1-Mozilla-Firefox-1-300x293.png" alt="Security page" width="300" height="293" /></a></p>
<p>When XAMPP will be used for local development these settings won’t matter much. It is good practice however to set it up securely.</p>
<h3>Next I’ll show you how to setup security</h3>
<p>&nbsp;<br />
11. Copy the code on the bottom of the security page and then paste it into a terminal</p>
<p><a href="http://codetorment.com/wp-content/uploads/Screenshot-XAMPP-for-Linux-1.7.1-Mozilla-Firefox-3.png"><img class="alignnone size-medium wp-image-35" title="Select code" src="http://codetorment.com/wp-content/uploads/Screenshot-XAMPP-for-Linux-1.7.1-Mozilla-Firefox-3-300x293.png" alt="Select code" width="300" height="293" /></a></p>
<pre><code style="color: white;">
/opt/lampp/lampp security
</code></pre>
<p>&nbsp;<br />
This will start an interactive program to help you configure security settings</p>
<div><span style="color: #ffcc33;">Make sure you’re logged in as super admin to start xampp or you’ll get an error message!</span></div>
<p>&nbsp;<br />
<a href="http://codetorment.com/wp-content/uploads/Screenshot-tom@laptop-1.png"><img class="alignnone size-medium wp-image-36" title="Login as sudo" src="http://codetorment.com/wp-content/uploads/Screenshot-tom@laptop-1-300x199.png" alt="Login as sudo" width="300" height="199" /></a></p>
<p>12. Type yes when prompted to enter a password and enter a secure password twice</p>
<p><a href="http://codetorment.com/wp-content/uploads/Screenshot-root@laptop-.png"><img class="alignnone size-medium wp-image-38" title="Enter password" src="http://codetorment.com/wp-content/uploads/Screenshot-root@laptop--300x199.png" alt="Enter password" width="300" height="199" /></a></p>
<p>13. Turn off MySQL network accesibility by entering yes, MySQL will now restart so the setting can take effect</p>
<p><a href="http://codetorment.com/wp-content/uploads/Screenshot-root@laptop-1.png"><img class="alignnone size-medium wp-image-39" title="MySQL restart" src="http://codetorment.com/wp-content/uploads/Screenshot-root@laptop-1-300x199.png" alt="MySQL restart" width="300" height="199" /></a></p>
<p>14. You’ll be prompted to set a password for phpMyAdmin, do so.</p>
<p>15. And again for setting a MySQL root password, make sure you write this one down or you’ll be in trouble later on.</p>
<p><a href="http://codetorment.com/wp-content/uploads/Screenshot-root@laptop-2.png"><img class="alignnone size-medium wp-image-40" title="MySQL root password" src="http://codetorment.com/wp-content/uploads/Screenshot-root@laptop-2-300x199.png" alt="MySQL root password" width="300" height="199" /></a></p>
<p>16. Now set a password for user nobody.</p>
<p>This should complete the security setup procedure.</p>
<p><a href="http://codetorment.com/wp-content/uploads/Screenshot2.png"><img class="alignnone size-medium wp-image-41" title="Done" src="http://codetorment.com/wp-content/uploads/Screenshot2-299x210.png" alt="Done" width="299" height="210" /></a></p>
<p>To confirm everything went ok, open a browserwindow and go to <a href="http://localhost/">localhost</a></p>
<p>17. You’ll be prompted for a username and password.</p>
<p><a href="http://codetorment.com/wp-content/uploads/Screenshot-1.png"><img class="alignnone size-medium wp-image-46" title="Login" src="http://codetorment.com/wp-content/uploads/Screenshot-1-300x230.png" alt="Login" width="300" height="230" /></a></p>
<p>the username is ‘lampp’<br />
the password is the one you entered in step 12</p>
<p>18. Go the the security pages</p>
<p>This should show all subjects are now secured..</p>
<p><a href="http://codetorment.com/wp-content/uploads/Screenshot-XAMPP-for-Linux-1.7.1-Mozilla-Firefox-4.png"><img class="alignnone size-medium wp-image-44" title="Secured" src="http://codetorment.com/wp-content/uploads/Screenshot-XAMPP-for-Linux-1.7.1-Mozilla-Firefox-4-300x293.png" alt="Secured" width="300" height="293" /></a></p>
<p>Place content you want to add to the webserver in the root web directory located in</p>
<pre><code style="color: white;">
/opt/lamp/htdocs
</code></pre>
<p>&nbsp;<br />
To make things easier we&#8217;ll add a link to the htdocs folder to a folder in our home directory.</p>
<p>You can do this in a terminal by typing</p>
<pre><code style="color: white;">
mkdir ~/public_html
</code></pre>
<p>&nbsp;<br />
Or just right-click in your home folder and create a new folder named &#8216;public_html&#8217;</p>
<p>19. Now we&#8217;ll make a link from the new folder to /opt/lampp/htdocs , open a terminal and enter</p>
<pre><code style="color: white;">
sudo ln -s ~/public_html /opt/lampp/htdocs/
</code></pre>
<p>&nbsp;<br />
20. To setup permissions for the htdocs folder, go to the terminal (still logged in as super user) and type</p>
<pre><code style="color: white;">
chown  yourusername -R /opt/lampp/htdocs
</code></pre>
<p>&nbsp;<br />
This changes the ownership of the htdocs folder to your user, the -R option makes the command recursive so all permissions of folders and files inside htdocs are changed aswell.<br />
&nbsp;</p>
<div><span style="color: #ffcc33;">Note that depending on the applications used to interact with content on your server, permissions might need to be altered to grant read/write access.</span></div>
<p>&nbsp;</p>
<h4>Congratulations that was it! Well sort of&#8230;</h4>
<p>&nbsp;<br />
After restarting your computer you have to manually start the server by entering</p>
<pre><code style="color: white;">
/opt/lampp/lampp start
</code></pre>
<p>&nbsp;<br />
in a terminal.</p>
<p>EDIT: MiD-AwE pointed out he had to install the ia32 libraries when installing XAMPP on Ubuntu 9.10 64-bit. The ia32 library is needed when installing a 64-bit version on a AMD64 or <a href="http://nl.wikipedia.org/wiki/IA-64">ia64</a>-system.</p>
<p>To do this open a terminal and type</p>
<pre><code style="color: white;">
sudo apt-get install ia32-libs
</code></pre>
<p>&nbsp;</p>
<h3>If you want xampp to automatically start at boottime, follow  <a href="http://www.apachefriends.org/en/faq-xampp-linux.html#fsl">these</a> steps.</h3>
<p>&nbsp;<br />
EDIT : Or as MiD-AwE suggested you can go to System &gt; Preferences and add an entry</p>
<pre><code style="color: white;">
 /opt/lampp/lampp start
</code></pre>
<p>&nbsp;<br />
to “Startup Applications”</p>
<h3>If you want to use a GUI to start and stop xampp do the following:</h3>
<p>1. Open a terminal and type</p>
<pre><code style="color: white;">
sudo gedit ~/.local/share/applications/xampp-control-panel.desktop
</code></pre>
<p>&nbsp;<br />
2. Paste this code in the new empty file in gedit</p>
<pre><code style="color: white;">
[Desktop Entry]
Comment=Start and Stop XAMPP
Name=XAMPP Control Panel
Exec=gksudo python /opt/lampp/share/xampp-control-panel/xampp-control-panel.py
Icon[en_CA]=/usr/share/icons/Humanity/devices/24/network-wired.svg
Encoding=UTF-8
Terminal=false
Name[en_CA]=XAMPP Control Panel
Comment[en_CA]=Start and Stop XAMPP
Type=Application
Icon=/usr/share/icons/Humanity/devices/24/network-wired.svg
</code></pre>
<p>&nbsp;
<div>If you want to use another icon or if you are using another theme then make sure to change the path to the icon you want to showing up for the xampp control panel.</div>
<p>Change this line (twice) to match the location of the icon you want to use.</p>
<pre><code style="color: white;">
Icon[en_CA]=/usr/share/icons/Humanity/devices/24/network-wired.svg
</code></pre>
<p>&nbsp;<br />
3. The xampp control panel should now show up in Applications &gt; Other</p>
<p>You should get to see something like this :</p>
<p><a href="http://codetorment.com/wp-content/uploads/Screenshot.png"><img class="alignnone size-full wp-image-48" title="XAMPP control panel" src="http://codetorment.com/wp-content/uploads/Screenshot.png" alt="XAMPP control panel" width="268" height="256" /></a></p>
<h4>That was it!</h4>
<p>Now run along and go do something usefull</p>
<p><a title="home" href="http://www.codetorment.com/" target="_self">Back to homepage</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.codetorment.com/2009/10/20/guide-install-xampp-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
	</channel>
</rss>
