<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Nerdy Dork</title>
	
	<link>http://www.nerdydork.com</link>
	<description>Dustin Davis reviews... the internet.</description>
	<lastBuildDate>Thu, 17 May 2012 20:16:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/NerdyDork" /><feedburner:info uri="nerdydork" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>How to Reset a Django Admin Password</title>
		<link>http://feedproxy.google.com/~r/NerdyDork/~3/cANOcpvRAHw/how-to-reset-a-django-admin-password.html</link>
		<comments>http://www.nerdydork.com/how-to-reset-a-django-admin-password.html#comments</comments>
		<pubDate>Tue, 06 Mar 2012 18:11:05 +0000</pubDate>
		<dc:creator>Dustin</dc:creator>
				<category><![CDATA[Programming & Internet]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.nerdydork.com/?p=926</guid>
		<description><![CDATA[This is just a quick post to give a tip on how to recover or reset your Django admin username and/or password. Use your django shell to query the User model. $ python manage.py shell &#62;&#62;&#62; from django.contrib.auth.models import User If you can&#8217;t remember your username, you can view all users in the system. &#62;&#62;&#62; [...]
Related posts:<ol>
<li><a href='http://www.nerdydork.com/setting-up-a-znc-irc-bouncer.html' rel='bookmark' title='Setting Up a ZNC IRC Bouncer'>Setting Up a ZNC IRC Bouncer</a> <small>First of all, I&#8217;ll skip the discussion on what ZNC...</small></li>
<li><a href='http://www.nerdydork.com/django-color-theme-for-pycharm.html' rel='bookmark' title='Django Color Theme for PyCharm'>Django Color Theme for PyCharm</a> <small>Since I started writing Django, I&#8217;ve changed editors at least...</small></li>
<li><a href='http://www.nerdydork.com/django-dev-environment-virtualenv-pip-git-pycharm.html' rel='bookmark' title='My Django Dev Environment: Virtualenv, pip, git, &amp; PyCharm'>My Django Dev Environment: Virtualenv, pip, git, &#038; PyCharm</a> <small>Even though I&#8217;ve heard how wonderful virtualenv &amp; pip are...</small></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<div class='wp_fbr_top'></div><div class='wb_fb_top'><div style="float:right;"></div></div><p>This is just a quick post to give a tip on how to recover or reset your Django admin username and/or password.</p>
<p>Use your django shell to query the User model.</p>
<p><code>$ python manage.py shell</code></p>
<p><code>&gt;&gt;&gt; from django.contrib.auth.models import User</code></p>
<p>If you can&#8217;t remember your username, you can view all users in the system.</p>
<p><code>&gt;&gt;&gt; for u in User.objects.all():<br />
&gt;&gt;&gt;   print u.username<br />
&gt;&gt;&gt;</code></p>
<p>Once you know your username, you can simply reset the password:</p>
<p><code>&gt;&gt;&gt; u = User.objects.get(username='dustin')<br />
&gt;&gt;&gt; u.set_password('secret')<br />
&gt;&gt;&gt; u.save()</code></p>
<p>Related posts:<ol>
<li><a href='http://www.nerdydork.com/setting-up-a-znc-irc-bouncer.html' rel='bookmark' title='Setting Up a ZNC IRC Bouncer'>Setting Up a ZNC IRC Bouncer</a> <small>First of all, I&#8217;ll skip the discussion on what ZNC...</small></li>
<li><a href='http://www.nerdydork.com/django-color-theme-for-pycharm.html' rel='bookmark' title='Django Color Theme for PyCharm'>Django Color Theme for PyCharm</a> <small>Since I started writing Django, I&#8217;ve changed editors at least...</small></li>
<li><a href='http://www.nerdydork.com/django-dev-environment-virtualenv-pip-git-pycharm.html' rel='bookmark' title='My Django Dev Environment: Virtualenv, pip, git, &amp; PyCharm'>My Django Dev Environment: Virtualenv, pip, git, &#038; PyCharm</a> <small>Even though I&#8217;ve heard how wonderful virtualenv &amp; pip are...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.nerdydork.com/how-to-reset-a-django-admin-password.html/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		<feedburner:origLink>http://www.nerdydork.com/how-to-reset-a-django-admin-password.html</feedburner:origLink></item>
		<item>
		<title>Herniated L5-S1 Disc</title>
		<link>http://feedproxy.google.com/~r/NerdyDork/~3/nSNWVrfa6LM/herniated-l5-s1-disc.html</link>
		<comments>http://www.nerdydork.com/herniated-l5-s1-disc.html#comments</comments>
		<pubDate>Thu, 26 Jan 2012 21:18:21 +0000</pubDate>
		<dc:creator>Dustin</dc:creator>
				<category><![CDATA[Programming & Internet]]></category>
		<category><![CDATA[Yada]]></category>
		<category><![CDATA[back]]></category>
		<category><![CDATA[herniated disc]]></category>

		<guid isPermaLink="false">http://www.nerdydork.com/?p=912</guid>
		<description><![CDATA[I thought I&#8217;d share the story of how I herniated a disc in my back to hopefully education some programmers out there on why it is important to get up, stretch, work out, drink water, and all that healthy jazz you hear people talk about. Getting in the zone is great, but as you get [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<div class='wp_fbr_top'></div><div class='wb_fb_top'><div style="float:right;"></div></div><p><a href="http://218027m9pbuhbe3ikik1jkew07.hop.clickbank.net/?tid=NERDYDORK"><img class="alignright size-thumbnail wp-image-916" title="Herniated Disc: A Survival Guide" src="http://www.nerdydork.com/wp-content/uploads/2012/01/clip_image003-150x150.jpg" alt="" width="150" height="150" /></a>I thought I&#8217;d share the story of how I herniated a disc in my back to hopefully education some programmers out there on why it is important to get up, stretch, work out, drink water, and all that healthy jazz you hear people talk about. <a href="http://www.nerdydork.com/how-sports-improves-programmer-focus.html" class="broken_link">Getting in the zone</a> is great, but as you get older, it&#8217;s not a good idea to get in the zone for more than an hour at a time.</p>
<p>I&#8217;ll admit, the older I get, the less active I get. In high school I played sports non-stop, moving from football, to basketball to baseball with the passing seasons. My motto in life was &#8220;I don&#8217;t believe in exercise unless it is in the form of a sport.&#8221;</p>
<p>That hasn&#8217;t worked out for me so well the older I have gotten. I always figured I would go on to play college sports, but I broke my arm pitching in the state tournament my senior year, then recovered and served a two year mission and put on about 40 lbs. while there. When I got home, my priorities changed and I was more concerned about earning money than playing sports.</p>
<p>Since then I like to get in on all kinds of pick-up games such as basketball, ultimate frisbee, volleyball, softball and even some raquetball on occasion. That was about the extent of my exercise &#8211; basically whenever I could find a sport to play.</p>
<p>On New Year&#8217;s Eve, our church ward/neighborhood has a tradition of playing basketball. My lower back had been sore for a couple of days, but I generally tolerate pain pretty well and thought I could play anyway. I figured I could use the exercise since it had been a few months since I had played ultimate frisbee due to cold weather. To be honest, it hurt worse that I admitted to anyone. I could barely put on my shoes without wincing in pain.</p>
<p><strong>This should have been a major red flag! I wish I would have taken the time to learn WHY my back was so sore. But, hindsight is 20/20.</strong></p>
<p>So I started playing with a sore back. I didn&#8217;t play too hard because of it. But after a couple of short games, my left leg was hurting clear down to my foot and it was starting to go numb. Still, I didn&#8217;t do much about it. We had plans for the day. We went to lunch at Chili&#8217;s and by that time I couldn&#8217;t sit without being in major pain. I kept having to stad up and walk around. I&#8217;m sure I looked odd standing while my family was sitting and eating.</p>
<p>We then did some shopping when I finally admitted to my wife that I couldn&#8217;t take the pain any longer and I need to go home &amp; lie down.</p>
<p>I pretty much stayed on my back lying on the floor the remainder of the day and that night. I took 800 mg of Ibuprofen, but I didn&#8217;t notice any difference. I probably would have gone to the doctor that day, but I the next day my health insurance was going to change and I didn&#8217;t want to deal with the confusion. By 4:00 AM the next morning, I woke up Rachel and asked her to take me to the ER. I didn&#8217;t know if I could even stand or walk to ge to the car. I didn&#8217;t know how I would survive the drive to the ER.</p>
<p>The pain was excruciating. My legs were shaking uncontrollably and my teeth were chattering from the pain. Fortunately, once I got in the car, I found a position that was comfortable enough for the ride.</p>
<p>At the ER, they gave me a shot of painkiller and a prescription for some stronger pain killers. Then they gave a prescription to have an MRI done.</p>
<p>My first attempt at an MRI was a miserable failure. My pain pills had worn off completely and I wasn&#8217;t given Valium or anything. I lasted about 3 or 4 minutes in the MRI machine before I was screaming in pain for them to get me out. They said there was nothing they could do for me so they just sent me on my way. By this time I was very frustrated &#8211; mainly with myself for not being able to take the pain and being so stupid to play basketball with a sore back.</p>
<p>A couple of days later I had another MRI scheduled at a different facility. They gave me Valium to help calm me down. Again I didn&#8217;t last more that a few minutes in the MRI. I took a break and took the prescribed painkillers and waited for them to kick in to try again. They also tried putting my on my side, which was awkward for the MRI machine. That didn&#8217;t help either. Same result. Then they gave me an epidural with some pain killer and cortisone. Again I waited a bit for it to kick in and went in for my 4th MRI attempt. I don&#8217;t know how long I made it &#8211; probably 5 to 7 minutes. When they pulled me out they said it would just have to be good enough.</p>
<p>Once the cortisone kicked in, it helped out a great deal. But, I was told that it would likely be temporary relief, then I may be back in the same pain. So the next day I set up an appointment with my primary care physician to have him look at the MRI results and make plans going forward. I couldn&#8217;t get in to my doctor as soon as I wanted so I scheduled an appointment with different doctor in that office that I guess had just barely joined that practice.</p>
<p>It turns out that my new doctor had a herniated disc. I came in and never sat. He preferred to stand. He tole me about his experiences and how he had opted out of surgery. He had to manage his condition, but he was able to run and hand been on a mile mile run up the canyon that morning. I think after that appointment was the first time I started seeing hope. I asked for a referral to a Neural Surgeon just in case though so I could get a relationship established just in case I did decide to have surgery.</p>
<p>In the meantime I started doing a lot of research on the internet on things I could do to improve my condition. I bought <a href="http://218027m9pbuhbe3ikik1jkew07.hop.clickbank.net/?tid=NERDYDORK">this eBook</a> that was VERY helpful in helping me understand what had happened, why, and what I could do to improve and live with it, without surgery. It was almost like reading a slideshow with a helpful picture on every page. It took me about an hour to read the whole thing and I understood what was going on.</p>
<p>At my appointment with the neurosurgeon, I was prescribed physical therapy, told to try to walk 3 miles per day and if things didn&#8217;t improve I would likely need a discectomy. He explained that my disc blew out so bad that I had cartilage from the disk sitting on my nerve, which explained the constant numbness in my foot.</p>
<p>I snapped some photos with my iPhone of the MRI results showing the herniation:</p>
<p><a href="http://www.nerdydork.com/wp-content/uploads/2012/01/IMG_0402.jpg"><img class="alignnone size-thumbnail wp-image-913" title="Top down view" src="http://www.nerdydork.com/wp-content/uploads/2012/01/IMG_0402-150x150.jpg" alt="" width="150" height="150" /></a> <a href="http://www.nerdydork.com/wp-content/uploads/2012/01/IMG_0403.jpg"><img class="alignnone size-thumbnail wp-image-914" title="Side view" src="http://www.nerdydork.com/wp-content/uploads/2012/01/IMG_0403-150x150.jpg" alt="" width="150" height="150" /></a> <a href="http://www.nerdydork.com/wp-content/uploads/2012/01/IMG_0404.jpg"><img class="alignnone size-thumbnail wp-image-915" title="More side views" src="http://www.nerdydork.com/wp-content/uploads/2012/01/IMG_0404-150x150.jpg" alt="" width="150" height="150" /></a></p>
<p>So I&#8217;ve been doing physical therapy three times per week and walking about 1.5 miles per day. I think things are improving and I&#8217;m hopeful that they will continue to improve and I can gett the feeling back in my foot.</p>
<p>So again, to recap&#8230; If you sit at a desk all day, get up and stretch at least once an hour. Drink lots of water (this will help you get up and stretch as you are constantly running to the bathroom). If you&#8217;re having lower back pain, DON&#8217;T PLAY BASKETBALL!  Instead, do stretches by laying on your stomach and pressing your upper body up to arch your back more and use ice for relief. Sit up straight in your chair. Raise your monitor, work on good posture. If you really are having back pain, I recommend reading <a href="http://218027m9pbuhbe3ikik1jkew07.hop.clickbank.net/?tid=NERDYDORK">The Herniated Disc Survival Guide</a> which show great stretches you can do and principle of good posture and lifting to improve your back.</p>
<p>Also, I&#8217;ve ordered a GeekDesk for home and my work also bought one for me so I can sit or stand as I please. It&#8217;s hard to stand and work ALL day.</p>
<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.nerdydork.com/herniated-l5-s1-disc.html/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		<feedburner:origLink>http://www.nerdydork.com/herniated-l5-s1-disc.html</feedburner:origLink></item>
		<item>
		<title>Setting Up a ZNC IRC Bouncer</title>
		<link>http://feedproxy.google.com/~r/NerdyDork/~3/BHTmA22p3ik/setting-up-a-znc-irc-bouncer.html</link>
		<comments>http://www.nerdydork.com/setting-up-a-znc-irc-bouncer.html#comments</comments>
		<pubDate>Fri, 20 Jan 2012 17:22:37 +0000</pubDate>
		<dc:creator>Dustin</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[irc]]></category>
		<category><![CDATA[irssi]]></category>
		<category><![CDATA[linode]]></category>
		<category><![CDATA[tmux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[znc]]></category>

		<guid isPermaLink="false">http://www.nerdydork.com/?p=908</guid>
		<description><![CDATA[First of all, I&#8217;ll skip the discussion on what ZNC and IRC are, as you likely know if you are reading this post. I use IRC with my development team at work. It&#8217;s helpful to stay logged in 24/7 to keep up on pertinent discussions. I could stay logged in 24/7 with any IRC client [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<div class='wp_fbr_top'></div><div class='wb_fb_top'><div style="float:right;"></div></div><p>First of all, I&#8217;ll skip the discussion on what <a href="http://wiki.znc.in/ZNC">ZNC</a> and <a href="http://en.wikipedia.org/wiki/Internet_Relay_Chat">IRC</a> are, as you likely know if you are reading this post. I use IRC with my development team at work. It&#8217;s helpful to stay logged in 24/7 to keep up on pertinent discussions. I could stay logged in 24/7 with any IRC client at work, but some days (and perhaps some evenings) I may be working and chatting from home. To solve this problem I was using <a href="http://tmux.sourceforge.net/">tmux</a> and <a href="http://irssi.org/">irssi</a> running on my work computer. If I ever needed to log in from home, I would just ssh into my work computer and connect to tmux.</p>
<p>Since switching jobs, I got a laptop. Obviously it is not connect 24/7. So I switched to using my home computer. In this process of changing, I decided to try out ZNC. The main benefit to ZNC over IRC to me is that I can use other IRC clients that have more features. So I&#8217;m going to explain how I set up ZNC and Limechat (OS X).</p>
<p>I was running ZNC on my home computer &#8211; currently a Mac Pro. But I find either my 1 yr old or 4 yr old keeps getting into my office and turning off my computer. So, just to try it out, I set up a Linode running Ubuntu. Here are the step by step instructions that took me all of 10 minutes to get set up.</p>
<p>If you don&#8217;t have a <a href="http://www.linode.com/?r=0e672eb6d53973f0ac51b6d8e95a067f55a676bb">Linode</a> account, create one. Please feel free to use my <a href="http://www.linode.com/?r=0e672eb6d53973f0ac51b6d8e95a067f55a676bb">affiliate link</a>.</p>
<ol>
<li>Add a Linode. I selected the cheapest one, which is a Linode 512 for $19.95 per month. (I understand that paying $20 is likely a waste of money just for an IRC bouncer, but I&#8217;ll talk about this later&#8230;)</li>
<li>Create an instance of Ubuntu on your Linode. I used Ubuntu 11.10. Make note of your new IP address for your server. You may want to create an entry in your hosts file so you can reference it by name instead of remembering the IP address.</li>
<li>Boot your Linode</li>
<li>ssh into your Linode</li>
<li>Create a new user:</li>
<ul>
<li>adduser &lt;username&gt;</li>
</ul>
<li>Create an admin group</li>
<ul>
<li>addgroup admin</li>
</ul>
<li>Add yourself to the admin group (so you can use sudo)</li>
<ul>
<li>adduser &lt;username&gt; admin</li>
</ul>
<li>Log in to your user account</li>
<ul>
<li>su &lt;username&gt;</li>
</ul>
<li>Install ZNC</li>
<ul>
<li>sudo apt-get install znc</li>
</ul>
<li>Make a ZNC config file</li>
<ul>
<li>znc &#8211;makeconf</li>
<li>Here are the options I selected:</li>
<ul>
<li>listen on port 6667</li>
<li>SSL? no</li>
<li>ipv6? no</li>
<li>Listen host &#8211; left blank for all</li>
<li>No global modules</li>
<li>Username and password &#8211; I used the same as my IRC nick &amp; password so it is easy to remember</li>
<li>Blind host &#8211; left blank</li>
<li>Number of lines to buffer per channel &#8211; 5000 (why not?)</li>
<li>Keep buffers after replay? no</li>
<li>Default channel modes &#8211; went with default [+stn]</li>
<li>yes on on modules</li>
<li>IRC server: irc.freenode.net, port 6667, no password</li>
<li>I added one IRC channel (#utahdjango), I&#8217;ll join the others later</li>
<li>I added my IRC user and password.</li>
<li>Then I started IRC at the end of the script. (If you don&#8217;t, just type &#8216;znc&#8217; to start the znc server)</li>
</ul>
</ul>
<li>Connect to your new server. I used Limechat with the following settings:</li>
<ul>
<li>Network name: Linode ZNC</li>
<li>Server: Name I mapped to my linode IP address in my hosts file. You could just enter your IP address.</li>
<li>Port: 6667</li>
<li>Server Password: passoword I entered on my IRC makeconf script</li>
<li>Nickname: irc nick</li>
<li>Login name: irc nick (remember I used the same nick &amp; password for znc that I use for freenode)</li>
<li>Real Name: Dustin Davis <img src='http://www.nerdydork.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </li>
<li>Nickserv Passoword: same as above</li>
</ul>
</ol>
<p>That was it! I was connected and up and running just like that. Now, I&#8217;m bar far an expert on this stuff, but if you have any questions on what I did, leave a comment below.</p>
<p>Now, as I mentioned, paying $20 per month for an IRC bouncer doesn&#8217;t seem like a great idea. So here are some things to consider&#8230;</p>
<ul>
<li>Use your home computer. If you keep your computer on 24/7 and basically have a static IP this shouldn&#8217;t be a problem. If you have a router, you will have to set up port forwarding as well.</li>
<li>If you don&#8217;t want to leave your main computer or, or use you main computer in this manner, consider buying another computer. I have a friend that uses a plug computer for this purpose. This is actually very tempting for me. Paying for a linode for 5 months is about the same as buying a <a href="http://www.globalscaletechnologies.com/p-22-sheevaplug-dev-kit-us.aspx">$99 plug computer</a>. You would then have a small server running 24/7 on minimal power and it could also be used for a media server by plugging in an external hard drive among other uses. Another options is <a href="http://www.tonidoplug.com/">Tonido Plug</a>, but these always seem to sell out so fast.</li>
<li>User your work computer. This may not be easy. At my old job I was given a static IP and subdomain to connect to my computer.</li>
<li>If you are paying for hosting elsewhere, consider moving your hosting to your new Linode server. This would save you money from hosting elsewhere, but you should be comfortable managing your own hosting server.</li>
</ul>
<p>*** UPDATE ***</p>
<p>I purchased a <a href="http://www.globalscaletechnologies.com/t-guruplugdetails.aspx">GuruPlug</a> and got it set up. I&#8217;m not running znc from it. The set up was pretty much the same, so I won&#8217;t bother documenting it. No more monthly fees and its only consuming 2 watts of power from home!</p>
<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.nerdydork.com/setting-up-a-znc-irc-bouncer.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.nerdydork.com/setting-up-a-znc-irc-bouncer.html</feedburner:origLink></item>
		<item>
		<title>What I’d Change About 99 Designs</title>
		<link>http://feedproxy.google.com/~r/NerdyDork/~3/J0gKu3RUXEg/what-id-change-about-99-designs.html</link>
		<comments>http://www.nerdydork.com/what-id-change-about-99-designs.html#comments</comments>
		<pubDate>Tue, 20 Dec 2011 16:30:07 +0000</pubDate>
		<dc:creator>Dustin</dc:creator>
				<category><![CDATA[Web Sites]]></category>

		<guid isPermaLink="false">http://www.nerdydork.com/?p=904</guid>
		<description><![CDATA[I recently ran a logo design contest on 99 Designs. It was my second contest overall. The first one I did about 2 1/2 years ago was such a success, that it seemed a no-brainer. This recent contest turned out to be a flop, despite paying twice as much this go around. I love the [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<div class='wp_fbr_top'></div><div class='wb_fb_top'><div style="float:right;"></div></div><p>I recently ran a logo design contest on 99 Designs. It was my second contest overall. The first one I did about 2 1/2 years ago was such a success, that it seemed a no-brainer. This recent contest turned out to be a flop, despite paying twice as much this go around.</p>
<p>I love the idea of 99 Designs, but I think the execution could be improved. I was thinking about it this morning as I drove in to work and had some thoughts that I think would improve the service overall.</p>
<p>While 99 Designs is great for the person looking for a design, if I were a designer, I really doubt I would submit anything on 99 Designs. It would be far too much work with very little chance of receiving any compensation. I would perhaps use it as a stepping stone to build a portfolio, but beyond that, I&#8217;m sure I could find far easier &amp; betters ways to get paid.</p>
<p>So the first thing I would do is find a way to reward more designers. Here are my initial thoughts just for a logo competition:</p>
<ul>
<li>Charge $499 for every logo competition.</li>
<li>Allow designers to submit up to 3 designs. It seems on my last competition I had about 60 designs submitted. It seemed half of them came from one designer, and the majority came from 3 designers. Limiting a designer to 3 designs would force them to choose their best work. They could always remove a design and replace it with another.</li>
<li>To play off the name of the site, I would limit the contest to only 99 designs. So in theory if each designer submitted 3 drafts you could only have 33 designers. But not every designer will submit 3 drafts so there could certainly be more.</li>
<li>For every submission the designer will get paid $1 at the end of the competition. There would be checks in place so that the contest owner could mark a design as garbage and X number of other designers could concur to boot the awfully bad design. That designer simply wouldn&#8217;t get paid. So out of the gate, $99 of the $400 would be allocated to paying out submissions.</li>
<li>Each designer that submits work would be allowed to rate other designs, but not their own. As a project owner I would be curious to get such immediate feedback. At the end of the competition, the design with the highest average peer rating would get $25 (consider this the Miss Congeniality award). That leaves $375 in the pool</li>
<li>At the end of the submission deadline, the project owner could have some choices: 1) refund of $370. They are out $129 for running the competition ($5 service fee would go to 99 Designs to cover any credit card transaction fees and just a small charge for using the service. 2) Create a poll. They would select their top 6 designs to create a poll. Anyone selected for the poll would get a $10 bonus. That would leave s the pool with a minimum of $315. 3) Choose an outright winner. At this point 99 Designs takes their usual cut and the winner gets the rest.</li>
<li>If the project owner chose to do a poll and submit to friends &amp; colleagues on twitter, the highest rated logo would receive an additional $25 leaving the pool at $290. At this point the project owner would select a winner. 99 Designs would take their cut and the winner would get the remainder.</li>
</ul>
<p>I don&#8217;t know if this would fix much, but I have a feeling it would attract more designers and more designs per competition. The numbers are just straight off the top of my head. Some testing could be done to find the sweet spots.</p>
<p>What do you think? What would you change if anything?</p>
<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.nerdydork.com/what-id-change-about-99-designs.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.nerdydork.com/what-id-change-about-99-designs.html</feedburner:origLink></item>
		<item>
		<title>Audio Books!</title>
		<link>http://feedproxy.google.com/~r/NerdyDork/~3/qTmrF0svAK8/audio-books.html</link>
		<comments>http://www.nerdydork.com/audio-books.html#comments</comments>
		<pubDate>Thu, 17 Nov 2011 16:07:07 +0000</pubDate>
		<dc:creator>Dustin</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Finance]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web Sites]]></category>

		<guid isPermaLink="false">http://www.nerdydork.com/?p=897</guid>
		<description><![CDATA[Commuting is a drag. There was a point in time that I had a 5 minute commute to work, then I decided to move and my company said I could just work from home. When it came time to switch jobs my walk down the stairs turned into a 45 minute (one-way) commute &#8211; and [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<div class='wp_fbr_top'></div><div class='wb_fb_top'><div style="float:right;"></div></div><p>Commuting is a drag. There was a point in time that I had a 5 minute commute to work, then I decided to move and my company said I could just work from home. When it came time to switch jobs my walk down the stairs turned into a 45 minute (one-way) commute &#8211; and that was on a good day. So for the past two years I&#8217;ve found myself in the car for a minimum if an hour and a half each day. It seems insane at first thought, but I am a bit surprised how I have gotten used to it.</p>
<p>How do I pass the time? There are two main things I do that keep me sane: 1) Eat Sunflower seeds &#8211; this is mainly to keep me awake. I find I don&#8217;t get drowsy if I am constantly eating something and Spitz BBQ sunflower seeds are my addiction. 2) Listen to audio books.</p>
<p>Why audio books? A few reasons. First, I&#8217;m not much of a music person. I never have been. I will listen to music on occasion, but it gets old fast to me. I know, I&#8217;m strange in this regard. Second, I like learning new things. I don&#8217;t really get that from music. Third, there are lots of books I would like to read, but I just don&#8217;t have the time. My average weekday looks something like this:</p>
<p>4:00 AM &#8211; 6:30 AM: Freelance or independent work<br />
6:30 AM &#8211; 7:15 AM: Shower &amp; get dressed<br />
7:15 AM &#8211; 8:00 AM: Commute to work<br />
8:00 AM &#8211; 5:00 PM: Work my butt off!<br />
5:00 PM &#8211; 5:45 PM: Commute home<br />
5:45 PM &#8211; 8:00 PM: Family time (dinner, play with kids, etc)<br />
8:00 PM &#8211; 10:00 PM: Time with my wife (watch TV, talk, eat ice-cream)<br />
10:00 PM &#8211; 10:30 PM: Ready for bed, read, pray</p>
<p>So that is an average day, I wouldn&#8217;t say I stick to this schedule religiously, but it is somewhat predictable if nothing is on the schedule. So you can see I don&#8217;t really take the time to read. Dave Ramsey often says that the average millionaire reads one non-fiction book per month. So the best way for me to get in all the books I would like to read, is by listening to audio books.</p>
<p>Here are some of my favorite sources for audio books:</p>
<ol>
<li><a href="http://www.jdoqocy.com/click-1639684-10400420?sid=nerdydork">Audible.com</a>: this like the Amazon of audio books. (In fact, they are now owned by Amazon). I have a monthly subscription that I pay $14.95 per month for. This gives me 1 credit per month. Each audio book is 1 credit. Also, as a subscription member, you get discounted pricing on all books. If a discounted price of a book is less than $14.95 I will likely purchase it without using a credit and save my credits for more expensive books. I&#8217;ve learned that credits will expire if you don&#8217;t use them, so this encourages me to continue to find new interesting books to read. I do find that my favorite are self-help type books like Zig Ziglar stuff. It energizes me. I look at the membership price as an investment in me.</li>
<li><a href="http://www.booksshouldbefree.com/">BooksShouldBeFree.com</a>: This is a very easy to navigate site with all kinds of audio books created from public domain sources. Check out the <a href="http://www.booksshouldbefree.com/Top_100">top 100</a> to see some of the great classics available. Sometime is is nice to step away from non-fiction books and just be entertained.</li>
<li><a href="http://librivox.org/">LibriVox.org</a>: This may be a duplicate listing because it seems to me that all the listings in BooksShouldBeFree.com are essentially taken from LibriVox. It appears LibriVox is build on top of WordPress, so I mention them mainly because they are the source we can all thank for these free audio books, but their user interface will not be as nice as the custom interface of BooksShouldBeFree.com.</li>
<li>iTunes: While this integrates well with my iPhone, there are a few reasons I don&#8217;t use iTunes much. I have purchased AudioBooks on iTunes in the past and after switching computers and iPhones, I don&#8217;t have those books available and I can&#8217;t find them in my account history. I&#8217;m sure this has improved since the invention of iCloud. Second, they tend to be more expensive. Generally a book selling for $29.95 on iTunes I&#8217;ll just find on Audible.com and use 1 ($14.95) credit.</li>
<li>Podcasts: So I know they are not audio books per say, but if you run out of books you want to listen to, check out some podcasts that are in your interest area. The best place to find these are on iTunes, and most of them are free.</li>
</ol>
<div>So how do I play these audiobooks? I have an iPhone. I found it works great with Audio books. If I have audiobooks in MP3, I can tell iTunes to treat it as an audiobook. This gives me the ability to have all the audiobook features such as 30 second rewind, remembering position, skip when shuffling, playing at half the speed or playing at two times the speed.</div>
<div>I currently use an FM transmitter because I still have the factory stereo in my 2000 Maxima. But I have found that I can&#8217;t seem to find a station that is totally clear and I&#8217;ve tried a few FM transmitters. Soon I will be installing a new stereo that integrates better with iPhone. I went in to Best Buy last week and found a good stereo can be purchased for $100 and their geek squad will install it for $50 plus parts needed for integration. I believe they said parts for my car will run around $100. It is a bit more expensive because I have the Bose stereo system. So I&#8217;m looking at around $250 to get a new stereo installed. I&#8217;d say it is a good investment since I&#8217;ll be using it 7.5+ hours per week.</div>
<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.nerdydork.com/audio-books.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://www.nerdydork.com/audio-books.html</feedburner:origLink></item>
		<item>
		<title>My Django Dev Environment: Virtualenv, pip, git, &amp; PyCharm</title>
		<link>http://feedproxy.google.com/~r/NerdyDork/~3/84Z2GUG_nt0/django-dev-environment-virtualenv-pip-git-pycharm.html</link>
		<comments>http://www.nerdydork.com/django-dev-environment-virtualenv-pip-git-pycharm.html#comments</comments>
		<pubDate>Fri, 14 Oct 2011 17:00:11 +0000</pubDate>
		<dc:creator>Dustin</dc:creator>
				<category><![CDATA[Programming & Internet]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[pip]]></category>
		<category><![CDATA[pycharm]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[virtualenv]]></category>

		<guid isPermaLink="false">http://www.nerdydork.com/?p=890</guid>
		<description><![CDATA[Even though I&#8217;ve heard how wonderful virtualenv &#38; pip are for managing Django development environments, I didn&#8217;t think I needed to bother learning it. But one bored day I did. I&#8217;m so glad I did. Truth is, it is just as simple and awesome as everyone says it is. And it&#8217;s been so helpful with [...]
Related posts:<ol>
<li><a href='http://www.nerdydork.com/django-color-theme-for-pycharm.html' rel='bookmark' title='Django Color Theme for PyCharm'>Django Color Theme for PyCharm</a> <small>Since I started writing Django, I&#8217;ve changed editors at least...</small></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<div class='wp_fbr_top'></div><div class='wb_fb_top'><div style="float:right;"></div></div><p>Even though I&#8217;ve heard how wonderful virtualenv &amp; pip are for managing Django development environments, I didn&#8217;t think I needed to bother learning it. But one bored day I did. I&#8217;m so glad I did. Truth is, it is just as simple and awesome as everyone says it is. And it&#8217;s been so helpful with all the computer and OS switching I&#8217;ve done lately.</p>
<p>Here is a brief tutorial on how I use virtualenv, pip, git, &amp; <a href="http://www.jetbrains.com/pycharm/">PyCharm</a> to manage &amp; develop <a href="https://inzolo.com">Inzolo.com</a>. I won&#8217;t cover installing any of these. See basic instructions for <a href="http://www.pip-installer.org/en/latest/installing.html#using-the-installer">installing virtualenv &amp; pip</a>.</p>
<p>To create a virtualenv that does not use any global site-packages:</p>
<p><code>$ virtualenv --no-site-packages env_inzolo</code></p>
<p>Then activate your virtualenv:</p>
<p><code>$ source env_inzolo/bin/activate</code></p>
<p>To get out of your virtualenv:</p>
<p><code>(env_inzolo)$ deactivate</code></p>
<p><em>Tip: many tutorials I have seen would name their environment inzolo_env, but I put env_* first for consistency in tab autocompletion convenience. I was using just env, but the virtualenv you are using will show up on your command line and it is helpful to see which one you have activated if you have multiple projects.</em></p>
<p>When you first create your virtualenv, you will need to activate it and install all the requirements in that virtualenv for your project:</p>
<p><code>(env_inzolo)$ pip install django<br />
(env_inzolo)$ pip install south<br />
etc. </code></p>
<p>Once you have all your packages installed, create a requirements file:</p>
<p><code>(env_inzolo)$ pip freeze &gt; requirements.txt</code></p>
<p>Now, if you&#8217;re using git, add env_inzolo to your .gitignore file and add requirements.txt to your repository.</p>
<p>That&#8217;s it for the set up. Next time your need to recreate your development environment, it will be simple. Just clone your repository and run these commands:</p>
<p><code>$ virtualenv --no-site-packages env_inzolo<br />
$ source env_inzolo/bin/activate<br />
(env_inzolo)$ pip install -r requirements.txt</code></p>
<p>That&#8217;s it!</p>
<p>If you use PyCharm you&#8217;ll want to set up your virtualenv there for your project.</p>
<p>Edit your project settings. Select Python Interpreter -&gt; Add -&gt; Specify Other&#8230;<br />
<a href="http://www.nerdydork.com/wp-content/uploads/2011/10/Add-Python-Interpreter.png"><img class="alignnone size-medium wp-image-892" title="Add Python Interpreter" src="http://www.nerdydork.com/wp-content/uploads/2011/10/Add-Python-Interpreter-300x207.png" alt="" width="300" height="207" /></a></p>
<p>Add python from your virtual_env (env_inzolo/bin/python)</p>
<p>Click Apply to save.</p>
<p>Then click on Django Support and make sure your Django project root, settings file, manage script &amp; template directories are all in order. then you will experience the full goodness of PyCharm!</p>
<p>Related posts:<ol>
<li><a href='http://www.nerdydork.com/django-color-theme-for-pycharm.html' rel='bookmark' title='Django Color Theme for PyCharm'>Django Color Theme for PyCharm</a> <small>Since I started writing Django, I&#8217;ve changed editors at least...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.nerdydork.com/django-dev-environment-virtualenv-pip-git-pycharm.html/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<feedburner:origLink>http://www.nerdydork.com/django-dev-environment-virtualenv-pip-git-pycharm.html</feedburner:origLink></item>
		<item>
		<title>iOS5 Install Unknown Error Occurred</title>
		<link>http://feedproxy.google.com/~r/NerdyDork/~3/GBx5Q3s6Puw/ios5-install-unknown-error-occurred.html</link>
		<comments>http://www.nerdydork.com/ios5-install-unknown-error-occurred.html#comments</comments>
		<pubDate>Wed, 12 Oct 2011 20:12:11 +0000</pubDate>
		<dc:creator>Dustin</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.nerdydork.com/?p=884</guid>
		<description><![CDATA[While trying to install iOS5 today I kept getting an error message something to the effect of: The iPhone &#8220;Dustin&#8217;s iPhone&#8221; could not be restored. An unknown error occurred. After 4 attempts I could see I was getting nowhere. So I clicked the Restore button. After doing a factory restore, iOS5 was installed. Everything seems [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<div class='wp_fbr_top'></div><div class='wb_fb_top'><div style="float:right;"></div></div><p>While trying to install iOS5 today I kept getting an error message something to the effect of:</p>
<blockquote><p>The iPhone &#8220;Dustin&#8217;s iPhone&#8221; could not be restored.<br />
An unknown error occurred.</p></blockquote>
<p>After 4 attempts I could see I was getting nowhere. So I clicked the Restore button. After doing a factory restore, iOS5 was installed. Everything seems to be working now.</p>
<p>Hope this helps!</p>
<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.nerdydork.com/ios5-install-unknown-error-occurred.html/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
		<feedburner:origLink>http://www.nerdydork.com/ios5-install-unknown-error-occurred.html</feedburner:origLink></item>
		<item>
		<title>How Sports Improves Programmer Focus</title>
		<link>http://feedproxy.google.com/~r/NerdyDork/~3/Dp3ePU2cHPQ/how-sports-improves-programmer-focus.html</link>
		<comments>http://www.nerdydork.com/how-sports-improves-programmer-focus.html#comments</comments>
		<pubDate>Fri, 17 Jun 2011 20:14:15 +0000</pubDate>
		<dc:creator>Dustin</dc:creator>
				<category><![CDATA[Programming & Internet]]></category>

		<guid isPermaLink="false">http://www.nerdydork.com/?p=946</guid>
		<description><![CDATA[There was some talk recently about distractions at work. Guys were complaining they can’t get anything done with so many distractions. We used to have an open work space where you could see and hear everyone in the room. Now we have higher cubicle walls. Personally, I preferred the old layout. When a someone tells me they can’t focus [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<div class='wp_fbr_top'></div><div class='wb_fb_top'><div style="float:right;"></div></div><p><a href="http://www.nerdydork.com/wp-content/uploads/2011/06/clear-the-mechanism.png"><img class="alignright" title="clear-the-mechanism" src="https://0-focus-opensocial.googleusercontent.com/gadgets/proxy?container=focus&amp;gadget=a&amp;rewriteMime=image/*&amp;refresh=31536000&amp;url=http://www.nerdydork.com/wp-content/uploads/2011/06/clear-the-mechanism-150x150.png" alt="" width="150" height="150" /></a>There was some talk recently about distractions at work. Guys were complaining they can’t get anything done with so many distractions. We used to have an open work space where you could see and hear everyone in the room. Now we have higher cubicle walls. Personally, I preferred the old layout.</p>
<p>When a someone tells me they can’t focus because there is a conversation going on in another cubicle, I want to just tell them to “clear the mechanism”. Sadly, I don’t think any of them know what I would be referring to. It seems all the programmers I currently work with now hate sports – and make it known.</p>
<p>What I am referring to is the scene in <a href="http://www.imdb.com/title/tt0126916/">For Love of the Game</a> where Billy Chapel is starting to pitch. Yankees fans are being loud and obnoxious (go figure). Just before throwing the first pitch he says to himself, “Clear the mechanism“. The crowd blurs and falls silent and Chapel enters his zone.</p>
<p>I was going to share this video with co-workers, but I couldn’t find it, so I took the time to snip it off my DVD and upload it to YouTube. (Video was removed at the Request of NBC Universal)</p>
<p>This is for real. I played football, basketball, and baseball in high school. Honestly, I don’t remember the crowd when playing. There are times when you do, like when timeout is called, or your passing a ball in-bounds and guys are yanking on your jersey. But most of the game, you are so focused on the game that you don’t even know there is a crowd around you.</p>
<p>You really can get in a zone while programming. I don’t notice other conversations around me unless I choose too. I can get in a zone while programming that I don’t notice much of anything around me.</p>
<p>Sadly, I don’t have tips on how to develop this type of focus… just letting you know its for real.</p>
<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.nerdydork.com/how-sports-improves-programmer-focus.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.nerdydork.com/how-sports-improves-programmer-focus.html</feedburner:origLink></item>
		<item>
		<title>Django Color Theme for PyCharm</title>
		<link>http://feedproxy.google.com/~r/NerdyDork/~3/qzMDJ_V7T-4/django-color-theme-for-pycharm.html</link>
		<comments>http://www.nerdydork.com/django-color-theme-for-pycharm.html#comments</comments>
		<pubDate>Mon, 06 Jun 2011 14:13:02 +0000</pubDate>
		<dc:creator>Dustin</dc:creator>
				<category><![CDATA[Programming & Internet]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[pycharm]]></category>
		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://www.nerdydork.com/?p=855</guid>
		<description><![CDATA[Since I started writing Django, I&#8217;ve changed editors at least four times. In windows, I started with the TextMate clone, e. On mac I would use TextMate. Both can use a the django textmate theme. When I started using Ubuntu, I customized gedit to work like e &#38; TextMate. I even contributed to the gedit [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<div class='wp_fbr_top'></div><div class='wb_fb_top'><div style="float:right;"></div></div><p>Since I started writing Django, I&#8217;ve changed editors at least four times. In windows, I started with the TextMate clone, <a href="http://e-texteditor.com/">e</a>. On mac I would use <a href="http://macromates.com/">TextMate</a>. Both can use a the <a href="https://code.djangoproject.com/wiki/TextMate">django textmate theme</a>. When I started using Ubuntu, I customized <a href="http://projects.gnome.org/gedit/">gedit</a> to work like e &amp; TextMate. I even contributed to the <a href="https://code.djangoproject.com/wiki/gedit">gedit django theme</a>.</p>
<p>Now I use <a href="http://www.jetbrains.com/pycharm/">PyCharm</a> on every platform. I wasn&#8217;t able to find a django color theme, so I made my own. You can <a href="http://dl.dropbox.com/u/5444949/django.jar">download it here</a>.</p>
<p>To install, open PyCharm and select File -&gt; Import Settings&#8230; and select the file.</p>
<p>&nbsp;</p>
<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.nerdydork.com/django-color-theme-for-pycharm.html/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		<feedburner:origLink>http://www.nerdydork.com/django-color-theme-for-pycharm.html</feedburner:origLink></item>
		<item>
		<title>Python IRC Bot Using Twisted (Rollbot)</title>
		<link>http://feedproxy.google.com/~r/NerdyDork/~3/3Fk9dsJcgWM/python-irc-bot-using-twisted-rollbot.html</link>
		<comments>http://www.nerdydork.com/python-irc-bot-using-twisted-rollbot.html#comments</comments>
		<pubDate>Thu, 28 Apr 2011 22:38:14 +0000</pubDate>
		<dc:creator>Dustin</dc:creator>
				<category><![CDATA[Programming & Internet]]></category>
		<category><![CDATA[BeautifulSoup]]></category>
		<category><![CDATA[Friday]]></category>
		<category><![CDATA[irc]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[Rebecca Black]]></category>
		<category><![CDATA[RickRoll'd]]></category>
		<category><![CDATA[twisted]]></category>

		<guid isPermaLink="false">http://www.nerdydork.com/?p=850</guid>
		<description><![CDATA[I wrote my first IRC bot recently. It turned out to be a simpler task than I thought it would be. Here&#8217;s the back story: At work, our programming team uses an IRC channel for all our internal communication throughout the day. What more would you expect from a bunch of programmers? Recently I&#8217;ve been [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<div class='wp_fbr_top'></div><div class='wb_fb_top'><div style="float:right;"></div></div><p>I wrote my first IRC bot recently. It turned out to be a simpler task than I thought it would be.</p>
<p>Here&#8217;s the back story: At work, our programming team uses an IRC channel for all our internal communication throughout the day. What more would you expect from a bunch of programmers?</p>
<p>Recently I&#8217;ve been taking delight in Rebecca Rolling (worse than being <a href="http://www.youtube.com/watch?v=oHg5SJYRHA0">Rick Roll&#8217;d</a>) every each Friday. Someone made a comment that it would be nice to have a bot to detect such things. I had been looking for an excuse to try and write an IRC bot, so I took the challenge.</p>
<p>Basically, the majority of the script was created following <a href="http://www.eflorenzano.com/blog/post/writing-markov-chain-irc-bot-twisted-and-python/">Eric Florenzano&#8217;s blog post</a>, so I won&#8217;t cover all that again. Just go check it out yourself.</p>
<p>Basically, the part I modified was the privmsg function:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p850code2'); return false;">View Code</a> PYTHON</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p8502"><td class="code" id="p850code2"><pre class="python" style="font-family:monospace;">    <span style="color: #ff7700;font-weight:bold;">def</span> privmsg<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, <span style="color: #dc143c;">user</span>, channel, msg<span style="color: black;">&#41;</span>:
        <span style="color: #808080; font-style: italic;"># use regex to find posted URLs</span>
        matches = <span style="color: #dc143c;">re</span>.<span style="color: black;">findall</span><span style="color: black;">&#40;</span>r<span style="color: #483d8b;">'http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&amp;+]|[!*<span style="color: #000099; font-weight: bold;">\(</span><span style="color: #000099; font-weight: bold;">\)</span>,]|(?:%[0-9a-fA-F][0-9a-fA-F]))+'</span>, msg<span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">if</span> matches:
            <span style="color: #ff7700;font-weight:bold;">for</span> url <span style="color: #ff7700;font-weight:bold;">in</span> matches:
                u = <span style="color: #dc143c;">urllib</span>.<span style="color: black;">urlopen</span><span style="color: black;">&#40;</span>url<span style="color: black;">&#41;</span>
                <span style="color: #808080; font-style: italic;"># get the mime type</span>
                urltype = u.<span style="color: black;">headers</span>.<span style="color: black;">gettype</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
                <span style="color: #808080; font-style: italic;">#print urltype</span>
                <span style="color: #ff7700;font-weight:bold;">try</span>:
                    <span style="color: #808080; font-style: italic;"># use BeautifulSoup to get the page title</span>
                    soup = BeautifulSoup.<span style="color: black;">BeautifulSoup</span><span style="color: black;">&#40;</span>u<span style="color: black;">&#41;</span>
                    title = <span style="color: #dc143c;">re</span>.<span style="color: black;">sub</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\s</span>+&quot;</span>, <span style="color: #483d8b;">' '</span>, soup.<span style="color: black;">title</span>.<span style="color: #dc143c;">string</span><span style="color: black;">&#41;</span>.<span style="color: black;">strip</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
                    <span style="color: #008000;">self</span>.<span style="color: black;">msg</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">factory</span>.<span style="color: black;">channel</span>, <span style="color: #483d8b;">&quot;Title: %s&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: #008000;">str</span><span style="color: black;">&#40;</span>title<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
                <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: black;">&#40;</span><span style="color: #008000;">AttributeError</span>, HTMLParseError<span style="color: black;">&#41;</span>:
                    <span style="color: #808080; font-style: italic;"># if we have an error getting the title, show the mime type</span>
                    <span style="color: #008000;">self</span>.<span style="color: black;">msg</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">factory</span>.<span style="color: black;">channel</span>, \
                        <span style="color: #483d8b;">&quot;NO TITLE FOUND (%s)&quot;</span> <span style="color: #66cc66;">%</span> urltype<span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>Comments in the code above should explain what is going on. If you want the full source to the Rollbot, <a href="https://github.com/redseam/Rollbot">check it out on github</a>.</p>
<p>Hackers: Note that it is entirely possible to hack this. Just create a basic html page, set your own title, and redirect with JavaScript. My co-workers still don&#8217;t trust me&#8230;</p>
<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.nerdydork.com/python-irc-bot-using-twisted-rollbot.html/feed</wfw:commentRss>
		<slash:comments>16</slash:comments>
		<feedburner:origLink>http://www.nerdydork.com/python-irc-bot-using-twisted-rollbot.html</feedburner:origLink></item>
	</channel>
</rss><!-- This Quick Cache file was built for (  www.nerdydork.com/feed ) in 0.80701 seconds, on May 17th, 2012 at 8:16 pm UTC. --><!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on May 17th, 2012 at 9:16 pm UTC -->

