<?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>MadSoft &#187; client</title>
	<atom:link href="http://www.madsoft.org/tags/client/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.madsoft.org</link>
	<description></description>
	<lastBuildDate>Sat, 12 Dec 2009 20:47:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>SETI@Home Optimizers on Linux</title>
		<link>http://www.madsoft.org/2008/09/28/setihome-optimizers-on-linux/</link>
		<comments>http://www.madsoft.org/2008/09/28/setihome-optimizers-on-linux/#comments</comments>
		<pubDate>Sun, 28 Sep 2008 07:13:01 +0000</pubDate>
		<dc:creator>Alec Hussey</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[boinc]]></category>
		<category><![CDATA[client]]></category>
		<category><![CDATA[optimized]]></category>
		<category><![CDATA[seti]]></category>
		<category><![CDATA[setiathome]]></category>

		<guid isPermaLink="false">http://www.madsoft.org/?p=45</guid>
		<description><![CDATA[As I am a big proponent of the SETI@Home project as well as a Linux user, discovering that optimized SETI applications existed and how to use them was important. It took quite some time to figure this all out by myself since there are hardly any (from what I could find) resources on SETI@Home optimized [...]]]></description>
			<content:encoded><![CDATA[<p>As I am a big proponent of the SETI@Home project as well as a Linux user, discovering that optimized SETI applications existed and how to use them was important. It took quite some time to figure this all out by myself since there are hardly any (from what I could find) resources on SETI@Home optimized clients on Linux. Eventually I ran into <a href="http://lunatics.kwsn.net/" target="_blank">this</a> site which offers SSE3 and SSSE3 optimized clients for Linux in addition to SSE, SSE2, and SSE3 clients for FreeBSD.</p>
<p>For those of you who don&#8217;t know what SETI@Home optimizers are, they are essentially specialized versions of the standard version of the SETI@Home client which take advantage of extended floating-point instruction sets available to certain x86 (Intel, AMD, or the like) processors. Using these instruction sets allows optimized clients to complete work many times faster than it could before with the standard client. For example, prior to using an SSSE3 optimized client on my Intel Core 2 Quad Q6600 my recent average credit (RAC) on SETI was in the 500 range including one other active machine and now my RAC has spiked over 2,500 not including the other active machine.</p>
<p><span id="more-45"></span>Before we get started, you should make sure that all other active work units you have running are completed before replacing the standard client with an optimized one. Then you may choose which optimize client you will run. Keep in mind that currently, only Intel Core 2 based CPUs and a single VIA CPU are capable of running SSSE3 instructions. For more details on this you should refer to the <a href="http://en.wikipedia.org/wiki/SSSE3" target="_blank">SSSE3 wikipedia page</a>. Otherwise, you will likely be able to run an SSE3 optimized client, unless your CPU is more than several years old, also <a href="http://en.wikipedia.org/wiki/SSE3" target="_blank">refer to wikipedia</a> for more information on this. If you&#8217;ve got an even older CPU, there are also clients for MMX, SSE, and SSE2.</p>
<p>Optionally you may check which instruction sets are supported by your CPU using the following command:</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>maddog39<span style="color: #000000; font-weight: bold;">@</span>desktop ~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>cpuinfo <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> flags <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #660033;">-n</span> <span style="color: #000000;">1</span>
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm</pre></div></div>

</blockquote>
<p>First thing we want to do is download the client for your respective CPU and kernel version (most likely SSE3 or SSSE3 and kernel 2.6) from <a href="http://lunatics.kwsn.net/discussion-forum/linux-port-of-alex-kans-v8-0.msg8200.html;topicseen#msg8200" target="_blank">this</a> page and extract the tarball. If your using an older CPU requiring an older instruction set, see <a href="http://lunatics.kwsn.net/index.php?module=Downloads;catd=1" target="_blank">this</a> page instead.</p>
<p>Before we actually drop in the optimized client, its probably best to suspend the SETI@Home project in BOINC for safe measure.</p>
<p><a href="http://www.madsoft.org/wp-content/uploads/2008/09/boinc_seti_suspend.png"><img class="alignnone size-full wp-image-54" title="Suspend SETI@Home" src="http://www.madsoft.org/wp-content/uploads/2008/09/boinc_seti_suspend.png" alt="" width="500" height="193" /></a></p>
<p>Now we get to physically install our new SETI@Home optimizer. In the folder you extracted from the tarball, you should find a binary (executable) and an app_info.xml file, either in the folder&#8217;s top directory or in a subsequent sub-folder.</p>
<p><a href="http://www.madsoft.org/wp-content/uploads/2008/09/seti_optimizer_extracted.png"><img class="alignnone size-full wp-image-55" title="Extraced Optimizer Files" src="http://www.madsoft.org/wp-content/uploads/2008/09/seti_optimizer_extracted.png" alt="" width="500" height="342" /></a></p>
<p>You want to copy these files and launch nautilus (or your file manager of choice) as root and point it to the /var/lib/boinc folder. Hit Alt+F2 to bring up a run dialog and enter the command:</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">gksudo nautilus <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>boinc<span style="color: #000000; font-weight: bold;">/</span>projects<span style="color: #000000; font-weight: bold;">/</span>setiathome.berkeley.edu</pre></div></div>

</blockquote>
<p><a href="http://www.madsoft.org/wp-content/uploads/2008/09/run_nautilus_root_boinc_fixed.png"><img class="alignnone size-full wp-image-60" title="Run Nautilus as Root" src="http://www.madsoft.org/wp-content/uploads/2008/09/run_nautilus_root_boinc_fixed.png" alt="" width="461" height="179" /></a></p>
<p>Paste the optimizer files into the directory and when comes up. Finally, you will need to restart the BOINC daemon. On my distribution, Arch Linux its:</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rc.d<span style="color: #000000; font-weight: bold;">/</span>boinc restart</pre></div></div>

</blockquote>
<p>Although if you are using Ubuntu, Debian, or a derivative its:</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>boinc restart</pre></div></div>

</blockquote>
<p>Then, to start using your new SETI optimized client, you simply launch BOINC manager and resume the SETI@Home project. It should start downloading new workunits immediatley and your in business. I hope you found this article useful and keep in mind that I tried to keep it as easy as possible for the newer Linux users out there.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.madsoft.org/2008/09/28/setihome-optimizers-on-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easily create IRC bots in Python with PyBotlib</title>
		<link>http://www.madsoft.org/2008/05/09/easily-create-irc-bots-in-python-with-pybotlib/</link>
		<comments>http://www.madsoft.org/2008/05/09/easily-create-irc-bots-in-python-with-pybotlib/#comments</comments>
		<pubDate>Fri, 09 May 2008 19:19:02 +0000</pubDate>
		<dc:creator>Alec Hussey</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[bot]]></category>
		<category><![CDATA[botlib]]></category>
		<category><![CDATA[client]]></category>
		<category><![CDATA[irc]]></category>

		<guid isPermaLink="false">http://www.madsoft.org/2008/05/09/easily-create-irc-bots-in-python-with-pybotlib/</guid>
		<description><![CDATA[Back when I wrote ProxyBot, I was frustrated by the fact that there was a lack of maintained and documented third party libraries for the IRC client protocol. So I essentially wrote my own implementation of the IRC client protocol for use with the bots that I write. Well I wrote the library to take [...]]]></description>
			<content:encoded><![CDATA[<p>Back when I wrote ProxyBot, I was frustrated by the fact that there was a lack of maintained and documented third party libraries for the IRC client protocol. So I essentially wrote my own implementation of the IRC client protocol for use with the bots that I write. Well I wrote the library to take advantage of OOP (Object Oriented Programming for those who don&#8217;t know) which in turn made it really quick and easy for me to throw together a bot.</p>
<p>So this is a simple little tutorial on how to write a basic &#8220;Hello World&#8221; bot using PyBotlib. The library itself is only a single file so I have not bothered to repackage it or write setup scripts as you will only need import that single file within your application. You may get the latest source code for the library at any time <a title="botlib.py" href="http://ircproxybot.googlecode.com/svn/trunk/botlib.py" target="_blank">here</a> (google code/SVN) or <a title="PyBotlib 1.0" href="http://www.madsoft.org/wp-content/uploads/2008/05/botlib.py" target="_blank">here</a> (blog). So here we go&#8230;</p>
<p><span id="more-28"></span><br />
Lets start by defining our bot class and its constructor.</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> botlib
&nbsp;
<span style="color: #808080; font-style: italic;"># Create a new class for our bot, extending the Bot class from botlib</span>
<span style="color: #ff7700;font-weight:bold;">class</span> HelloWorldBot<span style="color: black;">&#40;</span>botlib.<span style="color: black;">Bot</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, server, channel, nick, password=<span style="color: #008000;">None</span><span style="color: black;">&#41;</span>:
        botlib.<span style="color: black;">Bot</span>.<span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, server, <span style="color: #ff4500;">6667</span>, channel, nick<span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #808080; font-style: italic;"># Send nickserv password if available</span>
        <span style="color: #ff7700;font-weight:bold;">if</span> password <span style="color: #66cc66;">!</span>= <span style="color: #008000;">None</span>:
            <span style="color: #008000;">self</span>.<span style="color: black;">protocol</span>.<span style="color: black;">privmsg</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;nickserv&quot;</span>, <span style="color: #483d8b;">&quot;identify&quot;</span> <span style="color: #66cc66;">%</span> password<span style="color: black;">&#41;</span></pre></div></div>

</blockquote>
<p>Next we are going to want to override the __actions__ function of the Bot class which will handle all of our bots actions. This acts as essentially a main loop and is called infinitely until the bot is shutdown. In here we put code for our commands, responders, whatever other interaction with the IRC channel that we need.</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">    <span style="color: #ff7700;font-weight:bold;">def</span> __actions__<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        botlib.<span style="color: black;">Bot</span>.__actions__<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #808080; font-style: italic;"># Create a Hello World responder/command</span>
        <span style="color: #ff7700;font-weight:bold;">if</span> botlib.<span style="color: black;">check_found</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">data</span>, <span style="color: #483d8b;">&quot;!hello&quot;</span><span style="color: black;">&#41;</span>:
            <span style="color: #808080; font-style: italic;"># Get the senders username</span>
            username = <span style="color: #008000;">self</span>.<span style="color: black;">get_username</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
            <span style="color: #808080; font-style: italic;"># Send user a message in response</span>
            <span style="color: #008000;">self</span>.<span style="color: black;">protocol</span>.<span style="color: black;">privmsg</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">channel</span>, <span style="color: #483d8b;">&quot;Hello %s!&quot;</span> <span style="color: #66cc66;">%</span> username<span style="color: black;">&#41;</span></pre></div></div>

</blockquote>
<p>So here, we have created a simple command called !hello which runs the code underneath its if statement when an instance of that command is found in the chat. Then we call the get_username() function of the Bot class (remember that we inherited from the Bot class) to get the user name of the person who initiated the command. After that, we simply send a message back to the channel using the equivalent function for IRC&#8217;s PRIVMSG command. Now all we to do is instantiate and run our new bot.</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"> <span style="color: #ff7700;font-weight:bold;">if</span> __name__ == <span style="color: #483d8b;">&quot;__main__&quot;</span>:
    <span style="color: #808080; font-style: italic;"># Create new instance of our bot and run it</span>
    HelloWorldBot<span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;irc.wyldryde.org&quot;</span>, <span style="color: #483d8b;">&quot;#maddog39&quot;</span>, <span style="color: #483d8b;">&quot;HelloWorldBot&quot;</span><span style="color: black;">&#41;</span>.<span style="color: black;">run</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

</blockquote>
<p>Keep in mind that when you are instantiating Bot object, that because PyBotlib is entirely threaded, you can make as many instances of your bot as you would like. I do have a BotManager class in PyBotlib intended for managing sets of multiple bots on the same process however I have never actually tested it so your results may vary. Here is the script in its entirety.</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> botlib
&nbsp;
<span style="color: #808080; font-style: italic;"># Create a new class for our bot, extending the Bot class from botlib</span>
<span style="color: #ff7700;font-weight:bold;">class</span> HelloWorldBot<span style="color: black;">&#40;</span>botlib.<span style="color: black;">Bot</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, server, channel, nick, password=<span style="color: #008000;">None</span><span style="color: black;">&#41;</span>:
        botlib.<span style="color: black;">Bot</span>.<span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, server, <span style="color: #ff4500;">6667</span>, channel, nick<span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #808080; font-style: italic;"># Send nickserv password if availible</span>
        <span style="color: #ff7700;font-weight:bold;">if</span> password <span style="color: #66cc66;">!</span>= <span style="color: #008000;">None</span>:
            <span style="color: #008000;">self</span>.<span style="color: black;">protocol</span>.<span style="color: black;">privmsg</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;nickserv&quot;</span>, <span style="color: #483d8b;">&quot;identify&quot;</span> <span style="color: #66cc66;">%</span> password<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> __actions__<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        botlib.<span style="color: black;">Bot</span>.__actions__<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #808080; font-style: italic;"># Create a Hello World responder/command</span>
        <span style="color: #ff7700;font-weight:bold;">if</span> botlib.<span style="color: black;">check_found</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">data</span>, <span style="color: #483d8b;">&quot;!hello&quot;</span><span style="color: black;">&#41;</span>:
            <span style="color: #808080; font-style: italic;"># Get the senders username</span>
            username = <span style="color: #008000;">self</span>.<span style="color: black;">get_username</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
            <span style="color: #808080; font-style: italic;"># Send user a message in response</span>
            <span style="color: #008000;">self</span>.<span style="color: black;">protocol</span>.<span style="color: black;">privmsg</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">channel</span>, <span style="color: #483d8b;">&quot;Hello %s!&quot;</span> <span style="color: #66cc66;">%</span> username<span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">if</span> __name__ == <span style="color: #483d8b;">&quot;__main__&quot;</span>:
    <span style="color: #808080; font-style: italic;"># Create new instance of our bot and run it</span>
    HelloWorldBot<span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;irc.wyldryde.org&quot;</span>, <span style="color: #483d8b;">&quot;#maddog39&quot;</span>, <span style="color: #483d8b;">&quot;HelloWorldBot&quot;</span><span style="color: black;">&#41;</span>.<span style="color: black;">run</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

</blockquote>
<p>Finally, to run your new bot, simply issue the command:</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">python helloworldbot.py</pre></div></div>

</blockquote>
<p>At the terminal prompt or command prompt (windows). Also note that you must make sure that your botlib.py file is in the same directory as your bot. Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.madsoft.org/2008/05/09/easily-create-irc-bots-in-python-with-pybotlib/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
