<?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>editor | Nerdpress.org</title>
	<atom:link href="https://nerdpress.org/tag/editor/feed/" rel="self" type="application/rss+xml" />
	<link>https://nerdpress.org</link>
	<description>...dev, tech problems and solutions.</description>
	<lastBuildDate>Fri, 13 Jan 2012 17:01:28 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>vim2html</title>
		<link>https://nerdpress.org/2010/02/09/vim2html/</link>
					<comments>https://nerdpress.org/2010/02/09/vim2html/#comments</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 09 Feb 2010 12:32:02 +0000</pubDate>
				<category><![CDATA[IDE]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[css code]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[font tags]]></category>
		<category><![CDATA[Highlighting]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[syntax]]></category>
		<category><![CDATA[tags]]></category>
		<category><![CDATA[vim]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=803</guid>

					<description><![CDATA[<p>Meinen Lieblingseditor vim brauche ich an dieser Stelle ja nicht en detail vorzustellen. Ein Feature allerdings, über das ich erst nach jahrelanger Nutzung gestolpert bin, passt sehr gut ins nerdpress: 2html. Was dieses Kommando macht? Na, HTML-Code aus dem Inhalt des aktuellen Puffers as is erzeugen &#8211; optional mit Zeilennummern und CSS-Code. Und so geht &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2010/02/09/vim2html/" class="more-link">Continue reading<span class="screen-reader-text"> "vim2html"</span></a></p>
The post <a href="https://nerdpress.org/2010/02/09/vim2html/">vim2html</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>Meinen Lieblingseditor <a title="vim.org" href="http://www.vim.org/" target="_self">vim</a> brauche ich an dieser Stelle ja nicht en detail vorzustellen.</p>
<p>Ein Feature allerdings, über das ich erst nach jahrelanger Nutzung <a title="Bens IT-Kommentare: Dateien aus VIM mit Syntaxhighlighting exportieren" href="http://blog.bmarwell.de/2010/01/23/dateien-aus-vim-mit-syntaxhighlighting-exportieren/">gestolpert bin</a>, passt sehr gut ins <em>nerdpress</em>: 2html.</p>
<p>Was dieses Kommando macht?</p>
<p>Na, HTML-Code aus dem Inhalt des aktuellen Puffers <em>as is</em> erzeugen &#8211; optional mit Zeilennummern und CSS-Code.</p>
<p>Und so geht das:<span id="more-803"></span></p>
<ul>
<li>Syntaxhighlighting einschalten<em><br />
</em></p>
<pre><em>:syntax on</em></pre>
</li>
<li>den Code erzeugen<em><br />
</em></p>
<pre><em>:runtime! syntax/2html.vim  </em>[oder <em><code>:TOhtml</code></em><code>]</code></pre>
</li>
<li>vim springt direkt in das neue split-Fenster, dort sollte man den Code direkt speichern
<pre><em>:w</em></pre>
</li>
</ul>
<p>fertig.</p>
<p>Falls man die Zeilennummern drin haben möchte, hilft vor der HTML-Erzeugung folgendes Kommando <em><br />
</em></p>
<pre><em>:let html_number_lines = 1</em></pre>
<p>Und<em> </em>wenn es CSS sein soll, statt der älteren Font-Tags, geht auch das<em><br />
</em></p>
<pre><em>:let html_use_css = 1</em></pre>
<p>Einfacher geht es kaum&#8230; oder?</p>The post <a href="https://nerdpress.org/2010/02/09/vim2html/">vim2html</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
					<wfw:commentRss>https://nerdpress.org/2010/02/09/vim2html/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Symfony flying with Lighttpd on Mac OS X 10.6</title>
		<link>https://nerdpress.org/2009/09/27/symfony-flying-with-lighttpd-on-mac-os-x-10-6/</link>
					<comments>https://nerdpress.org/2009/09/27/symfony-flying-with-lighttpd-on-mac-os-x-10-6/#comments</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sun, 27 Sep 2009 14:26:01 +0000</pubDate>
				<category><![CDATA[Admin]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Webserver]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=300</guid>

					<description><![CDATA[<p>This guide aims to Mac OS X 10.6 users who intend to run their Symfony 1.2 projects on Lighttpd with PHP 5.3 and MySQL5. Steps described in this article refer to a development machine setup and do not consider any security related configurations necessary for a production setup. Why? Why would I want to use &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2009/09/27/symfony-flying-with-lighttpd-on-mac-os-x-10-6/" class="more-link">Continue reading<span class="screen-reader-text"> "Symfony flying with Lighttpd on Mac OS X 10.6"</span></a></p>
The post <a href="https://nerdpress.org/2009/09/27/symfony-flying-with-lighttpd-on-mac-os-x-10-6/">Symfony flying with Lighttpd on Mac OS X 10.6</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>This guide aims to Mac OS X 10.6 users who intend to run their Symfony 1.2 projects on Lighttpd with PHP 5.3 and MySQL5. Steps described in this article refer to a development machine setup and do not consider any security related configurations necessary for a production setup.</p>
<h2>Why?</h2>
<p>Why would I want to use Symfony with Lighttpd (Lighty) instead of Apache?</p>
<ol>
<li> It is light &#8211; as the name tells already.<br />
<h2><span id="more-300"></span></h2>
</li>
<li> It is fast &#8211; believe it or not. Mark Round has an<a href="http://www.markround.com/archives/30-LigHTTPd-and-Apache-Symfony-benchmarks.html"> interesting benchmark </a>on the actual performance differences here:</li>
</ol>
<h2>Who?</h2>
<p>This guide assumes that you have basic knowledge of the bash, Web Server configuration, *NIX Filesystem Permissions, MySQL, PHP, who sudo is, etc.<br />
If more than one of the above does not apply to you, stop here.</p>
<h1>Preparation</h1>
<h2>Backup</h2>
<p>Of course your system is fully backed up and you are in the position to take full responsibility for the following steps.<br />
Ideally you had less than 2 beers &#8211; etc.</p>
<h2>Time</h2>
<p>Depending on your machine this procedure takes something between 2-3 hours.<br />
It is not only the configuration that takes time &#8211; but as we will be using the MacPorts System to get the software necessary,<br />
compile time is a major factor for this.</p>
<h2>Tools</h2>
<p>A Mac with OS X 10.6.1 based computer<br />
(It might apply to other OS X Versions which I have not tested so far.)</p>
<p>A working &#8211; ideally fast Internet connection</p>
<h3>Your favorite Editor</h3>
<p>I will be using <a href="http://macromates.com/" target="_blank">TextMate</a> &#8220;mate&#8221; in the following.<br />
I recommend it to everyone who&#8217;s old love is about to, or if you are honest to yourself &#8211; has already expired.<br />
While we talk about it, there is a TextMate bundle for lighttpd which can be obtained here (<a href="http://svn.textmate.org/trunk/Bundles/">http://svn.textmate.org/trunk/Bundles/</a>)<br />
(Yes, he&#8217;s a fanboy)<br />
In case you prefer VIM, EMACS or whatever editor you shall be easily able to replace all the mate commands with that.</p>
<h3>Apple Developer Tools</h3>
<p>The current Apple XCode Developer Tools installed (Version 3.2 at the time of writing).<br />
You can obtain them here: <a href="http://developer.apple.com/">http://developer.apple.com/<br />
</a></p>
<h3>A snack &amp; cup of coffee or tee</h3>
<h1>Assumptions</h1>
<p>You have clean OS X 10.6 installation with no Web Server active.<br />
To ensure this please go to System Preferences -&gt; Sharing on your Mac and make sure that Web Sharing is NOT ticked.<br />
<span style="text-decoration: underline;">(This appears to be <strong>enabled</strong> by default on a fresh 10.6 Installation!)</span></p>
<p>You are NOT running your shell as a super user. If you ARE running the shell as a super user &#8211; even better!<br />
You will save yourself loads of <em>sudo</em> statements at the beginning of each line in the following.</p>
<h1>Setting the Foundation</h1>
<p>As said we will be using MacPorts to get the required software.<br />
The one or the other might be raising there hand saying that not all packages we will be using are at latest<br />
in the MacPorts tree. Yes, you are right. Still it makes life simple &#8211; so I will stick to it.<br />
What versions are we dealing with? @16th of September 2009</p>
<ul>
<li> MacPorts 1.8.0</li>
<li> Lighttpd 1.4.2.2</li>
<li> PHP 5.3</li>
<li> MySQL 5.0.85</li>
<li> Symfony 1.2.8</li>
</ul>
<p>Open you favorite Web Browser and grab lets grab the latest version of MacPorts from http://www.macports.org/<br />
Follow the instructions on screen in order to complete the MacPorts installation.</p>
<h1>Installing MySQL</h1>
<p>Bring up the Terminal and make sure that your macports installation is up-to-date:</p>
<pre class="brush: bash; title: ; notranslate">sudo port selfupgrade</pre>
<p>Grab MySQL from ports</p>
<pre class="brush: bash; title: ; notranslate">sudo port install mysql5-server</pre>
<p>Configure MySQL and tell it to use the mysql user.</p>
<pre class="brush: bash; title: ; notranslate">sudo mysql_install_db5 -u mysql</pre>
<p>Start mysql for the first time:</p>
<pre>sudo /opt/local/lib/mysql5/bin/mysqld_safe &amp;</pre>
<p>Do a little basic security for your MySQL install:</p>
<p>sudo /opt/local/lib/mysql5/bin/mysql_secure_installation</p>
<p>Add MySQL to the OS X autostart.</p>
<pre class="brush: bash; title: ; notranslate">sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist</pre>
<h2>Installing Lighttpd</h2>
<pre class="brush: bash; title: ; notranslate">sudo port install lighttpd</pre>
<p>lets copy the default configuration, as it fits our needs with regard to amendments we need to make later on:</p>
<pre class="brush: bash; title: ; notranslate">sudo /opt/local/etc/lighttpd/lighttpd.conf.default /opt/local/etc/lighttpd/lighttpd.conf</pre>
<p>Lighty will require a few files to be accessible. The default configuration file tells Lighty to use www user and group.<br />
(Those are the default OS X Web Server Accounts &#8211; you do not need to create those.)</p>
<p>Let&#8217;s make sure that this is the case.</p>
<p><strong>Logfile Settings</strong></p>
<pre class="brush: bash; title: ; notranslate">
sudo mkdir /opt/local/var/log/lighttpd/
sudo touch /opt/local/var/log/lighttpd/access.log
sudo touch /opt/local/var/log/lighttpd/error.log
sudo chmod 755 /opt/local/var/log/lighttpd/*.log
sudo chown -R www:www /opt/local/var/log/lighttpd/
</pre>
<p><strong>Process Stuff</strong></p>
<pre class="brush: bash; title: ; notranslate">
sudo mkdir /opt/local/var/run/lighttpd/
sudo touch /opt/local/var/run/lighttpd.pid
sudo chown www:www /opt/local/var/run/lighttpd.pid
sudo chown -R www:www /opt/local/var/run/lighttpd/
</pre>
<p>Let&#8217;s place a dummy index page into the document root:<br />
sudo mate /opt/local/www/htdocs/index.html</p>
<p>&#8230;and put something like this into it:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;html&gt;
&lt;body&gt;
this is lighty on os x
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>The default document root of your is something we want to have accessible to Lighty:</p>
<pre class="brush: bash; title: ; notranslate">sudo chown -R www:www /opt/local/www/htdocs/</pre>
<p>Check if Lighty is working:</p>
<pre class="brush: bash; title: ; notranslate">sudo /opt/local/etc/LaunchDaemons/org.macports.lighttpd/lighttpd.wrapper start</pre>
<p>(You might want to define an alias in your ~/.profile so you do not need to type the whole path all the time.)</p>
<p>It starts! Good. Send your Web Browser to localhost, you should see our dummy page.<br />
It does not? That is the point in time where you might want to have look into the error logfile:</p>
<pre class="brush: bash; title: ; notranslate">tail -f /opt/local/var/log/lighttpd/error.log</pre>
<p>Afterwards ensure to add Lighty to the autostart with this command:</p>
<pre class="brush: bash; title: ; notranslate">sudo launchtl load -w /Library/LaunchDaemons/org.macports.lighttpd.plist</pre>
<h1>Installing PHP</h1>
<p>Lighty does not have &#8220;native&#8221; PHP support. It has something even better,<br />
it supports FastCGI http://www.fastcgi.com/ which lets you do a lot of great things &#8211; which I tend to explain. (3.2.1. NOT!)</p>
<p>So let&#8217;s tell MacPorts to grab PHP5 for us.<br />
(You might want to add additional PHP5 packages here. For details please refer to the MacPorts directory http://www.macports.org/ports.php)</p>
<p> sudo port install php5 +fastcgi +php5-mysql +php5-xsl +pear +php5-gd +php5-mbstring</p>
<p>This is the point where you would go for your snack&#8230; zzZZzzZz</p>
<p>So everything munged and your shell prompt is expecting you to throw crazy commands at it?<br />
Great!</p>
<p>Let&#8217;s get hold of a php.ini first</p>
<pre class="brush: bash; title: ; notranslate"> sudo cp /opt/local/etc/php5/php.ini-development /opt/local/etc/php5/php.ini</pre>
<p>Make sure to define the timezone to prevent annoying messages later on:<br />
Somewhere around line 995, there is a lonely</p>
<pre class="brush: php; title: ; notranslate">;date.timezone = </pre>
<p>Turn it into something like this. (according to your local timezone, of course)</p>
<pre class="brush: php; title: ; notranslate">date.timezone = Europe/Berlin </pre>
<p>Also have look into line 846 and uncomment the following parameter:</p>
<pre class="brush: bash; title: ; notranslate">cgi.fix_pathinfo=1</pre>
<p>(Knowing this is the default setting &#8211; I want you to be able to say yes in case someone asks&#8230;)</p>
<h2>Configuring Lighty for PHP</h2>
<p>At this point we should take some time to go through our lighttpd.conf.</p>
<p>Enable FastCGI by uncommenting the following line below server.modules by removing the #</p>
<pre class="brush: bash; title: ; notranslate">        &quot;mod_fascgi&quot;, </pre>
<p>Next thing is to make Lighty aware of these .php files.<br />
Scroll down to something around 230. There is a big block commented out. Modify it, so it looks like this one:</p>
<p>fastcgi.server             = ( &#8220;.php&#8221; =><br />
( &#8220;localhost&#8221; =><br />
(<br />
&#8220;socket&#8221; => &#8220;/opt/local/var/run/lighttpd/php-fastcgi.socket&#8221;,<br />
&#8220;bin-path&#8221; => &#8220;/opt/local/bin/php-cgi&#8221;<br />
)<br />
)<br />
)</p>
<p>Tell Lighty to restart:</p>
<pre class="brush: bash; title: ; notranslate">sudo /opt/local/etc/LaunchDaemons/org.macports.lighttpd/lighttpd.wrapper restart</pre>
<p>No error messages on the shell? Good &#8211; time to proceed.<br />
Let&#8217;s see if Lighty is able to run some PHP.</p>
<pre class="brush: bash; title: ; notranslate">sudo mate /opt/local/www/htdocs/info.php</pre>
<pre class="brush: php; title: ; notranslate">
&lt;?php
phpinfo()
?&gt;
</pre>
<p>Point your Web Browser to <a title="http://localhost/info.php" href="http://localhost/info.php" target="_self">http://localhost/info.php</a><br />
You should see the PHP Info page.</p>
<h1>Symfony specifics</h1>
<p>There are a few things we need to take into consideration now&#8230;</p>
<h3>Rewriting &amp; Virtual Hosts</h3>
<p>As Symfony makes use of Apache&#8217;s mod_rewrite &#8211; we need to use the Lighttpd equivalent.<br />
I did not find something like the &#8220;definitiv guide&#8221; &#8211; which btw was the reason to document my procedure.<br />
Much more you can find a few different snippets within the first 3 results when you googling.<br />
Also I am confident that the Virtual Server question mark might has passed you head already?!</p>
<p>So let&#8217;s have another hand on our Lighty config and enable some more modules.</p>
<pre class="brush: bash; title: ; notranslate">sudo mate /opt/local/etc/lighttpd.conf</pre>
<p>server.modules              = (<br />
&#8220;mod_rewrite&#8221;,<br />
&#8220;mod_alias&#8221;,</p>
<p>#define a new host which is reachable at the symfony.localhost domain</p>
<p>$HTTP [&#8220;host&#8221;] == &#8220;symfony.localhost&#8221; {</p>
<p>#point this domain to the symfony web directory<br />
server.document-root = &#8220;/opt/local/www/htdocs/sftest/web/&#8221;</p>
<p>#define the sf folder alias &#8211; as I pull Symfony from pear it is here:<br />
alias.url = (<br />
&#8220;/sf/&#8221; => &#8220;/opt/local/lib/php/data/symfony/web/sf/&#8221;<br />
)</p>
<p>#rewrite rules for symfony<br />
url.rewrite-once = (<br />
&#8220;^/([a-z_]).php(/[^?]+)?(?.*)?&#8221; => &#8220;/$1.php$2$3&#8221;,<br />
&#8220;^/(.*..+(?!html))$&#8221; => &#8220;$0&#8221;,<br />
&#8220;^/(.*).(.*)&#8221;        => &#8220;$0&#8221;,<br />
&#8220;^/([^.]+)$&#8221;          => &#8220;/index.php/$1&#8221;,<br />
&#8220;^/$&#8221;        => &#8220;/index.php&#8221;<br />
)</p>
<p>}</p>
<p>Tell Lighty to restart:</p>
<pre class="brush: bash; title: ; notranslate">sudo /opt/local/etc/LaunchDaemons/org.macports.lighttpd/lighttpd.wrapper restart</pre>
<h1></h1>
<h1>Project Setup</h1>
<h2>Which Symfony?</h2>
<p>Depending on your development practice you would pull Symfony out of your software configuration management (e.g. subversion)<br />
In this example I will pull Symfony through PEAR (http://pear.php.net/)</p>
<p>Pull Symfony through PEAR</p>
<pre class="brush: bash; title: ; notranslate">
sudo pear channel-discover pear.symfony-project.com
sudo pear install symfony/symfony-1.2.8</pre>
<p>Note: At the time of writing  &#8211; the latest stable version of Symfony is 1.2.8.</p>
<p>For some reason symfony/symfony still points to 1.0.2.1 &#8211; so please adapt as necessary.<br />
Question to the readers: Do I need to pull Phing separately?</p>
<p>Hostfile configuration<br />
remember to add the virtual server in your hosts file</p>
<pre class="brush: bash; title: ; notranslate">sudo mate /etc/hosts</pre>
<pre class="brush: bash; title: ; notranslate">
127.0.0.1    localhost
127.0.0.1    symfony.localhost    symfony
</pre>
<p>Ready for some Error Messages?</p>
<p>Basically we are done and you should now be able to generate your symfony project an obtain some error messages as you have not configured your database so far. Once you managed that &#8211; point your browser to symfony.localhost</p>The post <a href="https://nerdpress.org/2009/09/27/symfony-flying-with-lighttpd-on-mac-os-x-10-6/">Symfony flying with Lighttpd on Mac OS X 10.6</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
					<wfw:commentRss>https://nerdpress.org/2009/09/27/symfony-flying-with-lighttpd-on-mac-os-x-10-6/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>vim scp://user@server//path/to/the/file   [EOP]</title>
		<link>https://nerdpress.org/2009/09/11/vim-scpuserserverpathtothefile-eop/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Fri, 11 Sep 2009 20:53:31 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[remote]]></category>
		<category><![CDATA[vim]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=238</guid>

					<description><![CDATA[<p>Remote vim. Remote Mate? Haaallooooo?? ;-)</p>
The post <a href="https://nerdpress.org/2009/09/11/vim-scpuserserverpathtothefile-eop/">vim scp://user@server//path/to/the/file   [EOP]</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>Remote vim.</p>
<p>Remote Mate? Haaallooooo?? ;-)</p>The post <a href="https://nerdpress.org/2009/09/11/vim-scpuserserverpathtothefile-eop/">vim scp://user@server//path/to/the/file   [EOP]</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
