<?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>JB&#039;s Homepage &#187; Code</title>
	<atom:link href="http://blade.lansmash.com/category/technical/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://blade.lansmash.com</link>
	<description>One man on one island.</description>
	<lastBuildDate>Thu, 02 Sep 2010 07:34:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0-beta1</generator>
		<item>
		<title>MyBook backups with Rsnapshot and some bash trickey</title>
		<link>http://blade.lansmash.com/2008/06/20/mybook-backups-with-rsnapshot-and-some-bash-trickey/</link>
		<comments>http://blade.lansmash.com/2008/06/20/mybook-backups-with-rsnapshot-and-some-bash-trickey/#comments</comments>
		<pubDate>Fri, 20 Jun 2008 02:13:11 +0000</pubDate>
		<dc:creator>JB Hewitt</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blade.lansmash.com/2008/06/20/mybook-backups-with-rsnapshot-and-some-bash-trickey/</guid>
		<description><![CDATA[I had a client accidentally purchase half a dozen 500GB MyBook&#8217;s instead of the simpler cheaper USB models. Since this site is remote from me it took a little while to deduce what was going on since the MyBook&#8217;s don&#8217;t act as USB drives and hence don&#8217;t appear as a USB device to linux. User: [...]]]></description>
			<content:encoded><![CDATA[<p>I had a client accidentally purchase half a dozen 500GB MyBook&#8217;s instead of the simpler cheaper USB models.</p>
<p>Since this site is remote from me it took a little while to deduce what was going on since the MyBook&#8217;s don&#8217;t act as USB drives and hence don&#8217;t appear as a USB device to linux.</p>
<blockquote>
<p>User: &#8216;Yes, I&#8217;ve plugged it in! Yes it&#8217;s using the white cable!&#8217;<br />
  Me: &#8216;So&#8230; what exactly does it say on the box what drive it is&#8230;&#8217;</p>
</blockquote>
<p>Anyhow, after figuring out that is was a MyBook I implemented ssh access using <a href="http://martin.hinner.info/mybook/sshaccess.php">Martin Hinner&#8217;s clever hack</a> and found a nice website of various <a href="http://mybookworld.wikidot.com/hacks-and-howto">MyBook Hack&#8217;s</a>.</p>
<p>I was originally using the venerable Rdiff-backup, but alas couldn&#8217;t see it in the Optware packages. So I implemented a Rsnapshot solution, the only problem was I wanted some notifications from the MyBook devices to check that the backups were working, and so a simple bash script was in order&#8230;</p>
<pre>
#!/bin/bash
mailto=my@emailaddress.com,clients@theclientsdomain.com
time=$1
</pre>
<pre>
if /opt/bin/rsnapshot $time &gt; /tmp/rsnapshot.log 2&gt; /tmp/rsnapshot.logthen   subject='Backup success'else   subject='Backup FAILURE'ficat /tmp/rsnapshot.log | /opt/bin/nail -r admin@theclientsdomain.com -s "$subject" $mailto
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blade.lansmash.com/2008/06/20/mybook-backups-with-rsnapshot-and-some-bash-trickey/feed/</wfw:commentRss>
		<slash:comments>-1</slash:comments>
		</item>
		<item>
		<title>WP-Mail 0.312 &#8211; Some bug fixes</title>
		<link>http://blade.lansmash.com/2005/03/17/WP-Mail 0.312 - Some bug fixes/</link>
		<comments>http://blade.lansmash.com/2005/03/17/WP-Mail 0.312 - Some bug fixes/#comments</comments>
		<pubDate>Thu, 17 Mar 2005 13:12:40 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[This latest version just fixes some nagging issues like being able to post to default categories and poster. Enjoy! wp-mail-0.312.zip I&#8217;ll get around and explain how to use my wp-mail.php hack to be posted directly to in a few days&#8230;.]]></description>
			<content:encoded><![CDATA[<p>This latest version just fixes some nagging issues like being able to post to default categories and poster.  Enjoy!</p>
<p><a href="http://blade.lansmash.com/wp-filez/wp-mail-0.312.zip">wp-mail-0.312.zip</a></p>
<p>I&#8217;ll get around and explain how to use my wp-mail.php hack to be posted directly to in a few days&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://blade.lansmash.com/2005/03/17/WP-Mail 0.312 - Some bug fixes/feed/</wfw:commentRss>
		<slash:comments>125</slash:comments>
		</item>
		<item>
		<title>WP-Mail ver 0.311</title>
		<link>http://blade.lansmash.com/2005/01/31/wp-mail-ver-0311/</link>
		<comments>http://blade.lansmash.com/2005/01/31/wp-mail-ver-0311/#comments</comments>
		<pubDate>Mon, 31 Jan 2005 13:01:14 +0000</pubDate>
		<dc:creator>JohnBlade</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://blade.lansmash.com/?p=141</guid>
		<description><![CDATA[I had a nice long holiday at Coolangata, Queensland, Australia and had quite a lot of time sitting on the couch as my girlfriend read her book. So I grabbed my Powerbook and slowly worked away on my wp-mail.php plugin! It&#8217;s nice to work on something without having to worry about timing and just bang [...]]]></description>
			<content:encoded><![CDATA[<p>I had a nice long holiday at Coolangata, Queensland, Australia and had quite a lot of time sitting on the couch as my girlfriend read her book.  So I grabbed my Powerbook and slowly worked away on my wp-mail.php plugin!  It&#8217;s nice to work on something without having to worry about timing and just bang away&#8230;</p>
<p><img src="http://blade.lansmash.com/wp-photos/1165824146.jpeg" alt="IMG_259.jpg" /></p>
<p>And that&#8217;s a photo of my me lying on the couch, I knew I should have not taught Lauren how to use the camera&#8230; <img src='http://blade.lansmash.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Thanks to all the comments and feedback of this hack, because people submit code and fixes it&#8217;s a better program for everyone.  With a little more work we&#8217;ll get this plugin rock steady stable and see if the wordpress dev team would consider it for the core code of wordpress.</p>
<p>Here&#8217;s the updates that have happened in the latest version:<br />
- HTML e-mail support added (Thunderbird clients can easily use this mod now!)<br />
- Subject line searching support for categories (i.e., Subject: [Code] WP-Mail, will post to the Code category)<br />
- Added UBB decoding support, so if you want to post things written out of say phpbb you can now<br />
- Direct posting support (using /etc/alias on your e-mail server you can send the<br />
- PHP5 support<br />
- More fixes</p>
<p>What needs to be done is a bit of work for the HTML e-mail support.  It works at the moment, but it needs a little more work to add the images in position of where it is in the actual e-mail.  At the moment all images in HTML e-mail&#8217;s are just attached to the bottom of the message which is probably not what people want.  I can do it, just got to figure out the best way.</p>
<p>The second thing I suppose most people want is a little bit more image manipulation (like resizing images).  I&#8217;m not sure if this should be included in wp-mail.php or have wp-mail.php interface with some other image plugin for Wordpress.  I&#8217;ve played around with thumb nailing</p>
<p>* -= History =-</p>
<p>* Version 0.311 &#8211; 2005-01<br />
* &#8211; eep, major bug for pop3 server. Next time I test my code more before I released, fixed so that pop3 now works.<br />
* Version 0.31 &#8211; 2004-12 &amp; 2005-01<br />
* (Has it been this long, best get back into the swing of things&#8230; did most of this coding on my holiday as I didn&#8217;t have a machine to play WoW on <img src='http://blade.lansmash.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
* &#8211; moved the deletion of pop3 emails into a check so that e-mails aren&#8217;t deleted without proper checking.<br />
* &#8211; added html &#8216;decoding&#8217; (basic support for Thunderbird &amp; Outlook)<br />
* &#8211; updated the Category search so that it matches words as well as numbers (i.e. [General] Subjectname will work instead of just [1] Subjectname)<br />
* &#8211; Changed time function from time to strtotime (as per Senior Pez&#8217;s suggestion), but found out that strtotime isn&#8217;t in default php distro&#8230;<br />
*<br />
* Vesion 0.3 &#8211; 2004-09<br />
* &#8211; Added UBB decoding support<br />
* &#8211; Added default title (when there is no subject assigned)<br />
* &#8211; Started doing a little code cleanup, been reading Advanced PHP Book <img src='http://blade.lansmash.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Download it and test it out, I&#8217;ll be writing a little HowTo on using the direct e-mail support when I have a little spare time, in the meantime enjoy!</p>
<p><a href="http://blade.lansmash.com/wp-filez/wp-mail-0.311.zip">wp-mail-0.311.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blade.lansmash.com/2005/01/31/wp-mail-ver-0311/feed/</wfw:commentRss>
		<slash:comments>34</slash:comments>
		</item>
		<item>
		<title>wp-mail mod update! Now 0.2!</title>
		<link>http://blade.lansmash.com/2004/08/26/wp-mail-mod-update-now-02/</link>
		<comments>http://blade.lansmash.com/2004/08/26/wp-mail-mod-update-now-02/#comments</comments>
		<pubDate>Wed, 25 Aug 2004 22:50:11 +0000</pubDate>
		<dc:creator>JB Hewitt</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://blade.lansmash.com/?p=93</guid>
		<description><![CDATA[Thanks for all the feedback for my last wp-mail mod. I&#8217;ve done a lot of bug fixing in this release, and added a few features. Still working on improving though, so let me know how you guys go with this version! Here&#8217;s the new version: Thanks for all the feedback for my last wp-mail mod. [...]]]></description>
			<content:encoded><![CDATA[<p>Thanks for all the feedback for my last wp-mail mod.  I&#8217;ve done a lot of bug fixing in this release, and added a few features.  Still working on improving though, so let me know how you guys go with this version!</p>
<p>Here&#8217;s the new version: Thanks for all the feedback for my last wp-mail mod.  I&#8217;ve done a lot<br />
of bug fixing in this release, and added a few features.  Still<br />
working on improving though, so let me know how you guys go with this<br />
version!</p>
<p>Here&#8217;s the new version:<a href="wp-filez/wp-mail-0.2.zip">wp-mail-0.2.zip</a></p>
<p>&lt;rip from README-wp-mail.php&gt;<br />
Wordpress 1.2 &#8211; wp-mail hack<br />
Released 2004-08-26 &#8211; Version 0.2<br />
By John B. Hewitt &#8211; blade@lansmash.com<br />
Blog: http://blade.lansmash.com</p>
<p>License<br />
-=-=-=-=-=&#8211;<br />
It&#8217;s GPL!  Credits are in the wp-mail.php code.</p>
<p>Introduction<br />
-=-=-=-=-=-=-<br />
This hack is a &#8216;drop in&#8217; replacement for the current wp-mail.php. It uses pear as a mime compliant email &#8216;decoder&#8217;.  What&#8217;s cool is that you can  attach images inline in your email messages and they&#8217;ll be shown as an image in your wordpress article.  It does this by decoding the image attachments and writing them to &#8216;wp-photos&#8217; directory (not in default wp install).</p>
<p>History<br />
-=-=-=-<br />
* Version 0.2 &#8211; 2004-08-26<br />
* &#8211; Stopped using pear body decoding in favour of own decoding (may be slower but more modifiable) because of enriched text decoding<br />
* &#8211; Added base64_decode checking (may help mobile phone users)<br />
* &#8211; Fixed Subject line for non-english users (htmlentities instead of just trim)<br />
* &#8211; Fixed error in some pop hanging -&gt; more graceful exit on event on no emails in inbox ($pop3-&gt;quit)<br />
* &#8211; Added work around for email addresses with exta &lt;&gt; in field (ie: &lt;blade@lansmash.com&gt; instead of blade@lasmash.com<br />
* &#8211; Added some ===basic=== enriched text support<br />
* &#8211; Updated readme file for easier install<br />
* &#8211; Easy modify of globals (such as photosdir and filesdir)<br />
* &#8211; Cleaned up some pear stuff in install<br />
*<br />
* Version 0.1 &#8211; 2004-06-20<br />
* First release (was released under version 1.0 initially, oh boy was I silly)</p>
<p>Features<br />
-=-=-=-=-<br />
It has all the abilities of the current wp-mail.php plus:<br />
	- Allows image attachments (posts inline! Main reason I built this mod!!)<br />
	- Checks if user email address is in the database (otherwise discards message)<br />
	- Allows other file attachments (zip&#8217;s, exe&#8217;s, etc)<br />
	- You can post to various categories (ie, 1 = General)<br />
	- Fairly good cleaner for removing excessive line breaks</p>
<p>Would love to see it in the wordpress core<br />
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-<br />
I&#8217;m planning on more updates, but would love to see this update included in future wordpress releases.  Would be happy to maintain it to, I&#8217;m fairly sure it complies with most of the coding guidelines I&#8217;ve read on<br />
the wordpress coding standard.</p>
<p>Install<br />
-=-=-=-=-<br />
To install you grab the zip file.<br />
- &#8211;  Drop the two files (wp-mail.php &amp; mailmimedecode.php &amp; PEAR.php) into your wordpress 1.2 root directory<br />
- &#8211; Create the directories &#8216;wp-photos&#8217;  and &#8216;wp-filez&#8217; in the wordpress root directory (with writing permissions (probably 0777).</p>
<p>That&#8217;s it.  You should now be able to post email to wordpress.</p>
<p>Features to come<br />
-=-=-=-=-=-=-=-=-<br />
Immediate features to come:<br />
	- Direct email script that parses email as it comes in (so removes cronjobs)<br />
	- GPG/PGP signature verification<br />
	- Better enriched text support (only basic stuff at the moment)<br />
	- Better security for file attachments (no .php stuff, less l33t hax0rs)<br />
	- Look ups for Category posting</p>
<p>Usage<br />
-=-=-=-<br />
You can use the wp-mail hack just like the old wp-mail.</p>
<p>Make sure you change your email client to use HTML encoded messages, that way you&#8217;ll get a better looking post that is similar to what you emailed.</p>
<p>When emailing to your blog you can also change the category the post is going to.  To do so change the subject line to include [1] at the beginning where one is the number of the category you want to post to.<br />
1 is usually General&#8217;s category, so if I want my email to go to the General board I type:<br />
Subject: [1] This is a test</p>
<p>FAQ<br />
-=-<br />
	- If you are using Mozilla (thunderbird,etc), use HTML mail!  Not HTML/TEXT combined!  (One day this script will be able to decode both at the same time, just not today)<br />
	- If you are using Outook/Outlook express, use HTML mail!<br />
	- If you are using Mac OS X email, you&#8217;re sweet<br />
	- You can change the default photos and files directories.  The variables are on the top of the wp-mail.php code.</p>
]]></content:encoded>
			<wfw:commentRss>http://blade.lansmash.com/2004/08/26/wp-mail-mod-update-now-02/feed/</wfw:commentRss>
		<slash:comments>100</slash:comments>
		</item>
		<item>
		<title>wp-mail.php</title>
		<link>http://blade.lansmash.com/2004/06/16/wp-mailphp/</link>
		<comments>http://blade.lansmash.com/2004/06/16/wp-mailphp/#comments</comments>
		<pubDate>Wed, 16 Jun 2004 03:41:26 +0000</pubDate>
		<dc:creator>JB Hewitt</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blade.lansmash.com/?p=39</guid>
		<description><![CDATA[Started using Wordpress a few days ago and love the clean look/design/code. But it got me thinking about photos, I love photos but hate having to upload stuff and linking to it (CMS style). In fact I&#8217;m so lazy, I decided to have a hack at wp-mail.php What I ended up doing was replacing most [...]]]></description>
			<content:encoded><![CDATA[<p>Started using Wordpress a few days ago and love the clean look/design/code.  But it got me thinking about photos, I love photos but hate having to upload stuff and linking to it (CMS style).  In fact I&#8217;m so lazy, I decided to have a hack at wp-mail.php<br />
What I ended up doing was replacing most of the code in wp-mail.php for wordpress 1.2, didn&#8217;t anticipate that when I first started but the results are nice.</p>
<p>This hack is a &#8216;drop in&#8217; replacement for the current wp-mail.php. It uses pear as a mime compliant email &#8216;decoder&#8217;.  What&#8217;s cool is that you can attach images inline in your email messages and they&#8217;ll be shown as an image in your wordpress article.  It does this by decoding the image attachments and writing them to &#8216;wp-photos&#8217; directory (not in default wp install).</p>
<p>It has all the abilities of the current wp-mail.php plus:</p>
<ul>
<li>Allows image attachments (posts inline)</li>
<li>Checks if user email address is in the database (otherwise discards message)</li>
<li>Allows other file attachments (zip&#8217;s, exe&#8217;s, etc)</li>
<li>Fairly good cleaner for removing excessive line breaks</li>
</ul>
<p>I&#8217;m planning on more updates, but would love to see this update included in future wordpress releases.  Would be happy to maintain it to, I&#8217;m fairly sure it complies with most of the coding guidelines I&#8217;ve read on the wordpress website.</p>
<p>To install you grab the zip file: <a href="wp-filez/wp-mail.zip">wp-mail.zip</a></p>
<ol>
<li>Drop the two files (wp-mail.php &#038; mimedecode.php) into a wordpress 1.2 root directory </li>
<li>Create the directories &#8216;wp-photos&#8217;  and &#8216;wp-filez&#8217; in the wordpress root directory(with writing permissions (probably 0777).</li>
</ol>
<p>Let me know what you guys think!</p>
]]></content:encoded>
			<wfw:commentRss>http://blade.lansmash.com/2004/06/16/wp-mailphp/feed/</wfw:commentRss>
		<slash:comments>155</slash:comments>
		</item>
	</channel>
</rss>
