<?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/" version="2.0">

<channel>
	<title>tail -f findings.out</title>
	
	<link>http://dancingpenguinsoflight.com</link>
	<description />
	<lastBuildDate>Sun, 08 Nov 2009 22:08:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/dancingpenguinsoflight" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>A better way to search for methods of Python objects</title>
		<link>http://dancingpenguinsoflight.com/2009/11/a-better-way-to-search-for-methods-of-python-objects/</link>
		<comments>http://dancingpenguinsoflight.com/2009/11/a-better-way-to-search-for-methods-of-python-objects/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 22:08:10 +0000</pubDate>
		<dc:creator>Samuel Huckins</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[efficiency]]></category>

		<guid isPermaLink="false">http://dancingpenguinsoflight.com/?p=1316</guid>
		<description><![CDATA[Python&#8217;s introspection abilities are quite extensive and useful. They are also well-documented, so I won&#8217;t go into the basics here. Check out this article if you need a good overview. N.B.: discussion and code below applies to both methods and attributes. I will simply refer to &#8220;methods&#8221; for simplicity.
Beyond simply listing the methods of an [...]]]></description>
			<content:encoded><![CDATA[<p>Python&#8217;s introspection abilities are quite extensive and useful. They are also well-documented, so I won&#8217;t go into the basics here. <a title="Guide to Python Introspection" target="_blank" href="http://www.ibm.com/developerworks/library/l-pyint.html">Check out this article</a> if you need a good overview. N.B.: discussion and code below applies to both methods and attributes. I will simply refer to &#8220;methods&#8221; for simplicity.</p>
<p>Beyond simply listing the methods of an object, however, I often find that I want to search through them for something in particular. And eyeballing the output of dir(obj) is only efficient in the simplest of cases. hasattr(obj, &#8220;method&#8221;) won&#8217;t get you far either, as you need to match the &#8220;method&#8221; name exactly. What if you just have a good guess about the name of a method based on what you need to do? What if you want to know everything you can do with directories in the os module or ISO related methods in datetime.date? I haven&#8217;t found anything to help with this sort of problem yet. Approaches like writing a loop to do the search every time or perusing the pertinent API docs are too circuitous for such quick questions. So let&#8217;s make a tool to do this more easily!</p>
<p>We start with knowing some object and some string containing all or part of the method(s) we&#8217;re interested in:</p>
<div class="codecolorer-container python blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #ff7700;font-weight:bold;">def</span> mf<span style="color: black;">&#40;</span>obj, term<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; <span style="color: #483d8b;">&quot;&quot;&quot;<br />
&nbsp; &nbsp; Searches through the methods and attributes defined for obj, <br />
&nbsp; &nbsp; looks for those containing the term passed.<br />
&nbsp; &nbsp; Returns all matches or a warning if none found.<br />
&nbsp; &nbsp; &quot;&quot;&quot;</span><br />
&nbsp; &nbsp; meths = <span style="color: #008000;">dir</span><span style="color: black;">&#40;</span>obj<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; match_meths = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">for</span> meth <span style="color: #ff7700;font-weight:bold;">in</span> meths:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> meth.<span style="color: black;">rfind</span><span style="color: black;">&#40;</span>term<span style="color: black;">&#41;</span> <span style="color: #66cc66;">!</span>= -1:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; match_meths.<span style="color: black;">append</span><span style="color: black;">&#40;</span>meth<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> match_meths:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> match_meths<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">else</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;No matches!&quot;</span></div></td></tr></tbody></table></div>
<p>This simply iterates over the methods and attributes defined for the object passed and looks for the term passed within the name of each. rfind returns the highest index of the substring passed in the string it&#8217;s called on and returns -1 if no match is found. Once the matches are collected they are printed out. An example:</p>
<div class="codecolorer-container python blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">&gt;&gt;&gt;</span>from method_finder <span style="color: #ff7700;font-weight:bold;">import</span> mf<br />
<span style="color: #66cc66;">&gt;&gt;&gt;</span>import <span style="color: #dc143c;">os</span><br />
<span style="color: #66cc66;">&gt;&gt;&gt;</span>mf<span style="color: black;">&#40;</span><span style="color: #dc143c;">os</span>, <span style="color: #483d8b;">&quot;dir&quot;</span><span style="color: black;">&#41;</span><br />
<span style="color: black;">&#91;</span><span style="color: #483d8b;">'chdir'</span>, <span style="color: #483d8b;">'curdir'</span>, <span style="color: #483d8b;">'fchdir'</span>, <span style="color: #483d8b;">'listdir'</span>, <span style="color: #483d8b;">'makedirs'</span>, <span style="color: #483d8b;">'mkdir'</span>, <span style="color: #483d8b;">'pardir'</span>, <span style="color: #483d8b;">'removedirs'</span>, <span style="color: #483d8b;">'rmdir'</span><span style="color: black;">&#93;</span></div></td></tr></tbody></table></div>
<p>For convenience let&#8217;s make it available on the Python interactive prompt at every load without any extra effort. This is easy enough using a .pythonstartup file. This file can be used to load various useful items like tab completion for interactive Python sessions. If you haven&#8217;t used it before, you&#8217;ll need to add the following to your .bashrc:</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PYTHONSTARTUP</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$HOME</span>/.pythonstartup&quot;</span></div></td></tr></tbody></table></div>
<p>Then in your home directory create a .pythonstartup file containing something like the following:</p>
<div class="codecolorer-container python blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">os</span><br />
<span style="color: #808080; font-style: italic;"># Adds mf(obj, &quot;str&quot;) allowing search for methods matching 'str' on obj</span><br />
<span style="color: #808080; font-style: italic;"># as well as obinfo(obj) returning lots of info on obj</span><br />
util_loc = <span style="color: #483d8b;">&quot;/home/shuckins/code/code_homerepo/python-programming/utilities&quot;</span><br />
<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">isdir</span><span style="color: black;">&#40;</span>util_loc<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span><br />
&nbsp; &nbsp; <span style="color: #dc143c;">sys</span>.<span style="color: black;">path</span>.<span style="color: black;">append</span><span style="color: black;">&#40;</span>util_loc<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">from</span> utils <span style="color: #ff7700;font-weight:bold;">import</span> mf, obinfo<br />
&nbsp; &nbsp; <span style="color: #dc143c;">sys</span>.<span style="color: black;">path</span>.<span style="color: black;">remove</span><span style="color: black;">&#40;</span>util_loc<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">del</span> <span style="color: #dc143c;">sys</span><br />
<span style="color: #ff7700;font-weight:bold;">del</span> <span style="color: #dc143c;">os</span></div></td></tr></tbody></table></div>
<p>You&#8217;ll need to change the path specified to wherever you placed utils.py containing the mf() function of course. You can <a target="_blank" title="utils.py on github" href="http://github.com/shuckins/sph_code/blob/master/python-programming/utilities/utils.py">download mine here</a> if you&#8217;d like. The del statements are to clean up any trace of this operation once you get to the interactive interpreter. This way you get the added functions without mucking up your namespace. </p>
<p>This also loads in an obinfo(obj) function that I included in the same utils.py file. This is based on the interrogate() function written by Patrick O&#8217;Brien in the <a title="Guide to Python Introspection" target="_blank" href="http://www.ibm.com/developerworks/library/l-pyint.html">introspection article mentioned above</a>. My version just adds a check for objects without docstrings and prints more of the docstring:</p>
<div class="codecolorer-container python blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #ff7700;font-weight:bold;">def</span> obinfo<span style="color: black;">&#40;</span>obj<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; <span style="color: #483d8b;">&quot;&quot;&quot;<br />
&nbsp; &nbsp; Print useful information about object.<br />
<br />
&nbsp; &nbsp; From http://www.ibm.com/developerworks/library/l-pyint.html<br />
&nbsp; &nbsp; &quot;&quot;&quot;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">hasattr</span><span style="color: black;">&#40;</span>obj, <span style="color: #483d8b;">'__name__'</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;NAME: &nbsp; &nbsp;&quot;</span>, obj.__name__<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">hasattr</span><span style="color: black;">&#40;</span>obj, <span style="color: #483d8b;">'__class__'</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;CLASS: &nbsp; &quot;</span>, obj.__class__.__name__<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;ID: &nbsp; &nbsp; &nbsp;&quot;</span>, <span style="color: #008000;">id</span><span style="color: black;">&#40;</span>obj<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;TYPE: &nbsp; &nbsp;&quot;</span>, <span style="color: #008000;">type</span><span style="color: black;">&#40;</span>obj<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;VALUE: &nbsp; &quot;</span>, <span style="color: #dc143c;">repr</span><span style="color: black;">&#40;</span>obj<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;CALLABLE:&quot;</span>,<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">callable</span><span style="color: black;">&#40;</span>obj<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;Yes&quot;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">else</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;No&quot;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">hasattr</span><span style="color: black;">&#40;</span>obj, <span style="color: #483d8b;">'__doc__'</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; doc = <span style="color: #008000;">getattr</span><span style="color: black;">&#40;</span>obj, <span style="color: #483d8b;">'__doc__'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; doc = doc.<span style="color: black;">strip</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; topfive = doc.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span>0:4<span style="color: black;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;DOC: &nbsp; &nbsp; &quot;</span>, <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span>topfive<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">else</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;No docstring. Yell at the author.&quot;</span></div></td></tr></tbody></table></div>
<p>It&#8217;s fairly useful:</p>
<div class="codecolorer-container python blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">&gt;&gt;&gt;</span> obinfo<span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">&quot;some&quot;</span>, <span style="color: #483d8b;">&quot;list&quot;</span><span style="color: black;">&#93;</span>.<span style="color: black;">count</span><span style="color: black;">&#41;</span><br />
NAME: &nbsp; &nbsp; count<br />
CLASS: &nbsp; &nbsp;builtin_function_or_method<br />
ID: &nbsp; &nbsp; &nbsp; <span style="color: #ff4500;">139922087930696</span><br />
TYPE: &nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>type <span style="color: #483d8b;">'builtin_function_or_method'</span><span style="color: #66cc66;">&gt;</span><br />
VALUE: &nbsp; &nbsp;<span style="color: #66cc66;">&lt;</span>built-<span style="color: #ff7700;font-weight:bold;">in</span> method count of <span style="color: #008000;">list</span> <span style="color: #008000;">object</span> at 0x7f422658ef80<span style="color: #66cc66;">&gt;</span><br />
CALLABLE: Yes<br />
DOC: &nbsp; &nbsp; &nbsp;L.<span style="color: black;">count</span><span style="color: black;">&#40;</span>value<span style="color: black;">&#41;</span> -<span style="color: #66cc66;">&gt;</span> integer -- <span style="color: #ff7700;font-weight:bold;">return</span> number of occurrences of value</div></td></tr></tbody></table></div>
   ]]></content:encoded>
			<wfw:commentRss>http://dancingpenguinsoflight.com/2009/11/a-better-way-to-search-for-methods-of-python-objects/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Quick tips for NVIDIA and ATI graphics configuration repairs on Ubuntu</title>
		<link>http://dancingpenguinsoflight.com/2009/11/quick-tips-for-nvidia-and-ati-graphics-configuration-repairs-on-ubuntu/</link>
		<comments>http://dancingpenguinsoflight.com/2009/11/quick-tips-for-nvidia-and-ati-graphics-configuration-repairs-on-ubuntu/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 02:15:10 +0000</pubDate>
		<dc:creator>Samuel Huckins</dc:creator>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://dancingpenguinsoflight.com/?p=1306</guid>
		<description><![CDATA[While graphics card and display configuration on Ubuntu has come a long way from the days of always having to edit xorg.conf by hand, I still run into issues now and again. I almost never have problems any more when setting up a new system. But changing cards in an existing system is another story, [...]]]></description>
			<content:encoded><![CDATA[<p>While graphics card and display configuration on Ubuntu has come a long way from the days of always having to edit xorg.conf by hand, I still run into issues now and again. I almost never have problems any more when setting up a new system. But changing cards in an existing system is another story, especially if switching between NVIDIA and ATI. </p>
<p>Today I did indeed switch from an NVIDIA to an ATI graphics card on an Ubuntu 9.10 machine. I had the nvidia-glx kernel mod in place, and xorg.conf specified the NVIDIA related modules to load, so just switching out the card and rebooting resulted in a flickering text login, no more desktop. This post covers the commands needed to install the appropriate kernel module and reconfigure Xorg in such situations. </p>
<p>After putting in your new card if you aren&#8217;t able to get to your desktop/get sent to a text login when you boot/get an Xorg error, reboot and hit Escape when GRUB prompts you. Boot into the recovery mode for the latest kernel shown in the list. Drop into root prompt with networking when prompted.</p>
<h2>NVIDIA to ATI</h2>
<p>This assumes you have an ATI card in place. Once at the root prompt run:</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> xorg-driver-fglrx</div></td></tr></tbody></table></div>
<p>This will remove nvidia-glx if you have it installed and install the driver for ATI Radeon and FireGL graphics cards. After this is complete you need to reconfigure xorg.conf to use the new module. Fear not, no manual editing should be required to get a basic configuration working. Just run:</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">aticonfig <span style="color: #660033;">--initial</span></div></td></tr></tbody></table></div>
<p>This script comes with the xorg-driver-fglrx. Running this will add screen and device sections in /etc/X11/xorg.conf appropriate for an ATI card, backing up /etc/X11/xorg.conf beforehand. If you added any special configurations for your screen section before you might want to edit the file manually and copy the customizations into the appropriate new sections. The sections already in xorg.conf will still be there, just commented out or not actually called when loading X. Next run:</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">startx</div></td></tr></tbody></table></div>
<p>If all goes well you will be back to a working desktop. You can also check from the command line by running &#8220;fglrxinfo&#8221;.</p>
<p>For more information on using the ATI drivers on Ubuntu see <a target="_blank" title="ATI binary driver guide" href="https://help.ubuntu.com/community/BinaryDriverHowto/ATI">this wiki article</a>.</p>
<h2>ATI to NVIDIA</h2>
<p>And in the reverse situation:</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">apt-cache</span> search nvidia-glx<br />
<span style="color: #666666; font-style: italic;"># Install the latest stable one. Currently:</span><br />
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> nvidia-glx-<span style="color: #000000;">185</span></div></td></tr></tbody></table></div>
<p>And the equivalent for aticonfig:</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">nvidia-xconfig</div></td></tr></tbody></table></div>
<p>As above:</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">startx</div></td></tr></tbody></table></div>
<p>For more information on using the NVIDIA drivers on Ubuntu see <a target="_blank" title="NVIDIA binary driver guide" href="https://help.ubuntu.com/community/BinaryDriverHowto/Nvidia">this wiki article</a>.</p>
<p>No guarantees here, but these have worked for me.</p>
   ]]></content:encoded>
			<wfw:commentRss>http://dancingpenguinsoflight.com/2009/11/quick-tips-for-nvidia-and-ati-graphics-configuration-repairs-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Catching warnings from the MySQLdb module</title>
		<link>http://dancingpenguinsoflight.com/2009/10/catching-warnings-from-the-mysqldb-module/</link>
		<comments>http://dancingpenguinsoflight.com/2009/10/catching-warnings-from-the-mysqldb-module/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 03:53:50 +0000</pubDate>
		<dc:creator>Samuel Huckins</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://dancingpenguinsoflight.com/?p=1300</guid>
		<description><![CDATA[The MySQLdb Python module implements the Python DB API for MySQL. I&#8217;ve written about its use before. MySQL issues warning messages in a number of circumstances and PEP 249 (which specifies the Python DB API) describes a Warning error message to be included.
One issue I ran into recently was how to catch warnings thrown by [...]]]></description>
			<content:encoded><![CDATA[<p>The <a target="_blank" title="MySQLdb home" href="http://sourceforge.net/projects/mysql-python/">MySQLdb Python module</a> implements the Python DB API for MySQL. I&#8217;ve written about its use <a target="_blank" title="MySQL queries in Python" href="http://dancingpenguinsoflight.com/2009/03/running-mysql-queries-in-python/">before</a>. MySQL issues <a target="_blank" title="MySQL show warnings" href="http://dev.mysql.com/doc/refman/5.0/en/show-warnings.html">warning messages</a> in a number of circumstances and <a target="_blank" title="PEP 249" href="http://www.python.org/dev/peps/pep-0249/">PEP 249</a> (which specifies the Python DB API) describes a Warning error message to be included.</p>
<p>One issue I ran into recently was how to catch warnings thrown by this module when running queries. Oftentimes tutorials or forum discussions that cover warnings in the context of MySQLdb describe how to filter them (they can clog up script output). But in a recent case I wanted to grab and check the warning, logging a dependent result. I had hoped this clean implementation would work in a method used for all calls to the MySQL DB:</p>
<div class="codecolorer-container python blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #ff7700;font-weight:bold;">try</span>:<br />
&nbsp; &nbsp; cursor.<span style="color: black;">execute</span><span style="color: black;">&#40;</span>query<span style="color: black;">&#41;</span><br />
<span style="color: #ff7700;font-weight:bold;">except</span> MySQLdb.<span style="color: black;">Error</span>, e:<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">raise</span> e<br />
<span style="color: #ff7700;font-weight:bold;">except</span> MySQLdb.<span style="color: #008000;">Warning</span>, e:<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">raise</span> e<br />
<span style="color: #ff7700;font-weight:bold;">finally</span>:<br />
&nbsp; &nbsp; data = cursor.<span style="color: black;">fetchall</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; rows_returned = cursor.<span style="color: black;">rowcount</span><br />
&nbsp; &nbsp; cursor.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; db.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></td></tr></tbody></table></div>
<p>But the warnings just went right through. Instead I needed the warnings module&#8217;s assistance:</p>
<div class="codecolorer-container python blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">warnings</span><br />
<span style="color: #ff7700;font-weight:bold;">with</span> <span style="color: #dc143c;">warnings</span>.<span style="color: black;">catch_warnings</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; <span style="color: #dc143c;">warnings</span>.<span style="color: black;">simplefilter</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'error'</span>, MySQLdb.<span style="color: #008000;">Warning</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">try</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; cursor.<span style="color: black;">execute</span><span style="color: black;">&#40;</span>query<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">except</span> MySQLdb.<span style="color: black;">Error</span>, e:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">raise</span> e<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">finally</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; data = cursor.<span style="color: black;">fetchall</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; rows_returned = cursor.<span style="color: black;">rowcount</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; cursor.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; db.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></td></tr></tbody></table></div>
<p>This catches the warnings and raises them as errors, although their class is still correct, allowing a clean implementation to call the above code (wrapped into a method called do_query):</p>
<div class="codecolorer-container python blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #ff7700;font-weight:bold;">try</span>:<br />
&nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">do_query</span><span style="color: black;">&#40;</span>make_cool_table<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; logger.<span style="color: black;">info</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Created cool_table table.&quot;</span><span style="color: black;">&#41;</span><br />
<span style="color: #ff7700;font-weight:bold;">except</span> MySQLdb.<span style="color: #008000;">Warning</span>:<br />
&nbsp; &nbsp; logger.<span style="color: black;">info</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;cool_table already exists.&quot;</span><span style="color: black;">&#41;</span></div></td></tr></tbody></table></div>
   ]]></content:encoded>
			<wfw:commentRss>http://dancingpenguinsoflight.com/2009/10/catching-warnings-from-the-mysqldb-module/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Viewing all users on a Linux system</title>
		<link>http://dancingpenguinsoflight.com/2009/10/viewing-all-users-on-a-linux-system/</link>
		<comments>http://dancingpenguinsoflight.com/2009/10/viewing-all-users-on-a-linux-system/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 20:35:59 +0000</pubDate>
		<dc:creator>Samuel Huckins</dc:creator>
				<category><![CDATA[CLI]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://dancingpenguinsoflight.com/?p=1274</guid>
		<description><![CDATA[There are a number of widely-used and stable utilities on Linux systems that allow you to view information related to users. You can see who&#8217;s logged in with who, get info on a particular user with finger, see who you are with whoami and see who logged in last with last and lastlog. And there [...]]]></description>
			<content:encoded><![CDATA[<p>There are a number of widely-used and stable utilities on Linux systems that allow you to view information related to users. You can see who&#8217;s logged in with <a href="http://linux.die.net/man/1/who">who</a>, get info on a particular user with <a href="http://linux.die.net/man/1/finger">finger</a>, see who you are with <a href="http://linux.die.net/man/1/whoami">whoami</a> and see who logged in last with <a href="http://linux.die.net/man/1/last">last</a> and <a href="http://linux.die.net/man/8/lastlog">lastlog</a>. And there are commands to create, remove, and change users and their groups. </p>
<p>But what if you just want to see all the users defined on the entire system? Looking in /home won&#8217;t show you users that don&#8217;t have a home dir or one not located there. All users are indeed listed in <a target="_blank" title="Article on /etc/passwd format" href="http://www.cyberciti.biz/faq/understanding-etcpasswd-file-format/">/etc/passwd</a>, but having to look through this file every time you just want a list of users is tedious. I haven&#8217;t found a utility that performs this role. </p>
<p>This was somewhat surprising, as it&#8217;s not an uncommon need. Perhaps I&#8217;ve missed some essential program along my Linux journey. If so, feel free to enlighten me in a comment <img src='http://dancingpenguinsoflight.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  In the meantime, let&#8217;s fill this gap:</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># Prints all users, divided by login ability and homedir:</span><br />
<span style="color: #000000; font-weight: bold;">function</span> userinfo <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;----- Users that can login -----&quot;</span><br />
&nbsp; &nbsp; <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">&quot;:&quot;</span> <span style="color: #ff0000;">'!/bin\/false/ { print &quot;username: &quot; $1 &quot;, uid: &quot; $3 &quot;, homedir: &quot; $6 }'</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">passwd</span><br />
<br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>----- And have /home dir -----&quot;</span><br />
&nbsp; &nbsp; <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">&quot;:&quot;</span> <span style="color: #ff0000;">'!/bin\/false/ &amp;&amp; /\/home/ { print &quot;username: &quot; $1 &quot;, uid: &quot; $3 &quot;, homedir: &quot; $6 }'</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">passwd</span><br />
<br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>----- Users that can't login -----&quot;</span><br />
&nbsp; &nbsp; <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">&quot;:&quot;</span> <span style="color: #ff0000;">'/\/bin\/false/ { print &quot;username: &quot; $1 &quot;, uid: &quot; $3 &quot;, homedir: &quot; $6 }'</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">passwd</span><br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&quot;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span></div></td></tr></tbody></table></div>
<p>This function should work on any *nix system. Place it inside your ~/.bashrc, reload that (. ~/.bashrc), and try out &#8220;userinfo&#8221;:</p>
<p><img src="http://dancingpenguinsoflight.com/wp-content/uploads/2009/10/userinfo.png" alt="userinfo" title="userinfo" width="534" height="645" class="aligncenter size-full wp-image-1280" /></p>
<p>Three sections are displayed showing usernames, user IDs, and homedirs for users in /etc/passwd who:</p>
<ul>
<li>Don&#8217;t have /bin/false for a shell (i.e. users that can login)</li>
<li>Also have a homedir under /home (i.e. the users that aren&#8217;t for system processes)</li>
<li>Do have /bin/false for a shell (i.e. users that can&#8217;t login)</li>
</ul>
<p>Note that the users that can login category only shows users to which one could switch with &#8220;sudo su &#8211; USERNAME&#8221; from a shell. This doesn&#8217;t mean anything about whether they can login via SSH or other access methods.</p>
   ]]></content:encoded>
			<wfw:commentRss>http://dancingpenguinsoflight.com/2009/10/viewing-all-users-on-a-linux-system/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Great open source virtualization with VirtualBox</title>
		<link>http://dancingpenguinsoflight.com/2009/10/great-open-source-virtualization-with-virtualbox/</link>
		<comments>http://dancingpenguinsoflight.com/2009/10/great-open-source-virtualization-with-virtualbox/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 17:49:26 +0000</pubDate>
		<dc:creator>Samuel Huckins</dc:creator>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[VirtualBox]]></category>

		<guid isPermaLink="false">http://dancingpenguinsoflight.com/?p=1231</guid>
		<description><![CDATA[My first forays into virtualization were at work and utilized VMware&#8217;s myriad offerings (Player, Workstation, Server, ESX, VI). I was impressed by the capabilities of VMware&#8217;s products, and of course excited by the possibilities of virtualization. But for home use I didn&#8217;t push past getting VMware Player installed. I was annoyed at not being about [...]]]></description>
			<content:encoded><![CDATA[<p>My first forays into virtualization were at work and utilized <a target="_blank" title="VMware virtualization products" href="http://www.vmware.com/products/">VMware&#8217;s myriad offerings</a> (Player, Workstation, Server, ESX, VI). I was impressed by the capabilities of VMware&#8217;s products, and of course excited by the possibilities of virtualization. But for home use I didn&#8217;t push past getting VMware Player installed. I was annoyed at not being about to create my own virtual machines with the free products, and the product not being open source didn&#8217;t generate much excitement for me either.</p>
<p>So when I finally decided to set up some VMs for my own use, my criteria were straightforward: I wanted a broadly supported, performant, free virtualization solution that was open source. There is quite a range of options out there, e.g. <a title="Xen homepage" href="http://www.xen.org/" target="_blank">Xen</a> and <a title="OpenVZ wiki" href="http://wiki.openvz.org/Main_Page" target="_blank">OpenVZ</a>. I decided to give <a title="VirtualBox home" href="http://www.virtualbox.org/" target="_blank">Sun&#8217;s VirtualBox</a> a try and have been nothing but impressed so far:</p>
<p><a title="VirtualBox running Fedora 10 on Ubuntu 9.04" rel="shadowbox" href="http://dancingpenguinsoflight.com/wp-content/uploads/2009/10/virtualbox.png"><img class="aligncenter size-full wp-image-1247" title="virtualbox_small" src="http://dancingpenguinsoflight.com/wp-content/uploads/2009/10/virtualbox_small.png" alt="virtualbox_small" width="500" height="381" /></a></p>
<p>I&#8217;ve found VirtualBox easy to install, quite fast, attractive and easy to use.</p>
<h2>Installation</h2>
<p>Installation on Ubuntu 9.04 was fairly simple following <a target="_blank" title="Installing VirtualBox on Ubuntu 9.04" href="http://www.howtoforge.com/installing-virtualbox-3.0-on-an-ubuntu-9.04-desktop">this guide</a>. You add the VirtualBox repository, install the package, and follow the configuration wizard. I didn&#8217;t have to do anything special kernel-wise that the installation guide mentions. One thing they leave out: you need to add your user to the vboxusers group. Easy enough:</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> usermod <span style="color: #660033;">-a</span> <span style="color: #660033;">-G</span> vboxusers YOURUSERNAME</div></td></tr></tbody></table></div>
<p><a target="_blank" title="Manual section on installation" href="http://www.virtualbox.org/manual/UserManual.html#installation">The manual describes installing</a> on a wide range of other platforms, and there are plenty of tutorials out there as well.</p>
<h2>First steps</h2>
<p>After VirtualBox is installed, you need to create a VM and then install an OS on it. Click &#8220;New&#8221; in the top left of the VirtualBox window and follow the wizard. You might run into an issue in this process (only annoyance I&#8217;ve encountered so far) when selecting the OS Type and Version. For me the OS options in the drop down show up as very light grey on white until you hover over them:</p>
<p><img src="http://dancingpenguinsoflight.com/wp-content/uploads/2009/10/hard-to-see-os.png" alt="Nearly invisible OS options" title="Nearly invisible OS options" width="507" height="449" class="aligncenter size-full wp-image-1252" /></p>
<p>Not a critical issue, you can see the options by hovering down the list. </p>
<p>After you&#8217;ve followed the wizard to create the VM and provided it with storage space and other resources, you&#8217;ll end up at the VirtualBox main screen. At this point, select the VM you just made and click settings. Then go to CD/DVD-ROM on the left and check &#8220;Mount CD/DVD Drive&#8221;. If you have an actual install CD/DVD you want to use, select Host CD/DVD Drive. You can also just download the ISO for the OS you want to install and select ISO Image File:</p>
<p><a href="http://dancingpenguinsoflight.com/wp-content/uploads/2009/10/vm_settings.png" rel="shadowbox" title="Configuring CD/DVD drive mounting"><img src="http://dancingpenguinsoflight.com/wp-content/uploads/2009/10/vm_settings_small.png" alt="vm_settings_small" title="vm_settings_small" width="500" height="400" class="aligncenter size-full wp-image-1256" /></a></p>
<p>After selecting your drive or ISO for installation, save the settings and start the VM. A new window will open displaying the output of the running VM. If all goes well, you should be shown the installation menu for the CD or ISO you&#8217;ve mounted.</p>
<h2>Miscellaneous</h2>
<ul>
<li>You can take snapshots of your VMs in case you need to roll back to a known safe state. When the VM is turned off, go to the Snapshots tab to take new snapshots, review current ones, and roll back if needed.</li>
<li>Once you click on the VM window your output is sent to it alone. To get back out and interact with your own desktop, press the right CTRL key (configurable). Or install VirtualBox Guest Additions (see below) and not worry about this at all!</li>
<li>Your VMs (and assorted configuration info) are stored in ~/.VirtualBox:<br />
<img src="http://dancingpenguinsoflight.com/wp-content/uploads/2009/10/virtualbox_home_tree.png" alt="virtualbox_home_tree" title="virtualbox_home_tree" width="418" height="390" class="aligncenter size-full wp-image-1265" /></li>
<li>Installing <a target="_blank" title="Manual section on Guest Additions" href="http://www.virtualbox.org/manual/UserManual.html#id2507352">VirtualBox Guest Additions</a> is quite helpful. Aside from graphical improvements, after it&#8217;s installed you don&#8217;t have to click inside a VM to get focus. You just move your pointer into the VM and it has focus. Move out and the host GUI has control again.</li>
</ul>
<h2>Resources</h2>
<ul>
<li><strong><a target="_blank" title="VirtualBox home" href="http://www.virtualbox.org/">Homepage</a></strong></li>
<li><strong><a target="_blank" title="VirtualBox screenshots" href="http://www.virtualbox.org/wiki/Screenshots">Screenshots</a></strong></li>
<li><strong><a target="_blank" title="Installing VirtualBox on Ubuntu 9.04" href="http://www.howtoforge.com/installing-virtualbox-3.0-on-an-ubuntu-9.04-desktop">Installation on Ubuntu 9.04</a></strong></li>
<li><strong><a target="_blank" title="VirtualBox user manual" href="http://www.virtualbox.org/manual/UserManual.html">Manual</a></strong> (very well done)</li>
</ul>
   ]]></content:encoded>
			<wfw:commentRss>http://dancingpenguinsoflight.com/2009/10/great-open-source-virtualization-with-virtualbox/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Editing Trac comments at the DB layer</title>
		<link>http://dancingpenguinsoflight.com/2009/10/editing-trac-comments-at-the-db-layer/</link>
		<comments>http://dancingpenguinsoflight.com/2009/10/editing-trac-comments-at-the-db-layer/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 00:58:34 +0000</pubDate>
		<dc:creator>Samuel Huckins</dc:creator>
				<category><![CDATA[Web Applications]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Trac]]></category>

		<guid isPermaLink="false">http://dancingpenguinsoflight.com/?p=1238</guid>
		<description><![CDATA[Today I needed to alter the content of a comment made on a Trac ticket. I didn&#8217;t anticipate this would be a difficult task, but I wasn&#8217;t too familiar with Trac&#8217;s DB schema. So to save you a few consternated queries, here&#8217;s the spoiler. Comments on tickets aren&#8217;t kept within their own table (as you [...]]]></description>
			<content:encoded><![CDATA[<p>Today I needed to alter the content of a comment made on a Trac ticket. I didn&#8217;t anticipate this would be a difficult task, but I wasn&#8217;t too familiar with Trac&#8217;s DB schema. So to save you a few consternated queries, here&#8217;s the spoiler. Comments on tickets aren&#8217;t kept within their own table (as you might expect) but are instead stored in the ticket_change table. </p>
<p>In my particular case the Trac DB was MySQL, so the examples I&#8217;ll provide will be MySQL queries. If you have an SQLite-backed Trac the operations should be the same, you&#8217;ll just need to use SQLite&#8217;s syntax.</p>
<p>Say the ticket with the naughty comment is #1234. To see all comments on this ticket:</p>
<div class="codecolorer-container sql blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> trac<span style="color: #66cc66;">.</span>ticket_change <br />
<span style="color: #993333; font-weight: bold;">WHERE</span> <span style="color: #993333; font-weight: bold;">FIELD</span> <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;comment&quot;</span> <br />
<span style="color: #993333; font-weight: bold;">AND</span> ticket <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">1234</span>;</div></td></tr></tbody></table></div>
<p>And to update a comment:</p>
<div class="codecolorer-container sql blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">UPDATE</span> trac<span style="color: #66cc66;">.</span>ticket_change <br />
<span style="color: #993333; font-weight: bold;">SET</span> newvalue <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;New hotness&quot;</span> <br />
<span style="color: #993333; font-weight: bold;">WHERE</span> <span style="color: #993333; font-weight: bold;">FIELD</span> <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;comment&quot;</span> <br />
<span style="color: #993333; font-weight: bold;">AND</span> ticket <span style="color: #66cc66;">=</span> 1234<br />
<span style="color: #993333; font-weight: bold;">AND</span> oldvalue <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;Old and busted&quot;</span>;</div></td></tr></tbody></table></div>
<p>Happy revisionizing.</p>
   ]]></content:encoded>
			<wfw:commentRss>http://dancingpenguinsoflight.com/2009/10/editing-trac-comments-at-the-db-layer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Permanently remember password for gksudo</title>
		<link>http://dancingpenguinsoflight.com/2009/09/permanently-remember-password-for-gksudo/</link>
		<comments>http://dancingpenguinsoflight.com/2009/09/permanently-remember-password-for-gksudo/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 03:44:49 +0000</pubDate>
		<dc:creator>Samuel Huckins</dc:creator>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://dancingpenguinsoflight.com/?p=1220</guid>
		<description><![CDATA[I&#8217;m all about security practices on my remote server systems. On my firewalled desktop systems, however, I&#8217;d rather err on the side of convenience. I prefer to not have to type my password to use sudo or gksudo (graphical sudo). If I type my password to login to my account once, I want to have [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m all about security practices on my remote server systems. On my firewalled desktop systems, however, I&#8217;d rather err on the side of convenience. I prefer to not have to type my password to use sudo or gksudo (graphical sudo). If I type my password to login to my account once, I want to have access to everything unfettered thereafter.</p>
<p>While there are <a target="_blank" href="http://maestric.com/doc/unix/ubuntu_sudo_without_password">plenty</a> <a target="_blank" href="https://help.ubuntu.com/community/RootSudo#Remove%20Password%20Prompt%20For%20sudo">of</a> <a target="_blank" href="http://www.atoztoa.com/2009/07/sudo-without-password-in-ubuntu.html">posts</a> on how to get sudo without password going, I never could seem to find information on how to do this for gksudo as well. So here&#8217;s how to do that.</p>
<p>First open the gconf-editor (gnome configuration):</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">gksu gconf-editor</div></td></tr></tbody></table></div>
<p>Once that opens, go to /apps/gksu, and check &#8220;save-to-keyring&#8221;:</p>
<p><img src="http://dancingpenguinsoflight.com/wp-content/uploads/2009/09/gconf_gksu.png" alt="gconf_gksu" title="gconf_gksu" width="633" height="621" class="aligncenter size-full wp-image-1221" /></p>
<p>This will remember your password for gksudo, so you won&#8217;t get any more auth popups.</p>
   ]]></content:encoded>
			<wfw:commentRss>http://dancingpenguinsoflight.com/2009/09/permanently-remember-password-for-gksudo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get useful image information on the command line</title>
		<link>http://dancingpenguinsoflight.com/2009/09/get-useful-image-information-on-the-command-line/</link>
		<comments>http://dancingpenguinsoflight.com/2009/09/get-useful-image-information-on-the-command-line/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 03:20:57 +0000</pubDate>
		<dc:creator>Samuel Huckins</dc:creator>
				<category><![CDATA[CLI]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linuc]]></category>

		<guid isPermaLink="false">http://dancingpenguinsoflight.com/?p=1212</guid>
		<description><![CDATA[ImageMagick is an incredible set of programs that allow you to get all sorts of information on image files from the command line, as well as batch edit and generally alter images of many varieties. You can read all about these facilities on ImageMagick&#8217;s well-made documentation site.
What I often want, however, is simple: a command [...]]]></description>
			<content:encoded><![CDATA[<p><a target="_blank" title="ImageMagick home" href="http://www.imagemagick.org/script/index.php">ImageMagick</a> is an incredible set of programs that allow you to get all sorts of information on image files from the command line, as well as batch edit and generally alter images of many varieties. You can read all about these facilities on ImageMagick&#8217;s <a target="_blank" title="ImageMagick command line tools" href="http://www.imagemagick.org/script/command-line-tools.php">well-made documentation site</a>.</p>
<p>What I often want, however, is simple: a command to get commonly desired information from any image file. Alias to the rescue!</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">imginfo</span>=<span style="color: #ff0000;">&quot;identify -format '-- %f -- <span style="color: #000099; font-weight: bold;">\n</span>Type: %m<span style="color: #000099; font-weight: bold;">\n</span>Size: %b bytes<span style="color: #000099; font-weight: bold;">\n</span>Resolution: %wpx x %hpx<span style="color: #000099; font-weight: bold;">\n</span>Colors: %k'&quot;</span></div></td></tr></tbody></table></div>
<p>This produces a succinctly helpful output:</p>
<p><img src="http://dancingpenguinsoflight.com/wp-content/uploads/2009/09/imginfo.png" alt="imginfo" title="imginfo" width="415" height="101" class="aligncenter size-full wp-image-1216" /></p>
<p>Often this is all I need for basic tasks. And if more is needed there&#8217;s always the full ImageMagick suite.</p>
<p>You can alter the format to whatever you prefer, using <a target="_blank" title="ImageMagick format options" href="http://www.imagemagick.org/script/escape.php">the wide variety of variables</a>.</p>
   ]]></content:encoded>
			<wfw:commentRss>http://dancingpenguinsoflight.com/2009/09/get-useful-image-information-on-the-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>64-bit Ubuntu: Not a problem</title>
		<link>http://dancingpenguinsoflight.com/2009/09/64-bit-ubuntu-not-a-problem/</link>
		<comments>http://dancingpenguinsoflight.com/2009/09/64-bit-ubuntu-not-a-problem/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 02:39:20 +0000</pubDate>
		<dc:creator>Samuel Huckins</dc:creator>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://dancingpenguinsoflight.com/?p=1207</guid>
		<description><![CDATA[I recently had occasion to upgrade one of my home PCs. I went with a Core 2 Duo for the processor, and decided to give 64-bit Ubuntu (9.04, Jaunty Jackelope) a shot. I found it quite easy, with only a few adjustments needed to my usual system setup steps. General recommendations aside, I wanted to [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had occasion to upgrade one of my home PCs. I went with a Core 2 Duo for the processor, and decided to give 64-bit Ubuntu (9.04, Jaunty Jackelope) a shot. I found it quite easy, with only a few adjustments needed to my usual system setup steps. General recommendations aside, I wanted to share a few particular application notes I found useful.</p>
<ul>
<li><strong>Adobe Air</strong>: I love Pandora One, TweetDeck, and a number of other Air applications, so getting this working on 64-bit was a requirement. While there aren&#8217;t any 64-bit packages for Air on Linux, the 32-bit version works just fine. I was a bit dismayed when I saw the lengthy instructions Adobe has listed for this process, but I must admit they did work perfectly. So grab the eyedrops and <a target="_blank" title="Installation of Air on Ubuntu" href="http://kb2.adobe.com/cps/408/kb408084.html#Installing_AIR_1.5_on_64-bit_Ubuntu_7.10__8.04_and_9.04">hit up this page</a>. Be sure to follow the step at the end for 9.04, otherwise the Air apps won&#8217;t be able to connect to the internet on a 64-bit system.</li>
<li><strong>Pandora One</strong>: You have to subscribe to get access to <a target="_blank" title="Pandora One" href="http://www.pandora.com/pandora_one">Pandora One</a>, but rest assured it works just fine on 64-bit Ubuntu.</li>
<li><strong>Java</strong>: This used to present some complications for Ubuntu users, but <a target="_blank" title="Java on Ubuntu 9.04" href="http://monespaceperso.org/blog-en/2009/05/05/how-to-install-java-on-ubuntu-jaunty-904/">following this guide</a> I had things running in no time.</li>
<li><strong>Flash</strong>: All I needed to run was &#8220;sudo apt-get install flashplugin-nonfree&#8221;. Flash in Firefox worked perfectly.</li>
<li><strong>TweetDeck</strong>: <a href="http://tweetdeck.com/beta/">TweetDeck</a> is a great application to keep better track of your Twitter feed. v0.30.5 works just fine on 64-bit Jaunty.</li>
</ul>
<p>While the benefits of running a 64-bit OS aren&#8217;t as substantial for most desktop tasks, there is still a performance boost across the board. And at least for the applications I love and use everyday, the packages are definitely at a stable state for running under 64-bit.</p>
   ]]></content:encoded>
			<wfw:commentRss>http://dancingpenguinsoflight.com/2009/09/64-bit-ubuntu-not-a-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An improved ruby debugger invocation</title>
		<link>http://dancingpenguinsoflight.com/2009/09/an-improved-ruby-debugger-invocation/</link>
		<comments>http://dancingpenguinsoflight.com/2009/09/an-improved-ruby-debugger-invocation/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 01:17:41 +0000</pubDate>
		<dc:creator>Samuel Huckins</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://dancingpenguinsoflight.com/?p=1195</guid>
		<description><![CDATA[I&#8217;d been wanting to write a post for some time on improvements I&#8217;ve found useful in using Ruby&#8217;s debugger. Friend Trevor Rosen beat me to the proverbial punch, however. Give his post a read first, I&#8217;ll wait.
Now on top of his suggestions I have one more refinement to add. I&#8217;ve defined a snippet in vim [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;d been wanting to write a post for some time on improvements I&#8217;ve found useful in using Ruby&#8217;s debugger. Friend Trevor Rosen <a target="_blank" title="Trevor Rosen's post on improving Ruby debugger" href="http://www.catapult-creative.com/2009/08/12/make-ruby-debug-work-better/">beat me to the proverbial punch</a>, however. Give his post a read first, I&#8217;ll wait.</p>
<p>Now on top of his suggestions I have one more refinement to add. I&#8217;ve defined a snippet in vim for whenever I need to use the debugger. You should be able to define the same in whatever editor you use (and if your editor can&#8217;t do snippets, get <a target="_blank" title="vim home" href="http://www.vim.org/">a real one</a>). When in an .rb file, &#8220;debug&#8221; + Tab becomes:</p>
<div class="codecolorer-container ruby blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'ruby-debug'</span>; Debugger.<span style="color:#9900CC;">settings</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:autoeval</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#0000FF; font-weight:bold;">true</span>; debugger; rubys_debugger = <span style="color:#996600;">&quot;annoying&quot;</span></div></td></tr></tbody></table></div>
<p>In addition to the format Trevor suggested (which calls the necessary module, turns on auto evaluation, and calls the debugger itself) this adds a simple assignment after the debugger is called. I often find this necessary because I want to debug right at the very end of a given suite, a conditional, a method, etc. But if you invoke the debugger as the last statement in such a situation, it won&#8217;t actually be called. Here&#8217;s an example file:</p>
<div class="codecolorer-container ruby blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#008000; font-style:italic;">#!/usr/bin/env ruby</span><br />
<br />
<span style="color:#9966CC; font-weight:bold;">def</span> troubled_func<span style="color:#006600; font-weight:bold;">&#40;</span>var1<span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Entering troubled function...&quot;</span><br />
&nbsp; secret_num = <span style="color:#CC0066; font-weight:bold;">rand</span><span style="color:#006600; font-weight:bold;">&#40;</span>10<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">*</span> var1<br />
&nbsp; <span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'ruby-debug'</span>; Debugger.<span style="color:#9900CC;">settings</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:autoeval</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#0000FF; font-weight:bold;">true</span>; debugger<br />
<span style="color:#9966CC; font-weight:bold;">end</span><br />
<br />
troubled_func<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">5</span><span style="color:#006600; font-weight:bold;">&#41;</span></div></td></tr></tbody></table></div>
<p>When you run this, you won&#8217;t get a debugger console. All the output you get is &#8220;Entering troubled function&#8230;&#8221; and the script exits. If instead you add the assignment I list above after debugger is called, you will get to the debugger console. Sad, but true. (You can select a less offensive assignment if you wish. I settled on it in disgust.)</p>
<p>Aside from this, the Ruby debugger is a useful and beautiful thing. So add the snippet and forget about it.</p>
   ]]></content:encoded>
			<wfw:commentRss>http://dancingpenguinsoflight.com/2009/09/an-improved-ruby-debugger-invocation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
