<?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>SuperWebDeveloper.com &#187; php</title>
	<atom:link href="http://www.superwebdeveloper.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.superwebdeveloper.com</link>
	<description>code, design, concepts, ecommerce, media</description>
	<lastBuildDate>Tue, 03 May 2011 04:41:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Takien.com Imitating php.net</title>
		<link>http://www.superwebdeveloper.com/2010/09/28/takien-com-imitating-php-net/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://www.superwebdeveloper.com/2010/09/28/takien-com-imitating-php-net/#comments</comments>
		<pubDate>Tue, 28 Sep 2010 17:32:33 +0000</pubDate>
		<dc:creator>pbg</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.superwebdeveloper.com/?p=567</guid>
		<description><![CDATA[Somebody is spoofing php.net. Its never cool to see one website rip off another. Here is an example of blatant use of the look of PHP.net, the core information site for PHP programmers on the web, being taken over by a site that came up on a goggle search for a reminder on a deprecated [...]]]></description>
			<content:encoded><![CDATA[<p>Somebody is spoofing php.net. Its never cool to see one website rip off another. Here is an example of blatant use of the look of PHP.net, the core information site for PHP programmers on the web, being taken over by a site that came up on a goggle search for a reminder on a deprecated function. I am not the greenest guy out there. I have even sat in on <a title="Chris Shifflett" href="http://shiflett.org/" target="_blank">Chris Shiflett&#8217;s</a> talk on Web security issues from social engineering at CodeWorks DC in 2009. But even I was fooled that this site was php.net for several minutes.</p>
<h2 style="text-align: center;">This is not PHP.net, this is <a title="takien.com" href="http://takien.com/" target="_blank">http://takien.com/</a></h2>
<p style="text-align: center;">
<div id="attachment_569" class="wp-caption aligncenter" style="width: 509px"><a href="http://takien.com/"><img class="size-full wp-image-569   " title="http://takien.com/" src="http://www.superwebdeveloper.com/wp-content/uploads/takienwebsite.jpg" alt="http://takien.com/" width="499" height="322" /></a><p class="wp-caption-text">takien.com is NOT php.net</p></div>
<h2 style="text-align: center;">This is not Takien.com, this is <a title="php.net" href="http://php.net" target="_blank">PHP.net</a></h2>
<p style="text-align: center;">
<div id="attachment_568" class="wp-caption aligncenter" style="width: 447px"><a href="http://php.net"><img class="size-full wp-image-568   " title="php.net website" src="http://www.superwebdeveloper.com/wp-content/uploads/phpweb.jpg" alt="php.net website" width="437" height="282" /></a><p class="wp-caption-text">This is not taiken.com, this is php.net</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.superwebdeveloper.com/2010/09/28/takien-com-imitating-php-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Coders Still Stuck in Windows, Register forgets The Growth of Linux Desktop</title>
		<link>http://www.superwebdeveloper.com/2010/02/16/php-coders-still-stuck-in-windows-register-forgets-the-growth-of-linux-desktop/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://www.superwebdeveloper.com/2010/02/16/php-coders-still-stuck-in-windows-register-forgets-the-growth-of-linux-desktop/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 07:35:45 +0000</pubDate>
		<dc:creator>pbg</dc:creator>
				<category><![CDATA[GNU Linux]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://www.superwebdeveloper.com/?p=367</guid>
		<description><![CDATA[The Register reports that PHP developers are still stuck on Windows Desktop. The Register quoted a survey conducted by Zend Technologies, that found on the desktop, the numbers breakdown thus: Windows: 42% Linux: 38.5% Mac OS X: 19.1% Everybody else: 0.4% The Register is only telling half the story. 38.5% on Linux is a fantastic [...]]]></description>
			<content:encoded><![CDATA[<p><a title="the register" href="http://www.theregister.co.uk/2010/02/17/php_windows_linux/" target="_blank">The Register reports that PHP developers are still stuck on Windows Desktop</a>. The Register quoted a survey conducted by <a title="zend" href="http://www.zend.com/" target="_blank">Zend Technologies</a>, that found on the desktop, the numbers breakdown thus:</p>
<ul>
<li>Windows: 42%</li>
<li>Linux: 38.5%</li>
<li>Mac OS X: 19.1%</li>
<li>Everybody else: 0.4%</li>
</ul>
<p>The Register is only telling half the story. 38.5% on Linux is a fantastic percentage. I for one am a happy Ubuntu &amp; Gnome desktop user and I haven&#8217;t depended on Windows desktop for at least 6 years. Its a shame though that so many employers and technical people still use Windows desktop when Linux Desktop has everything you need, its free, and its not crap either. Funny that the circling vultures at The Register would focus so much on how PHP coders are still on Windows, and fail to point out that as a group they are agressive adopters of Linux Desktop. Visitor stats for websites indicate that Linux desktop is a lot less than 38.5%.  PHP developers are helping lead the way for Linux as a choice for the desktop that is fast encroaching on Windows turf. That turf will soon be taken away from Windows by Linux. Somebody should have pointed that out. Guess that is what I am doing.</p>
<p>Linux dominates the web server world, and it makes darn good sense to see run the same system on the desktop as for the server for reasons of uniformity and behaviour. Its an obvious right choice to make. Learn to work well in the Linux shell on the desktop and you can use all those skills on the server.</p>
<p>Oddly, The Register reported all this but did not supply a reference to the source report on Zend.com</p>
<p><a title="the register" href="http://www.theregister.co.uk/2010/02/17/php_windows_linux/" target="_blank">Source: http://www.theregister.co.uk/2010/02/17/php_windows_linux/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.superwebdeveloper.com/2010/02/16/php-coders-still-stuck-in-windows-register-forgets-the-growth-of-linux-desktop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Incredible Rate of Diminishing Returns of Fixing Software Bugs</title>
		<link>http://www.superwebdeveloper.com/2009/11/25/the-incredible-rate-of-diminishing-returns-of-fixing-software-bugs/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://www.superwebdeveloper.com/2009/11/25/the-incredible-rate-of-diminishing-returns-of-fixing-software-bugs/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 20:41:25 +0000</pubDate>
		<dc:creator>pbg</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[thephpcc]]></category>

		<guid isPermaLink="false">http://www.superwebdeveloper.com/?p=287</guid>
		<description><![CDATA[While I was at Codeworks DC in September 2009, there was a particular slide during the talk by Stefan Priebsh, in his talk on OOP and Design Patterns that stood out more than all the others. It&#8217;s a slide that describes the relative cost of of a bug fix at different times in the life [...]]]></description>
			<content:encoded><![CDATA[<p>While I was at Codeworks DC in September 2009, there was a particular slide during the talk by Stefan Priebsh, in his talk on OOP and Design Patterns that stood out more than all the others. It&#8217;s a slide that describes the relative cost of of a bug fix at different times in the life cycle of a software project. At first, the cost of fixing a bug at the requirements stage is nominal, when everything is on the drawing board. But as the software moves along in its life cycle the cost of fixing a bug increases radically. We start at 1 times when we are at the initial development stage when a bug is no more than a change in notion. But at the design stage, the relative cost is 5 times what it was compared to the requirements stage, and then ten times what it was when it becomes code and on this goes until it the relative cost of a bug fix is 150 times what it was originally.  Conversely, the graphic indicates that the cost of rewriting is far less than attempting to maintain broken software. Starting right, or starting over right, is by far preferable to the alternative.</p>
<div id="attachment_286" class="wp-caption aligncenter" style="width: 546px"><img class="size-full wp-image-286" title="Relative Cost Of A Software Bug Fix" src="http://www.superwebdeveloper.com/wp-content/uploads/relativecostbugfix.png" alt="Relative Cost Of A Software Bug Fix" width="536" height="480" /><p class="wp-caption-text">Relative Cost Of A Software Bug Fix </p></div>
<p>Slide credit: Barry Boehm, “Equity Keynote Address” March 19, 2007.</p>
<p>This chart is intended for developers, to decide how best to spend ones time.  Ever wonder why, as a developer, fixing bugs is such a pain and a kludge? There is something not simply tough about fixing bugs, there is something fundamentally wrong about putting any effort at all into repairing them. But the chart is also a message to the paying client, the person whose dime it is on. A client may be only thinking in the short term to make the software work, but it is the most expensive and unproductive path to the realization of goals.</p>
<p>The effort to fix bugs is great and the rewards are minimal. Frustrations are high, satisfactions are low. The website suffers from some sort of performance penalty, users are inconvenienced. Bugs must be dealt with with some amount of procedural overhead no matter what, and when the bug is fixed and submitted, very little was ever really accomplished. It is really far better to think of a better solution to all your problems together rather than to continue fixing things one at at time. It will cost the customer less and they will get more. So when bugs become a staple of the work load, its time to persuade the client to accept a rewrite.</p>
<blockquote>
<h1>&#8230;with the software in production, fixing bugs is akin to repairing a car while it is driving down the road, long after it has left the drawing board, the assembly line, and the dealer lot. Its as expensive to do as it can possibly be.</h1>
</blockquote>
<p>Developers still have a great deal in common with the clients they perform work for. They charge money for their work so they think in terms of the cost in terms of labor time (actually, developers also think this way when they work on their own software). The question every developer asks is, “What is the simplest, easiest, and fastest way to get something done?” The answer could be open to interpretation, but that is because the long view must be taken into consideration, and that is why software makes use of functions, templates, classes, objects, and design patterns. The work is needed now, but  how will it be possible to understand the software in a few months time when noone is mentally fresh? How do I share my ideas with other people? How do I take the long view into account?</p>
<p>Despite the love a client may have for their own project, nobody is interested in working on the same software forever. After all, software developers are creative people who really want to expand their skills and take all that they have learned and apply it to the next project, instead of keeping something half dead on life support.</p>
<p>I enjoy attending talks from the best people in the world in my business, because they are very good at exposing the importance of planning and organizing the overall picture, and are very knowledgeable in all the concepts that make projects produce a top quality result in an efficient manner. They also point out the simple mistakes people make that cost them so much. When we are at the far right of the graph, with the software in production, fixing bugs is akin to repairing a car while it is driving down the road, long after it has left the drawing board, the assembly line, and the dealer lot. Its as expensive to do as it can possibly be.</p>
<p>Developers should try to understand the message of this graphic before going further fixing bugs. If you are put in a position fixing bugs, it is time to change the way you work, because you are the one  bearing the cost in terms of your own time performing the least valuable, most expensive, and least meaningful work.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.superwebdeveloper.com/2009/11/25/the-incredible-rate-of-diminishing-returns-of-fixing-software-bugs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installation Script Using WordPress Subversion Repositories</title>
		<link>http://www.superwebdeveloper.com/2009/11/07/installation-script-using-wordpress-subversion-repositories/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://www.superwebdeveloper.com/2009/11/07/installation-script-using-wordpress-subversion-repositories/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 06:07:19 +0000</pubDate>
		<dc:creator>pbg</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.superwebdeveloper.com/?p=268</guid>
		<description><![CDATA[I&#8217;d like to take the example of svn externals from my previous post a bit further. I created a bash script that captures a group of commands that one would need to deploy a vanilla WordPress website with a cherry picking of plugins and themes. This script is a big-ass time saver. It&#8217;s especially useful [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;d like to take the example of svn externals from my previous post a bit further. I created a bash script that captures a group of commands that one would need to deploy a vanilla WordPress website with a cherry picking of plugins and themes. <strong>This script is a big-ass time saver. </strong>It&#8217;s especially useful for deployment of websites based on a package like WordPress or Drupal, that host publicly available subversion repositories. I tested it recently and made two websites spending two hours on each site, four hours total.</p>
<p>Web developers as they learn start by downloading packages in zip and tar.gz archives which is fine. A pro technique is to pull in the resource via SubVersion (svn). Svn provides additional features such as svn externals and svn hooks. Svn externals allows for the pulling in of external resources into a defined project in a svn repository. Svn hooks is for additional labor saving scripting that allows for the automation of repeated tasks such as a script that can pass along data from commit messages into other resources in the project such as the bug tracker. Learning these tricks allows for labor savings at every step in the production cycle. We can take these practices to the next level with capturing the commands in a bash script and then organise all the features of a website in a deployment script, something that is done all the time at software majors.</p>
<blockquote>
<h2>This script is a big-ass time saver.</h2>
</blockquote>
<p>I took the time to sort this out recently because I had some web development requests from people who have simple websites that could be converted to WordPress easily enough, but I wasn&#8217;t interested in going fishing for plugins and themes twice, and again when the next people come along needing the same thing. The job of a software developer should be to automate processes. I say often that the credo of developers is not to work for a living, but to eliminate work. But this idea is not always employed by developers in all the places it could, and its sometimes even a harder to get a client on board to make full use of methods and procedures that automate tasks and eliminate work.</p>
<blockquote>
<h2>&#8230;the credo of (software) developers is not to work for a living, but to eliminate work.</h2>
</blockquote>
<p>Lets at least cover the benefits in point form:</p>
<ul>
<li> The script takes a couple of minutes and you save hours.</li>
<li>You dont repeat the labor, but you can repeat the use of the script, deploying anywhere else.</li>
<li>All your stuff is there at the beginning. Useful for planning, development, and policy across teams.</li>
<li>You are organised, and you can develop variations. Svn export may be good enough for your needs.</li>
</ul>
<p>In pseudo code, here is what your script will do:</p>
<ul>
<li> Set up your repository.</li>
<li>Make your directory structure for your project.</li>
<li>Check out your repository.</li>
<li>Run procedures for svn externals for core WordPress.</li>
<li>Run procedures for svn externals for plugins, iterating through data in an external file resource.</li>
<li>Run procedures for svn externals for themes, iterating through data in an external file resource.</li>
<li>Grab additional resources in an array, iterate through them using wget command, extract them.</li>
<li>Cleanup.</li>
<li>Commit message.</li>
<li>&#8230; anything else you can think to do.</li>
</ul>
<p>The bash file, save as getallwpsvn.sh:</p>
<blockquote>
<pre>#!/bin/bash
# run this script with chmod 755 permissions.

workPath=$(pwd)

rm -rf filerepository repository www *.zip # this line cleans dir for testing, comment out when done

svnadmin create repository

mkdir -p filerepository/{branches,tags,trunk/{html,db,cron,scripts,themes,plugins,project,selenium}}
# got anything to import into those directories under trunk?
# import into the directories under trunk now
# before the next step
svn import filerepository file://$workPath/repository -m "initial import using getallwpsvn.sh script"
rm -rf filerepository
svn checkout file://$workPath/repository/trunk www
cd www
svn rm html
svn commit -m "rm html temporarily for clean propset"
svn propset svn:externals 'html http://core.svn.wordpress.org/trunk/' .
svn up
cd html/wp-content/
# get plugins from repository http://svn.wp-plugins.org/
# plugins listed in svn.plugins.externals
svn propset svn:externals -F ../../../svn.plugins.externals plugins/
#svn commit "plugins propset" # no commit if no local repository
svn up
# themes repository: http://svn.wp-themes.org/
# themes repository is a bit of a ghost town, none grabbed here
# browse the site and get the zip
# themes listed in svn.themes.externals file, if there are any
svn propset svn:externals -F svn.themes.externals plugins/
svn up

cd themes
# load up on themes
#more human readable format for array

THEMESITES[0]=http://dev.digitalnature.ro/fusion/fusion-wordpress.zip
THEMESITES[1]=http://ericulous.com/?load=googlechrome.zip
THEMESITES[2]=http://ericulous.com/?load=internetcenter.zip
THEMESITES[3]=http://ericulous.com/?load=redbusiness.zip
THEMESITES[4]=http://wordpress.org/extend/themes/download/elegant-box.4.1.1.zip
THEMESITES[5]=http://wordpress.org/extend/themes/download/thirtyseventyeight.4.0.zip
THEMESITES[6]=http://wordpress.org/extend/themes/download/thirtyseventyeight.4.0.zip
THEMESITES[7]=http://wordpress.org/extend/themes/download/constructor.0.6.4.zip
THEMESITES[8]=http://wordpress.org/extend/themes/download/jq.2.4.zip
THEMESITES[9]=http://wordpress.org/extend/themes/download/ahimsa.3.0.zip
THEMESITES[10]=http://wordpress.org/extend/themes/download/retromania.1.3.zip
THEMESITES[11]=http://wordpress.org/extend/themes/download/skinbu.1.0.3.zip
THEMESITES[12]=http://wordpress.org/extend/themes/download/mystique.1.16.zip
THEMESITES[13]=http://wordpress.org/extend/themes/download/lightword.1.9.3.zip
THEMESITES[14]=http://wordpress.org/extend/themes/download/monochrome.2.3.zip
THEMESITES[15]=http://wordpress.org/extend/themes/download/thematic.0.9.5.1.zip
THEMESITES[16]=http://wordpress.org/extend/themes/download/hybrid.0.6.1.zip
THEMESITES[17]=http://wordpress.org/extend/themes/download/new-york.1.0.1.zip
THEMESITES[18]=http://wordpress.org/extend/themes/download/f8-lite.1.3.zip
THEMESITES[19]=http://wordpress.org/extend/themes/download/simplex.1.3.1.zip
THEMESITES[20]=http://wordpress.org/extend/themes/download/cleanr.0.1.2.zip

for s in ${THEMESITES[@]}
do wget "$s"
done

FILES="*.zip"
for f in "$FILES"
do unzip "$f"
done

rm *.zip
rm *.zip.*
cd ../../../
svn commit -m "load in of plugins and themes complete"

cd $workPath
cp $workPath/www/html/wp-config-sample.php  $workPath/www/html/wp-config.php
chmod 777 $workPath/www/html/wp-config.php
chmod 777 $workPath/www/html/wp-content #temporarily, for cache
mkdir $workPath/www/html/wp-content/uploads &amp;&amp; chmod 777 $_
touch $workPath/www/html/.htaccess &amp;&amp; chmod 777 $_

# do any post processing, other importing now, and commit it if you did.</pre>
</blockquote>
<p>Set the file permission to chmod 755, and run it from the shell command line as in ./getallwpsvn.sh.</p>
<p>The file you save as svn.plugins.externals:</p>
<blockquote>
<pre>all-in-one-seo-pack http://svn.wp-plugins.org/all-in-one-seo-pack/trunk
advertising-manager http://svn.wp-plugins.org/advertising-manager/trunk
cforms http://svn.wp-plugins.org/cforms/trunk
google-sitemap-generator http://svn.wp-plugins.org/google-sitemap-generator/trunk
sociable http://svn.wp-plugins.org/sociable/trunk
stats  http://svn.wp-plugins.org/stats/trunk
ultimate-google-analytics http://svn.wp-plugins.org/ultimate-google-analytics/trunk
vipers-video-quicktags http://svn.wp-plugins.org/vipers-video-quicktags/trunk
wordbook http://svn.wp-plugins.org/wordbook/trunk
wp-flickr http://svn.wp-plugins.org/wp-flickr/trunk
wp-super-cache http://svn.wp-plugins.org/wp-super-cache/trunk</pre>
</blockquote>
<p>The svn.plugins.externals file is a name &#8211; resource listing, one per line, when you have more than one resource to define with svn externals.</p>
<p>Please note that you may not need all of this; comment whatever out you want. You dont need to create a local repository, that is only if you are doing team development, or perhaps custom development on themes and plugins. I found though that it was necessary with svn propset directives to create a top-level directory structure wherein is stored all the different directories. The point of this exercise is a pull-in of public resources in a step that you can repeat automatically over and over. It also need not be a very sophisticated script to get the benefits from it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.superwebdeveloper.com/2009/11/07/installation-script-using-wordpress-subversion-repositories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Brickskellar Night Out At Codeworks DC 2009</title>
		<link>http://www.superwebdeveloper.com/2009/10/10/brickskellar-night-out-at-codeworks-dc-2009/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://www.superwebdeveloper.com/2009/10/10/brickskellar-night-out-at-codeworks-dc-2009/#comments</comments>
		<pubDate>Sun, 11 Oct 2009 05:29:48 +0000</pubDate>
		<dc:creator>pbg</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[User Groups]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[beer]]></category>
		<category><![CDATA[brickskellar]]></category>
		<category><![CDATA[codeworks]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[party]]></category>

		<guid isPermaLink="false">http://www.superwebdeveloper.com/?p=219</guid>
		<description><![CDATA[We took a break after day one of the Codeworks DC conference and went to the Brickskellar. The Brickskellar is a famous institution of beer in Washington DC, noted in the Guinness Book of World Records as been the place selling the greatest number of different beers of any drinking establishment on the planet earth. [...]]]></description>
			<content:encoded><![CDATA[<p>We took a break after day one of the <a href="http://cw.mtacon.com/schedule/city/washington" target="_blank">Codeworks DC conference</a> and went to the Brickskellar. <a href="http://www.lovethebeer.com/brickskeller.html" target="_blank">The Brickskellar</a> is a famous institution of beer in Washington DC, noted in the Guinness Book of World Records as been the place selling the greatest number of different beers of any drinking establishment on the planet earth. We met up with the group going there in the hotel lobby. We had originally scouted out the<a href="http://maps.google.ca/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=restaurants+alexandria+va&amp;sll=38.787944,-77.090034&amp;sspn=0.072522,0.181103&amp;gl=ca&amp;ie=UTF8&amp;hq=restaurants&amp;hnear=Alexandria,+VA,+USA&amp;z=14" target="_blank"> fine dining in Alexandria, of which there is plenty</a>. We were thinking of Overwood, 219, The Flying Fish, or others, but on a whim we decided rather to join the conference folks down at The Brickskellar. We got the address from the hotel, entered it in the TomTom, and made it there before the main group did.</p>

<a href='http://www.superwebdeveloper.com/2009/10/10/brickskellar-night-out-at-codeworks-dc-2009/dsc_0553/' title='DSC_0553'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0553-150x150.jpg" class="attachment-thumbnail" alt="DSC_0553" title="DSC_0553" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/brickskellar-night-out-at-codeworks-dc-2009/dsc_0554/' title='DSC_0554'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0554-150x150.jpg" class="attachment-thumbnail" alt="DSC_0554" title="DSC_0554" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/brickskellar-night-out-at-codeworks-dc-2009/dsc_0555/' title='DSC_0555'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0555-150x150.jpg" class="attachment-thumbnail" alt="DSC_0555" title="DSC_0555" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/brickskellar-night-out-at-codeworks-dc-2009/dsc_0556/' title='DSC_0556'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0556-150x150.jpg" class="attachment-thumbnail" alt="DSC_0556" title="DSC_0556" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/brickskellar-night-out-at-codeworks-dc-2009/dsc_0557/' title='DSC_0557'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0557-150x150.jpg" class="attachment-thumbnail" alt="DSC_0557" title="DSC_0557" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/brickskellar-night-out-at-codeworks-dc-2009/dsc_0558/' title='DSC_0558'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0558-150x150.jpg" class="attachment-thumbnail" alt="DSC_0558" title="DSC_0558" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/brickskellar-night-out-at-codeworks-dc-2009/dsc_0559/' title='DSC_0559'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0559-150x150.jpg" class="attachment-thumbnail" alt="DSC_0559" title="DSC_0559" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/brickskellar-night-out-at-codeworks-dc-2009/dsc_0560/' title='DSC_0560'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0560-150x150.jpg" class="attachment-thumbnail" alt="DSC_0560" title="DSC_0560" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/brickskellar-night-out-at-codeworks-dc-2009/dsc_0563/' title='DSC_0563'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0563-150x150.jpg" class="attachment-thumbnail" alt="DSC_0563" title="DSC_0563" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/brickskellar-night-out-at-codeworks-dc-2009/dsc_0569/' title='DSC_0569'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0569-150x150.jpg" class="attachment-thumbnail" alt="DSC_0569" title="DSC_0569" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/brickskellar-night-out-at-codeworks-dc-2009/dsc_0570/' title='DSC_0570'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0570-150x150.jpg" class="attachment-thumbnail" alt="DSC_0570" title="DSC_0570" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/brickskellar-night-out-at-codeworks-dc-2009/dsc_0571/' title='DSC_0571'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0571-150x150.jpg" class="attachment-thumbnail" alt="DSC_0571" title="DSC_0571" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/brickskellar-night-out-at-codeworks-dc-2009/dsc_0574/' title='DSC_0574'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0574-150x150.jpg" class="attachment-thumbnail" alt="DSC_0574" title="DSC_0574" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/brickskellar-night-out-at-codeworks-dc-2009/dsc_0576/' title='DSC_0576'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0576-150x150.jpg" class="attachment-thumbnail" alt="DSC_0576" title="DSC_0576" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/brickskellar-night-out-at-codeworks-dc-2009/dsc_0583/' title='DSC_0583'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0583-150x150.jpg" class="attachment-thumbnail" alt="DSC_0583" title="DSC_0583" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/brickskellar-night-out-at-codeworks-dc-2009/dsc_0585/' title='DSC_0585'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0585-150x150.jpg" class="attachment-thumbnail" alt="DSC_0585" title="DSC_0585" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/brickskellar-night-out-at-codeworks-dc-2009/dsc_0589/' title='DSC_0589'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0589-150x150.jpg" class="attachment-thumbnail" alt="DSC_0589" title="DSC_0589" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/brickskellar-night-out-at-codeworks-dc-2009/dsc_0590/' title='DSC_0590'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0590-150x150.jpg" class="attachment-thumbnail" alt="DSC_0590" title="DSC_0590" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/brickskellar-night-out-at-codeworks-dc-2009/dsc_0591/' title='DSC_0591'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0591-150x150.jpg" class="attachment-thumbnail" alt="DSC_0591" title="DSC_0591" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/brickskellar-night-out-at-codeworks-dc-2009/dsc_0593/' title='DSC_0593'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0593-150x150.jpg" class="attachment-thumbnail" alt="DSC_0593" title="DSC_0593" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/brickskellar-night-out-at-codeworks-dc-2009/dsc_0597/' title='DSC_0597'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0597-150x150.jpg" class="attachment-thumbnail" alt="DSC_0597" title="DSC_0597" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/brickskellar-night-out-at-codeworks-dc-2009/dsc_0598/' title='DSC_0598'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0598-150x150.jpg" class="attachment-thumbnail" alt="DSC_0598" title="DSC_0598" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/brickskellar-night-out-at-codeworks-dc-2009/dsc_0601/' title='DSC_0601'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0601-150x150.jpg" class="attachment-thumbnail" alt="DSC_0601" title="DSC_0601" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/brickskellar-night-out-at-codeworks-dc-2009/dsc_0602/' title='DSC_0602'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0602-150x150.jpg" class="attachment-thumbnail" alt="DSC_0602" title="DSC_0602" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/brickskellar-night-out-at-codeworks-dc-2009/dsc_0604/' title='DSC_0604'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0604-150x150.jpg" class="attachment-thumbnail" alt="DSC_0604" title="DSC_0604" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/brickskellar-night-out-at-codeworks-dc-2009/dsc_0606/' title='DSC_0606'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0606-150x150.jpg" class="attachment-thumbnail" alt="DSC_0606" title="DSC_0606" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/brickskellar-night-out-at-codeworks-dc-2009/dsc_0607/' title='DSC_0607'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0607-150x150.jpg" class="attachment-thumbnail" alt="DSC_0607" title="DSC_0607" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/brickskellar-night-out-at-codeworks-dc-2009/dsc_0608/' title='DSC_0608'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0608-150x150.jpg" class="attachment-thumbnail" alt="DSC_0608" title="DSC_0608" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/brickskellar-night-out-at-codeworks-dc-2009/dsc_0611/' title='DSC_0611'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0611-150x150.jpg" class="attachment-thumbnail" alt="DSC_0611" title="DSC_0611" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/brickskellar-night-out-at-codeworks-dc-2009/dsc_0612/' title='DSC_0612'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0612-150x150.jpg" class="attachment-thumbnail" alt="DSC_0612" title="DSC_0612" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/brickskellar-night-out-at-codeworks-dc-2009/dsc_0613/' title='DSC_0613'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0613-150x150.jpg" class="attachment-thumbnail" alt="DSC_0613" title="DSC_0613" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/brickskellar-night-out-at-codeworks-dc-2009/dsc_0615/' title='DSC_0615'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0615-150x150.jpg" class="attachment-thumbnail" alt="DSC_0615" title="DSC_0615" /></a>

<p>We had thousands of possible beers to choose from, but we were most attracted to the pumpkin beers from local microbreweries from the taps. We enjoyed a down home meal of mussels, beef, and a crab cake sandwich and fries. A few things to point out in the pics above: Not the skull foam in the beer glass, the chocolate cake, the double chocolate stout, the elephant tap, the cans in the wall, some familiar faces from the php community, and the trappist ale. So never mind the fine dining in DC, go for the soul food and beer.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.superwebdeveloper.com/2009/10/10/brickskellar-night-out-at-codeworks-dc-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CodeWorks in DC October 2009</title>
		<link>http://www.superwebdeveloper.com/2009/10/10/codeworks-in-dc-october-2009/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://www.superwebdeveloper.com/2009/10/10/codeworks-in-dc-october-2009/#comments</comments>
		<pubDate>Sun, 11 Oct 2009 04:05:43 +0000</pubDate>
		<dc:creator>pbg</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[User Groups]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[thephpcc]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://www.superwebdeveloper.com/?p=197</guid>
		<description><![CDATA[I am back recently from Codeworks 2009 in Washington, DC. It was in Alexandria, Virginia actually, but close enough, its a big place and its the same thing. This is the first time I have been able to go to a conference  without being involved at all in its planning and organization. I know from [...]]]></description>
			<content:encoded><![CDATA[<p>I am back recently from<a href="http://cw.mtacon.com/schedule/city/washington" target="_blank"> Codeworks 2009 in Washington, DC</a>. It was in Alexandria, Virginia actually, but close enough, its a big place and its the same thing. This is the first time I have been able to go to a conference  without being involved at all in its planning and organization. I know from experience that a lot of work is put into organizing and hosting a two day event with top-level speakers from all over. The DC Codeworks event was just one event in a series of dates in major cities across the us. Yep, php has gone rockstar. I am proud of the work I have done in the past but I found that by the time the conference came around I was too tired to absorb the lessons as I would like to. So while I am busy recompiling notes from the talks I attended, here are some photos from the conference I would like to share.</p>

<a href='http://www.superwebdeveloper.com/2009/10/10/codeworks-in-dc-october-2009/dsc_0658/' title='Derick Rethans'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0658-150x150.jpg" class="attachment-thumbnail" alt="Derick Rethans" title="Derick Rethans" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/codeworks-in-dc-october-2009/dsc_0657/' title='Chris Shifflet'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0657-150x150.jpg" class="attachment-thumbnail" alt="Chris Shifflet" title="Chris Shifflet" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/codeworks-in-dc-october-2009/dsc_0650/' title='Ben Ramsey'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0650-150x150.jpg" class="attachment-thumbnail" alt="Ben Ramsey" title="Ben Ramsey" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/codeworks-in-dc-october-2009/dsc_0644/' title='Andrei Zmievski'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0644-150x150.jpg" class="attachment-thumbnail" alt="Andrei Zmievski" title="Andrei Zmievski" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/codeworks-in-dc-october-2009/dsc_0637/' title='Kuassi Mensah'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0637-150x150.jpg" class="attachment-thumbnail" alt="Kuassi Mensah" title="Kuassi Mensah" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/codeworks-in-dc-october-2009/dsc_0622/' title='After Party'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0622-150x150.jpg" class="attachment-thumbnail" alt="After Party" title="After Party" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/codeworks-in-dc-october-2009/dsc_0621/' title='Cal Evans'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0621-150x150.jpg" class="attachment-thumbnail" alt="Cal Evans" title="Cal Evans" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/codeworks-in-dc-october-2009/dsc_0515/' title='Sebastian Bergman and Stefan Priebsch'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0515-150x150.jpg" class="attachment-thumbnail" alt="Sebastian Bergman and Stefan Priebsch" title="Sebastian Bergman and Stefan Priebsch" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/codeworks-in-dc-october-2009/dsc_0514/' title='Patterns'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0514-150x150.jpg" class="attachment-thumbnail" alt="Patterns" title="Patterns" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/codeworks-in-dc-october-2009/dsc_0508/' title='Slide: the relative cost of a bug fix'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0508-150x150.jpg" class="attachment-thumbnail" alt="Slide: the relative cost of a bug fix" title="Slide: the relative cost of a bug fix" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/codeworks-in-dc-october-2009/dsc_0505/' title='Stefan Priebsch'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0505-150x150.jpg" class="attachment-thumbnail" alt="Stefan Priebsch" title="Stefan Priebsch" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/codeworks-in-dc-october-2009/dsc_0503/' title='Hotel Atrium'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0503-150x150.jpg" class="attachment-thumbnail" alt="Hotel Atrium" title="Hotel Atrium" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/codeworks-in-dc-october-2009/dsc_0496/' title='Lukas Smith'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0496-150x150.jpg" class="attachment-thumbnail" alt="Lukas Smith" title="Lukas Smith" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/codeworks-in-dc-october-2009/dsc_0479/' title='Hotel Atrium'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0479-150x150.jpg" class="attachment-thumbnail" alt="Hotel Atrium" title="Hotel Atrium" /></a>
<a href='http://www.superwebdeveloper.com/2009/10/10/codeworks-in-dc-october-2009/dsc_0477/' title='Matthew O&#039;Phinney'><img width="150" height="150" src="http://www.superwebdeveloper.com/wp-content/uploads/DSC_0477-150x150.jpg" class="attachment-thumbnail" alt="Matthew O&#039;Phinney" title="Matthew O&#039;Phinney" /></a>

<p>The conference was great, I learned stuff, I learned what I know, what I dont know, what I need to know, and more. I met a great group of people and traded lots of business cards.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.superwebdeveloper.com/2009/10/10/codeworks-in-dc-october-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Formatted print_r is Darn useful</title>
		<link>http://www.superwebdeveloper.com/2008/11/11/formatted-print_r-is-darn-useful/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://www.superwebdeveloper.com/2008/11/11/formatted-print_r-is-darn-useful/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 20:39:21 +0000</pubDate>
		<dc:creator>pbg</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[arrays]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[print_r]]></category>

		<guid isPermaLink="false">http://www.superwebdeveloper.com/?p=80</guid>
		<description><![CDATA[Here is one of the little improvements upon a php script that makes it even more useful &#8211; at least appropriate for browser output. I make no claim to having invented this, its just a useful little script to pass on for debugging arrays in PHP. function printR($arr, $label= null) { if($label){ echo &#8220;&#60;h2&#62;$label&#60;/h2&#62; \n [...]]]></description>
			<content:encoded><![CDATA[<p>Here is one of the little improvements upon a php script that makes it even more useful &#8211; at least appropriate for browser output. I make no claim to having invented this, its just a useful little script to pass on for debugging arrays in PHP.</p>
<p>function printR($arr, $label= null) {<br />
if($label){<br />
echo &#8220;&lt;h2&gt;$label&lt;/h2&gt; \n &#8220;;<br />
}<br />
echo &#8220;\n\n&lt;pre&gt;\n&#8221;;<br />
print_r($arr);<br />
echo &#8220;\n&lt;/pre&gt;\n\n&#8221;;<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://www.superwebdeveloper.com/2008/11/11/formatted-print_r-is-darn-useful/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Edit a line in all php files in a directory with find and sed</title>
		<link>http://www.superwebdeveloper.com/2008/11/01/edit-a-line-in-all-php-files-in-a-directory-with-find-and-sed/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://www.superwebdeveloper.com/2008/11/01/edit-a-line-in-all-php-files-in-a-directory-with-find-and-sed/#comments</comments>
		<pubDate>Sun, 02 Nov 2008 03:41:42 +0000</pubDate>
		<dc:creator>pbg</dc:creator>
				<category><![CDATA[GNU Linux]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.superwebdeveloper.com/?p=76</guid>
		<description><![CDATA[Here is about the simplest example I could come up with, to change a reference to a new include directory location in a codebase. You can of course do fancier things should you wish to dump your results to a directory before overwriting your files. #!/bin/sh for files in `find *.php` do sed &#8216;s/..\/..\/adminincl/includes/g&#8217; $files [...]]]></description>
			<content:encoded><![CDATA[<p>Here is about the simplest example I could come up with, to change a reference to a new include directory location in a codebase.</p>
<p>You can of course do fancier things should you wish to dump your results to a directory before overwriting your files.</p>
<p>#!/bin/sh<br />
for files in `find *.php`<br />
do<br />
sed &#8216;s/..\/..\/adminincl/includes/g&#8217; $files &gt; &#8216;temp&#8217;.$files &amp;&amp; mv &#8216;temp&#8217;.$files $files<br />
done</p>
]]></content:encoded>
			<wfw:commentRss>http://www.superwebdeveloper.com/2008/11/01/edit-a-line-in-all-php-files-in-a-directory-with-find-and-sed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Protect weak passwords with login trap</title>
		<link>http://www.superwebdeveloper.com/2008/06/17/protect-weak-passwords-with-login-trap/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://www.superwebdeveloper.com/2008/06/17/protect-weak-passwords-with-login-trap/#comments</comments>
		<pubDate>Wed, 18 Jun 2008 05:37:15 +0000</pubDate>
		<dc:creator>pbg</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.superwebdeveloper.com/wp/?p=44</guid>
		<description><![CDATA[If one thing is for sure, the weaker the user, the weaker the password they use. Its a disaster waiting to happen. I decided to shore things up on a site I take care of just so I can sleep at night. It has lots of users, but weak ones. Many sites out there already [...]]]></description>
			<content:encoded><![CDATA[<p>If one thing is for sure,<strong> the weaker the user, the weaker the password they use</strong>. Its a disaster waiting to happen. I decided to shore things up on a site I take care of just so I can sleep at night. It has lots of users, but weak ones. Many sites out there already have safeguards in place to forbid further login attempts if you keep failing. If you let users own their passwords, and you probably do, there are no doubt some weak ones that could fall to some kind of rainbow attack if you allow an attacker to keep trying. There should be more than one example of this process on the web to compare this to.</p>
<p>It would work like this:</p>
<ul>
<li>set a number of allowed login attempts.</li>
<li>set the time limit in seconds for duration of access denial.</li>
<li>keep track of the number of failed login attempts.</li>
<li>keep track of when login attempts started with timestamp function.</li>
<li>test for meeting or exceeding the number of allowed login attempts.</li>
<li>let them keep trying if they have waited past the time limit.</li>
<li>set a time limit for when they can come back, and forbid them.</li>
<li>give them some messages and links to help.</li>
<li>if the login has been successful, wipe out all the tracking for login attempts.</li>
<li>You are done.</li>
</ul>
<p>Here we go, into your login processor after initial validation and constructing a sql query.</p>
<pre><code>$loginAttemptsAllowed = 5;</code></pre>
<pre>if( $_SESSION['loginAttempt']['Count'] &lt;= $loginAttemptsAllowed ) {
  $result = $db-&gt;queryRow($sql); // only query db if allowed to do so
}</pre>
<pre>if( !$result ){
  $seconds = 300; // 5 minutes
  // if trying again after lockout time limit ....
  if( $_SESSION['loginAttempt']['Count'] &gt;= $loginAttemptsAllowed ) {
    $difference  = abs($_SESSION['loginAttempt']['LockoutTime'] - $_SESSION['loginAttempt']['Time']);
    $diffSeconds = round($difference);
    if( $diffSeconds &gt; $seconds ) {
      unset($_SESSION['loginAttempt']); // they failed but have a new set of chances
      } else {
      $minutes = $seconds / 60;
      $message = "Sorry, you have had $loginAttemptsAllowed failed login attempts. &lt;br /&gt;
      We temporarily forbid access in order to protect your private information. &lt;br /&gt;
      Please wait $minutes minutes before logging on again.";
      }
    } else {
    if( !isset($_SESSION['loginAttempt']['Time']) ) {
      $_SESSION['loginAttempt']['Time']  = get_microtime();
      $_SESSION['loginAttempt']['Count'] = 1;
    } else {
      $_SESSION['loginAttempt']['Count']++;
    }
    if( $_SESSION['loginAttempt']['Count'] &gt;= $loginAttemptsAllowed ) {
      $_SESSION['loginAttempt']['LockoutTime'] = get_microtime();
    }
    $message = "login error";
  }
  addMessage($message, "MsgErr");
  redirect($_SESSION["backPage"]);
  exit();
}</pre>
<p>&#8230;.. go on and log them. Dont forget to unset( $_SESSION['loginAttempt'] );<br />
// a couple of the functions in there are custom ones, they are basically just wrappers.<br />
// I forget where I got the following function, but it is used for benchmarking. Maybe php.net?</p>
<pre><code>
function get_microtime() {</code></pre>
<pre><code>  $mtime = microtime();</code></pre>
<pre><code>  $mtime = explode(" ",$mtime);</code></pre>
<pre><code>  $mtime = doubleval($mtime[1]) + doubleval($mtime[0]);</code></pre>
<pre><code>  return ($mtime);
}</code></pre>
<p><code> </code>So there you have it. Forcing users to have highly secure passwords, while a good idea, is not always possible.</p>
<p>Keep your users safe. And curses to wordpress for screwing up my code formatting&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.superwebdeveloper.com/2008/06/17/protect-weak-passwords-with-login-trap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Doing Mod_Rewrite Right</title>
		<link>http://www.superwebdeveloper.com/2008/05/16/doing-mod_rewrite-right/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://www.superwebdeveloper.com/2008/05/16/doing-mod_rewrite-right/#comments</comments>
		<pubDate>Fri, 16 May 2008 21:35:59 +0000</pubDate>
		<dc:creator>pbg</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[regular expressions]]></category>
		<category><![CDATA[seo]]></category>

		<guid isPermaLink="false">http://www.superwebdeveloper.com/wp/?p=35</guid>
		<description><![CDATA[There are a few different things to do to make Apache_mod rewrite right. Overall the difficulty isnt too great, but setting it up right at the beginning is the key. You dont really want to have to catch every little exception in mod_rewrite regular expressions. Using your database to store safe strings to use in [...]]]></description>
			<content:encoded><![CDATA[<p>There are a few different things to do to make Apache_mod rewrite right. Overall the difficulty isnt too great, but setting it up right at the beginning is the key. You dont really want to have to catch every little exception in mod_rewrite regular expressions. Using your database to store safe strings to use in your url makes the whole process much more efficient. This little fact is usually not mentioned in tutorials for mod_rewrite.</p>
<p>You really do want to keep the mod_rewrite rules simple. Dont try to write a complex regexp in mod_rewrite that handles all kinds of apostropes, special characters, etc. (like I did). You dont have to have question marks, quotations, colons in the rewritten url for it to be useful to search engines. You can turn a title like &#8220;O&#8217;mally&#8217;s dog&#8217;s bone&#8221; into http://domain.com/Omallys_dogs_bone and there is definitely enough textual sense in that rewritten url for a search engine to deal with it.</p>
<p>Take your table with all your content data in it. Create a field for your content for a safe title. Then you can process your old titles into the new field. In your looping construct, use a bit of php to clean out your old titles for spaces, quotes, slashes, and other silly things.</p>
<pre>$punctuations = array('.', '\'', '?','!','*','=','Ã“','%','@','&amp;',',','/');</pre>
<pre>$safeTitle = str_replace($punctuations, "", $title);// get rid of the junk</pre>
<pre>$safeTitle   = str_replace(" ", "_", $safeTitle);// replace spaces with underscores</pre>
<p>Now you have a content resource which you can add to your output queries that will fill in your url link on your page for mod_rewrite goodness.</p>
<p>Make your mod_rewrite rule in your .htaccess file. Note here that the rule has a place for 2 variables, and is looking for all instances of strings with upper and lower case letters, the numbers 0-9, and the underscore character. And of course, it turns it all back into a query string to submit to your content page.</p>
<p>RewriteRule ^/?([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)(/)?$  item.php?safeTopicName=$1&amp;safeTitle=$2</p>
<p>Almost done right? Eh, not quite. Almost though. Dont screw over your existing users, who may have linked to something of yours to the past. You can still account for your old reference style to your web content, and you most definitely should. You can write checks for query string data validation to allow for  transparent access to content through either the old query string method or the new one.</p>
<pre>if($_GET["safeTopicName"]){</pre>
<pre>  $sql = sprintf("SELECT topicId
                  FROM contentTopics</pre>
<pre>                  WHERE safeTopicName</pre>
<pre>                  LIKE '%s'",</pre>
<pre>                mysql_real_escape_string($_GET["safeTopicName"]));</pre>
<pre>  diode($topicId = $db-&gt;getOne($sql), $sql); // my db connection wrapper</pre>
<pre>  $sql = sprintf("SELECT articleid</pre>
<pre>                  FROM content</pre>
<pre>                  WHERE safeTitle</pre>
<pre>                  LIKE '%s'",</pre>
<pre>                mysql_real_escape_string($_GET["safeTitle"]));</pre>
<pre>  diode($articleid = $db-&gt;getOne($sql), $sql);
} else {</pre>
<pre>  if($_GET["topicId"]) {</pre>
<pre>    $topicId =  (int)$_GET["topicId"]);</pre>
<pre>  }</pre>
<pre>  if($_GET["articleid"]) {</pre>
<pre>    $articleid =  (int)$_GET["articleid"];</pre>
<pre>  }
}
if(!isset($topicId) || !isset($articleid)) {</pre>
<pre>    addMessage("no item found", "MsgErr");</pre>
<pre>    redirect();</pre>
<pre>    exit();</pre>
<pre>}</pre>
<p>A couple notes: Im using PEAR, and a couple of custom functions for efficiency sake. Note the use of (int) and mysql_real_escape_string() for sanitizing and typing.Â  And yes, there are probably better ways to write this up, but you get the idea. Look for your $_GET vars, and if you dont have one set or the other, no result, otherwise, process it so the rest of the code needs no further reliance on these initial options so a user can get to your site with /Planets/earth as well as with item.php?topicId=2&amp;articleid=249.</p>
<p>To Recap:</p>
<ul>
<li>Set up safe versions of your content titles</li>
<li>process the old titles with a script</li>
<li>make a simpler rewrite rule as a result</li>
<li>set up your validation to process both kinds of queries</li>
<li>marvel about how much simpler it was to do it that way than to try and do it all with Mod_Rewrite alone.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.superwebdeveloper.com/2008/05/16/doing-mod_rewrite-right/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Form Security: Moving target vs. Honeypot</title>
		<link>http://www.superwebdeveloper.com/2008/05/13/web-form-security-moving-target-vs-honeypot/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://www.superwebdeveloper.com/2008/05/13/web-form-security-moving-target-vs-honeypot/#comments</comments>
		<pubDate>Wed, 14 May 2008 04:32:18 +0000</pubDate>
		<dc:creator>pbg</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.superwebdeveloper.com/wp/?p=20</guid>
		<description><![CDATA[In my last blog posting I alluded to using randomizing form field names as a solution to form attacks. Here is an example of how it can be created for a simple form page. There is no doubt more than one way to accomplish this kind of idea, so please this example only as a [...]]]></description>
			<content:encoded><![CDATA[<p>In my last blog posting I alluded to using randomizing form field names as a solution to form attacks. Here is an example of how it can be created for a simple form page. There is no doubt more than one way to accomplish this kind of idea, so please this example only as a basic demo that suited my needs.</p>
<p>Create a moving target that attackers cannot seize upon repeatedly.  build arrays in a looping construct for all the form fields you want to assign in your page. Store them in a PHP Session array. You use built-in php functions such as md5(), uniqid(), microtime(), mt_rand(), and a salt value if you like as well. You output your form fields dynamically, using php to assign the randomized hash to the name value of the form field. Enter some data, submit the form. The script takes your $_POST array and compares the array keys to $_SESSION. You can then do further validation and then assign your values to  common sense variable names that are always private.</p>
<p>When you have validated this submission, you know the data has come from your form page. While you can spoof referrers, You cant spoof the form field names because they are only created at runtime.</p>
<p>The honeypot is the inverse approach, And also has lots of fans in its camp. A honeypot is a web form with addtional form elements, usually of a hidden type, that get discovered by a spammers crawler. They then seize upon the field name and use it in an attack. But since the form field isnt visible to users through the browser, it must be some kind of forged submission, and is worthy of filtering out.</p>
<p>The advantage of the moving target over honeypot is that forged submissions can be filtered out earlier in the script. Also, an attacker could easily analyze the form page once and determine what form fields to omit, and just add that information into the submitting script. They visited the page once, made a correction, and are back in business. Even so it is known as a successful defense. It is a successful defense because of the reason spam is spam: people messing with your site without ever even visiting it, not once. And if you are using an off-the-shelf website-in-a-box like WordPress or Drupal or whatever, the attacker can even more easily attack your site, with its cookie cutter template form elements, one same as the other million out there already.</p>
<p>It is very economical to attack as many sites as possible in the same way as possible. It will always be so.</p>
<p>I have had my share of naysayers over the moving target method. Please allow me reply to a few of the comments others have already made.</p>
<p><em>Why not just use the form name, why all form fields?</em> I guess you could, but really there are a couple answers. First is the concept of defense in depth. Secure the whole thing, not just one element that an attacker could lock on to. Next answer is that it is simple enough to do the work in php to generate all the form field names you wish.</p>
<p><em>The site could still be attacked</em>. Yes. Assume that it will be. Funky forms is of course not the only line of defense you must apply to stop your site from being trashed. What I was able to accomplish here is to break the link between the site and the garden variety automated attack, which must assume to know your form name and names of input fields in order to forge the rest of the information. The client must be on your web page in real time to submit data into your form. And in fact that is all the moving target approach does. The attacker still harvests your page, prepares a http remote attack in the guise of a simulated form posting, then goes to work, submitting to all the websites. But nothing gets through to a site with the moving target approach because field names wont match up.</p>
<p><em>A position based attacker could still hit it</em>. Yes but of course you are not done validating your input because you have this in place. Spam, like anything else, is a matter of economics, in terms of both time and money.  Yes someone could get you, but not likely, because like 2 boxers in a ring, both have to be stationary for a moment for a punch to connect. Otherwise its much harder to be effective, and much less powerful. The analogy is a fair one: The time required to hit a site with moving target is greater than the time to perform the usual kind of automated crawling and submitting designed for static form field names. The mere fact that you require your user to be on your page, absolutely, is enough in itself for attackers not to bother changing its tactics for millions of websites, or to lose so much time to making an exception to you that it becomes uneconomical to do so. As it stands, they may never even know that their submission was unsuccessful. You can of course push suspicious submissions to Akismet.</p>
<p><em>Yeah but sessions are evil and should never be used</em>. Some have said so. Not to long ago, they didn&#8217;t work very well. But this isnt the case anymore. Drupal doesn&#8217;t use sessions, for example, and other middlewares avoid them as well. Projects with requirements for handling legacy code, particular kinds of services or policies may insist that sessions not be used. But even more evil is to never use sessions because of not understanding how to use them properly and parsimoniously.</p>
<p>First comes your form page, use some php before the form to generate the fields that you need.</p>
<pre style="padding-left: 30px;">&lt;?php
session_start();
if(!$_SESSION["subscriber"]["values"]) {
  $fieldNamesCount = 11;
  $fieldNamesArray = array();
  for ($i = 0; $i &lt; $fieldNamesCount; $i++) {
    // $fieldNamesArray2[] =  md5("killSpam" . uniqid(microtime(), 1)); // random coctail with salt, if you wish
    $fieldNamesArray[] =  uniqid(md5(mt_rand())); // random coctail
  }
  $_SESSION["subscriber"]["fieldNames"] = $fieldNamesArray;
} else {
// do something when its a return pag
}</pre>
<pre>echo "&lt;pre&gt;";
print_r($fieldNamesArray)
echo "&lt;/pre&gt;";</pre>
<p>&#8230;&#8230;. and then your form fields look something like this:</p>
<pre>Name: &lt;input type="text" name="{$_SESSION["subscriber"]["fieldNames"][0]}" value="&lt;?php  echo  $_SESSION["subscriber"]["values"][0]; ?&gt;" size="20" maxlength="50" /&gt;</pre>
<pre>Phone: &lt;input name="{$_SESSION["subscriber"]["fieldNames"][1]}" type="text" value="&lt;?php echo  $_SESSION["subscriber"]["values"][1]; ?&gt;" size="20" maxlength="20" /&gt;</pre>
<p>You submit this to your form target script. If you look at your page Info in Firefox, under the forms tab, you will see you have form field names created from random hashes generated at runtime. The values for the names will be unique at every page load. The user must be on the page to submit.</p>
<p>So lets take a look at the script you are posting this data to.</p>
<p>Lets just assume that you are pointing this form submission to a different file, so here is what is required at a minimum:</p>
<pre>&lt;?php
session_start();
if (!$_POST) {
  echo "no post reference";
  exit();
}
// compare $_SESSION["subscriber"]["fieldNames"]
// to array_keys($_POST);
if(!$_SESSION["subscriber"]["fieldNames"]) {
  echo "no ref to my session";
  exit();
}</pre>
<pre>$postedKeys = array_keys($_POST); // I need to access this as an  array.</pre>
<pre>$_SESSION["subscriber"]["values"] = $_POST;
$realNames = array('Name','Telephone',.... etc);</pre>
<pre>for($i = 0; $i &lt; count($postedKeys); $i++) {
  if($postedKeys[$i] == $_SESSION["subscriber"]["fieldNames"][$i]) {
    // no cheating! you must you my randomly generated field names to use this page!!!!
    $realValues[$realNames[$i]] = $_SESSION["subscriber"]["values"][$_SESSION["subscriber"]["fieldNames"][$i]];
  } else {
    // its the work of satan
    echo "please dont do that ";
    exit();
  }
}</pre>
<p>so if it passes all the tests, its good to go. Otherwise, its like two people talking to each other who dont speak each others language. They will never get what each other is saying, will never understand, and will just move on.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.superwebdeveloper.com/2008/05/13/web-form-security-moving-target-vs-honeypot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

