<?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>Gunnewiek.com</title>
	<atom:link href="http://gunnewiek.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://gunnewiek.com</link>
	<description>Gunnewiek.com is an programming, technology and Linux blog maintained by Phil Gunnewiek.</description>
	<lastBuildDate>Mon, 11 Jul 2011 19:49:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Arduino Basics 2: Potentiometers, Buttons and Switches</title>
		<link>http://gunnewiek.com/2011/arduino-basics-2-potentiometers-buttons-and-switches/</link>
		<comments>http://gunnewiek.com/2011/arduino-basics-2-potentiometers-buttons-and-switches/#comments</comments>
		<pubDate>Sat, 11 Jun 2011 18:43:55 +0000</pubDate>
		<dc:creator>Phil Gunnewiek</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[Button]]></category>
		<category><![CDATA[potentiometer]]></category>
		<category><![CDATA[Switch]]></category>

		<guid isPermaLink="false">http://gunnewiek.com/?p=195</guid>
		<description><![CDATA[Some basic user controls that you will find on almost any electronic device include buttons, switches and potentiometers. These are used in almost any electronic system that requires user input of any kind. I have covered how to use each of these inputs and how to use them to control LEDs or just gather their [...]]]></description>
			<content:encoded><![CDATA[<p>Some basic user controls that you will find on almost any electronic device include buttons, switches and potentiometers. These are used in almost any electronic system that requires user input of any kind. I have covered how to use each of these inputs and how to use them to control LEDs or just gather their data.</p>
<p><span id="more-195"></span></p>
<h2>Buttons</h2>
<p>There are two main types of buttons, one with 2 pins, and one with 4 pins.</p>
<p><img class="alignnone" title="Basic Buttons for Arduino" src="http://www.gunnewiek.com/images/arduino/Basic_Button/Basic_Button_Picture.JPG" alt="" width="640" height="480" /></p>
<p>As you can hopefully see, the 4 pin button will fit on a breadboard much more nicely, so I will use that but the 2 pin button can be connected with some basic wire. With the 4 pin button you just need to use the two pins on the same side, and it doesn't matter which side is positive/negative.</p>
<p>Here is a basic circuit diagram for the button:</p>
<p><img class="alignnone" title="Button Circuit Arduino" src="http://www.gunnewiek.com/images/arduino/Basic_Button/ButtonDiagram.png" alt="" width="313" height="346" /></p>
<p>We can use the serial monitor to tell us when the button is pressed. An LED could be used as well but this is a good introduction on how to use the serial monitor. The code can be downloaded below. When the button is pressed it will print a message to the serial monitor which can be opened with Ctrl+Shift+M in the Arduino IDE.</p>
<p><a href="http://gunnewiek.com/files/arduino/Basic_Button.pde">Download Code</a></p>
<h2>Switches</h2>
<p>Switches are pretty basic, and an example can be seen below. I have attached some basic 22AWG to it so that it is easier to hook up to my breadboard.</p>
<p><img class="alignnone" title="Basic Switch" src="http://www.gunnewiek.com/images/arduino/Basic_Switch/PIC_0035.JPG" alt="" width="640" height="480" /></p>
<p>I will use the same basic circuit that was used with the Basic LED program, but a switch is added before the resistor as seen below:</p>
<p><img class="alignnone" title="Switch Diagram Arduino" src="http://www.gunnewiek.com/images/arduino/Basic_Switch/SwitchDiagram.png" alt="" width="421" height="420" /></p>
<p>Here is a video of it in action:</p>
<p><span class="youtube">
<iframe title="YouTube video player" class="youtube-player" type="text/html" width="640" height="505" src="http://www.youtube.com/embed/Lo2p9SurjYk?color1=d6d6d6&amp;color2=f0f0f0&amp;border=0&amp;fs=1&amp;hl=en&amp;loop=0&amp;showinfo=0&amp;iv_load_policy=3&amp;showsearch=0&amp;rel=1" frameborder="0" allowfullscreen></iframe>
</span><p><a href="http://www.youtube.com/watch?v=Lo2p9SurjYk">www.youtube.com/watch?v=Lo2p9SurjYk</a></p></p>
<p><a href="http://gunnewiek.com/files/arduino/Basic_Switch.pde">Download Code</a></p>
<h2>Potentiometers</h2>
<p>Potentiometers have 3 pins: positive, negative and position (usually the middle). This can be seen below:</p>
<p><img class="alignnone" title="Basic Potentiometer" src="http://www.gunnewiek.com/images/arduino/Basic_Potentiometer/Basic_Potentiometer_Picture.JPG" alt="" width="640" height="480" /></p>
<p>The outside potentiometer pins gets hooked up to the 5V power pin and ground while the middle one gets hooked up to A0. The LED gets hooked up exactly the same as before.</p>
<p>In my example I control the brightness of an LED with the potentiometer. This can be seen below:</p>
<p><span class="youtube">
<iframe title="YouTube video player" class="youtube-player" type="text/html" width="640" height="505" src="http://www.youtube.com/embed/2LfX82yS7UQ?color1=d6d6d6&amp;color2=f0f0f0&amp;border=0&amp;fs=1&amp;hl=en&amp;loop=0&amp;showinfo=0&amp;iv_load_policy=3&amp;showsearch=0&amp;rel=1" frameborder="0" allowfullscreen></iframe>
</span><p><a href="http://www.youtube.com/watch?v=2LfX82yS7UQ">www.youtube.com/watch?v=2LfX82yS7UQ</a></p></p>
<p><a href="http://gunnewiek.com/files/arduino/Basic_Potentiometer.pde">Download Code</a></p>
]]></content:encoded>
			<wfw:commentRss>http://gunnewiek.com/2011/arduino-basics-2-potentiometers-buttons-and-switches/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open .pde files with Arduino IDE in Linux</title>
		<link>http://gunnewiek.com/2011/open-pde-files-with-arduino-ide-in-linux/</link>
		<comments>http://gunnewiek.com/2011/open-pde-files-with-arduino-ide-in-linux/#comments</comments>
		<pubDate>Mon, 30 May 2011 22:35:42 +0000</pubDate>
		<dc:creator>Phil Gunnewiek</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[.pde]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://gunnewiek.com/?p=247</guid>
		<description><![CDATA[After I installed the Arduino IDE I found out that I could not run "arduino test.pde" to open an existing sketch. The previous command would just open a blank sketch. To fix this problem you have to edit the Arduino startup script, which in my case is located at "/usr/share/arduino/arduino". The last line of this [...]]]></description>
			<content:encoded><![CDATA[<p>After I installed the Arduino IDE I found out that I could not run "arduino test.pde" to open an existing sketch. The previous command would just open a blank sketch.</p>
<p>To fix this problem you have to edit the Arduino startup script, which in my case is located at "/usr/share/arduino/arduino". The last line of this file looks like this:</p>
<p>java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel processing.app.Base</p>
<p>and it needs to be changed to this:</p>
<p>java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel processing.app.Base "$*"</p>
<p>Finally I had to change my "/usr/bin/arduino" from:</p>
<p>/usr/share/arduino/arduino</p>
<p>to</p>
<p>/usr/share/arduino/arduino "$*"</p>
<p>Now you should be able to associate .pde files with the Arduino IDE and have them automatically open.</p>
]]></content:encoded>
			<wfw:commentRss>http://gunnewiek.com/2011/open-pde-files-with-arduino-ide-in-linux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Arduino Basics 1: LEDs</title>
		<link>http://gunnewiek.com/2011/arduino-basics-1-leds/</link>
		<comments>http://gunnewiek.com/2011/arduino-basics-1-leds/#comments</comments>
		<pubDate>Sun, 29 May 2011 18:06:55 +0000</pubDate>
		<dc:creator>Phil Gunnewiek</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[LEDs]]></category>
		<category><![CDATA[multiple LEDs]]></category>

		<guid isPermaLink="false">http://gunnewiek.com/?p=168</guid>
		<description><![CDATA[I am going to start with some very simple programs, but hopefully build and program them in such a way that they can easily be reused in larger programs without too much modification. LEDs are used in many applications and can be very useful when debugging. Turning on an LED can be compared to writing [...]]]></description>
			<content:encoded><![CDATA[<p>I am going to start with some very simple programs, but hopefully build and program them in such a way that they can easily be reused in larger programs without too much modification.</p>
<p>LEDs are used in many applications and can be very useful when debugging. Turning on an LED can be compared to writing "Hello World" or some other test statement to the terminal window. LEDs have a positive end (the longer one) and a negative end (shorter). When hooking up a circuit make sure that the LED has the correct orientation.</p>
<p><span id="more-168"></span>My LEDs are rated at 3.4V, and the Arduino supplies 5V at the DC output. Most LEDs require about 20mA of current to flow through them. If you allow more current to flow through then it will shine brighter but it will also burn out / stop working more quickly. If you allow less then the LED will not shine as brightly and if using a battery it will last longer. Using Ohm's Law we can calculate:</p>
<p>(V<sub>2</sub>-V<sub>1</sub>) / I = R</p>
<p>and substituting in we get:</p>
<p>(5-3.4)/0.02 = 80Ω</p>
<p>I will use a 100Ω resistor because that is the closest thing I have over 80, and as mentioned previously this will just cause the LED to shine a little dimmer. I have created the circuit diagram below for a single LED:</p>
<p><img class="alignnone" title="Arduino - Single LED" src="http://gunnewiek.com/images/arduino/Basic_LED/SingleLED.png" alt="Basic Arduino circuit with one LED" width="421" height="420" /></p>
<p>To turn on multiple LEDs from the same source, they must be connected in parallel (each with its own resistor). This can be seen below:</p>
<p><img class="alignnone" title="Arduino - Multiple LEDs" src="http://gunnewiek.com/images/arduino/Basic_LED/MultipleLEDs.png" alt="Basic Arduino circuit with multiple LEDs" width="692" height="421" /></p>
<p>You can see below how I hooked up my circuit (sorry for the poor picture quality). There are multiple ways to do it, so it doesn't have to look exactly like this.</p>
<p><img class="alignnone" title="Multiple LEDs on a breadboard with an Arduino" src="http://gunnewiek.com/images/arduino/Basic_LED/Basic_LED_Picture.jpg" alt="Multiple LEDs on a breadboard with an Arduino" width="600" height="421" /></p>
<p>Now that the circuit is all hooked up it is time to program it. With only LEDs there isn't much to do, so we will just turn it on / off with a delay. The code and circuit diagrams can be downloaded below. I tried to make the functions as modular as possible even though they are not really needed in this basic example.</p>
<p><a href="http://gunnewiek.com/files/arduino/Basic_LED.pde" target="_blank">Download</a></p>
<p>And here is a video of it in action:</p>
<p><span class="youtube">
<iframe title="YouTube video player" class="youtube-player" type="text/html" width="640" height="505" src="http://www.youtube.com/embed/G0p374ncKGY?color1=d6d6d6&amp;color2=f0f0f0&amp;border=0&amp;fs=1&amp;hl=en&amp;loop=0&amp;showinfo=0&amp;iv_load_policy=3&amp;showsearch=0&amp;rel=1" frameborder="0" allowfullscreen></iframe>
</span><p><a href="http://www.youtube.com/watch?v=G0p374ncKGY">www.youtube.com/watch?v=G0p374ncKGY</a></p></p>
]]></content:encoded>
			<wfw:commentRss>http://gunnewiek.com/2011/arduino-basics-1-leds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C++ Grid Class</title>
		<link>http://gunnewiek.com/2011/c-grid-class/</link>
		<comments>http://gunnewiek.com/2011/c-grid-class/#comments</comments>
		<pubDate>Sun, 01 May 2011 14:41:47 +0000</pubDate>
		<dc:creator>Phil Gunnewiek</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[grid]]></category>

		<guid isPermaLink="false">http://gunnewiek.com/?p=166</guid>
		<description><![CDATA[This is a basic grid class which I plan to use for some simple games including a rewrite of my Connect Four game. This grid class uses std::vector for easy memory management. Accessors: height() width() retrieve(n, m) print() Mutalators: insert(n, m, x) resize(n, m) Download]]></description>
			<content:encoded><![CDATA[<p>This is a basic grid class which I plan to use for some simple games including a rewrite of my Connect Four game. This grid class uses std::vector for easy memory management.</p>
<p>Accessors:</p>
<ul>
<li>height()</li>
<li>width()</li>
<li>retrieve(n, m)</li>
<li>print()</li>
</ul>
<p>Mutalators:</p>
<ul>
<li>insert(n, m, x)</li>
<li>resize(n, m)</li>
</ul>
<p><a href="http://gunnewiek.com/files/classes/Grid.h">Download</a></p>
]]></content:encoded>
			<wfw:commentRss>http://gunnewiek.com/2011/c-grid-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino</title>
		<link>http://gunnewiek.com/2011/arduino/</link>
		<comments>http://gunnewiek.com/2011/arduino/#comments</comments>
		<pubDate>Thu, 28 Apr 2011 01:30:16 +0000</pubDate>
		<dc:creator>Phil Gunnewiek</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[arduino]]></category>

		<guid isPermaLink="false">http://gunnewiek.com/?p=162</guid>
		<description><![CDATA[I am now an owner of an Arduino Uno. I also purchased several 'value packs' of various components, LEDs and some basic sensors. I was able to find some buttons and switches and motors laying around and in old electronics. I have a good theoretical knowledge of circuits, and after two classes on them I [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" title="Arduino Uno" src="http://gunnewiek.com/images/arduino/Arduino.jpg" alt="Arduino Uno" width="188" height="252" />I am now an owner of an Arduino Uno. I also purchased several 'value packs' of various components, LEDs and some basic sensors. I was able to find some buttons and switches and motors laying around and in old electronics.</p>
<p>I have a good theoretical knowledge of circuits, and after two classes on them I can tell you the voltage or current at any point in almost any circuit. I know opamps and transistors like the back of my hand, but designing a circuit from scratch was surprisingly never covered.</p>
<p>After some quick reading and installing the software it seems like the Arduino programming language is heavily based off of C/C++ which is good because I don't have to relearn any syntax.</p>
<p>Hopefully I will start posting some basic accomplishments soon such as turning on LEDs.</p>
]]></content:encoded>
			<wfw:commentRss>http://gunnewiek.com/2011/arduino/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Data Structures and Algorithms</title>
		<link>http://gunnewiek.com/2011/data-structures-and-algorithms/</link>
		<comments>http://gunnewiek.com/2011/data-structures-and-algorithms/#comments</comments>
		<pubDate>Wed, 27 Apr 2011 14:06:59 +0000</pubDate>
		<dc:creator>Phil Gunnewiek</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[algorithms]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[B Tree]]></category>
		<category><![CDATA[data structures]]></category>
		<category><![CDATA[hash table]]></category>
		<category><![CDATA[linked list]]></category>
		<category><![CDATA[stack]]></category>
		<category><![CDATA[weighted graph]]></category>

		<guid isPermaLink="false">http://gunnewiek.com/blog/?p=114</guid>
		<description><![CDATA[I just finished taking a data structures and algorithms course which was very cool and broadened my perspective when it comes to programming. Although we only got to program a small portion of the things we learned about, I feel that what I did implement is clean and efficient. Single Linked List with Single Node [...]]]></description>
			<content:encoded><![CDATA[<p>I just finished taking a data structures and algorithms course which was very cool and broadened my perspective when it comes to programming. Although we only got to program a small portion of the things we learned about, I feel that what I did implement is clean and efficient.</p>
<ul>
<li><a href="http://gunnewiek.com/files/ece250/Single_list.h">Single Linked List</a> with <a href="http://gunnewiek.com/files/ece250/Single_node.h">Single Node</a></li>
<li><a href="http://gunnewiek.com/files/ece250/Undo_redo_stack.h">Undo Redo Stack</a> (uses Single Linked List and Single Node)</li>
<li><a href="http://gunnewiek.com/files/ece250/Double_list.h">Double Linked List</a> with <a href="http://gunnewiek.com/files/ece250/Double_node.h">Double Node</a></li>
<li><a href="http://gunnewiek.com/files/ece250/Dynamic_queue_as_array.h">Dynamic Queue as Array</a></li>
<li><a href="http://gunnewiek.com/files/ece250/B_tree.h">B Tree </a>with <a href="http://gunnewiek.com/files/ece250/B_tree_node.h">B Tree Node</a></li>
<li><a href="http://gunnewiek.com/files/ece250/Dynamic_double_hash_table.h">Dynamic Double Hash Table</a></li>
<li><a href="http://gunnewiek.com/files/ece250/Weighted_graph.h">Weighted Graph</a> (can find the minimum spanning tree)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://gunnewiek.com/2011/data-structures-and-algorithms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mouse Jail for Twinview</title>
		<link>http://gunnewiek.com/2011/mouse-jail-for-twinview/</link>
		<comments>http://gunnewiek.com/2011/mouse-jail-for-twinview/#comments</comments>
		<pubDate>Tue, 26 Apr 2011 17:45:41 +0000</pubDate>
		<dc:creator>Phil Gunnewiek</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[gaming]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mousejail]]></category>
		<category><![CDATA[multiple monitors]]></category>
		<category><![CDATA[twinview]]></category>

		<guid isPermaLink="false">http://gunnewiek.com/blog/?p=39</guid>
		<description><![CDATA[This program will trap the mouse within certain screen coordinates. It can keep your mouse in 1 screen when trying to play games so it doesn't mess up side scrolling and eliminates the possibility of clicking on other windows which makes the game lose focus. The original version of MouseJail was designed to work with [...]]]></description>
			<content:encoded><![CDATA[<p>This program will trap the mouse within certain screen coordinates.                It can keep your mouse in 1 screen when trying to play  games so it doesn't mess up side scrolling and eliminates the  possibility of clicking on other windows which makes the game lose  focus.                The original version of MouseJail was designed to work  with xinerama, but I modified it so that it works with nVidia's  twinview.                I personally use Openbox and it works great.</p>
<p>To use, just compile it and then run it like this (use appropriate coordinates):<br />
./Jail 0 0 1920 1080<br />
Note that the mouse might jump outside those boundaries for quick moments so use:<br />
./Jail 0 0 1917 1080</p>
<p><a href="http://gunnewiek.com/files/scripts/twinviewmousejail.tar.gz">Download</a></p>
]]></content:encoded>
			<wfw:commentRss>http://gunnewiek.com/2011/mouse-jail-for-twinview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Connect Four</title>
		<link>http://gunnewiek.com/2011/connect-four/</link>
		<comments>http://gunnewiek.com/2011/connect-four/#comments</comments>
		<pubDate>Tue, 26 Apr 2011 17:32:12 +0000</pubDate>
		<dc:creator>Phil Gunnewiek</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[connect four]]></category>

		<guid isPermaLink="false">http://gunnewiek.com/blog/?p=31</guid>
		<description><![CDATA[This is a console Connect Four game. This initial release only has support for a two player game, but I plan to add AI soon. Once I become more comfortable with C++ I will try to add graphics. Download &#160;]]></description>
			<content:encoded><![CDATA[<p>This is a console Connect Four game. 			 This initial release only has support for a two player game, but I plan to add AI soon. Once I become more comfortable with C++ I will try to add graphics.</p>
<p><a href="http://gunnewiek.com/files/projects/ConnectFour.tar.gz">Download</a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://gunnewiek.com/2011/connect-four/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DI.FM Radio Player</title>
		<link>http://gunnewiek.com/2011/di-fm-radio-player/</link>
		<comments>http://gunnewiek.com/2011/di-fm-radio-player/#comments</comments>
		<pubDate>Tue, 26 Apr 2011 17:25:04 +0000</pubDate>
		<dc:creator>Phil Gunnewiek</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[di.fm]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[radio player]]></category>

		<guid isPermaLink="false">http://gunnewiek.com/blog/?p=23</guid>
		<description><![CDATA[This project is basically a port of Manadar's windows edition. All the streams and stream names can be customized easily via a ~/.streams file, and the amount you wish to have is flexible. You are also not limited to di.fm streams, any stream should work. This project is still in an alpha stage. As of [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" title="DI.FM radio player" src="http://gunnewiek.com/images/projects/di.fm_player.png" alt="DI.FM radio player" width="215" height="334" />This project is basically a port of Manadar's <a href="http://manadar.com/#53">windows edition</a>.</p>
<p>All the streams and stream names can be customized  easily via a ~/.streams file, and the amount you wish to have is flexible.                 You are also not limited to di.fm streams, any stream  should work.</p>
<p>This project is still in an <strong>alpha</strong> stage. As of now:<br />
-Recording doesn't work.<br />
-Statusbar text doesn't scroll.<br />
-The ~/.streams file is  in the same directory as the script to make testing easier.</p>
<p>If you find a bug, problem, something you would like to  have or a way to fix the above problems please let me know.</p>
<p>Python, wxpython and gstreamer are required.</p>
<p><a href="http://gunnewiek.com/files/projects/di.fm.tar.gz">Download</a></p>
]]></content:encoded>
			<wfw:commentRss>http://gunnewiek.com/2011/di-fm-radio-player/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Netcfg Auto Connect</title>
		<link>http://gunnewiek.com/2011/netcfg-auto-connect/</link>
		<comments>http://gunnewiek.com/2011/netcfg-auto-connect/#comments</comments>
		<pubDate>Tue, 26 Apr 2011 16:41:00 +0000</pubDate>
		<dc:creator>Phil Gunnewiek</dc:creator>
				<category><![CDATA[Scripts]]></category>
		<category><![CDATA[connect]]></category>
		<category><![CDATA[netcfg]]></category>

		<guid isPermaLink="false">http://gunnewiek.com/blog/?p=35</guid>
		<description><![CDATA[This script scans to see what networks are available, then checks if any of the networks are ones you want to auto connect to. If this is the case it will connect to the approperiate netcfg profile. I start this script in my /etc/rc.local. Pick what is best for your distribution. #! /bin/bash sudo ifconfig [...]]]></description>
			<content:encoded><![CDATA[<p>This script scans to see what networks are available, then checks if any of the networks are ones you want to auto connect to.                If this is the case it will connect to the approperiate netcfg profile.<br />
I start this script in my /etc/rc.local. Pick what is best for your distribution.</p>
<p><span id="more-35"></span></p>
<pre>#! /bin/bash
sudo ifconfig wlan0 up
sudo iwlist wlan0 scan | grep ESSID: | while read line
do
    essid="${line:7:$((${#line}-7-1))}"
    #echo $essid

    if [ "$essid" == 'WLAN' ]; then
        sudo netcfg maya
    fi
    if [ "$essid" == 'eduroam' ]; then
        sudo netcfg eduroam
    fi
    if [ "$essid" == 'D3GN_SSID0' ]; then
        sudo netcfg home
    fi
    if [ "$essid" == 'Gunnewiek' ]; then
        sudo netcfg Gunnewiek
    fi
done</pre>
]]></content:encoded>
			<wfw:commentRss>http://gunnewiek.com/2011/netcfg-auto-connect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- www.000webhost.com Analytics Code -->
<script type="text/javascript" src="http://analytics.hosting24.com/count.php"></script>
<noscript><a href="http://www.hosting24.com/"><img src="http://analytics.hosting24.com/count.php" alt="web hosting" /></a></noscript>
<!-- End Of Analytics Code -->

