<?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>jathanism &#187; bugs</title>
	<atom:link href="http://jathan.com/tag/bugs/feed/" rel="self" type="application/rss+xml" />
	<link>http://jathan.com</link>
	<description>computers, robots, and other cool things.</description>
	<lastBuildDate>Thu, 20 Oct 2011 01:50:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Blue Dongs for a Friday Afternoon</title>
		<link>http://jathan.com/2009/09/04/blue-dongs-for-a-friday-afternoon/</link>
		<comments>http://jathan.com/2009/09/04/blue-dongs-for-a-friday-afternoon/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 01:08:08 +0000</pubDate>
		<dc:creator>jathan</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[absurd]]></category>
		<category><![CDATA[blue dong of justice]]></category>
		<category><![CDATA[blue dongs]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[dongs]]></category>
		<category><![CDATA[friday]]></category>
		<category><![CDATA[jughead]]></category>
		<category><![CDATA[mkdong]]></category>
		<category><![CDATA[random]]></category>

		<guid isPermaLink="false">http://jathan.com/?p=154</guid>
		<description><![CDATA[Today I wrote an awesome program called mkdong that will make a dong of your desired length and print it to your terminal, like this: % ./mkdong usage: mkdong &#60;length&#62; % ./mkdong 5 ()/()/////D % ./mkdong 25 ()/()/////////////////////////D That last one is impressive, isn&#8217;t it? Hmm&#8230; Yeah, it&#8217;s Friday. What do you want from me? [...]]]></description>
			<content:encoded><![CDATA[<p>Today I wrote an awesome program called <tt>mkdong</tt> that will make a dong of your desired length and print it to your terminal, like this:
<pre>% ./mkdong
usage: mkdong &lt;length&gt;
% ./mkdong 5
(<em>)/(</em>)/////D
% ./mkdong 25
(<em>)/(</em>)/////////////////////////D</pre>
That last one is impressive, isn&#8217;t it?  Hmm&#8230; Yeah, it&#8217;s Friday.  What do you want from me?  I still got work done!  Cool thing is if the dong is too big, well then it throws an error:
<pre>% ./mkdong 60
warning: a 60" dong is too big! cannot be longer than 40"!</pre>
&#8220;What is the point of this?&#8221;, you might ask yourself.  That&#8217;s a good question.  I&#8217;ve been so busy with other shit lately that I&#8217;ve barely had time to code.  I suppose I was itching to write <em>something</em>, anything&#8230; Dongs!!</p>

<p>It all started harmlessly enough with a silly AIM conversation with my coding buddy at work.  We were talking about a bug, and well, read on and you&#8217;ll see.  It regressed quickly.
<div id="chat" style="padding-left: 30px;margin-bottom:10px;">jughead: well there is the problem, now I just gotta figure out wtf
jathanism: what did you do!
jughead: nothing, it&#8217;s something in the rt stuff
jathanism: hmm, maybe with a certain ticket
jathanism: maybe one that is blank or something
jathanism: or missing xml data
jathanism: or might be a bug
jughead: ok from now on
jughead: bugs are not bugs
jughead: they are dongs
jathanism: ok
jughead: &#8220;I found a dong in this code&#8221;
jathanism: or might be a dong
jughead: #1 deterrent of all linux exploits
jughead: change root account to &#8220;poop&#8221;, chown -R poop.poop /
jughead: no uid 0
jughead: no user root
jathanism: what?
jathanism: you rename uid 0 to poop ?
jughead: poop will get it&#8217;s own uid
jughead: and gid
jathanism: oh
jathanism: would that work?
jathanism: there aren&#8217;t any hard-coded things to uid 0?
jughead: no idea, lets try it
jathanism: yeah let&#8217;s try it on marduk!
jughead: hahahahfdsaf
jughead: dsfa
jughead: hmm&#8230;. /dev/ would have to be rebuilt
jughead: MKNOD
jughead: hate that shit
jughead: MAKEDEV
jughead: FUCK YOU LINUX
jathanism: mkdong
jathanism: aww yeah
jathanism: i just made mkdong
jathanism: % ./mkdong 5
8====0
jathanism: % ./mkdong 15
8==============0
jathanism: % ./mkdong 25
8========================0
jathanism: % ./mkdong 41
warning: a 41&#8243; dong is too big! cannot be longer than 40&#8243;!
jughead: you should modify that
jughead: (<em>)/(</em>)&#92;&#92;&#92;&#92;&#92;&#92;&#92;&#92;&#92;&#92;&#92;&#92;&#92;\D
jathanism: hahahlk
jughead: looks much better
jathanism: ok!
jathanism: % ./mkdong 40
(<em>)/(</em>)&#92;&#92;&#92;&#92;&#92;&#92;&#92;&#92;&#92;&#92;&#92;&#92;&#92;&#92;&#92;&#92;&#92;&#92;&#92;\D
jathanism: aww yeah</div>
<br />So I took the stupidity and ran with it and mkdong was born!</p>

<p>The initial dongs were a little primitive and sickly looking.  So I took his suggestion and improved their visual style.  Here is how it turned out:
<pre class="brush:py">#!/usr/bin/env python</pre></p>

<p>import sys</p>

<p>maxlen = 40</p>

<p>try:
    donglen = int(sys.argv[1])
except:
    print "usage: mkdong &lt;length&gt;"
    sys.exit()</p>

<p>if donglen &gt; maxlen:
    print 'warning: a %s" dong is too big! cannot be longer than %s"!' % (donglen, maxlen)
    sys.exit()
else:
    dong = '(<em>)/(</em>)'
    for i in range(1, donglen): dong += "&#92;"
    dong += 'D'</p>

<p>print dong
We laughed.  We joked.  <a href="http://twitter.com/jathanism/status/3762448157" target="_blank">We Tweeted</a>.  And then it regressed even further:
<div id="chat" style="padding-left: 30px;margin-bottom:10px;">jughead: dude everyone loves mkdong
jathanism: aww yeah
jathanism: it needs easter eggs
jughead: DUDE
jughead: MAKE IT PRINT IN BLUE
jathanism: ok!
jughead: how exactly does one &#8220;suck a fuck&#8221;
jathanism: the ascii coloring fucks up the length
jughead: you can just put the blue at the beginning
jughead: and at the end
jughead: doesn&#8217;t have to be each char
jathanism: it&#8217;s not
jughead: is there a dong in the code?
jathanism: /tmp/mkdong 5
jathanism: will just use forward slashes instad
jathanism: released
jughead: man mkdong is the best ever</div>
<br />A feature request!  I had to make it print in blue!  But to do that I had to replace all of the &#8220;\&#8221; that make up the dong itself, with &#8220;/&#8221; so as to not have the <a href="http://pueblo.sourceforge.net/doc/manual/ansi_color_codes.html" target="_blank">ANSI escape codes</a> eat up the extra backslashes. (Backslashes are interpreted characters, duh.)  I also had to replace the <tt>print</tt> statement with a system call to <tt>echo -e</tt> so that the colorization would be interpreted.  This is high tech shit, man!!</p>

<p>And then I <a href="http://twitter.com/jathanism/status/3763185098" target="_blank">released it to the public</a>. So there you have it.  Here is the final release of mkdong 2.0 for your pleasure:
<pre class="brush:py">#!/usr/bin/env python</pre></p>

<p>import os, sys</p>

<p>maxlen = 40
color = '&#92;&#92;e[0;34m' # blue</p>

<p>try:
    donglen = int(sys.argv[1])
except:
    print "usage: mkdong &lt;length&gt;"
    sys.exit()</p>

<p>if donglen &gt; maxlen:
    print 'warning: a %s" dong is too big! cannot be longer than %s"!' % (donglen, maxlen)
    sys.exit()
else:
    dong = '(<em>)/(</em>)'
    for i in range(donglen): dong += '/'
    dong += 'D'</p>

<p>os.system('echo -e "%s%s"' % (color, dong))
Use it well.  And remember they aren&#8217;t bugs, they&#8217;re dongs!  Squish?  Gross.</p>
]]></content:encoded>
			<wfw:commentRss>http://jathan.com/2009/09/04/blue-dongs-for-a-friday-afternoon/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

