<?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>Views From The Hill &#187; Linux</title>
	<atom:link href="http://dustint.com/archives/category/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://dustint.com</link>
	<description>Tales Of A (Former) SFU Computing Scientist</description>
	<lastBuildDate>Thu, 17 Jun 2010 20:14:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Shellinabox Gentoo Init Script</title>
		<link>http://dustint.com/archives/177</link>
		<comments>http://dustint.com/archives/177#comments</comments>
		<pubDate>Tue, 27 Oct 2009 02:24:44 +0000</pubDate>
		<dc:creator>Dustin</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://dustint.com/?p=177</guid>
		<description><![CDATA[I&#8217;ve been playing around with ShellInABox and I think it is quite neat. From the website: Shell In A Box implements a web server that can export arbitrary command line tools to a web based terminal emulator. This emulator is accessible to any JavaScript and CSS enabled web browser and does not require any additional [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been playing around with <a href="http://code.google.com/p/shellinabox/">ShellInABox</a> and I think it is quite neat. From the website:</p>
<blockquote><p>Shell In A Box implements a web server that can export arbitrary command line tools to a web based terminal emulator. This emulator is accessible to any JavaScript and CSS enabled web browser and does not require any additional browser plugins.</p></blockquote>
<p>So basically it gives you a shell to your local system wherever you go (as long as you have a browser that was released since the turn of the century). This can be especially handy if you are on a public machine without permissions to install software (such as putty). The only dis-advantage is that the remote machine has to be running shellinabox, so this will not work for shared hosting environments. However, if  you setup a shellinabox machine, you can then SSH into other boxes that aren&#8217;t running the daemon.</p>
<p>I&#8217;m running Gentoo Linux on my utility machine, and shellinabox doesn&#8217;t ship with a gentoo init script. Please enjoy the one I have written below. Basically, you install shellinabox normally, then I copied its generated certs to /var/lib/shellingabox to be used for ssh connections.</p>
<p>Corrections and improvements are appreciated.</p>
<p>/etc/init.d/shellinaboxd:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/sbin/runscript</span>
<span style="color: #666666; font-style: italic;"># Copyright 1999-2009 Gentoo Foundation</span>
<span style="color: #666666; font-style: italic;"># Distributed under the terms of the GNU General Public License v2</span>
<span style="color: #666666; font-style: italic;"># $Header: $</span>
&nbsp;
<span style="color: #007800;">CMD</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>shellinaboxd
<span style="color: #007800;">CERT_DIR</span>=<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>shellinabox
<span style="color: #007800;">PIDFILE</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>shellinabox.pid
&nbsp;
depend<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        need net
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
start<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        ebegin <span style="color: #ff0000;">&quot;Starting Shellinabox&quot;</span>
        start-stop-daemon <span style="color: #660033;">--start</span> <span style="color: #660033;">--pidfile</span> <span style="color: #007800;">$PIDFILE</span> <span style="color: #660033;">--exec</span> <span style="color: #007800;">$CMD</span> <span style="color: #660033;">--</span> <span style="color: #660033;">--cert</span> <span style="color: #007800;">$CERT_DIR</span> <span style="color: #660033;">-b</span>=<span style="color: #007800;">$PIDFILE</span>
        eend <span style="color: #007800;">$?</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://dustint.com/archives/177/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fakemail for Developers</title>
		<link>http://dustint.com/archives/27</link>
		<comments>http://dustint.com/archives/27#comments</comments>
		<pubDate>Sat, 07 Jun 2008 07:34:18 +0000</pubDate>
		<dc:creator>Dustin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://dustint.com/?p=27</guid>
		<description><![CDATA[The other day when I was setting up email notifications for a Zend Framework application, I stumbled across Fakemail. From the developers website: fakemail is a fake mail server that captures emails as files for acceptance testing. This avoids the excessive configuration of setting up a real mail server and trying to extract mail queue [...]]]></description>
			<content:encoded><![CDATA[<p>The other day when I was setting up email notifications for a Zend Framework application, I stumbled across Fakemail.</p>
<p>From the developers website:</p>
<blockquote><p>fakemail is a fake mail server that captures emails as files for acceptance testing. This avoids the excessive configuration of setting up a real mail server and trying to extract mail queue content.</p></blockquote>
<p>I am quite impressed with this handy little script (written in both Python and Perl), as it works exactly as advertised: taking out the time required to properly configure a SMTP server and saving the hassle of having dozens of test messages showered across inboxes. Instead of forwarding emails on to their recipients, it simply saves a raw copy of the email to the specified directory.</p>
<p>The script has a windows installer that bundles the script with python and will run on all flavors of Linux and Unix assuming that they have perl or python installed.</p>
<p>To configure Zend_Mail use fakemail place the following in your bootstrapper or common config file:<br />
[php]Zend_Mail::setDefaultTransport(new Zend_Mail_Transport_Smtp(&#8216;localhost&#8217;,array(<br />
&#8216;port&#8217; =&gt; 10025<br />
)));[/php]</p>
<p>The &#8216;localhost&#8217; variable is the address of the computer that fakemail is running on (likely the local machine). The port number is the port that is specified when fakemail is run on the command line.</p>
<p>For more information about fakemail, binaries, and a usage guide. Visit the developers website at Sourceforce: <a href="http://www.lastcraft.com/fakemail.php">http://www.lastcraft.com/fakemail.php</a></p>
]]></content:encoded>
			<wfw:commentRss>http://dustint.com/archives/27/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gentoo blacklist.py init Script</title>
		<link>http://dustint.com/archives/22</link>
		<comments>http://dustint.com/archives/22#comments</comments>
		<pubDate>Wed, 04 Jun 2008 06:41:28 +0000</pubDate>
		<dc:creator>Dustin</dc:creator>
				<category><![CDATA[How-To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[blacklist.py]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[ssh security]]></category>

		<guid isPermaLink="false">http://dustint.com/?p=22</guid>
		<description><![CDATA[I have several servers which run an assortment of http, svn, ssh, and ftp services. One of the largest annoyances are automated breaking scripts pounding my services. Recently, I have been looking into blacklist.py: a handy python script written by Reto Glauser, which monitors syslog-ng logs looking for possible break-in attempts. The script uses iptables [...]]]></description>
			<content:encoded><![CDATA[<p>I have several servers which run an assortment of http, svn, ssh, and ftp services. One of the largest annoyances are automated breaking scripts pounding my services. Recently, I have been looking into <a href="http://blinkeye.ch/mediawiki/index.php/SSH_Blocking">blacklist.py</a>: a handy python script written by Reto Glauser, which monitors syslog-ng logs looking for possible break-in attempts. The script uses iptables to block future traffic from suspicious IP&#8217;s for a specified amount of time.</p>
<p>After I got the script setup and running I wanted a Gentoo init script that would automatically start the script on boot. After reading through some examples in my /etc/init.d/ directory I seem to have managed to cook up something that works:<span id="more-22"></span></p>
<pre>[code]
#!/sbin/runscript
# blacklist is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# blacklist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# Copyright: Dustin Thomson
# Homepage: http://dustint.com
# Date: 2008-06-03
# Version 0.0.1

EXEC=/usr/sbin/blacklist
PID=/var/run/blacklist.pid

depend(){
        need net
}

checkconfig(){
        if [ ! -e /usr/sbin/blacklist ] ; then
                eerror "blacklist not found in /usr/sbin/blacklist"
                return 1
        fi
}

start() {
        checkconfig || return 1
        ebegin "Starting Blacklist"
        $EXEC &amp;
        eend $?
}

stop()  {
        ebegin "Stopping Blacklist"
        start-stop-daemon --stop --retry 20 --quiet --pidfile $PID
        eend $?
}
[/code]</pre>
<p>Alternatively, for those with wget, cd into /etc/init.d/ and:</p>
<pre>wget <a href="http://dustint.com/wp-content/uploads/2008/06/blacklist">http://dustint.com/wp-content/uploads/2008/06/blacklist</a>
chmod +x blacklist</pre>
<p>I have placed blacklist.py in /usr/sbin/ and renamed it to simply blacklist</p>
<p>Reto also hosts a handy &#8220;stage-4&#8243; <a href="http://blinkeye.ch/mediawiki/index.php/GNU/Linux_System_Backup_Script_(stage4)">backup script</a> which can create a full backup of your filesystem.</p>
]]></content:encoded>
			<wfw:commentRss>http://dustint.com/archives/22/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
