<?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>HackDevDotCom &#187; General</title>
	<atom:link href="http://hackdev.com/category/general/feed/" rel="self" type="application/rss+xml" />
	<link>http://hackdev.com</link>
	<description>Hacked Development</description>
	<lastBuildDate>Thu, 10 Jun 2010 22:55:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Just a general update&#8230;</title>
		<link>http://hackdev.com/2010/04/just-a-general-update/</link>
		<comments>http://hackdev.com/2010/04/just-a-general-update/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 20:48:55 +0000</pubDate>
		<dc:creator>Gues7</dc:creator>
				<category><![CDATA[Fixes / Patches]]></category>
		<category><![CDATA[Gaming]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Mancave]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://hackdev.com/?p=144</guid>
		<description><![CDATA[It&#8217;s been quite a while since I&#8217;ve posted  anything, I&#8217;ve been very busy lately but since I&#8217;m out sick now for a few days, I have a bit of time to update&#8230; If you have tried to play Fallout 3 using an Asus branded NVidia card, and it crashes stating &#8220;Fallout 3 has stopped working&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been quite a while since I&#8217;ve posted  anything, I&#8217;ve been very busy lately but since I&#8217;m out sick now for a few days, I have a bit of time to update&#8230;</p>
<p>If you have tried to play Fallout 3 using an Asus branded NVidia card, and it crashes stating &#8220;Fallout 3 has stopped working&#8221; every time you try to load a new game, check and see if you have Asus Gamer OSD installed, if you do, get rid of it. Something the overlay does interferes with the game  and causes this to happen&#8230;</p>
<p>I have been doing some more work on the lighting for the man cave so I have some Python code that will pull the Average color (not the most predominant, yet, wont be hard, but I am lazy) so here it is, please keep in mind its not nice, fast or clean&#8230; for high res images it takes a few seconds to do its thing&#8230;</p>
<p style="padding-left: 30px;">

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/env python</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># PIL Image Module Handbook - http://www.pythonware.com/library/pil/handbook/image.htm</span>
<span style="color: #808080; font-style: italic;">#</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">from</span> PIL <span style="color: #ff7700;font-weight:bold;">import</span> Image
<span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">optparse</span> <span style="color: #ff7700;font-weight:bold;">import</span> OptionParser
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> processImageAverage<span style="color: black;">&#40;</span>imageFile<span style="color: black;">&#41;</span>:
    image = Image.<span style="color: #008000;">open</span><span style="color: black;">&#40;</span>imageFile<span style="color: black;">&#41;</span>     <span style="color: #808080; font-style: italic;">#open the image for processing</span>
    pixels = <span style="color: #008000;">list</span><span style="color: black;">&#40;</span>image.<span style="color: black;">getdata</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>    <span style="color: #808080; font-style: italic;">#break the image down into a list of pixels, each pixel contains a list of red,green,blue</span>
&nbsp;
    totalpx = <span style="color: #ff4500;">0</span> <span style="color: #808080; font-style: italic;">#set some default values to start counting...</span>
    redpx = <span style="color: #ff4500;">0</span>
    greenpx = <span style="color: #ff4500;">0</span>
    bluepx = <span style="color: #ff4500;">0</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">for</span> pixel <span style="color: #ff7700;font-weight:bold;">in</span> pixels:    <span style="color: #808080; font-style: italic;">#loop through the lists and build the values.</span>
        totalpx += <span style="color: #ff4500;">1</span>
        redpx += pixel<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span>
        greenpx += pixel<span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span>
        bluepx += pixel<span style="color: black;">&#91;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span>
&nbsp;
    redavg = redpx / totalpx   <span style="color: #808080; font-style: italic;">#generate the averages</span>
    greenavg = greenpx / totalpx
    blueavg = bluepx / totalpx
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>Total Pixels:<span style="color: #000099; font-weight: bold;">\t</span>&quot;</span>, totalpx     <span style="color: #808080; font-style: italic;">#and write them out.</span>
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;Red Average:<span style="color: #000099; font-weight: bold;">\t</span>&quot;</span>, redavg
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;Green Average:<span style="color: #000099; font-weight: bold;">\t</span>&quot;</span>, greenavg
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;Blue Average:<span style="color: #000099; font-weight: bold;">\t</span>&quot;</span>, blueavg
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;HEX Color:<span style="color: #000099; font-weight: bold;">\t</span>#%x%x%x&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>redavg, greenavg, blueavg<span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> main<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
    <span style="color: #dc143c;">parser</span> = OptionParser<span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Usage: %prog source&quot;</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: black;">&#40;</span>options, arguments<span style="color: black;">&#41;</span> = <span style="color: #dc143c;">parser</span>.<span style="color: black;">parse_args</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">len</span><span style="color: black;">&#40;</span>arguments<span style="color: black;">&#41;</span> <span style="color: #66cc66;">!</span>= <span style="color: #ff4500;">1</span>:
        <span style="color: #dc143c;">parser</span>.<span style="color: black;">error</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Please specify a single input file.&quot;</span><span style="color: black;">&#41;</span>
&nbsp;
    processImageAverage<span style="color: black;">&#40;</span>arguments<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">if</span> __name__ == <span style="color: #483d8b;">&quot;__main__&quot;</span>:
    main<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

</p>
<p>I have a new job now, I&#8217;m no longer a software validation engineer (tester), I&#8217;m now an IT Support Engineer (IT Techie&#8230;) which is kinda nice&#8230;.</p>
<p>Well&#8230; that is for now&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://hackdev.com/2010/04/just-a-general-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>€1366.07 down&#8230;</title>
		<link>http://hackdev.com/2010/02/e1366-07-down/</link>
		<comments>http://hackdev.com/2010/02/e1366-07-down/#comments</comments>
		<pubDate>Sun, 14 Feb 2010 14:34:31 +0000</pubDate>
		<dc:creator>Gues7</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Mancave]]></category>

		<guid isPermaLink="false">http://hackdev.com/?p=135</guid>
		<description><![CDATA[So I have been doing some serious work on my mancave during my two weeks off, so far I have all of the walls battened, the new door fitted, and two of the walls wired for mains sockets. I have even been picking up some additional parts that we are not quite ready yet, such [...]]]></description>
			<content:encoded><![CDATA[<p>So I have been doing some serious work on my mancave during my two weeks off, so far I have all of the walls battened, the new door fitted, and two of the walls wired for mains sockets. I have even been picking up some additional parts that we are not quite ready yet, such as a roll of CAT6 cable, CAT6 wall outlets with faceplate&#8217;s, 17 double gang switched sockets and much much more&#8230; all in all its coming along nicely. No photo&#8217;s taken as of yet though, I really should have taken some at the start and all the way through as it would have been quite a good evolution slide show, but alas its too late now&#8230; we did run into a few issues though, the garage is still crammed full of stuff and there is not much room to move around in it so that has been slowing us down a lot, however there is nowhere else to put it so it has to be this way for now I&#8217;m afraid <img src='http://hackdev.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>Another issue we&#8217;ve encountered was that the cavity blocks haven&#8217;t aged all that well and are quite hard, like flint even, so masonry nails havent been working out too well on that, so as a more expensive, and time consuming work-around, we have been using nail-anchors and manually drilling for each baton&#8230; not the most fun thing in the world, but at least its progress&#8230;</p>
<p>As a side note, from working out in the cold weather all week I seem to have gotten another cold <img src='http://hackdev.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://hackdev.com/2010/02/e1366-07-down/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I Hate Webdesign</title>
		<link>http://hackdev.com/2010/02/i-hate-webdesign/</link>
		<comments>http://hackdev.com/2010/02/i-hate-webdesign/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 17:22:29 +0000</pubDate>
		<dc:creator>Gues7</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://hackdev.com/?p=132</guid>
		<description><![CDATA[Did I mention lately that I hate webdesign? no? let me explain&#8230; While I am quite proficient at writing backend systems in PHP and mySQL, or even taking an existing design and twising it around, chopping it up and changing things, I have no artistic taste when it comes to actually designing things. I have [...]]]></description>
			<content:encoded><![CDATA[<p>Did I mention lately that I hate webdesign? no? let me explain&#8230;</p>
<p>While I am quite proficient at writing backend systems in PHP and mySQL, or even taking an existing design and twising it around, chopping it up and changing things, I have no artistic taste when it comes to actually designing things. I have taken on a job for a client, and I now feel that I am out of my depth, it doesnt help that I have absolutely no specification what so ever, none, nada, ziltch&#8230; but even still, I should be able to come up with something suitable, but I cant, its just not coming to me&#8230; It&#8217;s not a particularly complex website, its basicly an online brochure for a catering company so I have settled on using the website baker CMS for doing all of the backend management, it doesnt really need anything more complex than that to do what it needs to do, however this means that 90% of the work to be done on this site is purely design, look and feel&#8230; and I hate it.</p>
<p>So far, my design consists of a solid, light coffee color background, some red (to slightly pinkish) text, and a white box with a border&#8230; really&#8230; is this the best I can do?</p>
]]></content:encoded>
			<wfw:commentRss>http://hackdev.com/2010/02/i-hate-webdesign/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>To the Man Cave!</title>
		<link>http://hackdev.com/2010/01/to-the-man-cave/</link>
		<comments>http://hackdev.com/2010/01/to-the-man-cave/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 02:30:40 +0000</pubDate>
		<dc:creator>Gues7</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://hackdev.com/?p=120</guid>
		<description><![CDATA[UPDATED: Syntax Highlighting for code blocks. Purpose: A man cave is loosely a male-only space to retreat to, watch sports matches, or play video games. According to psychiatrist and author Scott Haltzman, it is important for a man to have a place to call his own, referring to a male area to retreat to. Some psychologists [...]]]></description>
			<content:encoded><![CDATA[<p><em><span style="color: #c0c0c0;">UPDATED: Syntax Highlighting for code blocks.</span></em></p>
<p>Purpose: A man cave is loosely a male-only space to retreat to, watch sports matches, or play video games. According to psychiatrist and author Scott Haltzman, it is important for a man to have a place to call his own, referring to a male area to retreat to. Some psychologists claim that a man cave can provide refuge from stressful surroundings and be beneficial to marriage.</p>
<p style="text-align: right;">Via: <a href="http://en.wikipedia.org/wiki/Man_cave">Wikipedia</a></p>
<p style="text-align: left;">So I have committed myself to building one of these, at present, I have a 15&#8242; x 15&#8242; garage space, ready for the taking. I plan on turning the space into a male friendly (read: full of beer) area with a home cinema setup, a bar and some cool and interesting technology. To date, I already have the Projector &amp; Screen, some basic fittings, some decent insulation for the roof, 2x Wireless access points with which I will be building a P-T-P link, and lots of ideas&#8230;</p>
<p style="text-align: left;">One of the things that I want to do is to install an all LED lighting system composed of high output RGB LED&#8217;s &#8211; My idea for this is to use an I2C bus linking all of the LED modules with the info and the power over CAT5; as such, I have begun development. I bought some small 3W RGB LED&#8217;s from <a href="http://www.dealextreme.com/default.dx/r.79901961">Deal Extreme</a> for developing my proof of concept modules. My PoC so far is comprised of an Seeeduino Mega as the LED controller and unfortunately as I havent made as much progress with my BifferBoard as of yet, I&#8217;m currently using a Bus Pirate (v2go) for controlling the I2C bus, the protocol Im using is quite simple, you send the write address of the unit, a # character and then the hexadecimal RGB values, as such the full pallet of colors is available and can be looked up online or from the majority of graphics programs&#8230; There are a few points to consider for what you want to use as the LED Controller, if I beef up my C skills, I do intend on moving away from the Arduino plaform and migrating to a smaller lower specced Atmel or PIC uC &#8211; resulting in lower costs&#8230; the controller so far has a few features&#8230;</p>
<ul>
<li style="text-align: left;">The Default (Startup) Color is programmable from the I2C bus so if there is a power failure etc&#8230; the lights will return automatically to a known state.</li>
<li>The controller is bus configurable to be Common Cathode OR Common Anode</li>
<li>There is more to add here as I complete them, such as disco mode or fade mode, or pre-defined sequences&#8230;</li>
</ul>
<p>I have taken a photo of the test setup I have at present and will provide the sourcode below, I have also been working on a Processing application to play with the idea of doing something similar to the Phillips Ambilight tv where depending on the image on my screen, the lights in the mancave will be a particular color, while I will also post the code for this, its not commented, or pretty, or even working at this point so your on your own with it&#8230; I will update as time goes on&#8230; anyways, enough jibber jabber, time for some actuall images and real code&#8230;</p>
<p>General (Outdated)  Flowchart for the controller:</p>
<p><a href="http://hackdev.com/wp-content/uploads/2010/01/light_controller_flowchart.png"><img class="aligncenter size-medium wp-image-125" title="light_controller_flowchart" src="http://hackdev.com/wp-content/uploads/2010/01/light_controller_flowchart-300x294.png" alt="" width="300" height="294" /></a></p>
<p>Picture of the test setup&#8230;</p>
<p><a href="http://hackdev.com/wp-content/uploads/2010/01/P240110_01.47.jpg"><img class="aligncenter size-medium wp-image-124" title="P240110_01.47" src="http://hackdev.com/wp-content/uploads/2010/01/P240110_01.47-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>And as promised, here is the source for the Arduino:</p>
<p style="padding-left: 30px;">

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* 
&nbsp;
Arduino I2C RGB LED Controller
&nbsp;
EEPROM Map:
  0x00  configuration block
  0x01  red pwm value
  0x02  green pwm value
  0x03  blue pwm value
&nbsp;
*/</span>
&nbsp;
<span style="color: #339933;">#include</span>
<span style="color: #339933;">#include </span>
&nbsp;
<span style="color: #666666; font-style: italic;">//PIN Definitions</span>
<span style="color: #339933;">#define addr0      2</span>
<span style="color: #339933;">#define addr1      3</span>
<span style="color: #339933;">#define addr2      4</span>
<span style="color: #339933;">#define addr3      5</span>
<span style="color: #339933;">#define redPin     7</span>
<span style="color: #339933;">#define greenPin   8</span>
<span style="color: #339933;">#define bluePin    9</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Global Variables</span>
byte redPWM <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
byte greenPWM <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
byte bluePWM <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
byte configBlock <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
byte i2cAddress <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
byte i2cData<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">4</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #0000dd;">0</span><span style="color: #339933;">,</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">,</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">,</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
boolean processQueue <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">false</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #993333;">void</span> setup<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">//Set PIN I/O's</span>
  pinMode<span style="color: #009900;">&#40;</span>redPin<span style="color: #339933;">,</span> OUTPUT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  pinMode<span style="color: #009900;">&#40;</span>greenPin<span style="color: #339933;">,</span> OUTPUT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  pinMode<span style="color: #009900;">&#40;</span>bluePin<span style="color: #339933;">,</span> OUTPUT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  pinMode<span style="color: #009900;">&#40;</span>addr0<span style="color: #339933;">,</span> INPUT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  pinMode<span style="color: #009900;">&#40;</span>addr1<span style="color: #339933;">,</span> INPUT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  pinMode<span style="color: #009900;">&#40;</span>addr2<span style="color: #339933;">,</span> INPUT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  pinMode<span style="color: #009900;">&#40;</span>addr3<span style="color: #339933;">,</span> INPUT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">//Enable internal pullups</span>
  digitalWrite<span style="color: #009900;">&#40;</span>addr0<span style="color: #339933;">,</span> <span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  digitalWrite<span style="color: #009900;">&#40;</span>addr1<span style="color: #339933;">,</span> <span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  digitalWrite<span style="color: #009900;">&#40;</span>addr2<span style="color: #339933;">,</span> <span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  digitalWrite<span style="color: #009900;">&#40;</span>addr3<span style="color: #339933;">,</span> <span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">//Set I2C Address...</span>
  <span style="color: #666666; font-style: italic;">//i2cAddress = (digitalRead(addr0) | digitalRead(addr1) | digitalRead(addr2) | digitalRead(addr3));</span>
  i2cAddress <span style="color: #339933;">=</span> <span style="color: #0000dd;">7</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">//Register an event to fire when we receive I2C data then join the bus...</span>
  Wire.<span style="color: #202020;">onReceive</span><span style="color: #009900;">&#40;</span>grabData<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  Wire.<span style="color: #202020;">begin</span><span style="color: #009900;">&#40;</span>i2cAddress<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">//Grab previous settings from EEPROM...</span>
  configBlock <span style="color: #339933;">=</span> EEPROM.<span style="color: #202020;">read</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  redPWM <span style="color: #339933;">=</span> EEPROM.<span style="color: #202020;">read</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  greenPWM <span style="color: #339933;">=</span> EEPROM.<span style="color: #202020;">read</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  bluePWM <span style="color: #339933;">=</span> EEPROM.<span style="color: #202020;">read</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">//Set the PWM outputs for the LED(s)</span>
  setPWM<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">//I think we're ready to enter the main loop now...</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> grabData<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> data<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #993333;">int</span> i <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span>Wire.<span style="color: #202020;">available</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     i2cData<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> Wire.<span style="color: #202020;">receive</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     i<span style="color: #339933;">++;</span>
  <span style="color: #009900;">&#125;</span>
  processQueue <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">true</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> setPWM<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>configBlock <span style="color: #339933;">==</span> <span style="color: #ff0000;">'A'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    analogWrite<span style="color: #009900;">&#40;</span>redPin<span style="color: #339933;">,</span> <span style="color: #0000dd;">255</span> <span style="color: #339933;">-</span> redPWM<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    analogWrite<span style="color: #009900;">&#40;</span>greenPin<span style="color: #339933;">,</span> <span style="color: #0000dd;">255</span> <span style="color: #339933;">-</span> greenPWM<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    analogWrite<span style="color: #009900;">&#40;</span>bluePin<span style="color: #339933;">,</span> <span style="color: #0000dd;">255</span> <span style="color: #339933;">-</span> bluePWM<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
    analogWrite<span style="color: #009900;">&#40;</span>redPin<span style="color: #339933;">,</span> redPWM<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    analogWrite<span style="color: #009900;">&#40;</span>greenPin<span style="color: #339933;">,</span> greenPWM<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    analogWrite<span style="color: #009900;">&#40;</span>bluePin<span style="color: #339933;">,</span> bluePWM<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> updateEEPROM<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  EEPROM.<span style="color: #202020;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">0</span><span style="color: #339933;">,</span> configBlock<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  EEPROM.<span style="color: #202020;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #339933;">,</span> redPWM<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  EEPROM.<span style="color: #202020;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">2</span><span style="color: #339933;">,</span> bluePWM<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  EEPROM.<span style="color: #202020;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">3</span><span style="color: #339933;">,</span> greenPWM<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> loop<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #666666; font-style: italic;">//Check to see if we have something to do...</span>
  <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span>processQueue <span style="color: #339933;">==</span> <span style="color: #000000; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">//Do nothing... but do it quickly!</span>
    delay<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #b1b100;">switch</span><span style="color: #009900;">&#40;</span>i2cData<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">case</span> <span style="color: #ff0000;">'#'</span><span style="color: #339933;">:</span>
      <span style="color: #666666; font-style: italic;">//we have a color</span>
      redPWM <span style="color: #339933;">=</span> i2cData<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
      greenPWM <span style="color: #339933;">=</span> i2cData<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
      bluePWM <span style="color: #339933;">=</span> i2cData<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">3</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
      setPWM<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">case</span> <span style="color: #ff0000;">'D'</span><span style="color: #339933;">:</span>
      <span style="color: #666666; font-style: italic;">//We're setting the default startup color...</span>
      redPWM <span style="color: #339933;">=</span> i2cData<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
      greenPWM <span style="color: #339933;">=</span> i2cData<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
      bluePWM <span style="color: #339933;">=</span> i2cData<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">3</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
      updateEEPROM<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      setPWM<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">case</span> <span style="color: #ff0000;">'C'</span><span style="color: #339933;">:</span>
      <span style="color: #666666; font-style: italic;">//we're changing the LED type</span>
      <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>i2cData<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #ff0000;">'A'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        configBlock <span style="color: #339933;">=</span> <span style="color: #ff0000;">'A'</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
        configBlock <span style="color: #339933;">=</span> <span style="color: #ff0000;">'C'</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
      updateEEPROM<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">default</span><span style="color: #339933;">:</span>
      <span style="color: #666666; font-style: italic;">//do nothing...</span>
      <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  processQueue <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>And here is the source for Processing:</p>
<p style="padding-left: 30px;">

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">processing.serial.*</span><span style="color: #339933;">;</span>
&nbsp;
PImage myImage<span style="color: #339933;">;</span>
Serial myPort<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">float</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> redpx<span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">float</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> greenpx<span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">float</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> bluepx<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">float</span> redtotal<span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">float</span> greentotal<span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">float</span> bluetotal<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">int</span> imgWidth<span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">int</span> imgHeight<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">void</span> setup<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">//println(Serial.list());</span>
    myPort <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Serial<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span>, <span style="color: #0000ff;">&quot;COM13&quot;</span>, <span style="color: #cc66cc;">115200</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    myImage <span style="color: #339933;">=</span> loadImage<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;red.jpg&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    myImage.<span style="color: #006633;">loadPixels</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    redpx <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #000066; font-weight: bold;">float</span><span style="color: #009900;">&#91;</span>myImage.<span style="color: #006633;">pixels</span>.<span style="color: #006633;">length</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    greenpx <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #000066; font-weight: bold;">float</span><span style="color: #009900;">&#91;</span>myImage.<span style="color: #006633;">pixels</span>.<span style="color: #006633;">length</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    bluepx <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #000066; font-weight: bold;">float</span><span style="color: #009900;">&#91;</span>myImage.<span style="color: #006633;">pixels</span>.<span style="color: #006633;">length</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #cc66cc;">16</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;</span> 0xFF<span style="color: #339933;">;</span>
        greenpx<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> myImage.<span style="color: #006633;">pixels</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #cc66cc;">8</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;</span> 0xFF<span style="color: #339933;">;</span>
        bluepx<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> myImage.<span style="color: #006633;">pixels</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;</span> 0xFF<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> r<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> r <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> redpx.<span style="color: #006633;">length</span><span style="color: #339933;">;</span> r<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        redtotal <span style="color: #339933;">+=</span> redpx<span style="color: #009900;">&#91;</span>r<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    redtotal <span style="color: #339933;">=</span> redtotal <span style="color: #339933;">/</span> redpx.<span style="color: #006633;">length</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> g<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> g <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> greenpx.<span style="color: #006633;">length</span><span style="color: #339933;">;</span> g<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        greentotal <span style="color: #339933;">+=</span> greenpx<span style="color: #009900;">&#91;</span>g<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    greentotal <span style="color: #339933;">=</span> greentotal <span style="color: #339933;">/</span> greenpx.<span style="color: #006633;">length</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> b<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> b <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> bluepx.<span style="color: #006633;">length</span><span style="color: #339933;">;</span> b<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        bluetotal <span style="color: #339933;">+=</span> bluepx<span style="color: #009900;">&#91;</span>b<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    bluetotal <span style="color: #339933;">=</span> bluetotal <span style="color: #339933;">/</span> bluepx.<span style="color: #006633;">length</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">int</span> serialData<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span> <span style="color: #cc66cc;">91</span>, <span style="color: #cc66cc;">32</span>, <span style="color: #cc66cc;">48</span>, <span style="color: #cc66cc;">120</span>, <span style="color: #cc66cc;">48</span>, <span style="color: #cc66cc;">69</span>, <span style="color: #cc66cc;">32</span>, <span style="color: #cc66cc;">48</span>, <span style="color: #cc66cc;">120</span>, <span style="color: #cc66cc;">50</span>, <span style="color: #cc66cc;">51</span>, <span style="color: #cc66cc;">32</span>, floor<span style="color: #009900;">&#40;</span>redtotal<span style="color: #009900;">&#41;</span>, <span style="color: #cc66cc;">32</span>, floor<span style="color: #009900;">&#40;</span>greentotal<span style="color: #009900;">&#41;</span>, <span style="color: #cc66cc;">32</span>, floor<span style="color: #009900;">&#40;</span>bluetotal<span style="color: #009900;">&#41;</span>, <span style="color: #cc66cc;">32</span>, <span style="color: #cc66cc;">93</span>, <span style="color: #cc66cc;">13</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>      <span style="color: #666666; font-style: italic;">//used for i2c control through a bus pirate</span>
    <span style="color: #666666; font-style: italic;">//int serialData[] = { 'R', floor(redtotal), 'G', floor(greentotal), 'B', floor(bluetotal), 'C', 'A', 'U' };      //used for serial control through rs232</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> j<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> j <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
       <span style="color: #003399;">String</span> inBuffer <span style="color: #339933;">=</span> myPort.<span style="color: #006633;">readString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
       <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>inBuffer <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        println<span style="color: #009900;">&#40;</span>inBuffer<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
       <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    myImage.<span style="color: #006633;">updatePixels</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://hackdev.com/2010/01/to-the-man-cave/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>It made me LOL</title>
		<link>http://hackdev.com/2009/12/it-made-me-lol/</link>
		<comments>http://hackdev.com/2009/12/it-made-me-lol/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 04:15:01 +0000</pubDate>
		<dc:creator>Gues7</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://hackdev.com/?p=117</guid>
		<description><![CDATA[Just spotted this video online and found it quite funny&#8230;]]></description>
			<content:encoded><![CDATA[<p>Just spotted this video online and found it quite funny&#8230;</p>
<p style="text-align: center;"><img title="YouTube" src="http://i28.tinypic.com/machfq.jpg" alt="" width="400" height="319" /></p>
]]></content:encoded>
			<wfw:commentRss>http://hackdev.com/2009/12/it-made-me-lol/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Teamspeak 3 server on Ubuntu</title>
		<link>http://hackdev.com/2009/12/teamspeak-3-server-on-ubuntu/</link>
		<comments>http://hackdev.com/2009/12/teamspeak-3-server-on-ubuntu/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 10:59:31 +0000</pubDate>
		<dc:creator>Gues7</dc:creator>
				<category><![CDATA[Gaming]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Roll your own:]]></category>
		<category><![CDATA[Server]]></category>

		<guid isPermaLink="false">http://hackdev.com/?p=100</guid>
		<description><![CDATA[Well, Teamspeak have finally released their new server platform for a public BETA test, although supposedly in this state the code is not meant to be stable, it appears to be working quite well on my Ubuntu server here at home. This is what I done to get it up and running &#8211; as a [...]]]></description>
			<content:encoded><![CDATA[<p>Well, Teamspeak have finally released their new server platform for a public BETA test, although supposedly in this state the code is not meant to be stable, it appears to be working quite well on my Ubuntu server here at home. This is what I done to get it up and running &#8211; as a service from init.d no less.  Before doing any of the following steps, please be aware that this <strong>IS</strong> BETA code and <strong>WILL</strong> contain bugs that may introduce security issues.  The first step is to create a user that the Teamspeak executable can run as, this user should have a complex password for security reasons. This user will also not require a shell account.</p>
<blockquote><p>sudo adduser teamspeak</p></blockquote>
<p>Fill in the questions presented by the adduser application.</p>
<blockquote><p>sudo usermod -s /bin/false teamspeak</p></blockquote>
<p>The above command will change the users shell to be /bin/false ie. no shell.  Now it is time to go and get Teamspeak&#8230; visit http://www.goteamspeak.com and find the correct package for the architecture you wish to use ie. Teamspeak_3.0.0-Beta5-32bit&#8230;</p>
<blockquote><p>wget http://ftp.4players.de/pub/hosted/ts3/releases/beta-5/teamspeak3-server_linux-x86-3.0.0-beta5.tar.gz tar -zxvf teamspeak3-server_linux-x86-3.0.0-beta5.tar.gz</p></blockquote>
<p>Now its time to move the new TS3 directory to its new home&#8230;</p>
<blockquote><p>sudo mv ./teamspeak3-server_linux-x86-3.0.0-beta5 /opt/TS3 sudo chown -R teamspeak /opt/TS3</p></blockquote>
<p>The above will place TS3 in /opt/TS3 and give ownership of the contents to the user teamspeak.  It is now possible to run Teamspeak, however as veteran Teamspeak users will know, the first time you run the Teamspeak server you are presented with a username/password combo that cannot be recovered without resetting the server. In TS3 you will also be presented with a `token` (all of this is described in the Teamspeak documentation). So for the first run, the following command will allow you to gather these details, they should be noted carefully for future reference.</p>
<blockquote><p>sudo start-stop-daemon &#8211;chuid teamspeak &#8211;chdir /opt/TS3 &#8211;start &#8211;exec /opt/TS3/ts3server_linux_x86</p></blockquote>
<p>From this, you should see the serveradmin user and password. You can now ^C that and be returned to the normal shell, if you cat /opt/TS3/logs/* you will be presented with the token you require to obtain server-admin status on the new server. The last part is to create a script for /etc/init.d/ to launch Teamspeak each time the system is booted to the correct runlevel. /etc/init.d/skeleton provides a suitable framework for this, here is the script I am using, just about&#8230; <strong>NOTE:</strong> WordPress does not want to format this correctly for me, as such, here is a link to the file in a tar archive. If you follow these instructions and are running a 32bit server, the following file will work out of the box. <a href="http://hackdev.com/wp-content/uploads/2009/12/teamspeak.gz">/etc/init.d/teamspeak</a> This file must then be made executable with</p>
<blockquote><p>sudo chmod +x /etc/init.d/teamspeak</p></blockquote>
<p>And finally, the init file must be symlinked to each of the runlevel start dirs using the following&#8230;</p>
<blockquote><p>sudo ln -s ../init.d/teamspeak /etc/rc0.d/K21teamspeak sudo ln -s ../init.d/teamspeak /etc/rc1.d/K21teamspeak sudo ln -s ../init.d/teamspeak /etc/rc2.d/S21teamspeak sudo ln -s ../init.d/teamspeak /etc/rc3.d/S21teamspeak sudo ln -s ../init.d/teamspeak /etc/rc4.d/S21teamspeak sudo ln -s ../init.d/teamspeak /etc/rc5.d/S21teamspeak sudo ln -s ../init.d/teamspeak /etc/rc6.d/K21teamspeak</p></blockquote>
<p>Viola, you should now have a working Teamspeak 3 server.</p>
<p>BOOTNOTE:</p>
<blockquote><p>For my initial install, and for the basis of the majority of <a href="http://ubuntuforums.org/showthread.php?t=236834" target="_blank">this</a>, I used this as a reference.  Items listed in <strong>bold</strong> with <strong>**</strong> are most likely not the correct file names for the command, I am not close to my server or an available shell to pull the correct parameters at present, but I will update ASAP.  As an additional side note, my first impressions of TS3 are very good&#8230; It has tons of new features, looks good and the voice quality is very good indeed. My only concern is however the permissions system is very bulky, difficult to understand, and unless you are reasonably familiar with administering a Teamspeak server already, the documentation is not as straight forward as people believe. Still, however, a great job. Well done Teamspeak 3 development team!</p></blockquote>
<p><em><strong>UPDATE:</strong></em> Fixed formatting issue, kinda&#8230; provided link to pastebin.</p>
<p><strong>UPDATE:</strong> Fixed information regarding server executable. Added /etc/init.d/teamspeak file, available for download <a href="http://hackdev.com/wp-content/uploads/2009/12/teamspeak.gz">here</a>, removed pastebin link.</p>
<blockquote>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 744px; width: 1px; height: 1px;">
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 498px; text-align: left;" dir="ltr">#! /bin/sh
### BEGIN INIT INFO
# Provides:          teamspeak
# Required-Start:    networking
# Required-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:      S 0 1 6
# Short-Description: TeamSpeak Server Daemon
# Description:       Starts/Stops/Restarts the TeamSpeak Server Daemon
### END INIT INFO

set -e

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="TeamSpeak Server"
NAME=teamspeak
USER=teamspeak
DIR=/opt/tss2_rc2
DAEMON=$DIR/server_linux
#PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0

d_start() {
        start-stop-daemon --start --quiet \
                --chuid $USER \
                --chdir $DIR \
                --exec $DAEMON \
                &gt; /dev/null \
                || echo -n " already running"
}

d_stop() {
        start-stop-daemon --stop --quiet \
                --chuid $USER \
                --chdir $DIR \
                --exec $DAEMON \
                || echo -n " not running"
}

case "$1" in
  start)
        echo -n "Starting $DESC: $NAME"
        d_start
        echo "."
        ;;
  stop)
        echo -n "Stopping $DESC: $NAME"
        d_stop
        echo "."
        ;;
  restart|force-reload)
        echo -n "Restarting $DESC: $NAME"
        d_stop
        sleep 15
        d_start
        echo "."
        ;;
  *)
        echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" &gt;&amp;2
        exit 3
        ;;
esac

exit 0</pre>
</div>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://hackdev.com/2009/12/teamspeak-3-server-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Welcome&#8230; I guess&#8230;</title>
		<link>http://hackdev.com/2009/04/welcome-i-guess/</link>
		<comments>http://hackdev.com/2009/04/welcome-i-guess/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 03:28:15 +0000</pubDate>
		<dc:creator>Gues7</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://hackdev.com/?p=3</guid>
		<description><![CDATA[Hi There, Just to keep y&#8217;all in the loop, this is going to be my blog of sorts, but for the most part its just going to be used to track my various how-to&#8217;s and to keep notes on stuff that I&#8217;ve done. Feel free to follow it or read it daily (if I can [...]]]></description>
			<content:encoded><![CDATA[<p>Hi There,</p>
<p>Just to keep y&#8217;all in the loop, this is going to be my blog of sorts, but for the most part its just going to be used to track my various how-to&#8217;s and to keep notes on stuff that I&#8217;ve done. Feel free to follow it or read it daily (if I can type that much&#8230;) and I hope if you do, you might learn something from it.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://hackdev.com/2009/04/welcome-i-guess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
