<?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>www.copyandwaste.com</title>
	<atom:link href="http://www.copyandwaste.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.copyandwaste.com</link>
	<description></description>
	<lastBuildDate>Tue, 17 Aug 2010 20:53:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>2003 Triumph Speedmaster modifications #1</title>
		<link>http://www.copyandwaste.com/2010/08/17/2003-triumph-speedmaster-modifications-1/</link>
		<comments>http://www.copyandwaste.com/2010/08/17/2003-triumph-speedmaster-modifications-1/#comments</comments>
		<pubDate>Tue, 17 Aug 2010 20:53:32 +0000</pubDate>
		<dc:creator>Andrew Konkol</dc:creator>
				<category><![CDATA[Fun]]></category>

		<guid isPermaLink="false">http://www.copyandwaste.com/?p=193</guid>
		<description><![CDATA[

Mirrors replaced
Turn signals relocated
Turn signal lens color changed
Gas tank kneepads


]]></description>
			<content:encoded><![CDATA[<p><img class="attachment wp-att-194 " src="http://www.copyandwaste.com/wp-content/uploads/2010/08/profilebetty.jpg" alt="profilebetty" width="720" height="540" /></p>
<ol>
<li>Mirrors replaced</li>
<li>Turn signals relocated</li>
<li>Turn signal lens color changed</li>
<li>Gas tank kneepads</li>
</ol>
<p><a title="birdseyebetty" rel="lightbox[pics193]" href="http://www.copyandwaste.com/wp-content/uploads/2010/08/birdseyebetty.jpg"><img class="attachment wp-att-195 " src="http://www.copyandwaste.com/wp-content/uploads/2010/08/birdseyebetty.jpg" alt="birdseyebetty" width="480" height="640" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.copyandwaste.com/2010/08/17/2003-triumph-speedmaster-modifications-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2003 Triumph Speedmaster</title>
		<link>http://www.copyandwaste.com/2010/08/02/2003-triumph-speedmaster/</link>
		<comments>http://www.copyandwaste.com/2010/08/02/2003-triumph-speedmaster/#comments</comments>
		<pubDate>Tue, 03 Aug 2010 04:14:22 +0000</pubDate>
		<dc:creator>Andrew Konkol</dc:creator>
				<category><![CDATA[Fun]]></category>

		<guid isPermaLink="false">http://www.copyandwaste.com/?p=185</guid>
		<description><![CDATA[3,000 Miles
2004 tank paint job
2004 windshield
dresser bars, knee pads, mirrors, and signal relocators to come.





]]></description>
			<content:encoded><![CDATA[<p>3,000 Miles</p>
<p>2004 tank paint job</p>
<p>2004 windshield</p>
<p>dresser bars, knee pads, mirrors, and signal relocators to come.</p>
<p><a title="tank" rel="lightbox[pics185]" href="http://www.copyandwaste.com/wp-content/uploads/2010/08/tank.jpg"><img class="attachment wp-att-190 " src="http://www.copyandwaste.com/wp-content/uploads/2010/08/tank.jpg" alt="tank" width="640" height="478" /></a></p>
<p><a title="Picture-2" rel="lightbox[pics185]" href="http://www.copyandwaste.com/wp-content/uploads/2010/08/Picture-2.png"><img class="attachment wp-att-187 " src="http://www.copyandwaste.com/wp-content/uploads/2010/08/Picture-2.png" alt="Picture-2" width="498" height="370" /></a></p>
<p><a title="trailer" rel="lightbox[pics185]" href="http://www.copyandwaste.com/wp-content/uploads/2010/08/trailer.jpg"><img class="attachment wp-att-191 " src="http://www.copyandwaste.com/wp-content/uploads/2010/08/trailer.jpg" alt="trailer" width="640" height="478" /></a></p>
<p><a title="Picture-1" rel="lightbox[pics185]" href="http://www.copyandwaste.com/wp-content/uploads/2010/08/Picture-1.png"><img class="attachment wp-att-186 " src="http://www.copyandwaste.com/wp-content/uploads/2010/08/Picture-1.png" alt="Picture-1" width="500" height="373" /></a></p>
<p><a title="Picture-3" rel="lightbox[pics185]" href="http://www.copyandwaste.com/wp-content/uploads/2010/08/Picture-3.png"><img class="attachment wp-att-188 " src="http://www.copyandwaste.com/wp-content/uploads/2010/08/Picture-3.png" alt="Picture-3" width="499" height="375" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.copyandwaste.com/2010/08/02/2003-triumph-speedmaster/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pexpect, Python, and Managing Devices &#8212; Tratto</title>
		<link>http://www.copyandwaste.com/2010/01/26/pexpect-python-and-managing-devices/</link>
		<comments>http://www.copyandwaste.com/2010/01/26/pexpect-python-and-managing-devices/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 09:20:56 +0000</pubDate>
		<dc:creator>Andrew Konkol</dc:creator>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[SysAdmin]]></category>

		<guid isPermaLink="false">http://www.copyandwaste.com/?p=172</guid>
		<description><![CDATA[
A few months ago I decided to write a web application that would essentially run like RANCID, I named it &#8220;tratto.&#8221;   Since then I decided that it would be better to nail down a basic python framework first, then integrate it into say.. a django application.  In all of my years as an engineer [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.copyandwaste.com/wp-content/uploads/2010/01/tratto-logo.png" rel="lightbox[pics172]" title="tratto-logo"><img src="http://www.copyandwaste.com/wp-content/uploads/2010/01/tratto-logo.png" alt="tratto-logo" width="245" height="80" class="attachment wp-att-178 alignleft" /></a><br />
A few months ago I decided to write a web application that would essentially run like <a href="http://www.shrubbery.net/rancid/">RANCID</a>, I named it &#8220;tratto.&#8221;   Since then I decided that it would be better to nail down a basic python framework first, then integrate it into say.. a django application.  In all of my years as an engineer I had never leveraged <a href="http://expect.nist.gov/">expect</a> to accomplish simple and repetitive tasks.  I am a recent python &#8220;convert&#8221; and wanted to write a simple app that could be used as a framework for managing and monitoring network connected devices and hosts.  Tratto uses <a href="http://www.noah.org/wiki/Pexpect">pexpect</a> to connect and parse ssh and telnet sessions.</p>
<p>This framework provides an easy way to connect to remote devices and issue commands and store the output.  I also wanted an easy way to &#8220;extend&#8221; this framework and be able to add ways to connect to any operating system (or at least use default shell behavior as a baseline).  I manage a wide variety of devices and I wanted to support at least the default implementations of Cisco IOS, OpenBSD, Mac OS X, and Aruba OS.  Here is how you would add an operating system&#8217;s parameters to Tratto (Systems.py):</p>
<pre class="brush:python">class ArubaOS(OperatingSystem):
	'''aruba configs'''
	PROMPTLINE	='#'
	PAGINATES 	=True
	DISABLE_PAGINATION = 'terminal length 0'
	GET_CONFIG	="show run"</pre>
<p>There are 3 files included in Tratto right now:</p>
<ol>
<li>Connectivity.py &#8212; This is a class which manages sessions using pexpect</li>
<li>Systems.py &#8212; This is the class which manages all the operating parameters</li>
<li>driver.py &#8212; This is an example file of how to use Tratto to fetch whatever info you want</li>
</ol>
<p>Here is an example of how to use the framework to connect to devices and issue commands:</p>
<pre class="brush:python">#!/usr/bin/env python

import Connectivity
import Systems

#telnet to a cisco switch
m = Systems.OperatingSystems['IOS']
s = Connectivity.Session("192.168.6.1",23,telnet,m)
s.login("akonkol", "mypass")
s.sendcommand("show ver")
s.sendcommand("show clock")
s.sendcommand("show run")
s.logout()

#ssh to a apple machine
m = Systems.OperatingSystems['OSX']
s = Connectivity.Session("127.0.0.1",22,"ssh",m)
s.login("akonkol", "mypass")
#sendcommand will echo response by default, you can store that
#response in a variable if you wish
result = s.sendcommand("df -h")
print result
s.getversion()
s.logout()

#ssh to openbsd box
m = Systems.OperatingSystems['OBSD']
s = Connectivity.Session("192.168.5.1",22,"ssh",m)
s.login("akonkol", "mypass")
print s.sendcommand("cat /etc/passwd")
print s.sendcommand("arp -a")
s.logout()</pre>
<h2>The Future</h2>
<p>With Tratto you can technically pull information from any networked device and use that data for whatever you please.  Current ideas are integrating Tratto into </p>
<ul>
<li>a config repository application with a web frontend (like RANCID)</li>
<li>a network mapping application using cdp neighbors</li>
<li>monitoring platform which performs different commands based on certain scenarios (&#8221;show interfaces&#8221; when IP SLA shows latency)
</ul>
<p>This is my first attempt at releasing python software, so if you think something could be better let me know.<br />
<a href="http://www.copyandwaste.com/Tratto-Barcelona.zip">Download Tratto</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.copyandwaste.com/2010/01/26/pexpect-python-and-managing-devices/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Enabling VNC Server on MAC OS X Leopard</title>
		<link>http://www.copyandwaste.com/2009/12/29/enabling-vnc-server-on-mac-os-x-leopard/</link>
		<comments>http://www.copyandwaste.com/2009/12/29/enabling-vnc-server-on-mac-os-x-leopard/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 17:30:07 +0000</pubDate>
		<dc:creator>Andrew Konkol</dc:creator>
				<category><![CDATA[SysAdmin]]></category>

		<guid isPermaLink="false">http://www.copyandwaste.com/?p=170</guid>
		<description><![CDATA[Recently I needed to troubleshoot some issues using a GUI web browser from an outside connection.  This link shows how to enable vnc server on your mac using the command line.  After doing that, and configuring port forwarding on my firewall I was all set.
]]></description>
			<content:encoded><![CDATA[<p>Recently I needed to troubleshoot some issues using a GUI web browser from an outside connection.  This <a href="http://support.apple.com/kb/HT2370">link</a> shows how to enable vnc server on your mac using the command line.  After doing that, and configuring port forwarding on my firewall I was all set.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.copyandwaste.com/2009/12/29/enabling-vnc-server-on-mac-os-x-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring A Cisco 2600 Series Router as a Terminal Server</title>
		<link>http://www.copyandwaste.com/2009/12/07/configuring-a-cisco-2600-series-router-as-a-terminal-server/</link>
		<comments>http://www.copyandwaste.com/2009/12/07/configuring-a-cisco-2600-series-router-as-a-terminal-server/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 05:40:13 +0000</pubDate>
		<dc:creator>Andrew Konkol</dc:creator>
				<category><![CDATA[SysAdmin]]></category>

		<guid isPermaLink="false">http://www.copyandwaste.com/?p=159</guid>
		<description><![CDATA[I have a small lab I put together to help bash around new ideas, it consists of:

2 Cisco 2611s
2 Cisco 3500 XLs

Recently I&#8217;ve been jumping between devices using a single console cable&#8230; and that got old pretty quick.  I was able to pickup a NM-16A Async module which provides 16 more lines to my 2600.  [...]]]></description>
			<content:encoded><![CDATA[<p>I have a small lab I put together to help bash around new ideas, it consists of:</p>
<ul>
<li>2 Cisco 2611s</li>
<li>2 Cisco 3500 XLs</li>
</ul>
<p>Recently I&#8217;ve been jumping between devices using a single console cable&#8230; and that got old pretty quick.  I was able to pickup a <a href="http://www.cisco.com/en/US/products/hw/routers/ps274/products_tech_note09186a00800a93f0.shtml">NM-16A</a> Async module which provides 16 more lines to my 2600.  To use this card I also needed a Cisco <a href="http://www.cisco.com/en/US/tech/tk801/tk36/technologies_tech_note09186a00801c9a10.shtml">octal cable</a>.</p>
<p><a title="cab_oct_async" rel="lightbox[pics159]" href="http://www.copyandwaste.com/wp-content/uploads/2009/12/cab_oct_async.jpg"></a><a title="cisco-nm-async-16" rel="lightbox[pics159]" href="http://www.copyandwaste.com/wp-content/uploads/2009/12/cisco-nm-async-16.jpg"><img class="attachment wp-att-162 alignleft" src="http://www.copyandwaste.com/wp-content/uploads/2009/12/cisco-nm-async-16.thumbnail.jpg" alt="cisco-nm-async-16" width="200" height="107" /></a><img class="attachment wp-att-160 alignleft" src="http://www.copyandwaste.com/wp-content/uploads/2009/12/cab_oct_async.thumbnail.jpg" alt="cab_oct_async" width="200" height="163" /></p>
<p><strong>Steps:</strong></p>
<p><strong>1)</strong> After inserting the card and screwing in the octal cable you can verify that there is added line capacity:</p>
<p><code> Router_A#show version | i line<br />
16 terminal line(s)</code></p>
<p><strong>2) </strong>Before you proceed you will need to find out what line numbers your new NM-16A uses, in my case it was 33-48:<br />
<code><br />
Router_A#show line<br />
Tty Typ     Tx/Rx    A Modem  Roty AccO AccI   Uses   Noise  Overruns   Int<br />
*    0 CTY              -    -      -    -    -      6       0     0/0       -<br />
33 TTY   9600/9600  -    -      -    -    -      2       1    35/106     -<br />
34 TTY   9600/9600  -    -      -    -    -      4      19     0/0       -<br />
35 TTY   9600/9600  -    -      -    -    -      0       0     0/0       -<br />
36 TTY   9600/9600  -    -      -    -    -      0       0     0/0       -<br />
37 TTY   9600/9600  -    -      -    -    -      0       0     0/0       -<br />
38 TTY   9600/9600  -    -      -    -    -      0       0     0/0       -<br />
39 TTY   9600/9600  -    -      -    -    -      0       0     0/0       -<br />
40 TTY   9600/9600  -    -      -    -    -      0       0     0/0       -<br />
41 TTY   9600/9600  -    -      -    -    -      0       0     0/0       -<br />
42 TTY   9600/9600  -    -      -    -    -      0       0     0/0       -<br />
43 TTY   9600/9600  -    -      -    -    -      0       0     0/0       -<br />
44 TTY   9600/9600  -    -      -    -    -      0       0     0/0       -<br />
45 TTY   9600/9600  -    -      -    -    -      0       0     0/0       -<br />
46 TTY   9600/9600  -    -      -    -    -      0       0     0/0       -<br />
47 TTY   9600/9600  -    -      -    -    -      0       0     0/0       -<br />
48 TTY   9600/9600  -    -      -    -    -      0       0     0/0       -<br />
65 AUX   9600/9600  -    -      -    -    -      0       0     0/0       -</code></p>
<p><strong>3)</strong> You need to create a loopback to be used to telnet to each of the lines:<br />
<code><br />
interface Loopback0<br />
ip address 126.0.0.1 255.255.255.255<br />
no ip redirects<br />
end<br />
</code></p>
<p><strong>4)</strong> Next you need to configure the lines of this card with your preferred settings:<br />
<code><br />
line 33 48<br />
no flush-at-activation<br />
transport preferred telnet<br />
transport input all<br />
stopbits 1<br />
flowcontrol hardware<br />
</code></p>
<p><strong>5)</strong> Finally,  it&#8217;s nice to add ip hosts on the router for ease of use.  Note that the tcp port number for our new lines are named with 20xx where &#8220;xx&#8221; is the actual line number.  For example, our first line is &#8220;33&#8243; so you need to connect to port &#8220;2033.&#8221;  After this is done plug the rollover cable coming from the octal cable labeled &#8220;1&#8243; into the console port of the device you want to manage.  In my scenario, cable &#8220;1&#8243; == line 33 == port 2033, cable &#8220;2&#8243; == line 34 == port 2034, etc&#8230;</p>
<p><code><br />
ip host r2 2033 126.0.0.1<br />
ip host s1 2034 126.0.0.1<br />
</code></p>
<p>You should now have a console server in which you can &#8220;reverse&#8221; telnet into other devices connected through the octal cable.</p>
<p>You should be able to issue commands such as &#8220;telnet r2&#8243; and be dropped into a console session.</p>
<p>To return to the router press &#8220;control + shift + 6 +x.&#8221;</p>
<p>To disconnect the session type &#8220;disconnect &lt;connection number&gt;&#8221; or &#8220;disconnect &lt;hostname&gt; .&#8221;</p>
<p>Here is the relevant configuration parameters:<br />
<code><br />
ip host r2 2033 126.0.0.1<br />
ip host s1 2034 126.0.0.1<br />
interface Loopback0<br />
 ip address 126.0.0.1 255.255.255.255<br />
 no ip redirects<br />
line 33 48<br />
 exec-timeout 0 0<br />
 no flush-at-activation<br />
 logging synchronous<br />
 no exec<br />
 notify<br />
 transport preferred telnet<br />
 transport input all<br />
 stopbits 1<br />
 flowcontrol hardware<br />
</code></p>
<p>A big thank you to Gerry Murray for initial guidance and introducing me to this.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.copyandwaste.com/2009/12/07/configuring-a-cisco-2600-series-router-as-a-terminal-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New phone, New Development, New Instructions</title>
		<link>http://www.copyandwaste.com/2009/12/01/new-phone-new-development-new-instructions/</link>
		<comments>http://www.copyandwaste.com/2009/12/01/new-phone-new-development-new-instructions/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 05:43:40 +0000</pubDate>
		<dc:creator>Andrew Konkol</dc:creator>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[droid]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[mobile development]]></category>
		<category><![CDATA[motorola droid]]></category>

		<guid isPermaLink="false">http://www.copyandwaste.com/?p=141</guid>
		<description><![CDATA[I recently won a Motorola Droid phone in the &#8220;claw event&#8221; promotion held by Verizon.  That being said I wanted to take a stab at some development on it.  I was trying to use the SimpleCursorAdaptor method to bind results from sqlite to a listview.. and it just wasn&#8217;t happening.
To create the database I had [...]]]></description>
			<content:encoded><![CDATA[<p>I recently won a Motorola Droid phone in the &#8220;claw event&#8221; promotion held by Verizon.  That being said I wanted to take a stab at some development on it.  I was trying to use the SimpleCursorAdaptor method to bind results from sqlite to a listview.. and it just wasn&#8217;t happening.</p>
<p>To create the database I had a line like this:</p>
<pre class="brush:java">
private static final String DATABASE_CREATE =
             "create table decks (id integer primary key autoincrement, "
             + "name text not null);";
</pre>
<p>My application would throw an exception and I had no idea why until I wrote  a simple debug method.  It&#8217;s the equivalent of  &#8220;alert();&#8221; in javascript.</p>
<pre class="brush:java">
public void createAlert(String message){
      AlertDialog alertDialog = new AlertDialog.Builder(this).create();
      alertDialog.setTitle("Message");
      alertDialog.setMessage(message);
      alertDialog.setButton("OK", new DialogInterface.OnClickListener(){
      public void onClick(DialogInterface dialog, int which){
                    return; }
      });
      alertDialog.show();
}</pre>
<p>I simply threw my code in a java try-catch and received the error: &#8220;column _id does not exist.&#8221;  Did you catch that?  I didn&#8217;t declare my column name with an underscore.</p>
<p>I guess it is always good to read the <a href="http://developer.android.com/reference/android/widget/CursorAdapter.html">documentation.</a></p>
<blockquote><p>Adapter that exposes data from a <code><a href="http://developer.android.com/reference/android/database/Cursor.html">Cursor</a></code> to a   <code><a href="http://developer.android.com/reference/android/widget/ListView.html">ListView</a></code> widget. The Cursor must include   a column named &#8220;_id&#8221; or this class will not work.</p></blockquote>
<p>Now why would I post this lame crap? Because after googling the problem&#8230; it seems that a lot of beginners are running into this issue.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.copyandwaste.com/2009/12/01/new-phone-new-development-new-instructions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Searching Your Corporate LDAP/AD with python</title>
		<link>http://www.copyandwaste.com/2009/11/18/searching-your-corporate-ldapad-with-python/</link>
		<comments>http://www.copyandwaste.com/2009/11/18/searching-your-corporate-ldapad-with-python/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 17:27:02 +0000</pubDate>
		<dc:creator>Andrew Konkol</dc:creator>
				<category><![CDATA[SysAdmin]]></category>

		<guid isPermaLink="false">http://www.copyandwaste.com/?p=140</guid>
		<description><![CDATA[There are a ton of examples out there on how to utilize ldap in python.  I recently worked on a simple project which required active directory authentication  using ldap.  The following is simple script I&#8217;ve used hundreds of times.

#!/usr/bin/env python
#binds to ldap, queries for a specific AD account
import ldap
def Search(server,port, auth_user, auth_pass, [...]]]></description>
			<content:encoded><![CDATA[<p>There are a ton of examples out there on how to utilize ldap in python.  I recently worked on a simple project which required active directory authentication  using ldap.  The following is simple script I&#8217;ve used hundreds of times.</p>
<p><code><br />
#!/usr/bin/env python<br />
#binds to ldap, queries for a specific AD account</p>
<p>import ldap</p>
<p>def Search(server,port, auth_user, auth_pass, ldap_user,attrs):</p>
<p>        #base_dn should reflect your domain<br />
        base_dn="dc=yourcompanydomain,dc=com"<br />
        found_results=""</p>
<p>        l = ldap.initialize('ldap://%s:%s' % (server, port) )<br />
        l.simple_bind_s(auth_user, auth_pass)<br />
        try:<br />
                search_result= l.search(base_dn,ldap.SCOPE_SUBTREE,'sAMAccountName='+ldap_user,attrs)<br />
                result_set =[]<br />
                while 1:<br />
                        result_type, result_data = l.result(search_result,0)<br />
                        if (result_data ==[]):<br />
                                break<br />
                        else:<br />
                                if result_type == ldap.RES_SEARCH_ENTRY:<br />
                                        result_set.append(result_data)</p>
<p>                print len(result_set)<br />
                for line in result_set:<br />
                        print line<br />
        except ldap.LDAPError, e:<br />
                print e</p>
<p>results = Search("192.168.5.10",3268,"akonkol@yourcompanydomain.com","mysecretpassword","akonkol",['givenName','sn','mail'])<br />
</code><br />
This will return the attributes you supplied (givenName, sn, mail)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.copyandwaste.com/2009/11/18/searching-your-corporate-ldapad-with-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Useful Commands for Proxy Migration</title>
		<link>http://www.copyandwaste.com/2009/11/10/useful-commands-for-proxy-migration/</link>
		<comments>http://www.copyandwaste.com/2009/11/10/useful-commands-for-proxy-migration/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 16:53:22 +0000</pubDate>
		<dc:creator>Andrew Konkol</dc:creator>
				<category><![CDATA[SysAdmin]]></category>

		<guid isPermaLink="false">http://www.copyandwaste.com/?p=139</guid>
		<description><![CDATA[Recently I took on a project to migrate &#8220;difficult&#8221; users from our proxy-based firewalls to use default route towards packet filters.  Since we do not force users to authenticate for dhcp / keep track of IP assignments to users, it was very difficult to contact the remaining users going through our proxies.  The first step [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I took on a project to migrate &#8220;difficult&#8221; users from our proxy-based firewalls to use default route towards packet filters.  Since we do not force users to authenticate for dhcp / keep track of IP assignments to users, it was very difficult to contact the remaining users going through our proxies.  The first step to identify hosts going through our proxy firewalls is to get a list of IP addresses, which I did with the following command  on the proxy firewalls:</p>
<p><strong>tcpdump -qni em1 not src host 192.168.5.2 | awk &#8216;{print $2}&#8217; | awk -F. &#8216;{print $1&#8243;.&#8221;$2&#8243;.&#8221;$3&#8243;.&#8221;$4}&#8217; &gt;&gt; ~/hosts-through-proxy.txt</strong></p>
<p>Explanation:</p>
<p><strong>tcpdump -qni</strong> tells tcpdump to operate in &#8220;quiet&#8221; mode which really strips off a lot of extraneous info for our purposes.   The n flag also tells tcpdump to not resolve hostnames.</p>
<p><strong>em1</strong> This is your inside (internal) interface</p>
<p><strong>192.168.5.2</strong> This is the IP address on your internal interface, and tells tcpdump to ignore traffic coming from this IP address.</p>
<p><strong>awk &#8216;{print $2}&#8217; </strong>This prints the source ip field</p>
<p><strong>awk -F. &#8216;{print $1&#8243;.&#8221;$2&#8243;.&#8221;$3&#8243;.&#8221;$4}&#8217;</strong> This breaks up the souce ip text by periods, then prints the all the octets minus the port that tcpdump adds on</p>
<p><strong>&gt;&gt; ~/hosts-through-proxy.txt</strong> This obviously writes the output to a file</p>
<p>After letting this run for a decent amount of time (a few days) I was able to run the file through uniq and produce a list of hosts using the firewall.</p>
<p>I will continue to post commands/workflows I find useful in this project.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.copyandwaste.com/2009/11/10/useful-commands-for-proxy-migration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Maintaining Sanity Through Insanity</title>
		<link>http://www.copyandwaste.com/2009/08/08/maintaining-sanity-through-insanity/</link>
		<comments>http://www.copyandwaste.com/2009/08/08/maintaining-sanity-through-insanity/#comments</comments>
		<pubDate>Sat, 08 Aug 2009 18:50:02 +0000</pubDate>
		<dc:creator>Andrew Konkol</dc:creator>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[SysAdmin]]></category>

		<guid isPermaLink="false">http://www.copyandwaste.com/?p=137</guid>
		<description><![CDATA[Last month was a spirit crusher due to an increased workload.  Every once in a while I decide to run into the woods and get lost in something that I&#8217;ve never done.  It&#8217;s been a while since I&#8217;ve had the chance to develop something selfishly.
Last year I wrote an intranet site using ruby [...]]]></description>
			<content:encoded><![CDATA[<p>Last month was a spirit crusher due to an increased workload.  Every once in a while I decide to run into the woods and get lost in something that I&#8217;ve never done.  It&#8217;s been a while since I&#8217;ve had the chance to develop something selfishly.</p>
<p>Last year I wrote an intranet site using ruby on rails for what I call &#8220;personal enrichment.&#8221;  Rails went OK, but whenever I wanted to achieve something that wasn&#8217;t textbook I found myself writing code that was like a trick/hack&#8230; needless to say it didn&#8217;t give me a good feeling.</p>
<p>About 6 months ago i started to force myself to use Python for all shell script tasks that were thrown my way.  I love python.  If you are used to scripting or actually enjoy scripting python is great.  Now one of my pet peeves is when people say things like &#8220;lightweight, efficient, clean, easy to read.&#8221;  Now all of those things are great.. but what does it really mean?  Visual Basic is almost like writing english and developers think its the fisher-price of languages (including me).  I have no answer to why I like python except a few little things:</p>
<ul>
<li>whitespace is used to terminate directives, which forces everyone to use similar formatting</li>
<li>smtplib is the best email library I&#8217;ve ever worked with</li>
<li>django doesn&#8217;t assume as much as rails does, you still have some tedious work but I find it the perfect balance.</li>
</ul>
<p>So I built my first site in django it&#8217;s currently running in my dev enviornment.  What does the app do?  It&#8217;s an app that uses the power of expect (one of my favorites), diff (another favorite), and a repository model.  Simply put, the app connects to a device (via ssh/telnet) logs in and issues a command, stores the output in a database, does a diff between the last retrieved output and does a diff, if there is a diff it emails the system owner.</p>
<p>What does this achieve?  Automatic change control and a configuration repository.  I&#8217;ve used RANCID to do this before and I love the concept.  RANCID doesn&#8217;t have a front end, but it also uses cvs/svn so you can install cvs/svn frontends.</p>
<p>I re-invented the wheel, but I like this wheel&#8230; it&#8217;s dead simple&#8230; and it helps out those admins that suck at cli.</p>
<p>Like I said, I haven&#8217;t deployed it yet&#8230; but I think I may want to release it.  So my next problem I&#8217;m thinking about is how to package up and release a distribution.  I&#8217;ve never used/installed a django driven web app&#8230; how do people usually release their django projects to the public? VMs?</p>
<p><a title="tratto-screenshot" rel="lightbox[pics137]" href="http://www.copyandwaste.com/wp-content/uploads/2009/08/tratto-screenshot.png"><img class="attachment wp-att-138 alignleft" src="http://www.copyandwaste.com/wp-content/uploads/2009/08/tratto-screenshot.png" alt="tratto-screenshot" width="500" height="213" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.copyandwaste.com/2009/08/08/maintaining-sanity-through-insanity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Powerline Fishing</title>
		<link>http://www.copyandwaste.com/2009/06/18/powerline-fishing/</link>
		<comments>http://www.copyandwaste.com/2009/06/18/powerline-fishing/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 04:28:57 +0000</pubDate>
		<dc:creator>Andrew Konkol</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.copyandwaste.com/?p=131</guid>
		<description><![CDATA[I&#8217;ve been fishing on Chicago&#8217;s lakefront since I was a very young child.  There is a certain culture that arises from people that like to fish but don&#8217;t have boats.  I never picked up on this culture until I lurked several chicago fishing messageboards.  Like any hobby, hobbyists are nerds which can&#8217;t wait to tell [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been fishing on Chicago&#8217;s lakefront since I was a very young child.  There is a certain culture that arises from people that like to fish but don&#8217;t have boats.  I never picked up on this culture until I lurked several chicago fishing messageboards.  Like any hobby, hobbyists are nerds which can&#8217;t wait to tell you about something they built&#8230; and help you along in your own projects.</p>
<p>I&#8217;ve always heard the rumor or urban legend about powerlining rigs.  <em><strong>Powerlining </strong></em>is essentially launching a high test fishing line out with an anchor and several baited hooks.  Pitching a line out with several other smaller lines allows you to achieve distances (and in turn depths) that would be hard to achieve using the traditional rod and reel.</p>
<p style="text-align: center;"><a title="powerline" rel="lightbox[pics131]" href="http://www.copyandwaste.com/wp-content/uploads/2009/06/powerline.gif"><img class="attachment wp-att-132 centered" src="http://www.copyandwaste.com/wp-content/uploads/2009/06/powerline.gif" alt="powerline" width="500" height="322" /></a></p>
<p style="text-align: center;">
<p style="text-align: left;">There are three main ways to pitch this monster line out into the water:</p>
<ol>
<li>Throwing the anchor/weight by hand</li>
<li>Using a water balloon sling shot</li>
<li>Using the pressure of a CO2 tank (think potato gun)</li>
</ol>
<p>Guess which one I&#8217;m interested in&#8230;. you guessed it&#8230; CO2 tank.</p>
<p style="text-align: center;"><a title="there_she_blows" rel="lightbox[pics131]" href="http://www.copyandwaste.com/wp-content/uploads/2009/06/there_she_blows.jpg"><img class="attachment wp-att-133 centered" src="http://www.copyandwaste.com/wp-content/uploads/2009/06/there_she_blows.jpg" alt="there_she_blows" width="500" height="375" /></a></p>
<p>After perusing several messaging boards I&#8217;ve come up with the following bill of materials:</p>
<ol>
<li>CO2 Fire extinguisher</li>
<li>5ft of 1&#8243; pipe</li>
<li>some sort of pipe adapter (I&#8217;ll figure that out once at home depot)</li>
<li>12 oz 1&#8243; x 2.5&#8243; weight</li>
<li>70&#8242; of rubber band/cord</li>
<li>A couple hundred yards of 10-12 lb test</li>
<li>Reel</li>
<li>two large swivels</li>
<li>10 smaller swivels</li>
<li>hooks</li>
<li>beads</li>
</ol>
<p>Then my additonail ideas:</p>
<ol>
<li>Door stopper spring</li>
<li>Dowel rod</li>
<li>Bell</li>
<li>Screweyes</li>
</ol>
<p>The plan I&#8217;m working on&#8230; still need to add snelled hooks.</p>
<p style="text-align: center;"><a title="powerline-rig1" rel="lightbox[pics131]" href="http://www.copyandwaste.com/wp-content/uploads/2009/06/powerline-rig1.jpg"><img class="attachment wp-att-135 centered" src="http://www.copyandwaste.com/wp-content/uploads/2009/06/powerline-rig1.jpg" alt="powerline-rig1" width="500" height="201" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.copyandwaste.com/2009/06/18/powerline-fishing/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
