<?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/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
>
<channel>
	<title>G-Loaded Journal &#187; Remote</title>
	<atom:link href="http://www.g-loaded.eu/tag/remote/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.g-loaded.eu</link>
	<description>An open-source software and technology related journal</description>
	<lastBuildDate>Mon, 05 Dec 2011 19:55:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
		<item>
		<title>Python SSH Server for UNIX Systems using Twisted.conch</title>
		<link>http://www.g-loaded.eu/2010/03/26/python-ssh-server-unix-twisted-conch/</link>
		<comments>http://www.g-loaded.eu/2010/03/26/python-ssh-server-unix-twisted-conch/#comments</comments>
		<pubDate>Fri, 26 Mar 2010 20:27:00 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Administration]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Remote]]></category>
		<category><![CDATA[Snippet]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[Twisted]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/?p=1572</guid>
		<description><![CDATA[I can still recall the excitement of the first time I tried to access and administer a remote system using SSH. Accessing my shell at a remote machine securely, being able to do local and remote port forwarding in order to access remote services through encrypted tunnels, X forwarding, secure file transfers using scp or [...]]]></description>
			<content:encoded><![CDATA[<p>I can still recall the excitement of the first time I tried to access and administer a remote system using <strong>SSH</strong>. Accessing my shell at a remote machine securely, being able to do local and remote port forwarding in order to access remote services through encrypted tunnels, X forwarding, secure file transfers using <em>scp</em> or <em>sftp</em>, <a href="http://www.g-loaded.eu/2005/11/10/ssh-with-keys/">authentication using public key infrastructure</a> are just a few of the features that justify the excitement of the first time. The only <em>Secure Shell</em> server implementation I had used all that time was the <a href="http://www.openssh.com/">OpenSSH</a> server. Although this is an open-source project, the fact that it is written in C makes it extremely difficult for me to have fun with it by making any modifications in order to implement even simple things like command filtering. This is because I have never programmed in <strong>C</strong> and do not intend to learn how to do it in the foreseeable future. So what I&#8217;ve been looking for today was a server implementation of the <strong>SSH2 protocol</strong> written in <a href="http://python.org">Python</a>. Unfortunately, there is no such project ready for immediate use. I had to hack my own! After several hours of trial and error, having written dozens of sample scripts for testing, I finally created a minimal project, called <strong>RapidSSH</strong>, in order to demonstrate how to create a fully functional SSH server with just a few lines of Python code by using <em>Twisted.conch</em>, part of the <a href="http://twistedmatrix.com">Twisted Framework</a>. Read on&#8230;<br />
<span id="more-1572"></span><br />
At first, I tried to experiment with the <a href="http://twistedmatrix.com/documents/current/conch/examples/sshsimpleserver.py">sshsimpleserver.py</a> example script that exists on the Twisted homepage. But, soon I realized that this script is there just to give an idea about how to use <code>Twisted.conch</code> and also provide a sensible starting point for your own implementations. That script was not even close in having the functionality I had in mind. After spending some time examining the Twisted source code, I found a fantastic, but completely undocumented, module: <a href="http://twistedmatrix.com/trac/browser/trunk/twisted/conch/unix.py">twisted.conch.unix</a>. Having gained some experience by my experimentation with <code>sshsimpleserver.py</code> I managed to easily put the pieces together and come up with the SSH server implementation as shown below.</p>
<p>But first, let&#8217;s install some <strong>dependencies</strong>. I assume that you will try the code on a machine aimed for testing, so I won&#8217;t be using the system&#8217;s package manager but instead use <strong>easy_install</strong> to install the needed Python modules. Other commands like <em>pip</em> could be used as well. If you do not want to mess with your system-wide python installation, just use <strong>virtualenv</strong> and <strong>pip</strong>, but I won&#8217;t go into the details about how to use these tools in the current document.</p>
<p>Install the needed dependencies:</p>
<pre class="console">
easy_install pycrypto
easy_install pyasn1
easy_install pam
easy_install twisted
</pre>
<p>Make sure you have <strong>gcc</strong> installed, because it will be needed to complete the installation of Twisted and PyCrypto.</p>
<p>I have created a project for this code at <strong>Bitbucket</strong>, called <a href="http://bitbucket.org/gnotaras/rapidssh/">RapidSSH</a>. This will make it easier to share code and ideas about SSH server implementations in Python using Twisted.</p>
<p>Filename: <code>scripts/rapidsshd_unix.py</code></p>
<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/env python</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># This file is part of rapidssh - http://bitbucket.org/gnotaras/rapidssh/</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># rapidssh - A set of Secure Shell (SSH) server implementations in Python</span>
<span style="color: #808080; font-style: italic;">#            using Twisted.conch, part of the Twisted Framework.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># Copyright (c) 2010 George Notaras - http://www.g-loaded.eu</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># Permission is hereby granted, free of charge, to any person obtaining a copy</span>
<span style="color: #808080; font-style: italic;"># of this software and associated documentation files (the &quot;Software&quot;), to deal</span>
<span style="color: #808080; font-style: italic;"># in the Software without restriction, including without limitation the rights</span>
<span style="color: #808080; font-style: italic;"># to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
<span style="color: #808080; font-style: italic;"># copies of the Software, and to permit persons to whom the Software is</span>
<span style="color: #808080; font-style: italic;"># furnished to do so, subject to the following conditions:</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># The above copyright notice and this permission notice shall be included in</span>
<span style="color: #808080; font-style: italic;"># all copies or substantial portions of the Software.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
<span style="color: #808080; font-style: italic;"># IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<span style="color: #808080; font-style: italic;"># FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<span style="color: #808080; font-style: italic;"># AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<span style="color: #808080; font-style: italic;"># LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
<span style="color: #808080; font-style: italic;"># OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN</span>
<span style="color: #808080; font-style: italic;"># THE SOFTWARE.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># Initially based on the sshsimpleserver.py kindly published by:</span>
<span style="color: #808080; font-style: italic;"># Twisted Matrix Laboratories - http://twistedmatrix.com</span>
<span style="color: #808080; font-style: italic;">#</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
<span style="color: #ff7700;font-weight:bold;">import</span> pam
&nbsp;
<span style="color: #ff7700;font-weight:bold;">from</span> twisted.<span style="color: black;">conch</span>.<span style="color: black;">unix</span> <span style="color: #ff7700;font-weight:bold;">import</span> UnixSSHRealm
<span style="color: #ff7700;font-weight:bold;">from</span> twisted.<span style="color: black;">cred</span> <span style="color: #ff7700;font-weight:bold;">import</span> portal
<span style="color: #ff7700;font-weight:bold;">from</span> twisted.<span style="color: black;">cred</span>.<span style="color: black;">credentials</span> <span style="color: #ff7700;font-weight:bold;">import</span> IUsernamePassword
<span style="color: #ff7700;font-weight:bold;">from</span> twisted.<span style="color: black;">cred</span>.<span style="color: black;">checkers</span> <span style="color: #ff7700;font-weight:bold;">import</span> ICredentialsChecker
<span style="color: #ff7700;font-weight:bold;">from</span> twisted.<span style="color: black;">cred</span>.<span style="color: black;">error</span> <span style="color: #ff7700;font-weight:bold;">import</span> UnauthorizedLogin
<span style="color: #ff7700;font-weight:bold;">from</span> twisted.<span style="color: black;">conch</span>.<span style="color: black;">checkers</span> <span style="color: #ff7700;font-weight:bold;">import</span> SSHPublicKeyDatabase
<span style="color: #ff7700;font-weight:bold;">from</span> twisted.<span style="color: black;">conch</span>.<span style="color: black;">ssh</span> <span style="color: #ff7700;font-weight:bold;">import</span> factory, userauth, connection, keys, session
<span style="color: #ff7700;font-weight:bold;">from</span> twisted.<span style="color: black;">internet</span> <span style="color: #ff7700;font-weight:bold;">import</span> reactor, defer
<span style="color: #ff7700;font-weight:bold;">from</span> zope.<span style="color: black;">interface</span> <span style="color: #ff7700;font-weight:bold;">import</span> implements
<span style="color: #ff7700;font-weight:bold;">from</span> twisted.<span style="color: black;">python</span> <span style="color: #ff7700;font-weight:bold;">import</span> log
&nbsp;
<span style="color: #808080; font-style: italic;"># Logging</span>
<span style="color: #808080; font-style: italic;"># Currently logging to STDERR</span>
log.<span style="color: black;">startLogging</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">stderr</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Server-side public and private keys. These are the keys found in</span>
<span style="color: #808080; font-style: italic;"># sshsimpleserver.py. Make sure you generate your own using ssh-keygen!</span>
&nbsp;
publicKey = <span style="color: #483d8b;">'ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAGEArzJx8OYOnJmzf4tfBEvLi8DVPrJ3/c9k2I/Az64fxjHf9imyRJbixtQhlH9lfNjUIx+4LmrJH5QNRsFporcHDKOTwTTYLh5KmRpslkYHRivcJSkbh/C+BR3utDS555mV'</span>
&nbsp;
privateKey = <span style="color: #483d8b;">&quot;&quot;&quot;-----BEGIN RSA PRIVATE KEY-----
MIIByAIBAAJhAK8ycfDmDpyZs3+LXwRLy4vA1T6yd/3PZNiPwM+uH8Yx3/YpskSW
4sbUIZR/ZXzY1CMfuC5qyR+UDUbBaaK3Bwyjk8E02C4eSpkabJZGB0Yr3CUpG4fw
vgUd7rQ0ueeZlQIBIwJgbh+1VZfr7WftK5lu7MHtqE1S1vPWZQYE3+VUn8yJADyb
Z4fsZaCrzW9lkIqXkE3GIY+ojdhZhkO1gbG0118sIgphwSWKRxK0mvh6ERxKqIt1
xJEJO74EykXZV4oNJ8sjAjEA3J9r2ZghVhGN6V8DnQrTk24Td0E8hU8AcP0FVP+8
PQm/g/aXf2QQkQT+omdHVEJrAjEAy0pL0EBH6EVS98evDCBtQw22OZT52qXlAwZ2
gyTriKFVoqjeEjt3SZKKqXHSApP/AjBLpF99zcJJZRq2abgYlf9lv1chkrWqDHUu
DZttmYJeEfiFBBavVYIF1dOlZT0G8jMCMBc7sOSZodFnAiryP+Qg9otSBjJ3bQML
pSTqy7c3a2AScC/YyOwkDaICHnnD3XyjMwIxALRzl0tQEKMXs6hH8ToUdlLROCrP
EhQ0wahUTCk1gKA4uPD6TMTChavbh4K63OvbKg==
-----END RSA PRIVATE KEY-----&quot;&quot;&quot;</span>
&nbsp;
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> PamPasswordDatabase:
    <span style="color: #483d8b;">&quot;&quot;&quot;Authentication/authorization backend using the 'login' PAM service&quot;&quot;&quot;</span>
    credentialInterfaces = IUsernamePassword,
    implements<span style="color: black;">&#40;</span>ICredentialsChecker<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> requestAvatarId<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, credentials<span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">if</span> pam.<span style="color: black;">authenticate</span><span style="color: black;">&#40;</span>credentials.<span style="color: black;">username</span>, credentials.<span style="color: black;">password</span><span style="color: black;">&#41;</span>:
            <span style="color: #ff7700;font-weight:bold;">return</span> defer.<span style="color: black;">succeed</span><span style="color: black;">&#40;</span>credentials.<span style="color: black;">username</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> defer.<span style="color: black;">fail</span><span style="color: black;">&#40;</span>UnauthorizedLogin<span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;invalid password&quot;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> UnixSSHdFactory<span style="color: black;">&#40;</span>factory.<span style="color: black;">SSHFactory</span><span style="color: black;">&#41;</span>:
    publicKeys = <span style="color: black;">&#123;</span>
        <span style="color: #483d8b;">'ssh-rsa'</span>: keys.<span style="color: black;">Key</span>.<span style="color: black;">fromString</span><span style="color: black;">&#40;</span>data=publicKey<span style="color: black;">&#41;</span>
    <span style="color: black;">&#125;</span>
    privateKeys = <span style="color: black;">&#123;</span>
        <span style="color: #483d8b;">'ssh-rsa'</span>: keys.<span style="color: black;">Key</span>.<span style="color: black;">fromString</span><span style="color: black;">&#40;</span>data=privateKey<span style="color: black;">&#41;</span>
    <span style="color: black;">&#125;</span>
    services = <span style="color: black;">&#123;</span>
        <span style="color: #483d8b;">'ssh-userauth'</span>: userauth.<span style="color: black;">SSHUserAuthServer</span>,
        <span style="color: #483d8b;">'ssh-connection'</span>: connection.<span style="color: black;">SSHConnection</span>
    <span style="color: black;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Components have already been registered in twisted.conch.unix</span>
&nbsp;
portal = portal.<span style="color: black;">Portal</span><span style="color: black;">&#40;</span>UnixSSHRealm<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
portal.<span style="color: black;">registerChecker</span><span style="color: black;">&#40;</span>PamPasswordDatabase<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>   <span style="color: #808080; font-style: italic;"># Supports PAM</span>
portal.<span style="color: black;">registerChecker</span><span style="color: black;">&#40;</span>SSHPublicKeyDatabase<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>  <span style="color: #808080; font-style: italic;"># Supports PKI</span>
UnixSSHdFactory.<span style="color: black;">portal</span> = portal
&nbsp;
<span style="color: #ff7700;font-weight:bold;">if</span> __name__ == <span style="color: #483d8b;">'__main__'</span>:
    reactor.<span style="color: black;">listenTCP</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">5022</span>, UnixSSHdFactory<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
    reactor.<span style="color: black;">run</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>
<p>Some notes:</p>
<ul>
<li>The server uses the very same public and private keys as found in the <code>sshsimpleserver.py</code> script. Make sure you generate new keys using <strong>ssh-keygen</strong> if you plan to run this on a public server (although this not recommended).</li>
<li>Twisted included a module for PAM authentication, <code>twisted.cred.pamauth</code>, but unfortunately I could not locate one of its dependencies to make it work. So, I used the excellent <a href="http://atlee.ca/software/pam/">python-pam</a> to create a custom PAM authenticator class.</li>
<li>I can guess what you might thought when you read about this code:<br />
<blockquote>Python is a cross-platform programming language. Twisted runs on Windows. So, is this a solution for running a SSH server on Win32?</p></blockquote>
<p> Well, at the moment it won&#8217;t run because internally it uses some Python modules that are available on UNIX platforms only. But, I intend to investigate the possibility of running this on <strong>Windows</strong> since I already need something like that.</li>
</ul>
<p>We can now enjoy our Python SSH server. Run as root:</p>
<pre class="console">
python scripts/rapidsshd_unix.py
</pre>
<p>From another machine, connect to the server using an <em>ssh client</em>:</p>
<pre class="console">
ssh -p 5022 rocky@arena
</pre>
<p>If you have deployed your public key in the <code>~/.ssh/authorized_keys</code> file on the remote machine (<em>arena</em>), you should be able to authenticate using the public key:</p>
<pre class="console">
ssh -p 5022 -i /path/to/private.key rocky@arena
</pre>
<p>You should get output like the following on the server:</p>
<pre class="console">
[root@arena ~]# python ssh.py
2010-03-26 21:30:05+0000 [-] Log opened.
2010-03-26 21:30:05+0000 [-] __main__.UnixSSHdFactory starting on 5022
2010-03-26 21:30:05+0000 [-] Starting factory <__main__.UnixSSHdFactory instance at 0xb7a0b0cc>
2010-03-26 21:30:13+0000 [__main__.UnixSSHdFactory] disabling diffie-hellman-group-exchange because we cannot find moduli file
2010-03-26 21:30:13+0000 [SSHServerTransport,0,192.168.0.172] kex alg, key alg: diffie-hellman-group1-sha1 ssh-rsa
2010-03-26 21:30:13+0000 [SSHServerTransport,0,192.168.0.172] outgoing: aes256-ctr hmac-sha1 none
2010-03-26 21:30:13+0000 [SSHServerTransport,0,192.168.0.172] incoming: aes256-ctr hmac-sha1 none
2010-03-26 21:30:14+0000 [SSHServerTransport,0,192.168.0.172] NEW KEYS
2010-03-26 21:30:14+0000 [SSHServerTransport,0,192.168.0.172] starting service ssh-userauth
2010-03-26 21:30:17+0000 [SSHService ssh-userauth on SSHServerTransport,0,192.168.0.172] rocky trying auth none
2010-03-26 21:30:17+0000 [SSHService ssh-userauth on SSHServerTransport,0,192.168.0.172] rocky trying auth publickey
2010-03-26 21:30:17+0000 [SSHService ssh-userauth on SSHServerTransport,0,192.168.0.172] rocky trying auth publickey
2010-03-26 21:30:17+0000 [SSHService ssh-userauth on SSHServerTransport,0,192.168.0.172] rocky authenticated with publickey
2010-03-26 21:30:17+0000 [SSHService ssh-userauth on SSHServerTransport,0,192.168.0.172] starting service ssh-connection
2010-03-26 21:30:17+0000 [SSHService ssh-connection on SSHServerTransport,0,192.168.0.172] got channel session request
2010-03-26 21:30:17+0000 [SSHChannel session (0) on SSHService ssh-connection on SSHServerTransport,0,192.168.0.172] channel open
2010-03-26 21:30:17+0000 [SSHChannel session (0) on SSHService ssh-connection on SSHServerTransport,0,192.168.0.172] pty request: xterm (24L, 80L, 0L, 0L)
2010-03-26 21:30:17+0000 [SSHChannel session (0) on SSHService ssh-connection on SSHServerTransport,0,192.168.0.172] getting shell
</pre>
<p>This first release of the <a href="http://bitbucket.org/gnotaras/rapidssh/">RapidSSH</a> project exists solely for demonstration purposes. Don&#8217;t get fooled by the small amount of code. Information about how to put the pieces together is scarce and it required a lot trial&#038;error and source code reading. The above implementation contains none of the customizations I had in mind. These will be done as soon as I find some time to do so. Until then it will be nice to hear about your experiences or implementations you have worked on.</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2010/03/26/python-ssh-server-unix-twisted-conch/">Python SSH Server for UNIX Systems using Twisted.conch</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>
<h4>Related Articles</h4>
<ul><li><a href="http://www.g-loaded.eu/2006/09/23/use-python-to-get-the-web-page-data-in-epiphany/" rel="bookmark">Use Python to get the web page data in Epiphany</a></li>
<li><a href="http://www.g-loaded.eu/2006/05/17/epiphany-python-console-open-new-tab/" rel="bookmark">Epiphany Python Console &#8211; Open New Tab</a></li>
<li><a href="http://www.g-loaded.eu/2007/01/31/python-irc-bot/" rel="bookmark">Python IRC Bot</a></li>
<li><a href="http://www.g-loaded.eu/2006/04/07/python-crash-course/" rel="bookmark">Python Crash Course</a></li>
<li><a href="http://www.g-loaded.eu/2005/11/10/configure-vnc-server-in-fedora/" rel="bookmark">Set up the VNC Server in Fedora</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2010/03/26/python-ssh-server-unix-twisted-conch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Send a text file as SMS with a Sony-Ericsson mobile</title>
		<link>http://www.g-loaded.eu/2007/07/28/send-a-text-file-as-sms-with-a-sony-ericsson-mobile/</link>
		<comments>http://www.g-loaded.eu/2007/07/28/send-a-text-file-as-sms-with-a-sony-ericsson-mobile/#comments</comments>
		<pubDate>Sat, 28 Jul 2007 20:14:31 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mobiles]]></category>
		<category><![CDATA[K320i]]></category>
		<category><![CDATA[Remote]]></category>
		<category><![CDATA[Resolved]]></category>
		<category><![CDATA[Tips]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/2007/07/28/send-a-text-file-as-sms-with-a-sony-ericsson-mobile/</guid>
		<description><![CDATA[I thought that sending a text file as a text message through the GSM network&#8217;s short message service would be a trivial task either it was performed from within the phone&#8217;s operating system or from a computer that runs a flavour of Linux. Once again, I have been badly misled. In 2007, this task still [...]]]></description>
			<content:encoded><![CDATA[<p>I thought that sending a text file as a text message through the GSM network&#8217;s short message service would be a trivial task either it was performed from within the phone&#8217;s operating system or from a computer that runs a flavour of Linux. Once again, I have been badly misled. In 2007, this task still remains a glorious achievement that requires great effort and fantasy in order to be accomplished.<br />
<span id="more-429"></span><br />
It&#8217;s hard to believe that the engineers over at the Sony-Ericsson labs have not taken into account the fact that the phone&#8217;s operating system should give the user the opportunity to send the contents of a text file as a <strong>text</strong> message. I tend to believe that this lack of features is actually <em>on-purpose</em> and has its roots in the company&#8217;s marketing department. There is no other logical explanation.</p>
<p>Anyhow, the phone&#8217;s internal web browser is the default viewer for plain text files, but this browser will never let you either copy the text in order to paste it in the sms editor or send the file that is being viewed as a text message directly. On the other hand, the phone&#8217;s OS will not let you send the file&#8217;s contents as text directly either.</p>
<p>&#8230;and when things like this happen, it is time for some monkey stuff. I tried to send the contents of the file as SMS through the phone by using two programs, <a href="http://www.gnokii.org/">gnokii</a> and <a href="http://www.gammu.org/">gammu</a>, from my fedora desktop. The phone is a <a href="http://www.g-loaded.eu/2007/05/11/sony-ericsson-k320i-advanced-feature-list/">Sony-Ericsson K320i</a>. I should state from the beginning that nothing worked.</p>
<h4>gnokii &#038; gammu</h4>
<p>The bluetooth service (<code>hcid</code>) has been configured properly and the device pairing between the usb dongle and the phone has been accomplished succesfully. Here follow a couple of examples of what I have tried with <code>gnokii</code> and <code>gammu</code>. These are provided for informational purposes only, as <strong>nothing worked out</strong>. Also, note that the configuration files contain only the absolutely required options in order to work with the phone over the <strong>bluetooth interface</strong>.</p>
<p><code>XX:XX:XX:XX:XX:XX</code> represents the phone&#8217;s hardware address. Also, <code>channel 2</code> is used as the <strong>rfcomm</strong> channel, as the phone&#8217;s serial port service &#8220;<em>listens</em>&#8221; on that channel (see the detailed <a href="http://www.g-loaded.eu/2007/05/11/sony-ericsson-k320i-advanced-feature-list/">K320i services</a> over the bluetooth interface).</p>
<p>The <strong>gnokii</strong> configuration file: <code>/etc/gnokiirc</code></p>
<pre class="codesnp">
[global]
port = XX:XX:XX:XX:XX:XX
model = AT
connection = bluetooth
rfcomm_channel = 2
</pre>
<p>A failed attempt to send the sms directly:</p>
<pre class="console">
$ echo "test" | gnokii --sendsms +306911111111 -r
GNOKII Version 0.6.14
SMS Send failed (The specified memory is full.)
</pre>
<p>No, the memory is not full. You make a mistake!</p>
<p>The <strong>gammu</strong> configuration file: <code>/etc/gammurc</code></p>
<pre class="codesnp">
[gammu]
port = XX:XX:XX:XX:XX:XX
connection = blueat
</pre>
<p>In this example, I will try to save the SMS to an SMS specific folder on the phone. But first, in order to get information about those folders, I issue the command:</p>
<pre class="console">
$ gammu --getsmsfolders
1. "                         Inbox", SIM memory, Inbox folder
2. "                        Outbox", SIM memory, Outbox folder
3. "                         Inbox", phone memory, Inbox folder
4. "                        Outbox", phone memory, Outbox folder
</pre>
<p>Then I try to store the message on the phone:</p>
<pre class="console">
$ echo "test" | gammu --savesms TEXT -folder 4
Saving SMS 1/1
Unknown error.
</pre>
<p>Ladies and gentlemen&#8230; the error is unknown! Unknown error in sight!</p>
<h4>Original Monkey Stuff</h4>
<p>Having wasted enough time for a single SMS, I started thinking of other ways to get the job done. I noticed that the phone&#8217;s OS would let me send calendar <strong>appointments</strong>, <strong>tasks</strong> and <strong>notes</strong> as a text message. So, all I had to do was to save the contents of the text file as one of the aforementioned types of data on the phone.</p>
<p>Although, gnokii and gammu support management of those data types, I did not even try to use either of them.</p>
<p>Instead, I <strong>created a task</strong> in <a href="http://www.gnome.org/projects/evolution/">Evolution</a>, <strong>pasted</strong> the text file contents in the <strong>task descrtiption field</strong> and then used <a href="http://www.opensync.org/">multisync</a> (at least this works) in order to <strong>transfer</strong> the task to the phone. Finally, I sent the task as a text message from the phone&#8217;s interface.</p>
<p>I wonder who will give me my wasted time back&#8230;</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2007/07/28/send-a-text-file-as-sms-with-a-sony-ericsson-mobile/">Send a text file as SMS with a Sony-Ericsson mobile</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>
<h4>Related Articles</h4>
<ul><li><a href="http://www.g-loaded.eu/2007/05/11/sony-ericsson-k320i-advanced-feature-list/" rel="bookmark">Sony Ericsson K320i &#8211; Advanced Feature List</a></li>
<li><a href="http://www.g-loaded.eu/2005/10/01/another-way-to-create-a-text-file/" rel="bookmark">Another way to create a text file</a></li>
<li><a href="http://www.g-loaded.eu/2008/02/25/size-text-with-em-in-your-css-explained-with-example/" rel="bookmark">Size text with em in your CSS &#8211; Explained with example</a></li>
<li><a href="http://www.g-loaded.eu/2008/11/04/send-to-desktop-create-symlink/" rel="bookmark">Send to Desktop &#8211; Create Symlink</a></li>
<li><a href="http://www.g-loaded.eu/2007/08/06/file-and-directory-diff-in-color-in-midnight-commander/" rel="bookmark">File and Directory diff in color in Midnight Commander</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2007/07/28/send-a-text-file-as-sms-with-a-sony-ericsson-mobile/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>rtorstat &#8211; a simple rTorrent status web page generator</title>
		<link>http://www.g-loaded.eu/2007/06/23/rtorstat-a-simple-rtorrent-status-web-page-generator/</link>
		<comments>http://www.g-loaded.eu/2007/06/23/rtorstat-a-simple-rtorrent-status-web-page-generator/#comments</comments>
		<pubDate>Sat, 23 Jun 2007 11:35:44 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Web Applications]]></category>
		<category><![CDATA[Bittorrent]]></category>
		<category><![CDATA[Remote]]></category>
		<category><![CDATA[rTorrent]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Web]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/2007/06/23/rtorstat-a-simple-rtorrent-status-web-page-generator/</guid>
		<description><![CDATA[rtorstat is a simple web page generator, written in Python, which shows status information about the rTorrent bittorrent client. This makes it possible to quickly have an overview of your torrent list from a remote location, without having to log into the remote machine that actually runs rTorrent.]]></description>
			<content:encoded><![CDATA[<p><strong>rtorstat</strong> is a simple <em>web page generator</em>, written in <a href="http://www.python.org/">Python</a>, which shows status information about the <a href="http://libtorrent.rakshasa.no/">rTorrent</a> bittorrent client. This makes it possible to quickly have an overview of your torrent list from a remote location, without having to log into the remote machine that actually runs rTorrent.<br />
<span id="more-408"></span><br />
The script can operate in two modes:</p>
<ul>
<li>Run through <strong>cron</strong> at predefined intervals. In this case it reads the saved <em>rtorrent session data</em>, creates a <strong>summary</strong> about the loaded torrent files status and <strong>prints</strong> the HTML code to <strong>stdout</strong>, which can then be <strong>redirected to a file</strong> and thus be made publicly available by a web server.</li>
<li>Run as a <strong>CGI</strong> script, which makes it possible to <strong>dynamically generate the HTML page</strong> on-demand. This method, compared to running rtorstat through cron at short pre-defined intervals, has the advantage of <em>limiting system resource waste</em> by parsing the session data only when a user runs the CGI script through the web browser. Also, depending on your rtorrent settings, the displayed information is usually more current than that of the HTML page generated through cron, unless cron runs the script very often.</li>
</ul>
<p>rtorstat does not support or will never support any kind of remote rTorrent administration. It is not supposed to be a web-based rtorrent frontend, but, as the title says, a <em>simple status page generator</em> (status web interface).</p>
<h4>Requirements</h4>
<p>rtorstat is not dependency-free. Here is the list of the required software in order to run rtorstat:</p>
<ul>
<li><a href="http://www.python.org/">Python</a></li>
<li><a href="http://libtorrent.rakshasa.no/">rTorrent</a> (configured to save session data &#8211; <em>see below</em>)</li>
<li>The file &#8220;<em>bencode.py</em>&#8220;, part of the official <a href="http://www.bittorrent.com/">Bittorrent</a> client (<em>Mainline</em>) distribution, has been included in the <strong>rtorstat</strong> distribution package, so the Mainline Bittorrent client is <strong>no longer a dependency for rtorstat</strong>.</li>
</ul>
<h4>rTorrent Configuration</h4>
<p><em>rtorstat</em> needs to read the <strong>torrent session data</strong>, so rTorrent needs to be configured to save this information to a pre-defined directory. The following shows all the session-data specific configuration rTorrent (<code>.rtorrent.rc</code>) options:</p>
<pre class="codesnp">
# Sets the directory where session data files are stored
session = /opt/bittorrent/sessiondata
# Keeps session data files even if torrent has finished
session_on_completion = yes
# Not really required, but recommended - see rtorrent(1) man page
session_lock = yes
# Setup A: Run through CRON
# Save session data every 5 mins, with a 4 min offset
schedule = session_save,240,300,session_save=
# Setup B: Run as a CGI
# Save session data every 300 seconds
# (This is an example value. Setting it to a lower value is highly recommended)
#schedule = session_save,300,300,session_save=
</pre>
<p>The last directive (<code>schedule</code>) instructs rtorrent to save session data at the specified interval.</p>
<h4>Usage</h4>
<p>rtorstat can be run through cron or as a CGI script. Running it as a CGI is the preferred way of running it as the parsing of the session data and the HTML page generation take place dynamically only when you visit the web page. This leads to wasting less system resources.</p>
<h5>Running rtorstat through cron</h5>
<p>No special <strong>installation</strong> is needed as the location of <code>rtorstat.py</code> can be set within the <strong>cron</strong> job. Just make sure that the file <code>bencode.py</code> exists in the same directory as rtorstat.py.</p>
<p>rtorstat requires one <strong>argument</strong>; that is the <strong>path to the directory</strong> where the session data is saved:</p>
<pre class="console">$ python rtorstat.py /opt/bittorrent/sessiondata/</pre>
<p>Having parsed the session data files and having created the summary, the HTML code is printed to <strong>stdout</strong>, from where it can be redirected to a html file. For example:</p>
<pre class="console">$ python rtorstat.py /opt/bittorrent/sessiondata/ > /var/www/index.html</pre>
<p>rtorstat is supposed to be run through cron at regular intervals. In the example configuration above (<em>Setup A</em>), rtorrent saves the session data every 5 minutes (300 sec), so rtorstat needs to be run at the <strong>same interval</strong> through cron. The 4 min offset (240 sec) that had been set in the rtorrent scheduler serves so that there is good timing between rTorrent saving the session data and rtorstat parsing it.</p>
<p>Such a cron job would be:</p>
<pre class="codesnp">*/5 * * * *   root python /path/to/rtorstat.py /opt/bittorrent/sessiondata/ > /var/www/index.html</pre>
<p>rtorstat will parse the session data files, for example, at 00:05, 00:10 etc.</p>
<p>Having adjusted the paths according to your configuration, <strong>save</strong> the above <strong>cronjob</strong> to a file inside the <code>/etc/cron.d/</code> directory and you are set.</p>
<h5>Running rtorstat as a CGI script</h5>
<p>In this case, you need to place 3 files in your cgi-bin: rtorstat.py, rtorstat.cgi and bencode.py.</p>
<p>Apart from the rtorrent configuration, it is required to set the path of the directory where rtorrent saves session data in rtorstat.cgi. So, open rtorstat.cgi in your favourite text editor and fill-in the required information:</p>
<pre class="codesnp">
session_dir = "/path/to/rtorrent/session/dir/"
</pre>
<p>Now, you can visit the web page http://yourdomain.example.org/cgi-bin/rtorstat.cgi</p>
<p>Setting up a scriptaliased directory is covered by your web server&#8217;s documentation and is outside of the scope of this document.</p>
<h4>Security</h4>
<p>rtorstat generates a HTML page which is made publicly available through a web server (most probably). Therefore it is your responsibility to secure this location using any of your web server&#8217;s access control methods.</p>
<h4>License</h4>
<p>This project is released under the terms of the <a href="http://www.codetrax.org/licenses/ApacheLicenseV2">Apache License version 2</a>.</p>
<h4>Download</h4>
<p>All versions of the software, including the latest stable release, are available from the development web site&#8217;s <a href="http://www.codetrax.org/projects/rtorstat/files">download area</a>.</p>
<h4>Donate</h4>
<p>This software is released as <strong>free software</strong>. Nevertheless, its development requires time and effort. A small donation, as a sign of appreciation of the effort, is welcome. Please, use the following button to visit the <em>Donations</em> page. Thank you.</p>
<p><a href="http://www.g-loaded.eu/about/donate" title="Donate"><img src="/images/donations_button.png" alt="Donations Button" /></a></p>
<h4>Support</h4>
<p>This software is released as <em>free software</em> without any warranties or official support. You can still get first class <strong>support</strong> from the <a href="http://www.codetrax.org/projects/rtorstat/boards">community of users</a>.</p>
<h4>Bugs and Feature Requests</h4>
<p>Found a bug? Want to suggest a new feature for the upcoming release? Feel free to file your requests in the <a href="http://www.codetrax.org/projects/rtorstat/issues">issue database</a> on the <a href="http://www.codetrax.org/projects/rtorstat">development website</a>.</p>
<h4>Things to consider</h4>
<p>It has been mentioned before, but here it goes again:</p>
<p>Note that by making the rtorrent status page publicly available through a web server, the world will know what you download at any time. It is your exclusive responsibility to keep this page private, if this is what you really want. This piece of information is of course beyond the scope of this article.</p>
<p>This script was written in a quick and dirty way. If you encounter any bugs, please notify me through the <em>g-loaded forums</em> and I will get back to you when I have the time.</p>
<p>Last, but not least, if you improve the looks, consider <a href="http://www.g-loaded.eu/about/contributions/">contributing</a> back your <strong>string template</strong>.</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2007/06/23/rtorstat-a-simple-rtorrent-status-web-page-generator/">rtorstat &#8211; a simple rTorrent status web page generator</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>
<h4>Related Articles</h4>
<ul><li><a href="http://www.g-loaded.eu/2008/05/09/remove-generator-meta-tag-wordpress-plugin/" rel="bookmark">Remove-Generator-Meta-Tag WordPress Plugin</a></li>
<li><a href="http://www.g-loaded.eu/2006/05/04/write-a-man-page/" rel="bookmark">Write A Man Page</a></li>
<li><a href="http://www.g-loaded.eu/2006/09/23/use-python-to-get-the-web-page-data-in-epiphany/" rel="bookmark">Use Python to get the web page data in Epiphany</a></li>
<li><a href="http://www.g-loaded.eu/2007/03/05/print-a-man-page/" rel="bookmark">Print a Man Page</a></li>
<li><a href="http://www.g-loaded.eu/2006/01/15/simple-recent-comments-wordpress-plugin/" rel="bookmark">Simple-Recent-Comments WordPress Plugin</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2007/06/23/rtorstat-a-simple-rtorrent-status-web-page-generator/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>BIP IRC Proxy</title>
		<link>http://www.g-loaded.eu/2007/03/10/bip-irc-proxy/</link>
		<comments>http://www.g-loaded.eu/2007/03/10/bip-irc-proxy/#comments</comments>
		<pubDate>Sat, 10 Mar 2007 19:20:28 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Remote]]></category>
		<category><![CDATA[Servers]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/2007/03/10/bip-irc-proxy/</guid>
		<description><![CDATA[A while back I had mentioned dircproxy as a solution for an IRC proxy server. Although dircproxy is good and effective, recently I&#8217;ve been reading many positive comments about another similar application, BIP. I hope I find some free time in the next days to give it a shot. Judging by its extensive feature set, [...]]]></description>
			<content:encoded><![CDATA[<p>A while back I had <a href="http://www.g-loaded.eu/2007/02/01/dircproxy-irc-proxy/">mentioned</a> <a href="http://dircproxy.securiweb.net/">dircproxy</a> as a solution for an IRC proxy server. Although dircproxy is good and effective, recently I&#8217;ve been reading many positive comments about another similar application, <a href="http://bip.berlios.de/">BIP</a>. I hope I find some free time in the next days to give it a shot. Judging by its extensive feature set, chances are that I will like it, despite the fact that it is still marked as beta at the <a href="http://developer.berlios.de/projects/bip">BerliOS Project Page</a>.</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2007/03/10/bip-irc-proxy/">BIP IRC Proxy</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>
<h4>Related Articles</h4>
<ul><li><a href="http://www.g-loaded.eu/2007/02/01/dircproxy-irc-proxy/" rel="bookmark">dircproxy IRC Proxy</a></li>
<li><a href="http://www.g-loaded.eu/2007/02/24/creative-commons-v30-licenses-launched/" rel="bookmark">Creative Commons v3.0 Licenses Launched</a></li>
<li><a href="http://www.g-loaded.eu/2007/03/15/cc-configurator-plugin-version-10-is-out/" rel="bookmark">CC Configurator plugin version 1.0 is out!</a></li>
<li><a href="http://www.g-loaded.eu/2006/11/01/bot-allow-content-and-cc-configurator-plugin-updates/" rel="bookmark">Bot-Allow-Content and CC-Configurator plugin updates</a></li>
<li><a href="http://www.g-loaded.eu/2007/07/29/best-practices-of-software-licensing/" rel="bookmark">Best Practices of Software Licensing</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2007/03/10/bip-irc-proxy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Python IRC Bot</title>
		<link>http://www.g-loaded.eu/2007/01/31/python-irc-bot/</link>
		<comments>http://www.g-loaded.eu/2007/01/31/python-irc-bot/#comments</comments>
		<pubDate>Wed, 31 Jan 2007 12:43:57 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Remote]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/2007/01/31/python-irc-bot/</guid>
		<description><![CDATA[One of the things in which I never reached a decent level of knowledge is IRC. I mean I know the basic stuff in order to connect to servers, join channels, send/receive files etc. What I know nothing of is actually IRC server or channel administration&#8230; I am not going to learn or write more [...]]]></description>
			<content:encoded><![CDATA[<p>One of the things in which I never reached a decent level of knowledge is <abbr title="Internet Relay Chat">IRC</abbr>. I mean I know the basic stuff in order to connect to servers, join channels, send/receive files etc. What I know nothing of is actually IRC server or channel administration&#8230; I am not going to learn or write more about it now.<br />
<span id="more-336"></span><br />
What I need at the moment is an automatic <strong>IRC</strong> client, a <strong>bot</strong>. I want it to be able to connect to the specified server and channel and stay there without sending any messages, but keep logs of all the conversation at that channel, so I do not miss anything&#8230; I need a bot with a <abbr title="Command Line">CLI</abbr> interface, so I can set it to run from my always-on machine&#8217;s terminal, no GUIs and no unnecessary resource consumption. In other words I need the bot to be able to:</p>
<ul>
<li><strong>connect</strong> to a server and try to reconnect automatically if the connection is lost</li>
<li><strong>identify</strong> my nick to the server</li>
<li><strong>join</strong> the specified channel and keep a <strong>log</strong> of the conversation</li>
<li>play the request-response (<strong>ping-pong</strong>) game with the server so to be able to stay online as long as I want</li>
<li>be extremely <strong>reliable</strong>.</li>
</ul>
<p>Well, this is not a hell of features! I guess a bot with these capabilities would be very easy to implement in Python, but no time for this kind of stuff&#8230; A google search returned some interesting results about such bots. I think I&#8217;ll stick to clients written in <a href="http://python.org/">Python</a> only because this is the language I know well enough, so, in case I need to modify anything, it will be rather easy.</p>
<p>So, here is <a href="http://supybot.com/">supybot</a>, <a href="http://inamidst.com/phenny/">phenny</a>, <a href="http://sourceforge.net/projects/pynfo/">pynfo</a> and <a href="http://code.google.com/p/pyfibot/">pyfibot</a>. All seem to cover my needs, but I think I&#8217;ll stick to the <strong>supybot</strong>. Its website seemed  more organised and I have the feeling that I will find any kind of help easily, if I need it.</p>
<p>Apart from these ready-made clients, here are a few articles where the authors document the creation of such a bot with very primitive functionality: <a href="http://gfxfor.us/general/tutorial-how-to-make-a-simple-irc-bot-from-scratch-in-python">IRC bot in python from scratch</a> and <a href="http://www.osix.net/modules/article/?id=780">a simple IRC bot written in python</a>.</p>
<p>Furthermore, if help about the IRC commands or the protocol itself is required, take a loog at <a href="http://www.irchelp.org/">IRChelp.org</a> and at <a href="http://www.irchelp.org/irchelp/rfc/index.html">IRC RFCs</a> .</p>
<p>PS: so where am I supposed to test these bots? <a href="irc://irc.freenode.net">Freenode</a> or should I quickly set up a local IRC server?</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2007/01/31/python-irc-bot/">Python IRC Bot</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>
<h4>Related Articles</h4>
<ul><li><a href="http://www.g-loaded.eu/2007/02/01/dircproxy-irc-proxy/" rel="bookmark">dircproxy IRC Proxy</a></li>
<li><a href="http://www.g-loaded.eu/2010/03/26/python-ssh-server-unix-twisted-conch/" rel="bookmark">Python SSH Server for UNIX Systems using Twisted.conch</a></li>
<li><a href="http://www.g-loaded.eu/2006/09/23/use-python-to-get-the-web-page-data-in-epiphany/" rel="bookmark">Use Python to get the web page data in Epiphany</a></li>
<li><a href="http://www.g-loaded.eu/2006/04/07/python-crash-course/" rel="bookmark">Python Crash Course</a></li>
<li><a href="http://www.g-loaded.eu/2006/05/17/epiphany-python-console-open-new-tab/" rel="bookmark">Epiphany Python Console &#8211; Open New Tab</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2007/01/31/python-irc-bot/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>The hole trick</title>
		<link>http://www.g-loaded.eu/2006/12/18/the-hole-trick/</link>
		<comments>http://www.g-loaded.eu/2006/12/18/the-hole-trick/#comments</comments>
		<pubDate>Mon, 18 Dec 2006 10:38:11 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Firewall]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Remote]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tips]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/2006/12/18/the-hole-trick/</guid>
		<description><![CDATA[This is an excellent article that describes in detail how P2P applications can bypass the firewall and accept incoming data without opening any ports in the firewall configuration. This trick is used by the majority of VoIP software. In this article, the author not only describes how the popular internet telephony software Skype manages to [...]]]></description>
			<content:encoded><![CDATA[<p>This is an excellent article that describes in detail how <strong>P2P</strong> applications can bypass the firewall and accept incoming data without opening any ports in the firewall configuration. This trick is used by the majority of <em>VoIP</em> software. In this article, the author not only describes how the popular internet telephony software <a href="http://www.skype.com/">Skype</a> manages to establish a connection between two peers which are behind a firewall, but also provides an example about how to perform this trick with tools like <strong>netcat</strong> and the packet generator <strong>hping2</strong>. A must read!<br />
<a href="http://www.heise-security.co.uk/articles/82481">Read the full article</a></p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2006/12/18/the-hole-trick/">The hole trick</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>
<h4>Related Articles</h4>
<ul><li><a href="http://www.g-loaded.eu/2007/02/24/creative-commons-v30-licenses-launched/" rel="bookmark">Creative Commons v3.0 Licenses Launched</a></li>
<li><a href="http://www.g-loaded.eu/2006/11/27/effectively-remove-a-user-from-the-system/" rel="bookmark">Effectively remove a user from the system</a></li>
<li><a href="http://www.g-loaded.eu/2006/05/06/troubleshooting-with-strace/" rel="bookmark">Troubleshooting with strace</a></li>
<li><a href="http://www.g-loaded.eu/2007/07/10/a-css-trap-for-comment-spambots/" rel="bookmark">A CSS trap for comment spambots</a></li>
<li><a href="http://www.g-loaded.eu/2005/11/10/configure-vnc-server-in-fedora/" rel="bookmark">Set up the VNC Server in Fedora</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2006/12/18/the-hole-trick/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Auto-closing SSH tunnels</title>
		<link>http://www.g-loaded.eu/2006/11/24/auto-closing-ssh-tunnels/</link>
		<comments>http://www.g-loaded.eu/2006/11/24/auto-closing-ssh-tunnels/#comments</comments>
		<pubDate>Fri, 24 Nov 2006 04:33:00 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Encryption]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Remote]]></category>
		<category><![CDATA[Shell]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/2006/11/24/auto-closing-ssh-tunnels/</guid>
		<description><![CDATA[In some of my older articles, at least where an SSH tunnel is involved, I keep mentioning a specific way of initializing such an encrypted tunnel, which results in the automatic closure of the tunnel after the job on the remote server is finished. Since this is my method of choice, I decided to provide [...]]]></description>
			<content:encoded><![CDATA[<p>In some of my older articles, at least where an SSH tunnel is involved, I keep mentioning a specific way of initializing such an encrypted tunnel, which results in the automatic closure of the tunnel after the job on the remote server is finished. Since this is my method of choice, I decided to provide some detailed explanation in this post, so that it can be used as a reference in future articles.<br />
<span id="more-306"></span></p>
<h4>What is a tunnel</h4>
<p>Assume that an <a href="http://www.g-loaded.eu/2005/11/10/ssh-with-keys/" title="SSH Server Configuration HOWTO">SSH</a> and a <a href="http://www.g-loaded.eu/2005/11/10/configure-vnc-server-in-fedora/" title="VNC Server Configuration HOWTO">VNC</a> server are up and running on the machine <code>remote.example.org</code>. The remote firewall does not allow direct connections to the VNC port &#8211; assume that this is TCP port 5901 &#8211; from the network, which is generally a good idea. In this case, we will connect to the remote VNC service from the local workstation through the remote SSH server, by using a feature of the SSH protocol, called <em>local port forwarding</em> or, simply, tunneling.</p>
<p>Such a tunnel can be initialized from the local workstation with the following:</p>
<pre class="console">[me@local]$ ssh -L 25901:127.0.0.1:5901 me@remote.example.org</pre>
<p>When executed, the above statement has the following results:</p>
<ol>
<li>forwards the local port 25901 on the local workstation to port 5901 on the remote machine through the ssh connection. The port 25901 is an example and it could be any other available TCP port on the local machine. The result is that any request made on the local port 25901 is transfered to port 5901 on the remote machine through the encrypted SSH connection.</li>
<li>connects us to the remote SSH server and logs our remote user &#8220;<code>me</code>&#8221; in.</li>
</ol>
<p>In order to connect to the remote VNC service through that tunnel, it is required to keep the connection to the ssh server open and, from another local terminal, connect to the local port 25901 with the vnc client:</p>
<pre class="console">[me@local]$ vncviewer 127.0.0.1:25901:1</pre>
<p>By closing the vnc client and by logging out of the remote shell, the tunnel is destroyed too. </p>
<h4>A better way</h4>
<p>The previous method is too far from being convenient in the everyday use. Things could be a lot better if we could just create the SSH tunnel and launch vncviewer in one line of code. This can be achieved by using the <strong>-f</strong> and <strong>-N</strong> flags when connecting to the remote SSH server:</p>
<pre class="console">
[me@local]$ ssh -f -N -L 25901:127.0.0.1:5901 me@remote.example.org; \
              vncviewer 127.0.0.1:25901:1
</pre>
<p>The <strong>-f</strong> switch instructs the ssh client to fork the ssh session to the background. Therefore, we remain at our local terminal&#8217;s prompt, from where we can execute more commands on our local machine. In this case, with a single line of code, we created the tunnel and executed vncviewer. However, the <strong>-f</strong> switch has one requirement. It cannot be used on its own. It needs to be accompanied either by the <strong>-N</strong> switch or we have to execute a specific command on the remote machine.</p>
<p>In this case, the <strong>-f -N</strong> combination keeps the tunnel up and running in the background, but the drawback is that it runs forever, requiring us to explicitly kill the ssh process if the tunnel is not needed any more. Even if we close vncviewer, the following command confirms that the tunnel is still running, which was actually expected:</p>
<pre class="console">[me@local]$ ps ax | grep ssh | grep -v grep</pre>
<h4>The best way &#8211; Tunnels that auto-close</h4>
<p>As it has been mentioned previously, instead of using the <strong>-f -N</strong> switch combination, we can just use <strong>-f</strong> alone, but also execute a command on the remote machine. But, which command should be executed, since we only need to initialize a tunnel?</p>
<p>This is when <code>sleep</code> can be the most useful command of all! In this particular situation, <strong>sleep</strong> has two advantages:</p>
<ol>
<li>it does nothing, so no resources are consumed</li>
<li>the user can specify for how long it will be executed</li>
</ol>
<p>How these help in auto-closing the ssh tunnel is explained below.</p>
<p>We start the ssh session in the background, while executing the sleep command for 10 seconds on the remote machine. The number of seconds is not crucial. At the same time, we execute vncviewer exactly as before:</p>
<pre class="console">
[me@local]$ ssh -f -L 25901:127.0.0.1:5901 me@remote.example.org sleep 10; \
              vncviewer 127.0.0.1:25901:1
</pre>
<p>In this case, the ssh client is instructed to fork the ssh session to the background (<code>-f</code>), create the tunnel (<code>-L 25901:127.0.0.1:5901</code>) and execute the sleep command on the remote server for 10 seconds (<code>sleep 10</code>).</p>
<p>The difference between this method and the previous one (<strong>-N</strong> switch), basically, is that in this case the ssh client&#8217;s primary goal is not to create the tunnel, but rather to execute the sleep command for 10 seconds. The creation of the tunnel is some kind of side-effect, a secondary goal. If <code>vncviewer</code> was not used, the ssh client would exit after the 10 sec period, as it would have no more jobs to do, destroying the tunnel at the same time.</p>
<p>During the execution of the sleep command, if another process, <code>vncviewer</code> in this case, starts using that tunnel and keeps it occupied beyond the 10 sec period, then, even if the ssh client finishes its remote job (execution of sleep), it cannot exit because another process occupies the tunnel. In other words, the ssh client cannot destroy the tunnel because it would have to kill vncviewer as well. When vncviewer stops using the tunnel, then the ssh client exits too, as it has already accomplished its goal.</p>
<p>This way, no ssh processes are left running in the background.</p>
<h4>Further Enhancements</h4>
<p>Although this is not a general article about the SSH protocol, the following ssh client switches may prove useful in some situations.</p>
<p>The <strong>-C</strong> switch may be used in order to apply compression to the transfered data between the local workstation and the remote server. This will save some bandwidth, but will increase the cpu load.</p>
<p>Also, a specific encryption algorithm may be specified with the <strong>-c</strong> option. The blowfish cipher is a rather good choice, which offers good encryption and low cpu utilization.</p>
<pre class="console">
[me@local]$ ssh -C -c blowfish -f -L 25901:127.0.0.1:5901 me@remote.example.org sleep 10; \
              vncviewer 127.0.0.1:25901:1
</pre>
<p>Finally, the <strong>-v</strong> flag can also be used for verbose output.</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2006/11/24/auto-closing-ssh-tunnels/">Auto-closing SSH tunnels</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>
<h4>Related Articles</h4>
<ul><li><a href="http://www.g-loaded.eu/2005/10/20/ssh-tunnels-headaches/" rel="bookmark">SSH Tunnels Headaches</a></li>
<li><a href="http://www.g-loaded.eu/2005/11/10/configure-vnc-server-in-fedora/" rel="bookmark">Set up the VNC Server in Fedora</a></li>
<li><a href="http://www.g-loaded.eu/2006/11/06/netcat-a-couple-of-useful-examples/" rel="bookmark">Netcat &#8211; a couple of useful examples</a></li>
<li><a href="http://www.g-loaded.eu/2006/01/06/partition-images-with-partimage-and-partimaged/" rel="bookmark">Partition images with Partimage and Partimaged</a></li>
<li><a href="http://www.g-loaded.eu/2005/11/10/ssh-with-keys/" rel="bookmark">Setup the SSH server to use keys for authentication</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2006/11/24/auto-closing-ssh-tunnels/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Netcat &#8211; a couple of useful examples</title>
		<link>http://www.g-loaded.eu/2006/11/06/netcat-a-couple-of-useful-examples/</link>
		<comments>http://www.g-loaded.eu/2006/11/06/netcat-a-couple-of-useful-examples/#comments</comments>
		<pubDate>Mon, 06 Nov 2006 07:34:12 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Remote]]></category>
		<category><![CDATA[Shell]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/2006/11/06/netcat-a-couple-of-useful-examples/</guid>
		<description><![CDATA[One of the Linux command line tools I had initially under-estimated is netcat or just nc. By default, netcat creates a TCP socket either in listening mode (server socket) or a socket that is used in order to connect to a server (client mode). Actually, netcat does not care whether the socket is meant to [...]]]></description>
			<content:encoded><![CDATA[<p>One of the Linux command line tools I had initially under-estimated is <strong>netcat</strong> or just <strong>nc</strong>. By default, netcat creates a TCP socket either in listening mode (server socket) or a socket that is used in order to connect to a server (client mode). Actually, netcat does not care whether the socket is meant to be a server or a client. All it does is to take the data from stdin and transfer it to the other end across the network.<br />
<span id="more-301"></span><br />
The simplest example of its usage is to create a server-client chat system. Although this is a very primitive way to chat, it shows how netcat works. In the following examples it is assumed that the machine that creates the listening socket (server) has the 192.168.0.1 IP address. So, create the chat server on this machine and set it to listen to 3333 TCP port:</p>
<pre class="console">$ nc -l 3333</pre>
<p>On the other end, connect to the server with the following:</p>
<pre class="console">$ nc 192.168.0.1 3333</pre>
<p>In this case, the keyboard acts as the stdin. Anything you type in the server machine&#8217;s terminal is transfered to the client machine and vice-versa.</p>
<h4>Transfering Files</h4>
<p>In the very same way it can be used to transfer files between two computers. You can create a server that serves the file with the following:</p>
<pre class="console">$ cat backup.iso | nc -l 3333</pre>
<p>Receive backup.iso on the client machine with the following:</p>
<pre class="console">$ nc 192.168.0.1 3333 > backup.iso</pre>
<p>As you may have noticed, netcat does not show any info about the progress of the data transfer. This is inconvenient when dealing with large files. In such cases, a pipe-monitoring utility like <a href="http://www.ivarch.com/programs/pv.shtml">pv</a> can be used to show a progress indicator. For example, the following shows the total amount of data that has been transfered in real-time on the server side:</p>
<pre class="console">$ cat backup.iso | pv -b | nc -l 3333</pre>
<p>Of course, the same can be implemented on the client side by piping netcat&#8217;s output through pv:</p>
<pre class="console">$ nc 192.168.0.1 3333 | pv -b > backup.iso</pre>
<h5>Other Examples</h5>
<p>Netcat is extremely useful for creating a partition image and sending it to a remote machine on-the-fly:</p>
<pre class="console">$ dd if=/dev/hdb5 | gzip -9 | nc -l 3333</pre>
<p>On the remote machine, connect to the server and receive the partition image with the following command:</p>
<pre class="console">$ nc 192.168.0.1 3333 | pv -b > myhdb5partition.img.gz</pre>
<p>This might not be as classy as the <a href="http://www.g-loaded.eu/2006/01/06/partition-images-with-partimage-and-partimaged/">partition backups using partimage</a>, but it is efficient.</p>
<p>Another useful thing is to compress the critical files on the server machine with <code>tar</code> and have them pulled by a remote machine:</p>
<pre class="console">$ tar -czf - /etc/ | nc -l 3333</pre>
<p>As you can see, there is a dash in the tar options instead of a filename. This is because tar&#8217;s output needs to be passed to netcat.</p>
<p>On the remote machine, the backup is pulled in the same way as before:</p>
<pre class="console">$ nc 192.168.0.1 3333 | pv -b > mybackup.tar.gz</pre>
<h4>Security</h4>
<p>It is obvious that using netcat in the way described above, the data travels in the clear across the network. This is acceptable in case of a local network, but, in case of transfers across the internet, then it would be a wise choice to do it through an SSH tunnel.</p>
<p>Using an SSH tunnel has two advantages:</p>
<ol>
<li>The data is transfered inside an encrypted tunnel, so it is well-protected.</li>
<li>You do not need to keep any open ports in the firewall configuration of the machine that will act as the server, as the connections will take place through SSH.</li>
</ol>
<p>You pipe the file to a listening socket on the server machine in the same way as before. It is assumed that an SSH server runs on this machine too.</p>
<pre class="console">$ cat backup.iso | nc -l 3333</pre>
<p>On the client machine connect to the listening socket through an SSH tunnel:</p>
<pre class="console">
$ ssh -f -L 23333:127.0.0.1:3333 me@192.168.0.1 sleep 10; \
        nc 127.0.0.1 23333 | pv -b > backup.iso
</pre>
<p>This way of creating and using the SSH tunnel has the advantage that the tunnel is <strong>automagically closed</strong> after file transfer finishes. For more information and explanation about it please read my article about <a href="http://www.g-loaded.eu/2006/11/24/auto-closing-ssh-tunnels/">auto-closing SSH tunnels</a>.</p>
<h4>Telnet-like Usage</h4>
<p>Netcat can be used in order to talk to servers like telnet does. For example, in order to get the definition of the word &#8220;server&#8221; from the &#8220;WordNet&#8221; database at the dict.org dictionary server, I&#8217;d do:</p>
<pre class="console">
$ nc dict.org 2628
220 ..............some WELCOME.....
DEFINE wn server
150 1 definitions retrieved
151 "server" wn "WordNet (r) 2.0"
server
     n 1: a person whose occupation is to serve at table (as in a
          restaurant) [syn: {waiter}]
     2: (court games) the player who serves to start a point
     3: (computer science) a computer that provides client stations
        with access to files and printers as shared resources to a
        computer network [syn: {host}]
     4: utensil used in serving food or drink
.
250 ok [d/m/c = 1/0/18; 0.000r 0.000u 0.000s]
QUIT
221 bye [d/m/c = 0/0/0; 16.000r 0.000u 0.000s]
</pre>
<h4>Works as a Port Scanner too</h4>
<p>A useful command line flag is <strong>-z</strong>. When it is used, netcat does not initiate a connection to the server, but just informs about the open port it has found. Also, instead of a single port, it can accept a port-range to scan. For example:</p>
<pre class="console">
$ nc -z 192.168.0.1 80-90
Connection to 192.168.0.1 80 port [tcp/http] succeeded!
</pre>
<p>In this example, netcat scanned the 80-90 range of ports and reported that port 80 is open on the remote machine.</p>
<p>The man page contains some more interesting examples, so take the time to read it.</p>
<h4>Notes</h4>
<p>All the above examples have been performed on Fedora 5/6. Netcat syntax may vary slightly among Linux distributions, so read the man page carefully.</p>
<p>Netcat provides a primitive way to transfer data between two networked computers. I wouldn&#8217;t say it&#8217;s an absolutely necessary tool in the everyday use, but there are times that this primitive functionality is very useful.</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2006/11/06/netcat-a-couple-of-useful-examples/">Netcat &#8211; a couple of useful examples</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>
<h4>Related Articles</h4>
<ul><li><a href="http://www.g-loaded.eu/2006/11/24/auto-closing-ssh-tunnels/" rel="bookmark">Auto-closing SSH tunnels</a></li>
<li><a href="http://www.g-loaded.eu/2005/10/20/ssh-tunnels-headaches/" rel="bookmark">SSH Tunnels Headaches</a></li>
<li><a href="http://www.g-loaded.eu/2005/11/10/configure-vnc-server-in-fedora/" rel="bookmark">Set up the VNC Server in Fedora</a></li>
<li><a href="http://www.g-loaded.eu/2006/01/06/partition-images-with-partimage-and-partimaged/" rel="bookmark">Partition images with Partimage and Partimaged</a></li>
<li><a href="http://www.g-loaded.eu/2007/09/15/use-wget-or-curl-to-download-from-rapidshare-premium/" rel="bookmark">Use wget or curl to download from RapidShare Premium</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2006/11/06/netcat-a-couple-of-useful-examples/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Training Videos</title>
		<link>http://www.g-loaded.eu/2006/10/05/training-videos/</link>
		<comments>http://www.g-loaded.eu/2006/10/05/training-videos/#comments</comments>
		<pubDate>Thu, 05 Oct 2006 19:08:35 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Multimedia]]></category>
		<category><![CDATA[Remote]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/2006/10/05/training-videos/</guid>
		<description><![CDATA[I was aware that a non-encrypted VNC session could be recorded and then reproduced, but I had never searched for utilities that could do that job. The recorded sessions can be perfectly used to show others how to accomplish a task and, generally, can serve as excellent training videos. There is a very good HOWTO [...]]]></description>
			<content:encoded><![CDATA[<p>I was aware that a non-encrypted VNC session could be recorded and then reproduced, but I had never searched for utilities that could do that job. The recorded sessions can be perfectly used to show others how to accomplish a task and, generally, can serve as excellent training videos. There is a very good HOWTO article at <em>Linux.com</em> that explains how to use the Python version of <a href="http://www.unixuser.org/~euske/vnc2swf/">vnc2swf</a> (aka <code>pyvnc2swf</code>) in order to record the VNC session to ShockWave Flash format (SWF).<br />
<a href="http://applications.linux.com/article.pl?sid=06/09/18/1349218">Read the full article at Linux.com</a></p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2006/10/05/training-videos/">Training Videos</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>
<h4>Related Articles</h4>
<ul><li><a href="http://www.g-loaded.eu/2007/07/01/watch-videos-in-ascii-art/" rel="bookmark">Watch Videos in ASCII Art</a></li>
<li><a href="http://www.g-loaded.eu/2006/02/05/how-to-author-dvd-with-menus-under-linux/" rel="bookmark">How to author DVD with menus under Linux</a></li>
<li><a href="http://www.g-loaded.eu/2006/09/10/how-to-recover-lost-files/" rel="bookmark">How to recover lost files</a></li>
<li><a href="http://www.g-loaded.eu/2007/02/24/creative-commons-v30-licenses-launched/" rel="bookmark">Creative Commons v3.0 Licenses Launched</a></li>
<li><a href="http://www.g-loaded.eu/2006/12/18/the-hole-trick/" rel="bookmark">The hole trick</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2006/10/05/training-videos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>WordPress Performance</title>
		<link>http://www.g-loaded.eu/2006/09/10/wordpress-performance/</link>
		<comments>http://www.g-loaded.eu/2006/09/10/wordpress-performance/#comments</comments>
		<pubDate>Sat, 09 Sep 2006 22:56:24 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web Applications]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Remote]]></category>
		<category><![CDATA[RRDtool]]></category>
		<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/2006/09/10/wordpress-performance/</guid>
		<description><![CDATA[Some months ago, I had a talk on IRC with someone who had created a useful plugin for WordPress, which shows performance related information. The plugin is called Performance Probe. Its output is saved in text files. I had written a quick python script, for demonstration purposes only, that uses performance probe&#8217;s output and RRDTool [...]]]></description>
			<content:encoded><![CDATA[<p>Some months ago, I had a talk on IRC with someone who had created a useful plugin for WordPress, which shows performance related information. The plugin is called <a href="http://libertini.net/libertus/wordpress-plugins/performance-probe/">Performance Probe</a>. Its output is saved in text files. I had written a quick python script, for demonstration purposes only, that uses performance probe&#8217;s output and <a href="http://oss.oetiker.ch/rrdtool/">RRDTool</a> to create a performance graph with WP loading times. The created RRA keeps data of one hour. This script is located <a href="http://www.g-loaded.eu/packages/wpperf/">here</a>.</p>
<p>Information about its usage can be found inside the script. It is completely unsupported and it will not be further developed.</p>
<p><em>Special Note</em>: My script visits the blog 60 times/hour, so do not run it on a production blog, unless you have adjusted your web server statistics analysis software to ignore those visits.</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2006/09/10/wordpress-performance/">WordPress Performance</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>
<h4>Related Articles</h4>
<ul><li><a href="http://www.g-loaded.eu/2008/05/10/fast-static-feed-wordpress-plugin/" rel="bookmark">Fast-Static-Feed WordPress Plugin</a></li>
<li><a href="http://www.g-loaded.eu/2006/01/14/creative-commons-configurator-wordpress-plugin/" rel="bookmark">Creative-Commons-Configurator WordPress Plugin</a></li>
<li><a href="http://www.g-loaded.eu/2008/03/31/wordpress-25-plugin-compatibility/" rel="bookmark">WordPress 2.5 &#8211; Plugin Compatibility</a></li>
<li><a href="http://www.g-loaded.eu/2008/05/08/more-feed-excerpt-wordpress-plugin/" rel="bookmark">More-Feed-Excerpt WordPress Plugin</a></li>
<li><a href="http://www.g-loaded.eu/2006/01/04/bot-allow-content-wordpress-plugin/" rel="bookmark">Bot-Allow-Content WordPress plugin</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2006/09/10/wordpress-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
	</channel>
</rss>

