<?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>Jen Peters</title>
	<atom:link href="http://jenpeters.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://jenpeters.com</link>
	<description></description>
	<lastBuildDate>Wed, 15 Feb 2012 18:29:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Random Image on WebPage</title>
		<link>http://jenpeters.com/random-image-on-webpage/</link>
		<comments>http://jenpeters.com/random-image-on-webpage/#comments</comments>
		<pubDate>Tue, 07 Feb 2012 19:25:49 +0000</pubDate>
		<dc:creator>cxjtc</dc:creator>
				<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://jenpeters.com/?p=103</guid>
		<description><![CDATA[I was doing the home page of my site today and couldnt decide which image to put there. So I got a bunch of them and set it to show a random image on page load. Heres how I did it: first create a directory in which you want to put your images: $ mkdir [...]]]></description>
			<content:encoded><![CDATA[<p>I was doing the home page of my site today and couldnt decide which image to put there.  So I got a bunch of them and set it to show a random image on page load.  Heres how I did it:</p>
<p>first create a directory in which you want to put your images:</p>
<p><code>$ mkdir frontcycle</code></p>
<p>then put all your pics in that folder.</p>
<p><code>$ cp pic1.jpg frontcycle/</code></p>
<p>next you write a php function.  you can do this in an external page or right in your file.</p>
<p><code>function get_random_image() {<br />
&nbsp;&nbsp;&nbsp;$dh = opendir( "path/to/frontcycle" );</p>
<p>&nbsp;&nbsp;&nbsp;$files = array();</p>
<p>&nbsp;&nbsp;&nbsp;while ( $file = readdir( $dh ) ) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ( preg_match( "/\.(jpg|jpeg|gif|png)$/i", $file ) ) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// add or remove file extensions if you want<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$files[] = $file;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;}</p>
<p>&nbsp;&nbsp;&nbsp;return $files[ rand( 0, sizeof( $files ) - 1 ) ];<br />
}</code></p>
<p>finally, in the page your image will be displayed, add the following code:</p>
<p><code>&lt;img src='/path/to/frontcycle/&lt;?php echo get_random_image() ?&gt;' /&gt;</code></p>
]]></content:encoded>
			<wfw:commentRss>http://jenpeters.com/random-image-on-webpage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Copy/Paste from XTerm</title>
		<link>http://jenpeters.com/copypaste-from-xterm/</link>
		<comments>http://jenpeters.com/copypaste-from-xterm/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 21:40:30 +0000</pubDate>
		<dc:creator>cxjtc</dc:creator>
				<category><![CDATA[how to]]></category>
		<category><![CDATA[commandline]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[xterm]]></category>

		<guid isPermaLink="false">http://jenpeters.com/?p=78</guid>
		<description><![CDATA[Users of XTerm know all too well the frustrations caused by the inability to copy something in XTerm and paste it somewhere else, and vice versa. You can hack and recompile XTerm to solve this problem, but heres a way enable copy/paste as you launch: /usr/bin/xterm -xrm 'XTerm*VT100.translations: #override : select-end(PRIMARY, CLIPBOARD, CUT_BUFFER0)' -e 'ssh [...]]]></description>
			<content:encoded><![CDATA[<p>Users of XTerm know all too well the frustrations caused by the inability to copy something in XTerm and paste it somewhere else, and vice versa.  You can hack and recompile XTerm to solve this problem, but heres a way enable copy/paste as you launch:</p>
<p><code>/usr/bin/xterm -xrm 'XTerm*VT100.translations: #override <Btn1Up>: select-end(PRIMARY, CLIPBOARD, CUT_BUFFER0)' -e 'ssh user@server'</code></p>
]]></content:encoded>
			<wfw:commentRss>http://jenpeters.com/copypaste-from-xterm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Send Email With an Attachment in PHP</title>
		<link>http://jenpeters.com/send-email-with-an-attachment-in-php/</link>
		<comments>http://jenpeters.com/send-email-with-an-attachment-in-php/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 20:49:13 +0000</pubDate>
		<dc:creator>cxjtc</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[attachment]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://jenpeters.com/?p=68</guid>
		<description><![CDATA[// basic information $to = "mailbox@jenpeters.com"; $from = "noreply@jenpeters.com"; $subject = "This is an email"; $body = "This is some text"; // get file information $file = "/home/cxjtc/file.csv"; $filename = basename( $file ); $contenttype = "text/csv"; // change to suit your attachment $fh = fopen( $file, "r" ); $content = fread( $fh, filesize( $file ) [...]]]></description>
			<content:encoded><![CDATA[<p><code><br />
// basic information<br />
$to = "mailbox@jenpeters.com";</p>
<p>$from = "noreply@jenpeters.com";</p>
<p>$subject = "This is an email";</p>
<p>$body = "This is some text";</p>
<p>// get file information<br />
$file = "/home/cxjtc/file.csv";</p>
<p>$filename = basename( $file );</p>
<p>$contenttype = "text/csv"; // change to suit your attachment</p>
<p>$fh = fopen( $file, "r" );</p>
<p>$content = fread( $fh, filesize( $file ) );</p>
<p>fclose( $fh );</p>
<p>$content = chunk_split( base64_encode( $content) );</p>
<p>$headers = <<<EOT<br />
From: $from\n<br />
MIME-Version: 1.0\n<br />
Content-Type: multipart/mixed; boundary="$boundary"\n\n<br />
This is a multi-part message in MIME format.\n<br />
--$boundary\n<br />
Content-Type: text/plain; charset=iso-8859-1\n<br />
Content-Transfer-Encoding: 7bit\n\n<br />
$body\n\n<br />
--$boundary\n<br />
Content-Type: text/csv; name="$filename"\n<br />
Content-Transfer-Encoding: base64\n<br />
Content-Disposition: attachment; filename="$filename"\n\n<br />
$content\n\n<br />
--$boundary--<br />
EOT</p>
<p>mail( $to, $subject, "", $headers );<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://jenpeters.com/send-email-with-an-attachment-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

