<?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>raspi.fi</title>
	<atom:link href="http://raspi.fi/feed/" rel="self" type="application/rss+xml" />
	<link>http://raspi.fi</link>
	<description>raspi&#039;s homepage</description>
	<lastBuildDate>Sat, 14 Aug 2010 07:56:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>TUPAS authentication service for Zend Framework</title>
		<link>http://raspi.fi/2010/08/14/tupas-authentication-service-for-zend-framework/</link>
		<comments>http://raspi.fi/2010/08/14/tupas-authentication-service-for-zend-framework/#comments</comments>
		<pubDate>Sat, 14 Aug 2010 07:56:18 +0000</pubDate>
		<dc:creator>raspi</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[zf-tupas]]></category>

		<guid isPermaLink="false">http://raspi.fi/?p=88</guid>
		<description><![CDATA[TUPAS is authentication service used by finnish banks. I created Zend_Service for it. See project site for code and examples.
]]></description>
			<content:encoded><![CDATA[<p>TUPAS is authentication service used by finnish banks. I created Zend_Service for it. See <a href="http://github.com/raspi/zf-tupas">project site</a> for code and examples.</p>
]]></content:encoded>
			<wfw:commentRss>http://raspi.fi/2010/08/14/tupas-authentication-service-for-zend-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iMagickFX &#8211; image effects for the people</title>
		<link>http://raspi.fi/2010/08/02/imagickfx-image-effects-for-the-people/</link>
		<comments>http://raspi.fi/2010/08/02/imagickfx-image-effects-for-the-people/#comments</comments>
		<pubDate>Mon, 02 Aug 2010 16:45:32 +0000</pubDate>
		<dc:creator>raspi</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[iMagickFx]]></category>

		<guid isPermaLink="false">http://raspi.fi/?p=80</guid>
		<description><![CDATA[I just started new project called iMagickFX which adds possibility to add different effects to images easily.
Like so:

$im = new iMagickFx('example.jpg');
$im-&#62;fxCropResize(100, 100)-&#62;fxReflection('white', 0.9);

$im = new iMagickFx('example.jpg');
$im-&#62;fxCropResize(100, 100)-&#62;fxRoundCorners()-&#62;fxDropShadow();

Currently it contains only four effects. Reflection, drop shadow, greyscaling and resizing but more is coming!

]]></description>
			<content:encoded><![CDATA[<p>I just started new project called <a href="http://github.com/raspi/iMagickFx">iMagickFX</a> which adds possibility to add different effects to images easily.</p>
<p>Like so:</p>
<pre class="brush: php;">
$im = new iMagickFx('example.jpg');
$im-&gt;fxCropResize(100, 100)-&gt;fxReflection('white', 0.9);

$im = new iMagickFx('example.jpg');
$im-&gt;fxCropResize(100, 100)-&gt;fxRoundCorners()-&gt;fxDropShadow();
</pre>
<p>Currently it contains only four effects. Reflection, drop shadow, greyscaling and resizing but more is coming!</p>
<pre><img class="size-large wp-image-84 alignnone" title="imfx" src="http://raspi.fi/wp-content/uploads/2010/08/imfx-369x1024.jpg" alt="imfx" width="369" height="1024" /></pre>
]]></content:encoded>
			<wfw:commentRss>http://raspi.fi/2010/08/02/imagickfx-image-effects-for-the-people/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XoNoiD CRM development stopped</title>
		<link>http://raspi.fi/2010/07/28/xonoid-crm-development-stopped/</link>
		<comments>http://raspi.fi/2010/07/28/xonoid-crm-development-stopped/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 17:51:54 +0000</pubDate>
		<dc:creator>raspi</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[XoNoiD]]></category>

		<guid isPermaLink="false">http://raspi.fi/?p=77</guid>
		<description><![CDATA[I&#8217;ve now stopped XoNoiD CRM development completely because lack of time and feedback from testers and users. Please be free to fork it for your own CRM projects.
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve now stopped <a href="http://code.google.com/p/xonoid/">XoNoiD CRM</a> development completely because lack of time and feedback from testers and users. Please be free to fork it for your own CRM projects.</p>
]]></content:encoded>
			<wfw:commentRss>http://raspi.fi/2010/07/28/xonoid-crm-development-stopped/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Subversion logs to iCalendar format</title>
		<link>http://raspi.fi/2010/04/02/subversion-logs-to-icalendar-format/</link>
		<comments>http://raspi.fi/2010/04/02/subversion-logs-to-icalendar-format/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 10:05:30 +0000</pubDate>
		<dc:creator>raspi</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://raspi.fi/?p=75</guid>
		<description><![CDATA[I wanted to know when I&#8217;ve kept my vacations so I wrote small Python script to find out.
pysvnlog2ics parses SVN XML commit log and creates iCalendar .ics file from it. This resulted in many .ics files as in work I use one repository per project and over the years this count is in hundreds today. [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to know when I&#8217;ve kept my vacations so I wrote small Python script to find out.</p>
<p><a href="http://code.google.com/p/pysvnlog2ics/"><span style="text-decoration: none; color: #000000;">pysvnlog2ics</span></a><a style="text-decoration: none; color: #000000;" href="http://code.google.com/p/pysvnlog2ics/"> pa</a>rses <a href="http://en.wikipedia.org/wiki/Subversion_%28software%29">SVN</a> <a href="http://en.wikipedia.org/wiki/XML">XML</a> commit log and creates <a href="http://en.wikipedia.org/wiki/ICalendar">iCalendar</a> .ics file from it. This resulted in many .ics files as in work I use one repository per project and over the years this count is in hundreds today. So I wrote another script &#8211; <a href="http://code.google.com/p/pyicalmerge/">pyicalmerge</a> which combines those .ics files to one big .ics file. Then I just uploaded that giant .ics file to Google Calendar and now I have all my commits in my calendar and can easily see the vacation gaps.</p>
]]></content:encoded>
			<wfw:commentRss>http://raspi.fi/2010/04/02/subversion-logs-to-icalendar-format/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Move PostgreSQL database</title>
		<link>http://raspi.fi/2009/12/05/move-postgresql-database/</link>
		<comments>http://raspi.fi/2009/12/05/move-postgresql-database/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 05:04:58 +0000</pubDate>
		<dc:creator>raspi</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://raspi.fi/?p=68</guid>
		<description><![CDATA[Moving PostgreSQL database to different name is pretty hard compared to MySQL. But here&#8217;s how you do it:

$ pg_dump --no-acl --no-owner -U &#60;username&#62; -h &#60;host&#62; -Fc &#60;database&#62; &#62; &#60;dump filename&#62;
$ pg_restore -1 -c -U &#60;username&#62; -d &#60;database&#62; -h &#60;host&#62; --no-owner &#60;dump filename&#62;


$ pg_dump --no-acl --no-owner -U old -h 127.0.0.1 -Fc olddb &#62; old.dump
$ pg_restore -1 [...]]]></description>
			<content:encoded><![CDATA[<p>Moving PostgreSQL database to different name is pretty hard compared to MySQL. But here&#8217;s how you do it:</p>
<pre class="brush: plain;">
$ pg_dump --no-acl --no-owner -U &lt;username&gt; -h &lt;host&gt; -Fc &lt;database&gt; &gt; &lt;dump filename&gt;
$ pg_restore -1 -c -U &lt;username&gt; -d &lt;database&gt; -h &lt;host&gt; --no-owner &lt;dump filename&gt;
</pre>
<pre class="brush: plain;">
$ pg_dump --no-acl --no-owner -U old -h 127.0.0.1 -Fc olddb &gt; old.dump
$ pg_restore -1 -c -U newuser -d newdb -h postgresql.lan --no-owner old.dump
</pre>
]]></content:encoded>
			<wfw:commentRss>http://raspi.fi/2009/12/05/move-postgresql-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding Windows 7 drivers directly to DVD</title>
		<link>http://raspi.fi/2009/10/31/adding-windows-7-drivers-directly-to-dvd/</link>
		<comments>http://raspi.fi/2009/10/31/adding-windows-7-drivers-directly-to-dvd/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 07:12:56 +0000</pubDate>
		<dc:creator>raspi</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://raspi.fi/?p=61</guid>
		<description><![CDATA[If you&#8217;re familiar with Windows XP Service Pack slipstreaming, this is pretty similar.
I&#8217;m using Windows XP Professional for this.
Make ISO image from your Windows 7 DVD with your favorite software. I used CDBurnerXP.
Save install.wim somewhere on your hard drive from that ISO image or straight from DVD.
Download Windows Automated Installation Kit for your OS.
Start AIK [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re familiar with Windows XP Service Pack slipstreaming, this is pretty similar.</p>
<p>I&#8217;m using Windows XP Professional for this.</p>
<p>Make ISO image from your Windows 7 DVD with your favorite software. I used CDBurnerXP.</p>
<p>Save <strong>install.wim</strong> somewhere on your hard drive from that ISO image or straight from DVD.</p>
<p>Download Windows Automated Installation Kit for your OS.</p>
<p>Start AIK Deployment Tools Command Prompt</p>
<pre class="brush: plain;">
cd &lt;path where you saved that wim file&gt;
</pre>
<p>Mount the WIM image with write permissions:<br />
imagex will tell which number is which Windows edition if it&#8217;s not found. I tried it first with just number 0.<br />
Number 4 is in this case Windows 7 Ultimate Edition 64 bit.</p>
<pre class="brush: plain;">
imagex /mountrw install.wim 4 c:\wim
</pre>
<p>add as many drivers as you like by using DISM<br />
if dism says that files are essential for booting but drivers are unsigned, then add /forceunsigned parameter.</p>
<p>Here&#8217;s example for nvidia nforce drivers (Installer EXE extracted with 7-zip):<br />
SATA/SATARAID/IDE/Ethernet/etc drivers:</p>
<pre class="brush: plain;">
cd c:\dl\15.51_nforce_win7_64bit_whql\ide\win764\
dism /image:c:\wim /add-driver /driver:. /recurse

cd c:\dl\15.51_nforce_win7_64bit_whql\smbus
dism /image:c:\wim /add-driver /driver:. /recurse /forceunsigned

cd c:\dl\15.51_nforce_win7_64bit_whql\smu
dism /image:c:\wim /add-driver /driver:. /recurse

cd c:\dl\15.51_nforce_win7_64bit_whql\ethernet
dism /image:c:\wim /add-driver /driver:. /recurse
</pre>
<p>..and so on for all needed drivers..</p>
<p>You will need to expand unexpanded driver files in some cases. Drivers are not expanded if filenames in driver directory are <strong>foo.dl_</strong> and not <strong>foo.dll</strong> etc.</p>
<p>Here&#8217;s NVidia GeForce driver sample for you (Installer EXE extracted with 7-zip)</p>
<pre class="brush: plain;">
cd c:\dl\191.07_desktop_win7_winvista_64bit_international_whql
mkdir c:\displaydriver
expand *.* c:\displaydriver
</pre>
<p>and then</p>
<pre class="brush: plain;">
cd c:\displaydriver
dism /image:c:\wim /add-driver /driver:. /recurse
</pre>
<p>Save the WIM image with new drivers:</p>
<p>unmount and commit (commit = save)</p>
<pre class="brush: plain;">
imagex /unmount /commit c:\wim
</pre>
<p>Add the <strong>install.wim</strong> back to the ISO image with your favorite ISO handling software. I used UltraISO.<br />
Make sure that the DVD is bootable. Burn ISO as new DVD yet again with favorite burning software (CDBurnerXP).<br />
Boot and enjoy your new Windows 7 with correct and working drivers.</p>
]]></content:encoded>
			<wfw:commentRss>http://raspi.fi/2009/10/31/adding-windows-7-drivers-directly-to-dvd/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>zfComicEngine now at Launchpad</title>
		<link>http://raspi.fi/2009/10/24/zfcomicengine-now-at-launchpad/</link>
		<comments>http://raspi.fi/2009/10/24/zfcomicengine-now-at-launchpad/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 16:16:24 +0000</pubDate>
		<dc:creator>raspi</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[zfComicEngine]]></category>

		<guid isPermaLink="false">http://raspi.fi/?p=59</guid>
		<description><![CDATA[I&#8217;ve added zfComicEngine to launchpad. It should be easy now to add new translations. Here&#8217;s the link: https://launchpad.net/zfcomicengine.
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve added zfComicEngine to launchpad. It should be easy now to add new translations. Here&#8217;s the link: <a href="https://launchpad.net/zfcomicengine">https://launchpad.net/zfcomicengine</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://raspi.fi/2009/10/24/zfcomicengine-now-at-launchpad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building OpenVPN for gaming</title>
		<link>http://raspi.fi/2009/10/13/building-bridged-openvpn-for-gaming/</link>
		<comments>http://raspi.fi/2009/10/13/building-bridged-openvpn-for-gaming/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 17:38:09 +0000</pubDate>
		<dc:creator>raspi</dc:creator>
				<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://raspi.fi/?p=47</guid>
		<description><![CDATA[This is OpenVPN setup for gaming where VPN&#8217;s own internal network is not connected to physical LAN. It&#8217;s star shaped and OpenVPN server is running on high bandwidth connection on virtual machine or dedicated server in some ISP&#8217;s server room so that the latency is minimal to all connected gamers (ie. guy which has most [...]]]></description>
			<content:encoded><![CDATA[<p>This is <a href="http://www.openvpn.net/">OpenVPN</a> setup for gaming where <a href="http://en.wikipedia.org/wiki/Virtual_private_network">VPN</a>&#8217;s own internal network is not connected to physical <a href="http://en.wikipedia.org/wiki/Local_area_network">LAN</a>. It&#8217;s star shaped and OpenVPN server is running on high bandwidth connection on virtual machine or dedicated server in some ISP&#8217;s server room so that the latency is minimal to all connected gamers (ie. guy which has most upload bandwidth should do this). Every player and game server hoster connects to this server and OpenVPN handles rest of networking stuff. It&#8217;s also <a href="http://en.wikipedia.org/wiki/Data_Link_Layer">layer 2</a> (TAP) so that everyone sees mac addresses and <a href="http://en.wikipedia.org/wiki/User_Datagram_Protocol">UDP</a> <a href="http://en.wikipedia.org/wiki/Broadcast_address">broadcasts</a> work ok etc.</p>
<h2>Install OpenVPN</h2>
<pre>aptitude install openvpn</pre>
<h2>Setting up OpenVPN server</h2>
<p>/etc/openvpn/server.conf:</p>
<pre class="brush: plain;">
mode server
tls-server
port 1194
proto udp
dev tap
client-to-client
ca /etc/openvpn/easy-rsa/keys/ca.crt
cert /etc/openvpn/easy-rsa/keys/servername.crt
key /etc/openvpn/easy-rsa/keys/servername.key
dh /etc/openvpn/easy-rsa/keys/dh384.pem
ifconfig-pool-persist ipp.txt
server-bridge 10.10.10.1 255.255.255.0 10.10.10.128 10.10.10.250
push .route 10.10.10.1 255.255.255.0
keepalive 5 60
comp-lzo
persist-key
persist-tun
status /var/log/openvpn-status.log
log-append /var/log/openvpn.log
verb 3
user nobody
group nogroup
#this allows more than one connection at a time from same key
#good if you just want to give one &quot;gaming&quot; certificate to everybody
#duplicate-cn
</pre>
<pre>mkdir /etc/openvpn/easy-rsa
cp /usr/share/doc/openvpn/examples/easy-rsa/2.0/* /etc/openvpn/easy-rsa
cd /etc/openvpn/easy-rsa</pre>
<p>Modify &#8220;<em>vars</em>&#8221; file with your favorite editor</p>
<p>Change <em>export KEY_SIZE=1024</em> to <em>export KEY_SIZE=384</em>. We don&#8217;t need much encryption for gaming.</p>
<p>Modify <em>export KEY_COUNTRY, KEY_PROVINCE, KEY_CITY, KEY_ORG</em> and <em>KEY_EMAIL</em> to your liking.</p>
<p>Save the file.</p>
<pre>source ./vars
./clean-all
./build-ca
./build-key-server servername
./build-dh
</pre>
<p>Use</p>
<pre>/etc/init.d/openvpn restart
/etc/init.d/openvpn start
/etc/init.d/openvpn stop
</pre>
<p>To start/stop/restart the OpenVPN server.</p>
<h2>Adding clients</h2>
<p>Replace <em>clientX</em> with actual username wanted.</p>
<pre>cd /etc/openvpn/easy-rsa
source ./vars
./build-key-pkcs12 clientX</pre>
<p>copy clientX.p12 file from &#8220;<em>keys</em>&#8221; directory to some directory</p>
<p>create following clientX.ovpn file:</p>
<pre class="brush: plain;">
client
dev tap
proto udp
#replace this with your OpenVPN server hostname/IP
remote 192.168.0.123 1194
resolv-retry infinite
nobind
ns-cert-type server
comp-lzo
verb 3
pull
# Replace this with your own .p12 certificate file
pkcs12 clientX.p12
</pre>
<p>Send the certificate (.p12) and .ovpn file to your buddy.</p>
<h2>Windows client configurations / troubleshooting</h2>
<p>We used <a href="http://openvpn.se/">OpenVPN GUI</a> as Windows client. Download the .ovpn and .p12 file to <em>C:\Program Files\OpenVPN\config</em> directory. Click connect on OpenVPN GUI&#8217;s taskbar icon and you should be connected.</p>
<p>To minimize problems set the OpenVPN TAP Adapter as first interface from network configuration. This required reboot for me so that Windows XP acknowledged it. Remove unnecessary stuff from TAP interface (like QoS).</p>
<p><a href="http://www.wireshark.org/">WireShark</a> is your friend. Use it to find out if games are shouting their packets to wrong network and not to VPN IP network. 99.9% of LAN games use UDP broadcast to tell about themselves so use &#8220;<em>udp</em>&#8221; as filter. <strong> </strong></p>
<p><strong>Ping</strong> and <strong>arp -a</strong> is also good for basic connectivity testing. Some firewalls block ping (ICMP) so be aware of that too. Other good tool is <strong>netstat</strong> and <a href="http://technet.microsoft.com/en-us/sysinternals/bb897437.aspx">TCPView</a> for looking in which port the game is running.</p>
<p>If you&#8217;re running some old games through virtual machine then set the virtual machine&#8217;s network adapter to OpenVPN&#8217;s TAP Adapter. IPX packets <em>should</em> go through too because TAP is layer 2 (but I didn&#8217;t test).</p>
<p>I also found this <a href="http://www.r1ch.net/stuff/forcebindip/">ForceBindIP</a> application which will force specified application to certain network card or network card IP. Might come in handy if game is constantly picking up wrong NIC or IP network.</p>
<h2>Sources</h2>
<ul>
<li><a href="http://www.openvpn.net/index.php/open-source/documentation/miscellaneous/76-ethernet-bridging.html">OpenVPN bridging page</a></li>
<li><a title="Permanent Link: Setting up OpenVPN in debian/ubuntu" rel="bookmark" href="http://www.monkeedev.co.uk/blog/2009/03/06/setting-up-openvpn-in-debianubuntu/">Setting up OpenVPN in debian/ubuntu</a></li>
<li><a href="http://www.thebakershome.net/openvpn_tutorial?page=1">How to Install Openvpn</a></li>
<li><a rel="bookmark" href="http://judebert.com/progress/permalink/GameVPN.html">Setting Up A Gaming LAN with OpenVPN</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://raspi.fi/2009/10/13/building-bridged-openvpn-for-gaming/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Minimal feedback form with ZF</title>
		<link>http://raspi.fi/2009/10/04/minimal-feedback-form-with-zf/</link>
		<comments>http://raspi.fi/2009/10/04/minimal-feedback-form-with-zf/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 23:01:00 +0000</pubDate>
		<dc:creator>raspi</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://raspi.fi/?p=40</guid>
		<description><![CDATA[Here&#8217;s minimal feedback form example using Zend Framework 1.9.2 without  MVC.

&#60;?php
ignore_user_abort(true);
header(&#34;Content-Type: text/html; charset=utf-8&#34;)

error_reporting(E_ALL);
ini_set('display_errors', '1');

ini_set('magic_quotes_gpc', false);
ini_set('magic_quotes_runtime', false);

ini_set('default_charset', 'UTF-8');

ini_set('iconv.input_encoding', 'UTF-8');
ini_set('iconv.output_encoding', 'UTF-8');
ini_set('iconv.internal_encoding', 'UTF-8');

function stripinputslashes(&#38;$input)
{
  if (is_array($input))
  {
    foreach ($input as $key =&#62; $value)
    {
      switch (gettype($value))
      {
   [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s minimal feedback form example using Zend Framework 1.9.2 without  MVC.</p>
<pre class="brush: php;">
&lt;?php
ignore_user_abort(true);
header(&quot;Content-Type: text/html; charset=utf-8&quot;)

error_reporting(E_ALL);
ini_set('display_errors', '1');

ini_set('magic_quotes_gpc', false);
ini_set('magic_quotes_runtime', false);

ini_set('default_charset', 'UTF-8');

ini_set('iconv.input_encoding', 'UTF-8');
ini_set('iconv.output_encoding', 'UTF-8');
ini_set('iconv.internal_encoding', 'UTF-8');

function stripinputslashes(&amp;$input)
{
  if (is_array($input))
  {
    foreach ($input as $key =&gt; $value)
    {
      switch (gettype($value))
      {
        default: break;
        case 'string':
          $input[$key] = stripinputslashes($value);
        break;
      } // /switch
    } // /foreach
  } // /if
  else
  {
    switch (gettype($input))
    {
      default: break;
      case 'string':
        $input = stripslashes($input);
      break;
    } // /switch
  } // /else

  return true;
} // /function

if (version_compare(phpversion(), 6) === -1)
{
  if (function_exists(&quot;get_magic_quotes_gpc&quot;) &amp;&amp; get_magic_quotes_gpc() === 1)
  {
    array_walk_recursive($_GET, 'stripinputslashes');
    array_walk_recursive($_REQUEST, 'stripinputslashes');

    if (isset($_POST))
    {
      array_walk_recursive($_POST, 'stripinputslashes');
    } // /if

  } // /if
} // /if

// Add library path
set_include_path(implode(PATH_SEPARATOR, array(
  realpath(dirname(__FILE__) . '/../library'),
  get_include_path(),
)));

// Enable autoloader
require_once 'Zend/Loader/Autoloader.php';
Zend_Loader_Autoloader::getInstance();

$view = new Zend_View();

$form = new Zend_Form();
$form-&gt;setView($view);
$form-&gt;setMethod(Zend_Form::METHOD_POST);
$form-&gt;setAction('/');

$submit = new Zend_Form_Element_Submit('submit');
$submit-&gt;setLabel('OK');

$email = new Zend_Form_Element_Text('email');
$email-&gt;setRequired(true);
$email-&gt;setLabel('E-mail');
$email-&gt;addFilter('StringTrim');
$email-&gt;addFilter('StringToLower');
$email-&gt;addValidator('StringLength', false, array(7));
$email-&gt;addValidator(new Zend_Validate_EmailAddress(Zend_Validate_Hostname::ALLOW_DNS, true));

$txt = new Zend_Form_Element_Textarea('text');
$txt-&gt;setRequired(true);
$txt-&gt;addFilter('StringTrim');
$txt-&gt;addValidator('StringLength', false, array(3));

// Add fields to form
$form-&gt;addElement($email);
$form-&gt;addElement($txt);
$form-&gt;addElement($submit);

if (isset($_POST) &amp;&amp; !empty($_POST))
{
  if ($form-&gt;isValid($_POST))
  {
    $values = $form-&gt;getValues();

    $m = new Zend_Mail('UTF-8');
    $m-&gt;setBodyText($values['text']);
    $m-&gt;setFrom($values['email']);
    $m-&gt;addTo('feedback@example.com');
    $m-&gt;setSubject('Feedback');
    $m-&gt;send();

    header(&quot;Location: /ok.php&quot;);
  }

}

// Output form to page
echo $form;
</pre>
<p>Page contains e-mail and free text field. E-mail address is checked against DNS. Form contents are send to feedback@example.com and given e-mail address is the sender. stripinputslashes kills all  stupid slashes from _POST data.</p>
<p>Directory structure:</p>
<pre>/home/foo/public_html/index.php (feedback form)
/home/foo/public_html/ok.php
/home/foo/library/Zend/ (ZF files)
</pre>
<p>ok.php contains something like &#8220;Thank you for giving feedback.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://raspi.fi/2009/10/04/minimal-feedback-form-with-zf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gozerbot and What is this file?</title>
		<link>http://raspi.fi/2009/10/02/gozerbot-and-what-is-this-file/</link>
		<comments>http://raspi.fi/2009/10/02/gozerbot-and-what-is-this-file/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 18:06:42 +0000</pubDate>
		<dc:creator>raspi</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[What is this file?]]></category>

		<guid isPermaLink="false">http://raspi.fi/?p=38</guid>
		<description><![CDATA[It&#8217;s been many years since I played with IRC bots. I&#8217;ve used eggdrop for something like 10+ years. Now I tried Gozerbot and coded plugin (source) to it which gets URLs from chat and then gives some information about them. It utilizes my other project &#8211; &#8220;what is this file?&#8221; which runs on top of [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been many years since I played with <a href="http://en.wikipedia.org/wiki/Internet_Relay_Chat">IRC</a> bots. I&#8217;ve used <a href="http://www.eggheads.org/">eggdrop</a> for something like 10+ years. Now I tried <a href="http://gozerbot.org/">Gozerbot</a> and coded plugin (<a href="http://dev.gozerbot.org/trac/attachment/ticket/138/urlinfo.py">source</a>) to it which gets URLs from chat and then gives some information about them. It utilizes my other project &#8211; &#8220;<a href="http://whatisthisfile.appspot.com/">what is this file?</a>&#8221; which runs on top of <a href="http://code.google.com/appengine/">Google App Engine</a>. Everything is using <a href="http://python.org">Python</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://raspi.fi/2009/10/02/gozerbot-and-what-is-this-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
