<?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>Cyborg Workshop</title>
	<atom:link href="http://cyborgworkshop.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://cyborgworkshop.org</link>
	<description>Bluring the line</description>
	<lastBuildDate>Thu, 06 Jun 2013 03:25:01 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Find websites that exist on an IP using bing</title>
		<link>http://cyborgworkshop.org/2013/06/05/find-websites-that-exist-on-an-ip-using-bing/</link>
		<comments>http://cyborgworkshop.org/2013/06/05/find-websites-that-exist-on-an-ip-using-bing/#comments</comments>
		<pubDate>Thu, 06 Jun 2013 03:25:01 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://cyborgworkshop.org/?p=863</guid>
		<description><![CDATA[This is a horrible one liner, but bing has a nice search feature where you can put in the IP of a web host and find all of the sites that live there. The search string is just ip:111.112.113.114,  but &#8230; <a href="http://cyborgworkshop.org/2013/06/05/find-websites-that-exist-on-an-ip-using-bing/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>This is a horrible one liner, but bing has a nice search feature where you can put in the IP of a web host and find all of the sites that live there. The search string is just ip:111.112.113.114,  but if you want that data to be put into a script, you can use this really terrible oneliner.<br />
<code>wget -q http://bing.com/search?q=ip:1.2.3.4\&amp;go=\&amp;count=50\&amp;FORM=QBHL\&amp;qs=n\&amp;first= -O- | grep --only-matching --perl-regexp "http(s?):\/\/[^ \"\(\)\&lt;\&gt;/]*" |grep -i -v "w3\|live\|msn\|microsoft\|bing" |sort |uniq<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://cyborgworkshop.org/2013/06/05/find-websites-that-exist-on-an-ip-using-bing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mobile Storm Telemetry</title>
		<link>http://cyborgworkshop.org/2013/06/01/mobile-storm-telemetry/</link>
		<comments>http://cyborgworkshop.org/2013/06/01/mobile-storm-telemetry/#comments</comments>
		<pubDate>Sun, 02 Jun 2013 01:37:21 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Hardware]]></category>

		<guid isPermaLink="false">http://cyborgworkshop.org/?p=859</guid>
		<description><![CDATA[Storms are pretty incredible qualitatively, but they become even cooler when you can quantify them. How about that for a nerdy start ? In 2013 we started to pilot a new DIY telemetry platform that I put together based on &#8230; <a href="http://cyborgworkshop.org/2013/06/01/mobile-storm-telemetry/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://i0.wp.com/stormtrackone.com/wp-content/uploads/2013/04/IMG_20130402_2059311.jpg"><img class="alignleft size-thumbnail wp-image-549" alt="Telemetry" src="http://i0.wp.com/stormtrackone.com/wp-content/uploads/2013/04/IMG_20130402_2059311.jpg?resize=150%2C150" data-recalc-dims="1" /></a> Storms are pretty incredible qualitatively, but they become even cooler when you can quantify them. How about that for a nerdy start ? In 2013 we started to pilot a new DIY telemetry platform that I put together based on the Arduino and an inspeed anemometer. The finished product can measure wind speed, temperature, temperature corrected barometric pressure and humidity as well as calculate dew point and heat index. All of the measurements are stored along with GPS data to an SD card and sent as CSV data over a serial or bluetooth link. Windspeed, pressure, temperature and dewpoint are also displayed in realtime on a 16&#215;2 LCD screen.</p>
<h2>Bill of Material</h2>
<p>I tried to source all of the parts from one supplier so you could just add to cart and go. I picked <a href="http://www.sparkfun.com">sparkfun</a> as I really like their gear and how they give back to the opensource community.</p>
<ul>
<li><a href="https://www.sparkfun.com/products/11021">Arduino Uno ($29.95)</a> really most Arduinos will do but the Uno has 32k of Flash and my code might not fit in 14k arduino .</li>
<li><a href="https://www.sparkfun.com/products/9569">HIH-4030 ($16.95)</a> based humidity sensor. This is an analog sensor that is very easy to interface.</li>
<li><a href="https://www.sparkfun.com/products/11282">BMP085 ($19.95)</a> Barometric pressure sensor. This one is i2c based, so if your Arduino doesn&#8217;t have i2c ports you&#8217;ll need to find a replacement. <strong>NOTE THAT THIS IS A 3.3V SENSOR AND NOT 5 VOLTS</strong></li>
<li><a href="https://www.sparkfun.com/products/245">DS18b20 ($4.95)</a> 1-wire temperature sensor.</li>
<li><a href="https://www.sparkfun.com/products/10097">16&#215;2 LCD ($24.95)</a> This is optional if you don&#8217;t want the real time display, but come on, who doesn&#8217;t want a real time display!</li>
<li><a href="https://www.sparkfun.com/products/9312">latching hall effect sensor ($1)</a> This is optional. If you buy the vortex anemometer, it has a reed sensor that would also work.</li>
<li><a href="https://www.sparkfun.com/products/10709">GPS Shield ($79.95)</a> This is optional if you don&#8217;t want GPS coordinates or if you are using the serial output to push the data to another device that already has GPS data</li>
<li><a href="https://www.sparkfun.com/products/544">SD card adapter ($9.95)</a> This is optional if you are not wanting to log data or are using the serial output for logging //Not Working</li>
<li><a href="http://www.inspeed.com/anemometers/Vortex_Wind_Sensor.asp">Inspeed Vortex Anemometer ($55)</a> any pulse based anemometer will work, but the vortex is very solid, has easily replaceable parts and is already at a great price.</li>
</ul>
<p>Grand total you&#8217;re looking at $243 for the full package, or $128 if you don&#8217;t need GPS, the LCD screen or the SD card. Sparkfun sells each of these pieces like building blocks, so they have a fair amount of price overhead compared to the raw components. If you wanted to build this entirely on your own, you could get the price down to under $100 with all features enabled, but you&#8217;re going to need to know how to surface mount solder.</p>
<h2>What&#8217;s it do?</h2>
<p>The arduino is the brains of the whole system. At boot, it initializes all of the sensors and then starts looping over the humidity, temperature and pressure sensors reading each one. After it has a good reading of those three sensors, a series of calculations are made to figure out the dewpoint, heat index and temperature adjusted pressure. A routine is tied to interrupt 0 that is triggered for every rotation of the anemometer that increments a counter and measures the number of rotations that have occurred in the last second. That number is then used to calculate windspeed based on 1hz = 2.5mph . The LCD screen is updated once every second and the serial data is updated at around 2hz.</p>
<h2>Wiring it up</h2>
<p>I will do a sketch and upload it shortly</p>
<h2>Basic code with no SD card</h2>
<p>This is the code that you would use if you built this system with no SD Card. It needs at least Arduino 1.0, The Dallas OneWire library and at least 14k of storage. You&#8217;ll need at least an arduino with 18k of flash and not a Mega or Leonardo. The code will run on a mega/leonardo, but the pins will be all messed up and you might damage the 3.3v sensor. The GPS also needs to be set to pins 4 and 5, see sparkfuns documentation on how to move those pins. Be warned, I am NOT a developer so this code will be far from efficient.</p>
<pre><span style="color: #7e7e7e;">/*Mobile weather station using Arduino and some sensors</span>
<span style="color: #7e7e7e;"> Can be used with an anemometer, temp, humidity and pressure sensors</span>
<span style="color: #7e7e7e;"> anemometer is interrupt driven off a Hall sensor</span>
<span style="color: #7e7e7e;"> 2013/05/14  removed DS18S20 requirement, now just using the temp off </span>
<span style="color: #7e7e7e;"> the bmp085</span>
<span style="color: #7e7e7e;"> 2013/05/15  removed an overflow condition in the anemometer. Migrated to the </span>
<span style="color: #7e7e7e;"> adafruit bmp085 library. added a blinky light for the anemometer</span>
<span style="color: #7e7e7e;"> */</span>

#include &lt;Adafruit_BMP085.h&gt;
#include &lt;<span style="color: #cc6600;">OneWire</span>.h&gt;
#include &lt;<span style="color: #cc6600;">Wire</span>.h&gt;
#include &lt;SoftwareSerial.h&gt;
#include &lt;math.h&gt;
#include &lt;<span style="color: #cc6600;">TinyGPS</span>.h&gt;

<span style="color: #7e7e7e;">//LCD stuff</span>
SoftwareSerial lcd(6, 7);  <span style="color: #7e7e7e;">//LCD on D6 and D7</span>

<span style="color: #7e7e7e;">//Temperature stuff</span>
<span style="color: #cc6600;">float</span> Tempc;

<span style="color: #7e7e7e;">//Anemometer stuff</span>
<span style="color: #cc6600;">unsigned</span> <span style="color: #cc6600;">long</span> rpm;
<span style="color: #cc6600;">unsigned</span> <span style="color: #cc6600;">long</span> timeold;
<span style="color: #cc6600;">unsigned</span> <span style="color: #cc6600;">long</span> rpmcount; 
<span style="color: #cc6600;">int</span> led = 13; <span style="color: #7e7e7e;">//Pin an LED is hooked to that flashes with each anemometer RPM</span>

<span style="color: #7e7e7e;">//Humidity stuff</span>
<span style="color: #cc6600;">const</span> <span style="color: #cc6600;">int</span> HIHPin = 0; <span style="color: #7e7e7e;">//analog pin 0</span>
<span style="color: #cc6600;">float</span> RH;
<span style="color: #cc6600;">float</span> temperature;
<span style="color: #cc6600;">float</span> max_voltage;
<span style="color: #cc6600;">float</span> dewpoint = 0;
<span style="color: #cc6600;">float</span> td;

<span style="color: #7e7e7e;">//Barometer stuff</span>
Adafruit_BMP085 bmp;
<span style="color: #cc6600;">long</span> pressure;

<span style="color: #7e7e7e;">//GPS Stuff</span>
#define RXPIN 5 <span style="color: #7e7e7e;">// Set GPS Receiver RX </span>
#define TXPIN 4 <span style="color: #7e7e7e;">//Set GPS Receiver TX </span>
#define GPSBAUD 4800 <span style="color: #7e7e7e;">//Not your serial coms, this is for GPS com</span>
<span style="color: #cc6600;">int</span> year;
<span style="color: #cc6600;">byte</span> month, day, hour, minute, second;
<span style="color: #cc6600;">float</span> latitude, longitude;
<span style="color: #cc6600;">unsigned</span> <span style="color: #cc6600;">long</span> age;
<span style="color: #cc6600;">TinyGPS</span> gps;  <span style="color: #7e7e7e;">//initialize the tinygps library and use it</span>
SoftwareSerial uart_gps(RXPIN, TXPIN); <span style="color: #7e7e7e;">//Init GPS software UART</span>

<span style="color: #cc6600;">void</span> rpm_irq() {              <span style="color: #7e7e7e;">//Routine that is run when INT is trigged, Don't add too much stuff here</span>
   rpmcount++;                <span style="color: #7e7e7e;">//increments a counter and flashes a light</span>
   <span style="color: #cc6600;">digitalWrite</span>(led,<span style="color: #006699;">HIGH</span>);
   <span style="color: #cc6600;">delay</span>(50);
   <span style="color: #cc6600;">digitalWrite</span>(led,<span style="color: #006699;">LOW</span>);
}

<span style="color: #cc6600;">void</span> <span style="color: #cc6600;"><b>setup</b></span>() {
  <span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">begin</span>(115200); 
  <span style="color: #cc6600;">attachInterrupt</span>(0, rpm_irq, <span style="color: #006699;">FALLING</span>); 
  <span style="color: #cc6600;">Wire</span>.<span style="color: #cc6600;">begin</span>();
  <span style="color: #cc6600;">if</span> (!bmp.<span style="color: #cc6600;">begin</span>()) {
    <span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">println</span>(<span style="color: #006699;">"Could not find a valid BMP085 sensor, check wiring!"</span>);
    lcd.<span style="color: #cc6600;">print</span>(<span style="color: #006699;">"NO SENSOR FOUND"</span>);
  <span style="color: #cc6600;">while</span> (1) {}
  }
  lcd.<span style="color: #cc6600;">begin</span>(9600);  <span style="color: #7e7e7e;">//Start the LCD at 9600 baud</span>
  clearDisplay();  <span style="color: #7e7e7e;">//Clear the display</span>
  setLCDCursor(2);  <span style="color: #7e7e7e;">//set cursor to the 1st line</span>
  lcd.<span style="color: #cc6600;">print</span>(<span style="color: #006699;">"Initializing"</span>);
  setLCDCursor(16);  <span style="color: #7e7e7e;">//Set the cursor to the beginning of the 2nd line</span>
  lcd.<span style="color: #cc6600;">print</span>(<span style="color: #006699;">"Please wait..."</span>);
  uart_gps.<span style="color: #cc6600;">begin</span>(GPSBAUD);  <span style="color: #7e7e7e;">//start GPS</span>
  <span style="color: #7e7e7e;">//Flash the backlight:</span>
  <span style="color: #cc6600;">for</span> (<span style="color: #cc6600;">int</span> i=0; i&lt;3; i++)
  {
    setBacklight(0);
    <span style="color: #cc6600;">delay</span>(250);
    setBacklight(255);
    <span style="color: #cc6600;">delay</span>(250);
  }
  <span style="color: #cc6600;">pinMode</span>(led, <span style="color: #006699;">OUTPUT</span>);
}

<span style="color: #cc6600;">void</span> <span style="color: #cc6600;"><b>loop</b></span>(){  
  <span style="color: #7e7e7e;">//Update wind speed every 3 RPM</span>
  <span style="color: #7e7e7e;">//if(rpmcount&gt;=3) {</span>
  <span style="color: #7e7e7e;">//  rpm=(2500*rpmcount)/((millis()-timeold));  //Convert RPM to MPH basde on 1hz=2.5mph</span>
  <span style="color: #7e7e7e;">//  timeold = millis(); //count the ms spent in IRQ</span>
  <span style="color: #7e7e7e;">//  rpmcount = 0;</span>
 <span style="color: #7e7e7e;">// }</span>
  <span style="color: #7e7e7e;">//update most displayed parameters every second</span>
  <span style="color: #cc6600;">if</span> (!(<span style="color: #cc6600;">millis</span>() % 1000))
  {
    rpm=(2500*rpmcount)/((<span style="color: #cc6600;">millis</span>()-timeold));  <span style="color: #7e7e7e;">//Convert RPM to MPH basde on 1hz=2.5mph</span>
    timeold = <span style="color: #cc6600;">millis</span>(); <span style="color: #7e7e7e;">//count the ms spent in IRQ</span>
    rpmcount = 0;
    pressure = bmp.readPressure();
    <span style="color: #cc6600;">float</span> temperature = getTemp();
    <span style="color: #cc6600;">float</span> DewPoint = ReadDewpoint(temperature);
    RH=ReadHumidity();
    clearDisplay();  <span style="color: #7e7e7e;">//Clear the display</span>
    setLCDCursor(3);  <span style="color: #7e7e7e;">//set cursor to 1</span>
    setLCDCursor(0);  <span style="color: #7e7e7e;">//set cursor to 1</span>
    lcd.<span style="color: #cc6600;">print</span>(rpm,<span style="color: #006699;">DEC</span>);
    lcd.<span style="color: #cc6600;">print</span>(<span style="color: #006699;">" MPH "</span>); <span style="color: #7e7e7e;">//print data to the LCD</span>
    lcd.<span style="color: #cc6600;">print</span>(pressure);
    lcd.<span style="color: #cc6600;">print</span>(<span style="color: #006699;">" pa"</span>);
    setLCDCursor(16);  <span style="color: #7e7e7e;">//Set cursor to the 3rd spot, 1st line</span>
    lcd.<span style="color: #cc6600;">print</span>(temperature);
    lcd.<span style="color: #cc6600;">print</span>((<span style="color: #cc6600;">char</span>)223);
    lcd.<span style="color: #cc6600;">print</span>(<span style="color: #006699;">" "</span>);
    lcd.<span style="color: #cc6600;">print</span>(DewPoint,2);
    lcd.<span style="color: #cc6600;">print</span>((<span style="color: #cc6600;">char</span>)223);
    <span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">print</span>(year, <span style="color: #006699;">DEC</span>); 
    <span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">print</span>(<span style="color: #006699;">"/"</span>);
    <span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">print</span>(month, <span style="color: #006699;">DEC</span>);
    <span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">print</span>(<span style="color: #006699;">"/"</span>); 
    <span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">print</span>(day, <span style="color: #006699;">DEC</span>);
    <span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">print</span>(<span style="color: #006699;">","</span>);
    <span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">print</span>(hour, <span style="color: #006699;">DEC</span>); 
    <span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">print</span>(<span style="color: #006699;">":"</span>); 
    <span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">print</span>(minute, <span style="color: #006699;">DEC</span>); 
    <span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">print</span>(<span style="color: #006699;">":"</span>); 
    <span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">print</span>(second, <span style="color: #006699;">DEC</span>);
    <span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">print</span>(<span style="color: #006699;">","</span>);
    <span style="color: #7e7e7e;">//Latitude </span>
    <span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">print</span>(latitude,5); 
    <span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">print</span>(<span style="color: #006699;">","</span>);
    <span style="color: #7e7e7e;">//Longitude </span>
    <span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">print</span>(longitude,5);
    <span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">print</span>(<span style="color: #006699;">","</span>);
    <span style="color: #7e7e7e;">//Altitude in meters</span>
    <span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">print</span>(gps.<span style="color: #cc6600;">f_altitude</span>());
    <span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">print</span>(<span style="color: #006699;">" m,"</span>);  
    <span style="color: #7e7e7e;">//Heading in degrees</span>
    <span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">print</span>(gps.<span style="color: #cc6600;">f_course</span>());
    <span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">print</span>(<span style="color: #006699;">" deg,"</span>); 
    <span style="color: #7e7e7e;">//Speed in KMh</span>
    <span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">print</span>(gps.<span style="color: #cc6600;">f_speed_kmph</span>());
    <span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">print</span>(<span style="color: #006699;">" KMh,"</span>);
    <span style="color: #7e7e7e;">//wind speed in MPh</span>
    <span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">print</span>(rpm,<span style="color: #006699;">DEC</span>);
    <span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">print</span>(<span style="color: #006699;">" MPH,"</span>);
    <span style="color: #7e7e7e;">//Humidity in %</span>
    <span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">print</span>(RH,4);
    <span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">print</span>(<span style="color: #006699;">" RH,"</span>);
    <span style="color: #7e7e7e;">//Temp in F</span>
    <span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">print</span>(temperature);
    <span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">print</span>(<span style="color: #006699;">" F,"</span>);
    <span style="color: #7e7e7e;">//Dewpoint in F</span>
    <span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">print</span>(DewPoint);
    <span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">print</span>(<span style="color: #006699;">" DPF,"</span>);
    <span style="color: #7e7e7e;">//Pressure in PA</span>
    <span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">print</span>(pressure);
    <span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">println</span>(<span style="color: #006699;">" pa"</span>);
  }  

    <span style="color: #7e7e7e;">//update GPS data every 10 seconds</span>
  <span style="color: #cc6600;">if</span> (!(<span style="color: #cc6600;">millis</span>() % 10000))  <span style="color: #7e7e7e;">//If it's been 10s</span>
  {

    <span style="color: #cc6600;">while</span>(uart_gps.<span style="color: #cc6600;">available</span>())     <span style="color: #7e7e7e;">// While there is data on the RX pin...</span>
  {
    <span style="color: #cc6600;">int</span> c = uart_gps.<span style="color: #cc6600;">read</span>(); 
    gps.<span style="color: #cc6600;">encode</span>(c);
  }
    gps.<span style="color: #cc6600;">f_get_position</span>(&amp;latitude, &amp;longitude, &amp;age);
    <span style="color: #cc6600;">if</span> (age == gps.<span style="color: #006699;">GPS_INVALID_AGE</span>)
    {
       lcd.<span style="color: #cc6600;">print</span>(<span style="color: #006699;">" !"</span>);
    }
    <span style="color: #cc6600;">else</span> {
      lcd.<span style="color: #cc6600;">print</span>(<span style="color: #006699;">" K"</span>);
      gps.<span style="color: #cc6600;">crack_datetime</span>(&amp;year, &amp;month, &amp;day, &amp;hour, &amp;minute, &amp;second);  
     lcd.<span style="color: #cc6600;">print</span>(<span style="color: #006699;">" K"</span>);
    }
  }
}

<span style="color: #cc6600;">void</span> setBacklight(<span style="color: #cc6600;">byte</span> brightness)
{
  lcd.<span style="color: #cc6600;">write</span>(0x80);  <span style="color: #7e7e7e;">// send the backlight command</span>
  lcd.<span style="color: #cc6600;">write</span>(brightness);  <span style="color: #7e7e7e;">// send the brightness value</span>
}

<span style="color: #cc6600;">void</span> clearDisplay()
{
  lcd.<span style="color: #cc6600;">write</span>(0xFE);  <span style="color: #7e7e7e;">// send the special command</span>
  lcd.<span style="color: #cc6600;">write</span>(0x01);  <span style="color: #7e7e7e;">// send the clear screen command</span>
}

<span style="color: #cc6600;">void</span> setLCDCursor(<span style="color: #cc6600;">byte</span> cursor_position)
{
  lcd.<span style="color: #cc6600;">write</span>(0xFE);  <span style="color: #7e7e7e;">// send the special command</span>
  lcd.<span style="color: #cc6600;">write</span>(0x80);  <span style="color: #7e7e7e;">// send the set cursor command</span>
  lcd.<span style="color: #cc6600;">write</span>(cursor_position);  <span style="color: #7e7e7e;">// send the cursor position</span>
}

<span style="color: #cc6600;">float</span> ReadHumidity()
{
  <span style="color: #7e7e7e;">//Humidity sensor is temperature sensitive and requires real temp to get an accurate value</span>
  <span style="color: #cc6600;">float</span> val = 0;
  <span style="color: #cc6600;">float</span> RH = 0;
  <span style="color: #cc6600;">float</span> voltage;
  max_voltage = (5-(0.00372549*temperature)) ; <span style="color: #7e7e7e;">// The max voltage value drops down 0.00372549 for each degree F over 32F. The voltage at 32F is 3.27 (corrected for zero precent voltage)</span>
  val = <span style="color: #cc6600;">analogRead</span>(HIHPin);
  voltage = val/1023. * max_voltage; <span style="color: #7e7e7e;">//this is calibration data, see the HIH datasheet for more info</span>
  RH = 161.0 * voltage / max_voltage - 25.8;
  RH = RH / (1.0546 - 0.0026 * (temperature - 32  * 5/9)); 
  <span style="color: #cc6600;">return</span> RH;
}

<span style="color: #cc6600;">float</span> ReadDewpoint(<span style="color: #cc6600;">float</span> temperature)
{
  <span style="color: #cc6600;">float</span> TempC;
  TempC = (temperature - 32) * 5/9;
  td = (log10(RH)-2.0)/0.4343+(17.62*TempC)/(243.12+TempC);  <span style="color: #7e7e7e;">//calculate dewpoint</span>
  dewpoint = ((243.12*td/(17.62-td) * 9/5)+32);
  <span style="color: #cc6600;">return</span> dewpoint;
}

<span style="color: #cc6600;">float</span> getTemp(){
  <span style="color: #cc6600;">float</span> TemperatureSum = bmp.<span style="color: #cc6600;">readTemperature</span>();
  TemperatureSum = (TemperatureSum *1.8) + 32;
  <span style="color: #cc6600;">return</span> TemperatureSum;

}</pre>
]]></content:encoded>
			<wfw:commentRss>http://cyborgworkshop.org/2013/06/01/mobile-storm-telemetry/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using OpenSSL to validate a webserver&#8217;s certificate</title>
		<link>http://cyborgworkshop.org/2013/03/05/using-openssl-to-validate-a-webservers-certificate/</link>
		<comments>http://cyborgworkshop.org/2013/03/05/using-openssl-to-validate-a-webservers-certificate/#comments</comments>
		<pubDate>Tue, 05 Mar 2013 12:30:30 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Best Tools]]></category>

		<guid isPermaLink="false">http://cyborgworkshop.org/?p=855</guid>
		<description><![CDATA[I don&#8217;t often have to mess with SSL, but it seems like everytime that I do, I mess something up.  Here are two OpenSSL commands that I use on a regular basis to validate that my cert is installed correctly &#8230; <a href="http://cyborgworkshop.org/2013/03/05/using-openssl-to-validate-a-webservers-certificate/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I don&#8217;t often have to mess with SSL, but it seems like everytime that I do, I mess something up.  Here are two OpenSSL commands that I use on a regular basis to validate that my cert is installed correctly and that I haven&#8217;t left weak ciphers enabled.</p>
<p>&nbsp;<br />
<code><br />
openssl s_client -connect www.google.com:443<br />
</code><br />
This connects to google.com over SSL and will display on screen and should look something like this.<br />
<block><br />
jason@boomer:~$ openssl s_client -connect google.com:443<br />
CONNECTED(00000003)<br />
depth=1 C = US, O = Google Inc, CN = Google Internet Authority<br />
verify error:num=20:unable to get local issuer certificate<br />
verify return:0<br />
&#8212;<br />
Certificate chain<br />
 0 s:/C=US/ST=California/L=Mountain View/O=Google Inc/CN=*.google.com<br />
   i:/C=US/O=Google Inc/CN=Google Internet Authority<br />
 1 s:/C=US/O=Google Inc/CN=Google Internet Authority<br />
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority<br />
&#8212;<br />
Server certificate<br />
&#8212;&#8211;BEGIN CERTIFICATE&#8212;&#8211;<br />
&#8230;<br />
</block></p>
<p>Another command I&#8217;ll run is to make sure weak SSL ciphers aren&#8217;t enabled on my hosts, so using the same command but adding -cipher LOW<br />
<block><br />
<code><br />
jason@boomer:~$ openssl s_client -connect google.com:443 -cipher LOW<br />
</code><br />
CONNECTED(00000003)<br />
139786025997984:error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure:s23_clnt.c:741:<br />
&#8212;<br />
no peer certificate available<br />
&#8212;<br />
No client certificate CA names sent<br />
&#8212;<br />
SSL handshake has read 7 bytes and written 70 bytes<br />
&#8212;<br />
New, (NONE), Cipher is (NONE)<br />
Secure Renegotiation IS NOT supported<br />
Compression: NONE<br />
Expansion: NONE<br />
</block></p>
]]></content:encoded>
			<wfw:commentRss>http://cyborgworkshop.org/2013/03/05/using-openssl-to-validate-a-webservers-certificate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install the native telnet client in Windows 7</title>
		<link>http://cyborgworkshop.org/2013/01/29/install-the-native-telnet-client-in-windows-7/</link>
		<comments>http://cyborgworkshop.org/2013/01/29/install-the-native-telnet-client-in-windows-7/#comments</comments>
		<pubDate>Tue, 29 Jan 2013 15:25:33 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://cyborgworkshop.org/?p=849</guid>
		<description><![CDATA[I don&#8217;t know why, but every windows 7 machine I have used has been missing the telnet client.   Not that I use telnet for administration, but it&#8217;s a handy tool for checking if ports are open and listening.  To install &#8230; <a href="http://cyborgworkshop.org/2013/01/29/install-the-native-telnet-client-in-windows-7/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I don&#8217;t know why, but every windows 7 machine I have used has been missing the telnet client.   Not that I use telnet for administration, but it&#8217;s a handy tool for checking if ports are open and listening.  To install the telnet client, you can use the windows package manager (did you know that exists? I didn&#8217;t) and do a one line install.  Open a command prompt as admin and run the following command.<br />
<code><br />
pkgmgr /iu:"TelnetClient"</code></p>
<p><code></code>Now sit back and enjoy the awesome. Most of the time you don&#8217;t get any feedback when you do this,  so just try to run &#8216;telnet&#8217; after the command returns.</p>
]]></content:encoded>
			<wfw:commentRss>http://cyborgworkshop.org/2013/01/29/install-the-native-telnet-client-in-windows-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cleanup old software in windows 7 after service pack install</title>
		<link>http://cyborgworkshop.org/2013/01/07/cleanup-old-software-in-windows-7-after-service-pack-install/</link>
		<comments>http://cyborgworkshop.org/2013/01/07/cleanup-old-software-in-windows-7-after-service-pack-install/#comments</comments>
		<pubDate>Mon, 07 Jan 2013 16:47:35 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://cyborgworkshop.org/?p=845</guid>
		<description><![CDATA[After windows 7 service packs have been installed, a lot of stuff is still left lying around your file system in case you need to roll back.  If you are ready to commit and want to get that space back &#8230; <a href="http://cyborgworkshop.org/2013/01/07/cleanup-old-software-in-windows-7-after-service-pack-install/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>After windows 7 service packs have been installed, a lot of stuff is still left lying around your file system in case you need to roll back.  If you are ready to commit and want to get that space back you can use the Deployment Image Servicing and Management to clean your drive up. After you run this, you will no longer be able to remove your service pack.  Run the following command using an admin command prompt.</p>
<p><code><br />
DISM /online /Cleanup-Image /SpSuperseded<br />
</code></p>
<p>Will run for awhile and clean up all of those left over remnants on your drive.  Output should look something like this</p>
<p>&nbsp;<br />
Microsoft Windows [Version 6.1.7601]<br />
Copyright (c) 2009 Microsoft Corporation. All rights reserved.</p>
<p>C:\Windows\system32&gt;DISM /online /Cleanup-Image /SpSuperseded</p>
<p>Deployment Image Servicing and Management tool<br />
Version: 6.1.7600.16385</p>
<p>Image Version: 6.1.7600.16385</p>
<p>Removing backup files created during service pack installation.<br />
[==========================100.0%==========================]<br />
Service Pack Cleanup operation completed.<br />
The operation completed successfully.</p>
<p>C:\Windows\system32&gt;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://cyborgworkshop.org/2013/01/07/cleanup-old-software-in-windows-7-after-service-pack-install/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shaming those who don&#8217;t patch</title>
		<link>http://cyborgworkshop.org/2013/01/06/shaming-those-who-dont-patch/</link>
		<comments>http://cyborgworkshop.org/2013/01/06/shaming-those-who-dont-patch/#comments</comments>
		<pubDate>Mon, 07 Jan 2013 04:31:28 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://cyborgworkshop.org/?p=834</guid>
		<description><![CDATA[This webserver gets scanned and probed on a pretty regular basis by boxes that have been compromised on the internet.  I&#8217;ve taken precautions like forcing ssh logins to use 2factor authentication and making sure that I keep patched, but still &#8230; <a href="http://cyborgworkshop.org/2013/01/06/shaming-those-who-dont-patch/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>This webserver gets scanned and probed on a pretty regular basis by boxes that have been compromised on the internet.  I&#8217;ve taken precautions like forcing ssh logins to use 2factor authentication and making sure that I keep patched, but still the spammers and bots try to get in. The ones that really annoy me though are the brute force attackers. These guys try to ssh in as root a couple of hundred times in a row and fill up my logs. The boxes that they are using, as I mentioned, are hacked themselves so hacking back doesn&#8217;t really do much other then risk getting myself in trouble. So instead, I&#8217;m going for shame.  Here is how I do it. (note that this was all put together using my Nexus 7 tablet and connectbot over a hotel wifi connection on new years while I was monumentally pissed off at a brute bot, so it&#8217;s a little rough to say the least)</p>
<p>I&#8217;m using swatch in linux to monitor my auth.log file looking specifically for brute force attempts, note that this is not a complete treatise on all of my security precautions, this is just how I deal with the ones that really annoy me.  My swatch.conf is here<br />
<code><br />
watchfor /authentication failure/<br />
threshold track_by=$1, type=both, count=5, seconds=3600<br />
exec /usr/local/bin/notifyme "$_"<br />
</code></p>
<p>I&#8217;m essentially telling swatch to look for any attacker that fails more then 5 ssh attempts in 1 hour, when you find such a person send the log file entry that triggered the alert over to a script called /usr/local/bin/notifyme as a parameter.</p>
<p>notifyme is just a bash script that uses a few external programs.</p>
<li>ssmtp  (apt-get install ssmtp)</li>
<li>twidge (apt-get install twidge)</li>
<li>nmap (apt-get install nmap)</li>
<li>the nmap script http-screenshot (cd /usr/share/nmap/scripts; wget https://raw.github.com/SpiderLabs/Nmap-Tools/master/NSE/http-screenshot.nse)</li>
<li>wkhtmltoimage (https://wkhtmltopdf.googlecode.com/files/wkhtmltoimage-0.11.0_rc1-static-amd64.tar.bz2)</li>
<p>Next you just need to run twidge for the first time and set it up with your twitter account.</p>
<p>The bash script itself is pretty simple.  When it runs, it takes the string sent to it from swatch, creates an email and a tweet off of the hostname, time and user they tried to break in as and then runs a noisy and thorough nmap scan against the host attacking you. No point in being quiet, if someone triggers this alert it wasn&#8217;t by accident.   If the host is running a webserver, nmap will also create a png screenshot of the page that they are serving and store it in /tmp. I used to have it sent in an email but one time I got 4 20mb png files that came in over a 3g connection. so we don&#8217;t do that anymore.<br />
<code><br />
#!/bin/bash</p>
<p>RCPT=YOUREMAIL@YOURDOMAIN.com<br />
FROM=YOUR_SCANNING_HOST<br />
SUBJECT="ssh asshat"</p>
<p>FILE=/tmp/message.txt<br />
DATE=`echo $1 | awk {'print $1" "$2" "$3'}`<br />
HOST=`echo $1 | awk {'print $14'} | awk -F= {'print $2'}`<br />
USER=`echo $1 | awk {'print $15'} | awk -F= {'print $2'}`</p>
<p>rm $FILE</p>
<p>echo "To: $RCPT" &gt;&gt;$FILE<br />
echo "From: $FROM"&gt;&gt;$FILE<br />
echo "Subject: $SUBJECT" &gt;&gt;$FILE<br />
echo "" &gt;&gt;$FILE<br />
echo "" &gt;&gt;$FILE<br />
echo "On $DATE, asshat at $HOST tried to ssh brute force as $USER" &gt;&gt;$FILE<br />
echo "Running nmap scan..." &gt;&gt;$FILE<br />
nmap -A -P0 -sV --script=default,http-screenshot $HOST &gt;&gt;$FILE<br />
echo "---" &gt;&gt;$FILE<br />
echo "" &gt;&gt;$FILE<br />
echo "" &gt;&gt;$FILE<br />
PORTS=`cat /tmp/message.txt |grep open | awk -vORS=' ' {'print $1'}|grep -v Warning`<br />
TWEET="#WallofShame $HOST open ports $PORTS"<br />
TWEET=`echo $TWEET | cut -c-140`<br />
ssmtp -s $SUBJECT -f $FROM $RCPT &lt;$FILE<br />
twidge update "#WallOfShame $HOST tried to brute force SSH as $USER on $DATE"<br />
twidge update "$TWEET"<br />
</code><br />
If you want to take this further, you can integrate calls to shodanhq using curl that will also pull back what security vulnerabilities the attacking host&#8217;s listening services are vulnerable to. I started off initially posting this information to twitter but decided that &#8220;incite to violence&#8221; would be an appropriate description for that feature.   But lets say you felt like you needed to do that research anyways, field #3 in the nmap open port results is all you need to submit to shodan to see if your attacker has a great big hole in his boat.<br />
<code><br />
curl http://www.shodanhq.com/exploits?q=`cat $FILE | grep open | awk {'print $3'}`<br />
</code></p>
<p>Lots and lots of room for improvement, but this is where I&#8217;m starting. you can monitor my scripts output by following my twitter account at @scratchhax  </p>
]]></content:encoded>
			<wfw:commentRss>http://cyborgworkshop.org/2013/01/06/shaming-those-who-dont-patch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WHIA v3</title>
		<link>http://cyborgworkshop.org/2012/12/31/whia-v3/</link>
		<comments>http://cyborgworkshop.org/2012/12/31/whia-v3/#comments</comments>
		<pubDate>Mon, 31 Dec 2012 06:45:15 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[WHIA]]></category>

		<guid isPermaLink="false">http://cyborgworkshop.org/?p=830</guid>
		<description><![CDATA[I just brought WHIA v3 online at the house tonight. This has been pretty much a complete rewrite with the next change being to bolt a Raspberry Pi into the structure for control and safety.  I made a much smaller &#8230; <a href="http://cyborgworkshop.org/2012/12/31/whia-v3/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://i0.wp.com/cyborgworkshop.org/wordpress/wp-uploads/2012/12/WHIA_v3.jpg"><img class="size-medium wp-image-831 alignleft" alt="WHIA_v3" src="http://i0.wp.com/cyborgworkshop.org/wordpress/wp-uploads/2012/12/WHIA_v3.jpg?resize=300%2C198" data-recalc-dims="1" /></a>I just brought WHIA v3 online at the house tonight. This has been pretty much a complete rewrite with the next change being to bolt a Raspberry Pi into the structure for control and safety.  I made a much smaller shield this time with 6 pin plugs and activity LEDS per port (driven by a shift register). Connectivity is no longer over serial and instead comes from an ethernet shield and some code that creates a very small webserver. The sensors are only scanned on access now, so I&#8217;m using Zenoss to grab the data off of the controller, graph it and alarm on out of band conditions and predictive failures. The Arduino this time around is a freaklabs freakduino with a built in 802.15.4 radio. The radio is going to come in handy later on as I convert all of the curtains over to xbee. Nothing too exciting, just groundwork right now, but here is a picture of my arduino abomination.</p>
]]></content:encoded>
			<wfw:commentRss>http://cyborgworkshop.org/2012/12/31/whia-v3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to switch windows from Legacy SATA to AHCI</title>
		<link>http://cyborgworkshop.org/2012/12/27/how-to-switch-windows-from-legacy-sata-to-ahci/</link>
		<comments>http://cyborgworkshop.org/2012/12/27/how-to-switch-windows-from-legacy-sata-to-ahci/#comments</comments>
		<pubDate>Thu, 27 Dec 2012 15:54:00 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://cyborgworkshop.org/?p=825</guid>
		<description><![CDATA[If you installed windows 7 and left your BIOS drive emulation set to SATA or Legacy, you won&#8217;t be able to use TRIM support on an SSD.  If you switch your BIOS emulation over to AHCI, that still won&#8217;t allow &#8230; <a href="http://cyborgworkshop.org/2012/12/27/how-to-switch-windows-from-legacy-sata-to-ahci/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>If you installed windows 7 and left your BIOS drive emulation set to SATA or Legacy, you won&#8217;t be able to use TRIM support on an SSD.  If you switch your BIOS emulation over to AHCI, that still won&#8217;t allow for TRIM until you tell windows that you are AHCI compliant.<br />
Microsoft offers a bit of guidance to fix this</p>
<ol>
<li>open regedit and look for the following key</li>
<p><code>HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Msahci</code></p>
<li>right click on &#8220;Start&#8221; and select &#8220;Modify&#8221;</li>
<li>Change the value to be &#8220;0&#8243; and then reboot</li>
</ol>
<p>Be sure that you enabled AHCI support in your BIOS. when you reboot windows will install the AHCI drivers for your drives and then make you reboot again.</p>
]]></content:encoded>
			<wfw:commentRss>http://cyborgworkshop.org/2012/12/27/how-to-switch-windows-from-legacy-sata-to-ahci/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to tell if windows is using TRIM</title>
		<link>http://cyborgworkshop.org/2012/12/26/how-to-tell-if-windows-is-using-trim/</link>
		<comments>http://cyborgworkshop.org/2012/12/26/how-to-tell-if-windows-is-using-trim/#comments</comments>
		<pubDate>Wed, 26 Dec 2012 15:53:31 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://cyborgworkshop.org/?p=823</guid>
		<description><![CDATA[How do I know if my windows 7 install is using TRIM on my SSD? The interwebs aren&#8217;t all in agreement on this, but here is what I&#8217;ve been using open a command prompt as admin. It has to be &#8230; <a href="http://cyborgworkshop.org/2012/12/26/how-to-tell-if-windows-is-using-trim/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>How do I know if my windows 7 install is using TRIM on my SSD? The interwebs aren&#8217;t all in agreement on this, but here is what I&#8217;ve been using</p>
<p>open a command prompt as admin. It has to be admin or this won&#8217;t work. Run the following<br />
<code>fsutil behavior query disabledeletenotify</code></p>
<p>DisableDeleteNotify = 1 means that TRIM is disabled<br />
DisableDeleteNotify = 0 means that TRIM is enabled</p>
<p>Note that TRIM will only work on an SSD drive that is set to use AHCI in BIOS. If you installed windows using Legacy or SATA mode, you can either reinstall windows after switching your BIOS to AHCI or you can edit your registry to enable AHCI drivers after you have changed your BIOS to use AHCI</p>
]]></content:encoded>
			<wfw:commentRss>http://cyborgworkshop.org/2012/12/26/how-to-tell-if-windows-is-using-trim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2 factor auth in ubuntu with google authenticator except for trusted networks</title>
		<link>http://cyborgworkshop.org/2012/12/12/2-factor-auth-in-ubuntu-with-google-authenticator-except-for-trusted-networks/</link>
		<comments>http://cyborgworkshop.org/2012/12/12/2-factor-auth-in-ubuntu-with-google-authenticator-except-for-trusted-networks/#comments</comments>
		<pubDate>Wed, 12 Dec 2012 19:41:06 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Best Tools]]></category>

		<guid isPermaLink="false">http://cyborgworkshop.org/?p=814</guid>
		<description><![CDATA[DO NOT ATTEMPT THIS IF YOUR COMPUTER&#8217;S TIME IS OFF. google authenticator is time based, if your clocks dont match the internet you will NOT be able to authenticate to your machine. 2factor authentication is awesome, therefore google authenticator is &#8230; <a href="http://cyborgworkshop.org/2012/12/12/2-factor-auth-in-ubuntu-with-google-authenticator-except-for-trusted-networks/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>DO NOT ATTEMPT THIS IF YOUR COMPUTER&#8217;S TIME IS OFF.  google authenticator is time based, if your clocks dont match the internet you will NOT be able to authenticate to your machine. </p>
<p>2factor authentication is awesome, therefore google authenticator is awesome.  I wanted all of my internet connected boxes to use 2factor for ssh, but only when the source IP isn&#8217;t coming from one of my internal networks. Here is how I did that on ubuntu 12.10</p>
<p>install the google_authenticator pam module<br />
<code><br />
sudo apt-get install libpam-google-authenticator<br />
</code></p>
<p>edit /etc/pam.d/sshd and add the following before the @include common-auth  line<br />
<code><br />
auth [success=1 default=ignore] pam_access.so accessfile=/etc/security/access-local.conf<br />
auth       required     pam_google_authenticator.so<br />
</code></p>
<p>create the file /etc/security/access-local.conf and add the following to it<br />
<code><br />
+ : ALL : 192.168.0.0/28<br />
+ : ALL : LOCAL<br />
- : ALL : ALL<br />
</code><br />
192.168.0.0/28 should be the subnet of your trusted network that you will not require 2factor from.</p>
<p>Edit /etc/sshd/sshd_config and make sure that<br />
<code><br />
ChallengeResponseAuthentication yes<br />
</code><br />
is set. By default it is set to No. </p>
<p>Install the google authenticator app on your phone and add a new source.  Log into your server as the user that you want to setup and run, from the command line<br />
<code><br />
google-authenticator<br />
</code></p>
<p>Now either copy the codes into your authenticator app or scan the QR code. Restart ssh and you&#8217;ll be done!  If you try to connect from a host outside of your trusted network, you should get prompted for your 2factor code. Anything inside of your trusted network should be allowed in with just a password. </p>
]]></content:encoded>
			<wfw:commentRss>http://cyborgworkshop.org/2012/12/12/2-factor-auth-in-ubuntu-with-google-authenticator-except-for-trusted-networks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
