<?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>Matt Ventura&#039;s blog &#187; Uncategorized</title>
	<atom:link href="http://mattventura.net/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://mattventura.net</link>
	<description>Matt Ventura&#039;s blog about various stuff.</description>
	<lastBuildDate>Fri, 26 Aug 2011 08:40:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=3.0-alpha</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>An RGB LED for your RSPro</title>
		<link>http://mattventura.net/2011/08/11/an-rgb-led-for-your-rspro/</link>
		<comments>http://mattventura.net/2011/08/11/an-rgb-led-for-your-rspro/#comments</comments>
		<pubDate>Fri, 12 Aug 2011 05:59:22 +0000</pubDate>
		<dc:creator>Matt Ventura</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mattventura.net/?p=335</guid>
		<description><![CDATA[As I mentioned in my review, the Routerstation Pro only has a single user-programmable LED. However, it has 7 GPIO lines that can easily be attached to more LEDs. Read on for instructions and pictures.
I decided I wanted more LEDs so that I could have an easy notification of when there is a problem with [...]]]></description>
			<content:encoded><![CDATA[<p>As I mentioned in my review, the Routerstation Pro only has a single user-programmable LED. However, it has 7 GPIO lines that can easily be attached to more LEDs. Read on for instructions and pictures.</p>
<p><span id="more-335"></span>I decided I wanted more LEDs so that I could have an easy notification of when there is a problem with my internet connection or tunnels. I did this on a WRT54GL using the white and orange LEDs behind the Linksys logo. You can easily script a blinking action that stops or changes color when your connection is down. However, the RSPro has only one user-programmable LED compared to the WRT&#8217;s 5 or so. However, there is a 7-pin GPIO header with a jumper block to select active low or high mode.</p>
<p>I already had an RGB LED, so once I figured out how to manually toggle the GPIO outputs, all I had to do was figure out how to wire it up. Use the RSPro page on either the OpenWRT wiki or the UBNT wiki for reference on the GPIO lines. I figured that the GPIO lines would act as a 3.3v source while the UART header could act as a ground. However, I learned that the <a href="http://www.radioshack.com/graphics/uc/rsk/Support/ProductManuals/2760028_DS_EN.pdf">LED in question</a> used a common anode rather than a common cathode, which meant I would have to get creative. I instead used the 3.3v off the UART header and used some of the GPIO lines as the ground after setting them to &#8220;active low&#8221; mode. After that, it was simply a matter of tweaking resistances in order to get good color balance, since the different elements of the LED had different characteristics. This is difficult because you have to not only make each channel the same brightness when one of them is lit exclusively, but you also have to make the combination of the three look convincingly white.</p>
<p>Lastly, there was still the issue of fitting it in the box. I use the newer Netgate enclosure for the RSPro, which has quite a bit of room. However, there wasn&#8217;t a whole lot of room above the board, so the breadboard I used for the project would have to sit below the Routerstation. The breadboard was then covered in electrical tape to prevent contact with the board, and I had lines go to the LED, which stuck out of one of the SMA holes on the case.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h1>Software</h1>
<p>To be honest, I don&#8217;t remember all of what I had to install to get manual control over GPIO lines. This does not use the OpenWRT LED configuration. I think that &#8216;gpioctl&#8217; had something to do with it, and maybe &#8216;kmod-leds-gpio&#8217;, although I doubt the latter since this bypasses the LED system. You can do something like this to set up the GPIO lines.</p>
<pre>#!/bin/bash

#Path to GPIO folder
GPIOPATH="/sys/class/gpio"

#Expose GPIO lines
echo 0 &gt; $GPIOPATH/export
echo 1 &gt; $GPIOPATH/export
echo 3 &gt; $GPIOPATH/export

#Set lines to output mode
echo out &gt; $GPIOPATH/gpio0/direction
echo out &gt; $GPIOPATH/gpio1/direction
echo out &gt; $GPIOPATH/gpio3/direction

#Set them to 0 initially
echo 0 &gt; $GPIOPATH/gpio0/value
echo 0 &gt; $GPIOPATH/gpio1/value
echo 0 &gt; $GPIOPATH/gpio3/value</pre>
<p>A few things to note:</p>
<ul>
<li>Remember, GPIO 2 is the RF LED.</li>
<li>Invert the values if you are using an active low line and 3.3v from elsewhere.</li>
</ul>
<p>After this, you just have to &#8216;echo 0&#8242; or &#8216;echo 1&#8242; into the &#8216;value&#8217; of the GPIO line to turn it on or off.</p>
<p>&nbsp;</p>
<p>As shown in the videos, my script does two things: It flashes the LED blue-cyan under normal circumstances, with the speed dependent on system load average, and it flashes red if a connection problem is detected. Right now, the scripts are a hacked-together mess, so I&#8217;ll post them if I get them cleaned up.</p>
<h1>Pictures and Videos</h1>
<p>Videos coming soon, enjoy the pictures for now.</p>
<p><a href="http://blog.mattventura.net/wp-content/uploads/red.jpg"><img class="alignnone size-thumbnail wp-image-341" title="red" src="http://blog.mattventura.net/wp-content/uploads/red-300x225.jpg" alt="" width="300" height="225" /></a><a href="http://blog.mattventura.net/wp-content/uploads/green.jpg"><img class="alignnone size-thumbnail wp-image-339" title="green" src="http://blog.mattventura.net/wp-content/uploads/green-300x225.jpg" alt="" width="300" height="225" /></a><a href="http://blog.mattventura.net/wp-content/uploads/blue.jpg"><img class="alignnone size-thumbnail wp-image-337" title="blue" src="http://blog.mattventura.net/wp-content/uploads/blue-300x225.jpg" alt="" width="300" height="225" /></a><a href="http://blog.mattventura.net/wp-content/uploads/magenta.jpg"><img class="alignnone size-thumbnail wp-image-340" title="magenta" src="http://blog.mattventura.net/wp-content/uploads/magenta-300x225.jpg" alt="" width="300" height="225" /></a><a href="http://blog.mattventura.net/wp-content/uploads/yellow.jpg"><img class="alignnone size-thumbnail wp-image-343" title="yellow" src="http://blog.mattventura.net/wp-content/uploads/yellow-300x225.jpg" alt="" width="300" height="225" /></a><a href="http://blog.mattventura.net/wp-content/uploads/cyan.jpg"><img class="alignnone size-thumbnail wp-image-338" title="cyan" src="http://blog.mattventura.net/wp-content/uploads/cyan-300x225.jpg" alt="" width="300" height="225" /></a><a href="http://blog.mattventura.net/wp-content/uploads/white.jpg"><img class="alignnone size-thumbnail wp-image-342" title="white" src="http://blog.mattventura.net/wp-content/uploads/white-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://mattventura.net/2011/08/11/an-rgb-led-for-your-rspro/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Review: RouterStation Pro + SR71A</title>
		<link>http://mattventura.net/2011/04/02/review-routerstation-pro-sr71a/</link>
		<comments>http://mattventura.net/2011/04/02/review-routerstation-pro-sr71a/#comments</comments>
		<pubDate>Sat, 02 Apr 2011 18:08:48 +0000</pubDate>
		<dc:creator>Matt Ventura</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mattventura.net/?p=306</guid>
		<description><![CDATA[After finally deciding to replace an aging WRT54GL, I decided to not get a typical poor-performing home router and go for a more professional product. The RouterStation Pro fit my needs perfectly, with its expandability and performance being far beyond most home routers. Read on for the review and pics.
I ordered the RSPro kit V2 [...]]]></description>
			<content:encoded><![CDATA[<p>After finally deciding to replace an aging WRT54GL, I decided to not get a typical poor-performing home router and go for a more professional product. The RouterStation Pro fit my needs perfectly, with its expandability and performance being far beyond most home routers. Read on for the review and pics.</p>
<p><span id="more-306"></span>I ordered the RSPro kit V2 and the SR71-A kit from <a href="http://store.netgate.com/" target="_blank">Netgate</a>. The kits are not pre-assembled, so some work is required.</p>
<p><a href="http://blog.mattventura.net/wp-content/uploads/IMG_5293.jpg"><img class="alignnone size-full wp-image-309" title="IMG_5293" src="http://blog.mattventura.net/wp-content/uploads/IMG_5293.jpg" alt="" width="640" height="480" /></a></p>
<p>Basically, the procedure involved attaching a mounting bracket, removing the old serial port screws, then securing the back plate on with new ones. You then would install the card and pigtails.</p>
<p><a href="http://blog.mattventura.net/wp-content/uploads/IMG_5295.jpg"><img class="alignnone size-full wp-image-311" title="IMG_5295" src="http://blog.mattventura.net/wp-content/uploads/IMG_5295.jpg" alt="" width="640" height="480" /></a></p>
<p><a href="http://blog.mattventura.net/wp-content/uploads/IMG_5295.jpg"></a><a href="http://blog.mattventura.net/wp-content/uploads/IMG_5296.jpg"><img class="alignnone size-full wp-image-312" title="IMG_5296" src="http://blog.mattventura.net/wp-content/uploads/IMG_5296.jpg" alt="" width="640" height="480" /></a></p>
<p><a href="http://blog.mattventura.net/wp-content/uploads/IMG_5297.jpg"><img class="alignnone size-full wp-image-313" title="IMG_5297" src="http://blog.mattventura.net/wp-content/uploads/IMG_5297.jpg" alt="" width="640" height="480" /></a></p>
<p>After that, you just have to slide the assembly into case, screw the back panel on, and then install the front panel and light guide.</p>
<p><a href="http://blog.mattventura.net/wp-content/uploads/IMG_5298.jpg"><img class="alignnone size-full wp-image-314" title="IMG_5298" src="http://blog.mattventura.net/wp-content/uploads/IMG_5298.jpg" alt="" width="640" height="480" /></a></p>
<p><a href="http://blog.mattventura.net/wp-content/uploads/IMG_5299.jpg"><img class="alignnone size-full wp-image-315" title="IMG_5299" src="http://blog.mattventura.net/wp-content/uploads/IMG_5299.jpg" alt="" width="640" height="480" /></a></p>
<p>The default software on the router was OpenWRT, but not the latest version. I decided to update to the latest stable Backfire, 10.03. However, the SR-71A was not recognized. Updating to 10.03-rc3 solved this problem, and the radio was usable. The router&#8217;s CPU blows away typical home routers, with a stock clock of 680MHz (some other sources report 720MHz). In addition, there are four gigabit ports with the WAN port being on a separate interface and supporting PoE. The router requires 48V DC power, which can be supplied through either the dedicated DC-in jack or through the WAN port.</p>
<p>The back of the router is where all the interesting stuff is. People who want to add serial ports to their routers often have to go through a bit of work to install one, but this box has one built in. In addition, it has SDIO and USB support built in. SDIO can be used for anything from Wifi cards to GPS receivers. There are 10 antenna holes on the back, and 6 on the front. The antenna holes are SMA/RP-SMA-sized. There are three mini PCI slots, which can be used for WLAN cards or other peripherals such as storage controllers and crypto accelerators. There are even mini PCI Ethernet cards available, if four ports aren&#8217;t enough for you. My card of choice, the SR71-A, supports 2.4GHz and 5-5.8GHz, with a transmit power of 24dBm.</p>
<p>One particular problem I had was the regulatory limitations placed on certain channels. The SR71A supports both 2.4GHz and 5GHz (not simultaneously) but many of the 5GHz channels are limited to either 17dBm or 20dBm due to regulations, compared to the 27dBm limit on the 2.4GHz range. When I tried to use the 2.4GHz band instead, I was unable to use a 40MHz channel width due to too many other APs, so I couldn&#8217;t get more than 144mbit/s theoretical on 2.4GHz. Using the 5Ghz range solved this problem, but I had to use the highest channels (Channels 149-165) in order to use higher transmission power. My laptop (with Intel 6300 wifi card) could easily get over 60mb/s from upstairs, and it achieved over 100mbit/s while near the router. Despite the great performance, in hindsight, I would have probably gotten the SR71-15 instead, a 5GHz-only card, which has more transmit power. In addition, the tri-band antennas have decent gain (5dBi on 5GHz) but there are single-band antennas of much higher gain. Since the card only supports one band at a time, you would need separate antennas anyway if you wanted simultaneous dual-band because you would you need to use two cards. The RSPro has support for three cards, so you could easily do a simultaneous dual-band system by using a 2.4GHz card and a 5GHz card and you would still have a slot left over for whatever else you wanted to do with the board.</p>
<h1>Gripes</h1>
<p>I don&#8217;t have any major problems with the device, but I have some small concerns. First of all, many of Ubiquiti&#8217;s other products have sufficient LEDs on the front, usually the standard stuff, plus a signal bar. The RouterStation Pro only has a power LED, Ethernet LEDs, and one RF LED. One RF LED would not be sufficient if you would like to use more than one wifi card, and wish to have one LED for each card. For comparison, the WRT54GL has a programmable power led, DMZ LED, WLAN LED, and two different colored LEDs behind the Cisco logo.</p>
<p>Secondly, the SR-71A is not <em>officially</em> supported, and is not supported in the stock firmware, as of writing this. This is kind of disappointing to see Ubiquiti&#8217;s best card not being officially supported on their <em>own device</em>, especially when I was able to get it to work simply by updating the firmware.</p>
<p>Lastly, there appears to be some kind of bug with either ath9k or some other part of OpenWRT. After a while (sometimes hours, sometimes days), any wireless clients will lose connectivity to any routed networks. They can still connect to bridged hosts, but not any outside hosts. Running &#8216;wifi&#8217; fixes this (temporarily).</p>
<h1>Rating</h1>
<p>Overall, it is a pretty nice board, and is a better value than most of its competitors.</p>
<p>Price: 9/10 (Cheaper than similar boards)<br />
Performance: 8/10 (Could have had more flash)<br />
Features: 9/10 (Good, other than a few minor issues)</p>
]]></content:encoded>
			<wfw:commentRss>http://mattventura.net/2011/04/02/review-routerstation-pro-sr71a/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>MVpybot stuff</title>
		<link>http://mattventura.net/2011/01/03/mvpybot-stuff/</link>
		<comments>http://mattventura.net/2011/01/03/mvpybot-stuff/#comments</comments>
		<pubDate>Tue, 04 Jan 2011 06:44:52 +0000</pubDate>
		<dc:creator>Matt Ventura</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mattventura.net/?p=316</guid>
		<description><![CDATA[Just a few minor fixes, new version should be in SVN.
]]></description>
			<content:encoded><![CDATA[<p>Just a few minor fixes, new version should be in SVN.</p>
]]></content:encoded>
			<wfw:commentRss>http://mattventura.net/2011/01/03/mvpybot-stuff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Major MVPyBot Update</title>
		<link>http://mattventura.net/2010/08/14/major-mvpybot-update/</link>
		<comments>http://mattventura.net/2010/08/14/major-mvpybot-update/#comments</comments>
		<pubDate>Sun, 15 Aug 2010 01:17:21 +0000</pubDate>
		<dc:creator>Matt Ventura</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mattventura.net/?p=301</guid>
		<description><![CDATA[The bot now supports &#8220;hot reloading.&#8221; The bot can now reload itself without losing connection due to a new wrapper.
You need to run &#8216;mvpybot.py 0&#8242; because start.py is broken now. Substitute the zero with a different server number if you want to connect to a different server.
]]></description>
			<content:encoded><![CDATA[<p>The bot now supports &#8220;hot reloading.&#8221; The bot can now reload itself without losing connection due to a new wrapper.</p>
<p>You need to run &#8216;mvpybot.py 0&#8242; because start.py is broken now. Substitute the zero with a different server number if you want to connect to a different server.</p>
]]></content:encoded>
			<wfw:commentRss>http://mattventura.net/2010/08/14/major-mvpybot-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MVpybot Major Update</title>
		<link>http://mattventura.net/2010/06/26/mvpybot-major-update/</link>
		<comments>http://mattventura.net/2010/06/26/mvpybot-major-update/#comments</comments>
		<pubDate>Sun, 27 Jun 2010 05:25:31 +0000</pubDate>
		<dc:creator>Matt Ventura</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mattventura.net/?p=290</guid>
		<description><![CDATA[There is a somewhat-major bot update in the works. The plugins system has been completely redone. Instead of plugin files being used for whatever functions can be found in them, they now have to explicitly register functions. Here is an example, the rewritten ping plugin:
#!/usr/bin/python

def register():
 registerfunction('ping', ping)
 addhelp('ping', help_ping)

def ping():
 outstuff=''
 print "ping called"
 [...]]]></description>
			<content:encoded><![CDATA[<p>There is a somewhat-major bot update in the works. The plugins system has been completely redone. Instead of plugin files being used for whatever functions can be found in them, they now have to explicitly register functions. Here is an example, the rewritten ping plugin:</p>
<pre>#!/usr/bin/python

def register():
 registerfunction('ping', ping)
 addhelp('ping', help_ping)

def ping():
 outstuff=''
 print "ping called"
 if (len(cmd)&lt;2):
  return('PRIVMSG %s :Incorrect usage. Syntax: ping (4|6) &lt;address&gt;.' %(channel))
 else:
  if cmd[1]=='4' or cmd[1]=='6':
   if cmd[1]=='4':

    output=syscmd(['ping','-c','5','-i','0.2',cmd[2]])
    outsplit=output.split('\n')
    outparts=outsplit[-3:-1]
    for part in outparts:
     outstuff+='PRIVMSG %s :%s\n' %(channel,part) 

   if cmd[1]=='6':

    output=syscmd(['ping6','-c','5','-i','0.2',cmd[2]])
    outsplit=output.split('\n')
    outparts=outsplit[-3:-1]
    for part in outparts:
     outstuff+='PRIVMSG %s :%s\n' %(channel,part)
  return(outstuff)
  else:
   return('PRIVMSG %s :Error: protocol must be either 4 or 6' %channel)

def help_ping():
 return('PRIVMSG %s :Pings an internet address. Usage: ping (4|6) &lt;address&gt;.' %(channel))
</pre>
<p>A plugin&#8217;s register() function is called when the plugin is loaded. It can use registerfunction(), addlistener(), and addhelp(). You can use each function as many times as you want, in case you have multiple functions and/or listeners, or if you want to include help with your plugin.</p>
<p>Read more to find out how to use the new plugin features.</p>
<p><span id="more-290"></span></p>
<h2>Function Usage</h2>
<p>registerfunction() usage:</p>
<pre>registerfunction('command', function)
</pre>
<p>where &#8216;command&#8217; is the command that the user would use to access this function, and &#8220;function&#8221; is the actual python function that you have defined in your module. See the ping example above for a usage example.</p>
<p>addlistener() usage:</p>
<pre>addlistener('type', function)
</pre>
<p>For addlistener(), &#8216;type&#8217; is a string denoting the type of event to call the function on, such as &#8220;any&#8221; or &#8220;privmsg&#8221;. &#8220;function&#8221; works the same as with registerfunction().</p>
<p>addhelp() usage:</p>
<pre>addhelp('command', function)</pre>
<p>&#8216;command&#8217; is the command that the user will access help on (eg, if &#8216;command&#8217; was &#8216;mycommand&#8217;, the user would use &#8216;help mycommand&#8217; to read the help.) Function works the same as the others.</p>
<h2>Other Notes</h2>
<p>All plugins go in the &#8220;modules&#8221; folder now. There are no longer separate folders for different types of plugins.</p>
<p>I have not yet rewritten the on-the-fly module management commands (enabling, disabling, reloading, etc) so you will not be able to use these with the new system until I feel like rewriting them.</p>
]]></content:encoded>
			<wfw:commentRss>http://mattventura.net/2010/06/26/mvpybot-major-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More MVpybot stuff</title>
		<link>http://mattventura.net/2010/04/30/more-mvpybot-stuff/</link>
		<comments>http://mattventura.net/2010/04/30/more-mvpybot-stuff/#comments</comments>
		<pubDate>Sat, 01 May 2010 02:49:37 +0000</pubDate>
		<dc:creator>Matt Ventura</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mattventura.net/?p=287</guid>
		<description><![CDATA[First of all, while I figure out how to have a system for hosting modules, I will put modules in mattventura.net/mvpybot/modules. Secondly, a bug tracking system is being set up.
Lastly, I will be improving the plugin system, and I will try to make older plugins backwards-compatible, but the new system will make the plugin system [...]]]></description>
			<content:encoded><![CDATA[<p>First of all, while I figure out how to have a system for hosting modules, I will put modules in <a href="http://mattventura.net/mvpybot/modules">mattventura.net/mvpybot/modules</a>. Secondly, a bug tracking system is being set up.</p>
<p>Lastly, I will be improving the plugin system, and I will try to make older plugins backwards-compatible, but the new system will make the plugin system more efficient. Instead of always having to scan for functions in plugins whenever a certain command is called, all function plugins will register in a list of plugins upon being loaded. This has the advantage of also allowing plugin authors to specify what functions are actual functions for the bot to use.</p>
]]></content:encoded>
			<wfw:commentRss>http://mattventura.net/2010/04/30/more-mvpybot-stuff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MVpybot: Update 2</title>
		<link>http://mattventura.net/2010/01/18/mvpybot-update-2/</link>
		<comments>http://mattventura.net/2010/01/18/mvpybot-update-2/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 07:06:41 +0000</pubDate>
		<dc:creator>Matt Ventura</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[irc]]></category>
		<category><![CDATA[mvpybot]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.mattventura.net/?p=278</guid>
		<description><![CDATA[I just did another major update to MVpybot. Listeners have been implemented. A listener is a function that gets called whenever the bot receives data, or it can be set to only be called when a certain type (privmsg, join, part, etc) is received. As usual, the source is at the SVN repo.
Now for the [...]]]></description>
			<content:encoded><![CDATA[<p>I just did another major update to MVpybot. Listeners have been implemented. A listener is a function that gets called whenever the bot receives data, or it can be set to only be called when a certain type (privmsg, join, part, etc) is received. As usual, the source is at <a title="SVN" href="http://theoks.net/viewvc/mvpybot/">the SVN repo</a>.</p>
<p>Now for the technical stuff. A listener is just a python file in the listeners folder, with functions defined in it. A function&#8217;s name should be botfunction_type, where type is the type of message to listen for (privmsg, join, part, etc) or it can be &#8216;any&#8217; for all data received by the bot. Here is an example logger function:</p>
<pre>#!/usr/bin/python

import time

enabled=1

logfile=open('log','a')
timestamp=time.strftime('[ Session starting at %y-%m-%d %H:%M:%S ]')
logfile.write(timestamp+'\n')
logfile.close()

def botfunction_any():
 logfile=open('log','a')
 timestamp=time.strftime('[%y-%m-%d %H:%M:%S] ')
 logfile.write(timestamp+line+'\n')
 logfile.close()</pre>
<p>As you can see from the example, plugins can be quickly enabled or disabled by toggling the &#8216;enabled&#8217; flag. Also, &#8216;line&#8217; is passed to the plugin. Not that anything outside of function definitions will be run when the bot starts.</p>
<p>Listeners can use the &#8217;socket&#8217; variable to send data to the server, as shown in this example:</p>
<pre>#!/usr/bin/python

enabled=0

def botfunction_privmsg():
 print "called"
 out="PRIVMSG %s :Botfunction_privmsg called" %(channel)
 print out
 socket.send(out+'\n')</pre>
<p>Note that in the example, it uses botfunction_privmsg. To make listeners easier to write, the main program will automatically figure out these variables from privmsgs and pass them to the function:</p>
<pre>info         #user info
msg          #the message
channel      #the channel the message was from (set to the sender for private messages)
sender       #the sender of the message
senderstuff  #info of the sender
isprivate    #whether or not the message was a private message as opposed to a channel message.</pre>
<p>This only applies to privmsgs. All other events only get &#8217;socket&#8217; and &#8216;line&#8217; passed and have to figure out everything from &#8216;line&#8217;</p>
<p>That&#8217;s all for now.</p>
]]></content:encoded>
			<wfw:commentRss>http://mattventura.net/2010/01/18/mvpybot-update-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MVpybot: Update</title>
		<link>http://mattventura.net/2009/12/22/mvpybot-update/</link>
		<comments>http://mattventura.net/2009/12/22/mvpybot-update/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 23:29:18 +0000</pubDate>
		<dc:creator>Matt Ventura</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[irc]]></category>
		<category><![CDATA[mvpybot]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.mattventura.net/?p=262</guid>
		<description><![CDATA[Well, i&#8217;ve finally gotten around to putting out some decent source for the bot. Here it is. There is also an addon system. To make an addon, simply make a python file in the botplugins/ folder and put your code in, like this:
#!/usr/bin/python 

def test():
 return("PRIVMSG %s :test" %(channel))
This would make a function called test. [...]]]></description>
			<content:encoded><![CDATA[<p>Well, i&#8217;ve finally gotten around to putting out some decent source for the bot. <a href="http://theoks.net/viewvc/mvpybot/">Here it is.</a> There is also an addon system. To make an addon, simply make a python file in the botplugins/ folder and put your code in, like this:</p>
<pre>#!/usr/bin/python 

def test():
 return("PRIVMSG %s :test" %(channel))</pre>
<p>This would make a function called test. The variables channel, sender, nick, cmd, and run are passed to the function. The functions syscmd() and getlevel() are also passed to the plugin.</p>
<p>The default plugins that are included with the bot are ping, for pinging addresses, testplugin, for testing the bot, yacas, for doing math with yacas (delete it if you don&#8217;t have yacas installed) and getlevel, for demonstrating the ability to use the getlevel function in a plugin.</p>
<p>I have also set up a page for the bot, see the links bar below the logo.</p>
]]></content:encoded>
			<wfw:commentRss>http://mattventura.net/2009/12/22/mvpybot-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python IRC Bot in the Works</title>
		<link>http://mattventura.net/2009/12/05/python-irc-bot-in-the-works/</link>
		<comments>http://mattventura.net/2009/12/05/python-irc-bot-in-the-works/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 20:59:01 +0000</pubDate>
		<dc:creator>Matt Ventura</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[irc]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.mattventura.net/?p=254</guid>
		<description><![CDATA[*** Update ***: Main page for bot here
I am currently writing a small, fast, small-footprint IRC bot in Python. More details as I finish the bot. The functions created so far:

Help (Displays Help)
Echo (Echo back a message)
Say (Send a message to a channel)
Spam (Send a message to a channel a specified amount of times)
Join (Join [...]]]></description>
			<content:encoded><![CDATA[<p>*** Update ***: Main page for bot <a href="/mvpybot/">here</a></p>
<p>I am currently writing a small, fast, small-footprint IRC bot in Python. More details as I finish the bot. The functions created so far:</p>
<ul>
<li>Help (Displays Help)</li>
<li>Echo (Echo back a message)</li>
<li>Say (Send a message to a channel)</li>
<li>Spam (Send a message to a channel a specified amount of times)</li>
<li>Join (Join a channel)</li>
<li>Part (Part a channel)</li>
<li>Authorization (username+password)</li>
<li>Deauthorization</li>
<li>User lookup</li>
<li>Raw (Use raw IRC commands)</li>
<li>Uptime (Display uptime)</li>
<li>Math (Do math functions with Yacas)</li>
</ul>
<p>Planned functions:</p>
<ul>
<li>Encrypted passwords</li>
<li>Data storage, either in a text file or a MySQL DB</li>
<li>Channel mode control</li>
</ul>
<p>This bot is not meant to be a complex bot, it is intended to be a fast, light bot that can be easily reprogrammed.</p>
]]></content:encoded>
			<wfw:commentRss>http://mattventura.net/2009/12/05/python-irc-bot-in-the-works/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Comparison 3: Laptops</title>
		<link>http://mattventura.net/2009/11/08/comparison-3-laptops/</link>
		<comments>http://mattventura.net/2009/11/08/comparison-3-laptops/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 06:13:37 +0000</pubDate>
		<dc:creator>Matt Ventura</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.mattventura.net/?p=247</guid>
		<description><![CDATA[Since laptops are becoming more and more popular these days, I decided to finally do a comparison on laptops as opposed to desktops. I&#8217;ll compare two laptops from Apple, Dell, HP, and whatever other good deals I can find.
To be more fair this time, I&#8217;ll start with Apple and set a budget accordingly, since Apples [...]]]></description>
			<content:encoded><![CDATA[<p>Since laptops are becoming more and more popular these days, I decided to finally do a comparison on laptops as opposed to desktops. I&#8217;ll compare two laptops from Apple, Dell, HP, and whatever other good deals I can find.</p>
<p><span id="more-247"></span>To be more fair this time, I&#8217;ll start with Apple and set a budget accordingly, since Apples cheapest laptop at the time of writing is $999. I&#8217;ll start with that one.</p>
<p>The $999 Macbook has a 13&#8243; screen and a 2.26Ghz C2D. Not a bad CPU for a laptop. It has only 2GB of RAM, which can be upgraded to 4 for $100, but seems substandard these days. Unfortunately, already being at the budget, I couldn&#8217;t get any upgrades.</p>
<p>Looking at Dell&#8217;s lineup, everything starts at under $1000 in the studio line. They have an i7 version of the studio 17, which would almost certainly beat everything else, but it was over budget. I decided to start with the basic Studio 17. I took an upgrade to 4GB of RAM and an upgrade to a 4650 from an Intel GPU. Getting an 802.11n card put me $75 under budget, so I upgraded to CPU to end up at exactly $999.</p>
<p>Now for HP. I went to &#8220;high performance&#8221; and started with the dv7t. I upgraded to 4GB of DDR3, took the free upgrade to a 320GB hard drive, upgraded to a 4650 1GB, and got 802.11n+bluetooth, which put me at $989.</p>
<p>On to Lenovo. The Y550 was under $1000 and had discrete graphics, so I went with the top model. It was $688, so I had some room to improve it. Also, it was clear that it was better than the other systems in some areas. I upgrade the wireless to 802.11n, upgraded to 4GB DDR3, and had $220 left to spend. I got a 500GB HDD, bluetooth, and still had money to spend. I upgraded the CPU to a 2.53GHz C2D, but this put me slightly over, so I downgraded to a 320GB HDD.</p>
<p>For the last laptop, I decided to go with a Sony. The Vaio SR started at $819, which should leave plenty of room for improvement.</p>
<table border="0">
<tbody>
<tr>
<td></td>
<td>Macbook</td>
<td>Dell Studio 17</td>
<td>HP</td>
<td>Lenovo</td>
<td>Vaio</td>
</tr>
<tr>
<td>CPU</td>
<td><span style="color: #000000;">2.26Ghz C2D</span></td>
<td><span style="color: #000000;">2.2GHz C2D</span></td>
<td>2.2GHz C2D</td>
<td><span style="color: #008000;">2.53GHz C2D</span></td>
<td><span style="color: #800000;">2.13GHz C2D</span></td>
</tr>
<tr>
<td>RAM</td>
<td><span style="color: #800000;">2GB <span style="color: #008000;">DDR3</span><br />
</span></td>
<td><span style="color: #008000;">4GB DDR3 1066</span></td>
<td><span style="color: #008000;">4GB DDR3</span></td>
<td><span style="color: #008000;">4GB DDR3<br />
</span></td>
<td><span style="color: #800000;"><span style="color: #008000;">4GB</span> DDR2</span></td>
</tr>
<tr>
<td>Video card</td>
<td><span style="color: #008000;">9400M</span></td>
<td><span style="color: #008000;">4650M 1GB<br />
</span></td>
<td><span style="color: #008000;">4650m 1GB<br />
</span></td>
<td><span style="color: #008000;">240M 1GB<br />
</span></td>
<td><span style="color: #800000;">4570 512MB<br />
</span></td>
</tr>
<tr>
<td>Hard Drive</td>
<td><span style="color: #000000;">250GB</span></td>
<td>250GB</td>
<td>250GB</td>
<td><span style="color: #008000;">320GB</span></td>
<td><span style="color: #800000;">160GB</span></td>
</tr>
<tr>
<td>Screen Size</td>
<td><span style="color: #800000;">13&#8243;</span></td>
<td><span style="color: #008000;">17&#8243;</span></td>
<td><span style="color: #008000;">17&#8243;</span></td>
<td>15.6&#8243;</td>
<td><span style="color: #000000;">15&#8243;</span></td>
</tr>
<tr>
<td>Screen Resolution</td>
<td><span style="color: #800000;">1280&#215;800</span></td>
<td><span style="color: #000000;">1440&#215;900</span></td>
<td><span style="color: #800000;"><span style="color: #008000;">1600&#215;900</span></span></td>
<td>1366&#215;768</td>
<td>?</td>
</tr>
<tr>
<td>Wireless</td>
<td><span style="color: #008000;">802.11n</span></td>
<td><span style="color: #008000;">802.11n</span></td>
<td><span style="color: #008000;">802.11n</span></td>
<td><span style="color: #008000;">802.11n</span></td>
<td><span style="color: #008000;">802.11n</span></td>
</tr>
<tr>
<td>Price</td>
<td>$999</td>
<td>$999</td>
<td>$989</td>
<td>$989</td>
<td>$969</td>
</tr>
</tbody>
</table>
<p>As you can see, the Macbook has poor RAM capacity, but makes up for it with a decent graphics card and CPU. The Lenovo, Dell, and HP seem to be the best overall, whereas the Sony seems to have lack in certain areas. No DDR3, slowest CPU, and smallest hard drive. Overall, all the laptops seems to be more even, and it&#8217;s nice to see Apple doesn&#8217;t seem to be doing the usual price-gouging routine, at least not as much.</p>
<p>Note: this is not intended to be a buying guide. This is just for showing which brands will give you the best computer for your money.</p>
]]></content:encoded>
			<wfw:commentRss>http://mattventura.net/2009/11/08/comparison-3-laptops/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

