<?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>Ben Hepworth</title>
	<atom:link href="http://www.benhepworth.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.benhepworth.com/blog</link>
	<description>Geek Dad {Technology, Health, Board Games, Music, &#38; Family}</description>
	<lastBuildDate>Thu, 10 Oct 2019 20:31:12 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.2.14</generator>
	<item>
		<title>Using command line tool jq to parse structured json</title>
		<link>http://www.benhepworth.com/blog/2019/10/10/using-command-line-tool-jq-to-parse-structured-json/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
				<comments>http://www.benhepworth.com/blog/2019/10/10/using-command-line-tool-jq-to-parse-structured-json/#respond</comments>
				<pubDate>Thu, 10 Oct 2019 20:31:10 +0000</pubDate>
		<dc:creator><![CDATA[Ben Hepworth]]></dc:creator>
				<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[brew]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[homebrew]]></category>
		<category><![CDATA[jq]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[parse]]></category>
		<category><![CDATA[sed]]></category>

		<guid isPermaLink="false">http://www.benhepworth.com/blog/?p=2400</guid>
				<description><![CDATA[Prerequisite: have brew installed. Visit this website to install brew &#8211; https://brew.sh/ Install jq: brew install jq Let&#8217;s say you have a file in tmp.json that contains the following (yes, I&#8217;m scripting against AWS if you can&#8217;t tell): { "Credentials": { "SecretAccessKey": "abcdefghj1234567", "SessionToken": "lkasjdhlfkjhalskdjfhlkajsdhlfkj", "Expiration": "2019-10-12T06:50:05Z", "AccessKeyId": "AHSDJF1234DSHFG" } } To pull out the [&#8230;]]]></description>
								<content:encoded><![CDATA[
<p>Prerequisite: have brew installed. Visit this website to install brew &#8211; <a href="https://brew.sh/">https://brew.sh/</a></p>



<p>Install jq:</p>



<p><code>brew install jq</code></p>



<p>Let&#8217;s say you have a file in tmp.json that contains the following (yes, I&#8217;m scripting against AWS if you can&#8217;t tell):</p>



<pre class="wp-block-preformatted">{
      "Credentials": {
          "SecretAccessKey": "abcdefghj1234567", 
          "SessionToken": "lkasjdhlfkjhalskdjfhlkajsdhlfkj", 
          "Expiration": "2019-10-12T06:50:05Z", 
          "AccessKeyId": "AHSDJF1234DSHFG"
      }
  }</pre>



<p>To pull out the value of SecretAccessKey in the Credentials object, run the following command:</p>



<pre class="wp-block-preformatted">$ cat tmp.json| jq -r .Credentials.SecretAccessKey<br>$ abcdefghj1234567</pre>



<p>Wow, that is so easy and powerful! Previously I was using a combination of grep and sed to parse it out of there. Not very efficient, super cryptic, and doesn&#8217;t scale well for nested objects. See the comparison:</p>



<pre class="wp-block-preformatted">cat tmp.json | grep SecretAccessKey|sed 's/",.*$//'|sed 's/^.*"//'
cat tmp.json| jq -r .Credentials.SecretAccessKey</pre>



<p>You judge for yourself which one is easier. The first one looks like a 2 year old got a hold of a keyboard.</p>



<p>Arrays are indexed starting at zero. For example, let&#8217;s say you have an array in tmp2.json called Items that has multiple items:</p>



<pre class="wp-block-preformatted">{
  "Items": [
    { "name": "Ben",
      "lastName": "Hepworth"
    },
    { "name": "Dingus",
      "lastName": "Hepworth"
    }
  ]
}</pre>



<p>To get the first item in the array, run the following command:</p>



<pre class="wp-block-preformatted">$ cat tmp2.json | jq -r .Items[0]<br> {<br>   "name": "Ben",<br>   "lastName": "Hepworth"<br> }</pre>



<p>As you can see, it just returned Ben Hepworth and not Dingus Hepworth. You can imagine what else you can do with this once you know how to properly reference items in the json. You could easily write a for loop to loop through all items in the array and do something with them. grep, sed and awk, I still love you. Like my aging grandparents.</p>
]]></content:encoded>
							<wfw:commentRss>http://www.benhepworth.com/blog/2019/10/10/using-command-line-tool-jq-to-parse-structured-json/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Fixing or installing Subversion SVN after upgrading to Mac OS Sierra</title>
		<link>http://www.benhepworth.com/blog/2016/09/26/fixing-or-installing-subversion-svn-after-upgrading-to-mac-os-sierra/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
				<comments>http://www.benhepworth.com/blog/2016/09/26/fixing-or-installing-subversion-svn-after-upgrading-to-mac-os-sierra/#comments</comments>
				<pubDate>Mon, 26 Sep 2016 17:01:48 +0000</pubDate>
		<dc:creator><![CDATA[Ben Hepworth]]></dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[broken]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[mac os sierra]]></category>
		<category><![CDATA[sierra]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[upgrade]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://www.benhepworth.com/blog/?p=2345</guid>
				<description><![CDATA[I upgraded to Mac OS Sierra the other day and my command line subversion broke. It sure seems like every time there is an update to the Mac OS, I spend a few days working through little kinks with the various programs that I use until everything stabilizes. After updating to Mac OS Sierra recently, [&#8230;]]]></description>
								<content:encoded><![CDATA[<p>I upgraded to Mac OS Sierra the other day and my command line subversion broke. It sure seems like every time there is an update to the Mac OS, I spend a few days working through little kinks with the various programs that I use until everything stabilizes. After updating to Mac OS Sierra recently, I tried to run a standard svn up command and got the following error message:</p>
<p><code>$ svn up<br />
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun<br />
</code></p>
<p>The solution is pretty simple and also applies if you want to install command line SVN. It appears that the svn command line tools were uninstalled when I upgraded from Mac OS El Capitan to Mac OS Sierra. To install or reinstall the svn command line tools, run the following command:<br />
<code>xcode-select --install</code></p>
<p>After running this command, you&#8217;ll get a popup window prompting you to confirm installation of the XCode command line tools. You don&#8217;t have to install the entire 4GB+ installation of XCode in order to get command line tools like svn.</p>
<p><a href="http://www.benhepworth.com/blog/wp-content/uploads/2016/09/fixSVN1.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img src="http://www.benhepworth.com/blog/wp-content/uploads/2016/09/fixSVN1.png" alt="" width="450" height="189" class="aligncenter size-full wp-image-2351" srcset="http://www.benhepworth.com/blog/wp-content/uploads/2016/09/fixSVN1.png 450w, http://www.benhepworth.com/blog/wp-content/uploads/2016/09/fixSVN1-300x126.png 300w" sizes="(max-width: 450px) 100vw, 450px" /></a></p>
<p>One more thing &#8211; when I was done installing, I tried to run a svn up and got the following error message:</p>
<p><code>tapir:$ svn up<br />
svn: E155036: Please see the 'svn upgrade' command<br />
svn: E155036: The working copy at '/Users/bhepworth/svn/trunk'<br />
is too old (format 29) to work with client version '1.9.4 (r1740329)' (expects format 31). You need to upgrade the working copy first.<br />
</code></p>
<p>I went into the root of the trunk that I had checked out and ran the command:</p>
<p><code>svn upgrade</code></p>
<p>After that, I was able to update from svn:</p>
<p><code>tapir:$ svn upgrade<br />
Upgraded '.'<br />
tapir:$ svn up<br />
Updating '.':<br />
U    share/scripts/deploy/deployBuild.sh<br />
Updated to revision 1372.<br />
</code></p>
<p>I hope this helps you out! Every time Apple upgrades their OS, there are several kinks to work though. Luckily this one was a fairly easy fix.</p>
<p>Here is a quick youtube video I made that shows this fix in action:</p>
<p><iframe width="560" height="315" src="https://www.youtube.com/embed/cWVWMM1QAbU" frameborder="0" allowfullscreen></iframe></p>
<p>~Ben</p>
]]></content:encoded>
							<wfw:commentRss>http://www.benhepworth.com/blog/2016/09/26/fixing-or-installing-subversion-svn-after-upgrading-to-mac-os-sierra/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
							</item>
		<item>
		<title>Turning Off Apple Live Photos</title>
		<link>http://www.benhepworth.com/blog/2016/08/15/turning-off-apple-live-photos/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
				<comments>http://www.benhepworth.com/blog/2016/08/15/turning-off-apple-live-photos/#comments</comments>
				<pubDate>Tue, 16 Aug 2016 02:15:57 +0000</pubDate>
		<dc:creator><![CDATA[Ben Hepworth]]></dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[fail]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[live photos]]></category>
		<category><![CDATA[photos]]></category>

		<guid isPermaLink="false">http://www.benhepworth.com/blog/?p=2325</guid>
				<description><![CDATA[Why, oh why, would Apple introduce Live Photos with iOS 9? In my opinion it is one of the worst decisions ever made by Apple. Phil, come on. You are definitely smarter than that. Why would you want a small video clip with every single photo you take that includes audio? Before you read any [&#8230;]]]></description>
								<content:encoded><![CDATA[<p>Why, oh why, would Apple introduce Live Photos with iOS 9? In my opinion it is one of the worst decisions ever made by Apple. Phil, come on. You are definitely smarter than that. Why would you want a small video clip with every single photo you take that includes audio? Before you read any further, please turn off Live Photos on your iPhone. Launching the camera app and click the yellow circle that is between the HDR and Timer button.<br />
<a href="http://www.benhepworth.com/blog/wp-content/uploads/2016/08/LivePhotos.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img src="http://www.benhepworth.com/blog/wp-content/uploads/2016/08/LivePhotos.png" alt="" width="300" height="532" class="aligncenter size-full wp-image-2330" srcset="http://www.benhepworth.com/blog/wp-content/uploads/2016/08/LivePhotos.png 300w, http://www.benhepworth.com/blog/wp-content/uploads/2016/08/LivePhotos-169x300.png 169w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>I made a quick video to show how to do this as well:<br />
<iframe width="560" height="315" src="https://www.youtube.com/embed/5xFVPq742eI" frameborder="0" allowfullscreen></iframe></p>
<p>I discovered this by accident when I had posted a picture to Facebook. It had this yellow circle on it and said something like &#8220;Live Photo&#8221;.</p>
<p>I was like, &#8220;um, what&#8217;s that?&#8221;</p>
<p>I did a little Googling and found out that for some reason Apple thought it would be a good idea to turn still photos into &#8220;unforgettable living memories&#8221; that include what happened right before and right after the photo, INCLUDING AUDIO. I held down my finger on the picture, and sure enough, it was a mini video with audio.</p>
<p>Now there are tons of people who think they are sharing a photo with someone on Facebook, text, or whatever social media platform you prefer, when they are actually sending a small video &#8211; let me repeat &#8211; THAT INCLUDES AUDIO.</p>
<p>WTF Apple!</p>
<p>Talk about a privacy issue. Not to mention the fact that Apple turned it on by default for everyone when they updated to iOS 9. This should be an &#8220;opt-in&#8221; feature, not an &#8220;opt-out&#8221; feature. Yes, if you read about all of the features ahead of time, you could have know about this and been on the lookout for it &#8211; but who does that? I think I vaguely remember them announcing it, but it was one of those &#8220;um, ok &#8211; what&#8217;s the use case for that&#8221; kinda moments during the Apple event of Sep 2015.</p>
<p>Do you agree? The only valid use case I&#8217;ve found is one that my son showed me where you can take a live photo and put that as your lock screen. Then your lockscreen comes to life everytime you unlock it. Big fat whoop-dee-doo! I&#8217;ve waited 9 iOS releases for this feature &#8211; woohoo! Seriously though, what if you were having some sort of private conversation while snapping a quick photo and then sent it to a friend, not realizing that your audio was captured too? This one is almost as bad as the &#8220;Siri raise to speak&#8221; that was introduced in iOS 8&#8230;but that&#8217;s another topic for another blog post.</p>
<p>Peace out &#8211; and turn off your Live Photos for crying out loud!</p>
]]></content:encoded>
							<wfw:commentRss>http://www.benhepworth.com/blog/2016/08/15/turning-off-apple-live-photos/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
							</item>
		<item>
		<title>The Best Way to Delete Old WordPress Revisions</title>
		<link>http://www.benhepworth.com/blog/2016/06/27/the-best-way-to-delete-old-wordpress-revisions/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
				<comments>http://www.benhepworth.com/blog/2016/06/27/the-best-way-to-delete-old-wordpress-revisions/#comments</comments>
				<pubDate>Tue, 28 Jun 2016 00:45:03 +0000</pubDate>
		<dc:creator><![CDATA[Ben Hepworth]]></dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.benhepworth.com/blog/?p=2264</guid>
				<description><![CDATA[By default, WordPress stores every modification to a post in a separate revision. The idea is that you can roll back to a previous revision. The problem with that, though, is that all of these old revisions can clog up your database and slow it down significantly. For my wife&#8217;s blog, her WordPress Admin was [&#8230;]]]></description>
								<content:encoded><![CDATA[<p>By default, WordPress stores every modification to a post in a separate revision. The idea is that you can roll back to a previous revision. The problem with that, though, is that all of these old revisions can clog up your database and slow it down significantly. For my wife&#8217;s blog, her WordPress Admin was running very slow. She had tens of thousands of old revisions. I did a bunch of googling and there are several different ways posted on the internet on how to do this. There is also a WordPress plugin to do this, but I just wanted to use the build-in way of deleting revisions without having to run some database hack or load a plugin.</p>
<p>
The problem with removing old posts is that the metadata is stored in multiple tables across the WordPress database. In order to ensure that all necessary rows are removed from all tables, you can call the wp_delete_post WordPress API. It is a native method in WordPress that handles the cleanup of all the necessary data everywhere in the database.</p>
<p>
In pseudocode, this is what you do:</p>
<ol>
<li>Load WordPress Config so you have access to the wp_delete_post method</li>
<li>Query the database and get the list of old revisions</li>
<li>Loop through the list of revisions and call wp_delete_post for each one</li>
</ol>
<p>Here is the code for the script:<br />
<code><br />
&lt;?php<br />
        require_once('WP_ROOT/wp-load.php');</p>
<p>        $counter=0;</p>
<p>        $post_revisions = $wpdb->get_results(<br />
                "SELECT `ID` AS revision_id<br />
                ,`POST_TITLE` AS post_title<br />
                FROM ($wpdb->posts)<br />
                WHERE `post_type` = 'revision'<br />
                ORDER BY `ID` DESC"<br />
        );</p>
<p>        foreach($post_revisions as $post)<br />
        {<br />
                echo "{$post->revision_id} : {$post->post_title}\n";<br />
                wp_delete_post($post->revision_id,true);<br />
                $counter++;<br />
        }<br />
        echo "Deleted $counter revisions\n";<br />
?&gt;<br />
</code></p>
<p>The only thing you should have to modify in this script is <<WP_ROOT>> and replace it with the full path to the root directory of your wordpress install. If you&#8217;re not sure where this is, SSH into your server and run the command:<br />
<code>find . -name "wp-load.php"</code></p>
<p>This will tell you where the wp-load.php file is located and will give you access to the internal WordPress APIs.</p>
<p>Save the script to a file called deleteOldRevisions.php. Then, to execute it, run the following command from within the same directory where the script is located:</p>
<p><code>php -f deleteOldRevisions.php</code></p>
<p>Now, let&#8217;s break down what the script is doing:<br />
<code>require_once('WP_ROOT/wp-load.php');</code><br />
This line loads the wp libraries so that you have access to the wp_delete_post method. We then set a counter variable so we can count how many revisions we end up deleting:<br />
<code>$counter=0;</code><br />
We then query the database for all posts that are of type revision. We return the ID to pass into the wp_delete_post method and the post_title for a nice output to the screen when running.<br />
<code>$post_revisions = $wpdb->get_results(<br />
                "SELECT `ID` AS revision_id<br />
                ,`POST_TITLE` AS post_title<br />
                FROM ($wpdb->posts)<br />
                WHERE `post_type` = 'revision'<br />
                ORDER BY `ID` DESC"<br />
        );<br />
</code><br />
This returns an array that is now stored in the $post_revisions variable. We then loop through the $post_revisions variable and call wp_delete_post against each one. The echo we print before calling the method so that we can see which post revision it is deleting. The counter at the end increments the counter for how many revisions we are deleting.<br />
<code>        foreach($post_revisions as $post)<br />
        {<br />
                echo "{$post->revision_id} : {$post->post_title}\n";<br />
                wp_delete_post($post->revision_id,true);<br />
                $counter++;<br />
        }<br />
</code><br />
Then, last but not least, we print how many revisions were deleted by printing the $counter variable:<br />
<code>echo "Deleted $counter revisions\n";</code></p>
<p>This method of removing old posts is the safest because you are getting down at the core functions that are built and maintained by the WordPress team. Once I ran this on my wife&#8217;s server, her WordPress Admin sped up significantly. Before it would sometimes take 30 seconds to a minute just to save a post. Now it is almost instantaneous. Good luck! </p>
]]></content:encoded>
							<wfw:commentRss>http://www.benhepworth.com/blog/2016/06/27/the-best-way-to-delete-old-wordpress-revisions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
							</item>
		<item>
		<title>Tech Tip: Mute Messages on Mac &#8211; Do Not Disturb Mode</title>
		<link>http://www.benhepworth.com/blog/2016/06/16/tech-tip-mute-messages-on-mac-do-not-disturb-mode/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
				<comments>http://www.benhepworth.com/blog/2016/06/16/tech-tip-mute-messages-on-mac-do-not-disturb-mode/#comments</comments>
				<pubDate>Thu, 16 Jun 2016 05:04:19 +0000</pubDate>
		<dc:creator><![CDATA[Ben Hepworth]]></dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[do not disturb]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[messages]]></category>
		<category><![CDATA[popup]]></category>
		<category><![CDATA[text message]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[trick]]></category>

		<guid isPermaLink="false">http://www.benhepworth.com/blog/?p=2287</guid>
				<description><![CDATA[Have you ever received a text message to your Mac while you&#8217;re in a meeting? Or maybe you&#8217;re showing someone something at work and then a text message pops up. Or maybe you&#8217;re on a screen share using Join.Me or WebEx and you don&#8217;t want any notifications. The notification center is useful, but at the [&#8230;]]]></description>
								<content:encoded><![CDATA[<p>Have you ever received a text message to your Mac while you&#8217;re in a meeting? Or maybe you&#8217;re showing someone something at work and then a text message pops up. Or maybe you&#8217;re on a screen share using Join.Me or WebEx and you don&#8217;t want any notifications.  The notification center is useful, but at the same time can be very annoying if you don&#8217;t want any notifications popping up &#8211; mail, messages, etc.  Here is how you turn it off and go into Do Not Disturb Mode.</p>
<p>Step 1: click on the 3 lines in the upper right corner of your Mac:</p>
<p><a href="http://www.benhepworth.com/blog/wp-content/uploads/2016/06/MacDoNotDisturb1.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img src="http://www.benhepworth.com/blog/wp-content/uploads/2016/06/MacDoNotDisturb1.png" alt="Mac Do Not Disturb" width="458" height="271" class="aligncenter size-full wp-image-2290" srcset="http://www.benhepworth.com/blog/wp-content/uploads/2016/06/MacDoNotDisturb1.png 458w, http://www.benhepworth.com/blog/wp-content/uploads/2016/06/MacDoNotDisturb1-300x178.png 300w" sizes="(max-width: 458px) 100vw, 458px" /></a></p>
<p>The notification center will slide in from the right.</p>
<p><a href="http://www.benhepworth.com/blog/wp-content/uploads/2016/06/MacDoNotDisturb2.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img src="http://www.benhepworth.com/blog/wp-content/uploads/2016/06/MacDoNotDisturb2.png" alt="Mac Do Not Disturb" width="460" height="519" class="aligncenter size-full wp-image-2291" srcset="http://www.benhepworth.com/blog/wp-content/uploads/2016/06/MacDoNotDisturb2.png 460w, http://www.benhepworth.com/blog/wp-content/uploads/2016/06/MacDoNotDisturb2-266x300.png 266w" sizes="(max-width: 460px) 100vw, 460px" /></a></p>
<p>Step 2: Scroll up while inside the notification bar &#8211; this is the trick.  By default, the Do Not Disturb button is hidden at the top.  Once you know where this is, it is quite easy to turn on/off.</p>
<p><a href="http://www.benhepworth.com/blog/wp-content/uploads/2016/06/MacDoNotDisturb3.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img src="http://www.benhepworth.com/blog/wp-content/uploads/2016/06/MacDoNotDisturb3.png" alt="Mac Do Not Disturb" width="462" height="569" class="aligncenter size-full wp-image-2292" srcset="http://www.benhepworth.com/blog/wp-content/uploads/2016/06/MacDoNotDisturb3.png 462w, http://www.benhepworth.com/blog/wp-content/uploads/2016/06/MacDoNotDisturb3-244x300.png 244w" sizes="(max-width: 462px) 100vw, 462px" /></a></p>
<p>By default when you turn notifications off, you&#8217;ll see a message indicating that they are off for the day and will automatically turn back on tomorrow. Click on any other window, the Desktop to get the notification bar to disappear.</p>
<p><a href="http://www.benhepworth.com/blog/wp-content/uploads/2016/06/MacDoNotDisturb4.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img src="http://www.benhepworth.com/blog/wp-content/uploads/2016/06/MacDoNotDisturb4.png" alt="Mac Do Not Disturb" width="464" height="568" class="aligncenter size-full wp-image-2293" srcset="http://www.benhepworth.com/blog/wp-content/uploads/2016/06/MacDoNotDisturb4.png 464w, http://www.benhepworth.com/blog/wp-content/uploads/2016/06/MacDoNotDisturb4-245x300.png 245w" sizes="(max-width: 464px) 100vw, 464px" /></a></p>
<p>Here is a quick YouTube video I made showing how easy this is.<br />
<iframe width="560" height="315" src="https://www.youtube.com/embed/EiZ_VVitzCQ" frameborder="0" allowfullscreen></iframe></p>
]]></content:encoded>
							<wfw:commentRss>http://www.benhepworth.com/blog/2016/06/16/tech-tip-mute-messages-on-mac-do-not-disturb-mode/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
							</item>
		<item>
		<title>Install python to separate directory on linux in 5 easy steps</title>
		<link>http://www.benhepworth.com/blog/2016/05/18/install-python-to-separate-directory-on-linux-in-5-easy-steps/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
				<comments>http://www.benhepworth.com/blog/2016/05/18/install-python-to-separate-directory-on-linux-in-5-easy-steps/#comments</comments>
				<pubDate>Wed, 18 May 2016 22:37:40 +0000</pubDate>
		<dc:creator><![CDATA[Ben Hepworth]]></dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[redhat]]></category>

		<guid isPermaLink="false">http://www.benhepworth.com/blog/?p=2270</guid>
				<description><![CDATA[In some cases you may not want to touch the system-wide python installation on a linux box. I recently ran into this where we had a need to install python in it&#8217;s own directory. To install it in a separate directory, it is quite simple. Several years ago I wrote about how to install perl [&#8230;]]]></description>
								<content:encoded><![CDATA[<p>In some cases you may not want to touch the system-wide python installation on a linux box.  I recently ran into this where we had a need to install python in it&#8217;s own directory.  To install it in a separate directory, it is quite simple.  Several years ago I wrote about how to install perl in it&#8217;s own directory in <a href="http://www.benhepworth.com/blog/2010/11/12/standalone-perl-with-dbi-oracle-instant-client-and-dbdoracle-in-10-minutes/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed" target="_blank">this post</a>.  Surprisingly enough, the first page of Google did not point me in the direction that I wanted.  The use cases for this are:</p>
<ol>
<li>You are developing custom software and need a newer version of python than your server has.  You don&#8217;t want to mess with the system-wide python that other programs and scripts may depend on.</li>
<li>You want to install some custom python modules and don&#8217;t want to touch the system-wide python.  I know you can create your own virtaulenv using pip, but what if you need newer functionality or a module is not compatible with the version of python that you have?</li>
<p>The install for this is quite simple.  The key is to use the &#8211;prefix= option in your configure command.  DONE.</p>
<p>So, for example, my home directory is /home/bhepworth.  Let&#8217;s say I want to install the latest python, which at the time of writing this is 3.5.1.  My python install choice is /home/bhepworth/python3.  You can technically install it to any directory you prefer, I&#8217;m just using /home/bhepworth as the example.  Here are the commands, starting from in my home directory of /home/bhepworth:</p>
<p><b><u>Step 1: Download Python</u></b><br />
<code>wget https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tgz</code></p>
<p><b><u>Step 2: Uncompress the binaries</u></b><br />
<code>tar -zxvf Python-3.5.1.tgz</code></p>
<p><b><u>Step 3: Go into the directory with the Python source code</u></b><br />
<code>cd Python-3.5.1</code></p>
<p><b><u>Step 4: Configure</u></b> (change /home/bhepworth/python3 to whatever directory you want to install python to)<br />
<code>./configure --prefix=/home/bhepworth/python3</code></p>
<p><b><u>Step 5: Compile and install</u></b><br />
<code>make</code><br />
<code>make test</code> (Optional)<br />
<code>make install</code></p>
<p><b><u>Verification</u></b><br />
Run python with the -V flag and you will see the version:<br />
<code>$ /home/bhepworth/python3/bin/python3 -V<br />
Python 3.5.1<br />
</code></p>
<p>In my case, the system-wide python is in /usr/bin/python and is on still on the older version, which I can verify by running the same command and using the system-wide python:<br />
<code>$ which python<br />
/usr/bin/python<br />
$ python -V<br />
Python 2.4.3<br />
</code></p>
<p><b>IMPORTANT: Referencing your new and shiny python in your scripts.</b></p>
<p>Make sure at the top of any python scripts you write, that you reference your new python and not /usr/bin/python &#8211; the first line should look like this:</p>
<p><code>#!/home/bhepworth/python3/bin/python3</code></p>
<p>Good luck, and happy python-ing!</p>
]]></content:encoded>
							<wfw:commentRss>http://www.benhepworth.com/blog/2016/05/18/install-python-to-separate-directory-on-linux-in-5-easy-steps/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
							</item>
		<item>
		<title>Tivo Hacks: Episode 2 &#8211; Unboxing Tivo Roamio Multi-Room Setup</title>
		<link>http://www.benhepworth.com/blog/2016/04/29/tivo-hacks-episode-2-unboxing-tivo-roamio-multi-room-setup/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
				<comments>http://www.benhepworth.com/blog/2016/04/29/tivo-hacks-episode-2-unboxing-tivo-roamio-multi-room-setup/#respond</comments>
				<pubDate>Sat, 30 Apr 2016 02:47:09 +0000</pubDate>
		<dc:creator><![CDATA[Ben Hepworth]]></dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[dvr]]></category>
		<category><![CDATA[TiVo]]></category>
		<category><![CDATA[unboxing]]></category>

		<guid isPermaLink="false">http://www.benhepworth.com/blog/?p=2249</guid>
				<description><![CDATA[This is part 2 in my series of setting up my own multi-room DVR setup using a real for real TiVo. You can view episode 1 here. This episode contains a video of the unboxing of my TiVo Roamio. This kit contains all of the equipment necessary to setup a multi-room TiVo setup in my [&#8230;]]]></description>
								<content:encoded><![CDATA[<p>This is part 2 in my series of setting up my own multi-room DVR setup using a real for real TiVo.  You can view episode 1 <a href="http://www.benhepworth.com/blog/2015/09/03/tech-hacks-tivo-episode-1-history/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed" target="_blank">here</a>. This episode contains a video of the unboxing of my TiVo Roamio.  This kit contains all of the equipment necessary to setup a multi-room TiVo setup in my house &#8211; a four room setup with streaming outside of the house to be exact.  Have fun watching the unboxing video!  Future episodes will contain tutorials for how to set this up yourself.</p>
<p><iframe width="560" height="315" src="https://www.youtube.com/embed/TPtxM9Ev_qs" frameborder="0" allowfullscreen></iframe></p>
<p><a href="http://www.benhepworth.com/blog/wp-content/uploads/2016/04/TiVo-equipment.jpg#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img src="http://www.benhepworth.com/blog/wp-content/uploads/2016/04/TiVo-equipment.jpg" alt="TiVo" width="550" height="413" class="aligncenter size-full wp-image-2255" srcset="http://www.benhepworth.com/blog/wp-content/uploads/2016/04/TiVo-equipment.jpg 550w, http://www.benhepworth.com/blog/wp-content/uploads/2016/04/TiVo-equipment-300x225.jpg 300w" sizes="(max-width: 550px) 100vw, 550px" /></a></p>
<p><a href="http://www.benhepworth.com/blog/wp-content/uploads/2016/04/TiVo-accessories.jpg#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img src="http://www.benhepworth.com/blog/wp-content/uploads/2016/04/TiVo-accessories.jpg" alt="Tivo Accessories" width="550" height="413" class="aligncenter size-full wp-image-2253" srcset="http://www.benhepworth.com/blog/wp-content/uploads/2016/04/TiVo-accessories.jpg 550w, http://www.benhepworth.com/blog/wp-content/uploads/2016/04/TiVo-accessories-300x225.jpg 300w" sizes="(max-width: 550px) 100vw, 550px" /></a></p>
<p><a href="http://www.benhepworth.com/blog/wp-content/uploads/2016/04/TiVo-accessories2.jpg#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img src="http://www.benhepworth.com/blog/wp-content/uploads/2016/04/TiVo-accessories2.jpg" alt="Tivo Accessories" width="413" height="550" class="aligncenter size-full wp-image-2256" srcset="http://www.benhepworth.com/blog/wp-content/uploads/2016/04/TiVo-accessories2.jpg 413w, http://www.benhepworth.com/blog/wp-content/uploads/2016/04/TiVo-accessories2-225x300.jpg 225w" sizes="(max-width: 413px) 100vw, 413px" /></a></p>
]]></content:encoded>
							<wfw:commentRss>http://www.benhepworth.com/blog/2016/04/29/tivo-hacks-episode-2-unboxing-tivo-roamio-multi-room-setup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Install Warcraft 3 Natively on Modern Mac</title>
		<link>http://www.benhepworth.com/blog/2016/04/04/install-warcraft-3-natively-on-modern-mac/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
				<comments>http://www.benhepworth.com/blog/2016/04/04/install-warcraft-3-natively-on-modern-mac/#comments</comments>
				<pubDate>Tue, 05 Apr 2016 04:24:05 +0000</pubDate>
		<dc:creator><![CDATA[Ben Hepworth]]></dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Video Games]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[Blizzard]]></category>
		<category><![CDATA[El Capitan]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Warcraft 3]]></category>

		<guid isPermaLink="false">http://www.benhepworth.com/blog/?p=2241</guid>
				<description><![CDATA[Ever since OS X Mavericks you have not been able to install Warcraft 3 on a mac&#8230;until now. Blizzard released patch 1.27a in March of 2016. The installer now supports modern day Mac computers and runs the game natively on your Mac. The video I made shows the download and install being done on OS [&#8230;]]]></description>
								<content:encoded><![CDATA[<p>Ever since OS X Mavericks you have not been able to install Warcraft 3 on a mac&#8230;until now. Blizzard released patch 1.27a in March of 2016. The installer now supports modern day Mac computers and runs the game natively on your Mac. The video I made shows the download and install being done on OS X El Capitan in April of 2016. Previously he only way to install Warcraft III on a Mac was to use an open source windows emulater called wineskin, which was a bit of a pain to setup. The game ran ok on it, but not like running natively. Warcraft 3 is now running natively and extremely smooth on my Mac &#8211; woohoo! Now I can introduce my son to old school RTS gaming. Can you believe Warcraft 3 is now 14 years old?</p>
<p><iframe src="https://www.youtube.com/embed/fiRTa6pEl4I" width="420" height="315" frameborder="0" allowfullscreen="allowfullscreen"></iframe></p>
]]></content:encoded>
							<wfw:commentRss>http://www.benhepworth.com/blog/2016/04/04/install-warcraft-3-natively-on-modern-mac/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
							</item>
		<item>
		<title>Annoying iPhone Group Text?  Here&#8217;s how to silence it</title>
		<link>http://www.benhepworth.com/blog/2016/02/06/annoying-iphone-group-text-heres-how-to-silence-it/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
				<comments>http://www.benhepworth.com/blog/2016/02/06/annoying-iphone-group-text-heres-how-to-silence-it/#respond</comments>
				<pubDate>Sat, 06 Feb 2016 19:46:30 +0000</pubDate>
		<dc:creator><![CDATA[Ben Hepworth]]></dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.benhepworth.com/blog/?p=2219</guid>
				<description><![CDATA[Have you ever been in a meeting and your phone is on silent when a group text comes in out of nowhere? Then people start replying left and right, creating an embarrassing buzzing during the meeting? Even worse, you have an iPad next to you as well and it is also buzzing with every new [&#8230;]]]></description>
								<content:encoded><![CDATA[<p>Have you ever been in a meeting and your phone is on silent when a group text comes in out of nowhere?  Then people start replying left and right, creating an embarrassing buzzing during the meeting? Even worse, you have an iPad next to you as well and it is also buzzing with every new message that comes in since it is hooked up to your iCloud account with Messages.  Here is a quick tip on how you can silence that group text so your phone and/or iPad will stop buzzing.  You will still receive all of the messages and can catch up on the thread later, you just won&#8217;t disturb your clients or the people that you are in a meeting with a buzzing iPhone and/or iPad.</p>
<p>Step 1: Open Messages (iPhone and/or iPad)<br />
Step 2: Open the group text<br />
Step 3: Click Details in the upper right<br />
Step 4: Scroll to the bottom<br />
Step 5: Select &#8220;Do Not Disturb&#8221;</p>
<p>Here are a few screenshots to show how to do this:</p>
<p><a href="http://www.benhepworth.com/blog/wp-content/uploads/2016/02/silenceGroupText1.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed" rel="attachment wp-att-2234"><img src="http://www.benhepworth.com/blog/wp-content/uploads/2016/02/silenceGroupText1.png" alt="" width="300" height="534" class="aligncenter size-full wp-image-2234" srcset="http://www.benhepworth.com/blog/wp-content/uploads/2016/02/silenceGroupText1.png 300w, http://www.benhepworth.com/blog/wp-content/uploads/2016/02/silenceGroupText1-169x300.png 169w" sizes="(max-width: 300px) 100vw, 300px" /></a><br />
<center>~~~~~~~~~~~~~~~~</center><br />
<a href="http://www.benhepworth.com/blog/wp-content/uploads/2016/02/silenceGroupText2.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed" rel="attachment wp-att-2235"><img src="http://www.benhepworth.com/blog/wp-content/uploads/2016/02/silenceGroupText2.png" alt="" width="300" height="534" class="aligncenter size-full wp-image-2235" srcset="http://www.benhepworth.com/blog/wp-content/uploads/2016/02/silenceGroupText2.png 300w, http://www.benhepworth.com/blog/wp-content/uploads/2016/02/silenceGroupText2-169x300.png 169w" sizes="(max-width: 300px) 100vw, 300px" /></a><br />
<center>~~~~~~~~~~~~~~~~</center><br />
<a href="http://www.benhepworth.com/blog/wp-content/uploads/2016/02/silenceGroupText3.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed" rel="attachment wp-att-2236"><img src="http://www.benhepworth.com/blog/wp-content/uploads/2016/02/silenceGroupText3.png" alt="" width="300" height="534" class="aligncenter size-full wp-image-2236" srcset="http://www.benhepworth.com/blog/wp-content/uploads/2016/02/silenceGroupText3.png 300w, http://www.benhepworth.com/blog/wp-content/uploads/2016/02/silenceGroupText3-169x300.png 169w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
]]></content:encoded>
							<wfw:commentRss>http://www.benhepworth.com/blog/2016/02/06/annoying-iphone-group-text-heres-how-to-silence-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Resolving issues during LEMP server installation</title>
		<link>http://www.benhepworth.com/blog/2015/12/14/resolving-issues-during-lemp-server-installation/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
				<comments>http://www.benhepworth.com/blog/2015/12/14/resolving-issues-during-lemp-server-installation/#comments</comments>
				<pubDate>Tue, 15 Dec 2015 00:01:10 +0000</pubDate>
		<dc:creator><![CDATA[Ben Hepworth]]></dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[lemp]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php-fpm]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.benhepworth.com/blog/?p=2187</guid>
				<description><![CDATA[I recently moved my wife&#8217;s blog from the terrible hosting of HostGator to my own VPS at XMission and setup a LEMP server (Linux, nginx, Mariadb, PHP) on CentOS 7. During the process I ran into a handful of issues that I had to work through. First off, I used this website as a rough [&#8230;]]]></description>
								<content:encoded><![CDATA[<p>I recently moved my wife&#8217;s blog from the terrible hosting of HostGator to my own VPS at XMission and setup a LEMP server (Linux, nginx, Mariadb, PHP) on CentOS 7.  During the process I ran into a handful of issues that I had to work through.</p>
<p>First off, I used <a href="https://deliciousbrains.com/hosting-wordpress-yourself-nginx-php-mysql/" target="_blank">this website</a> as a rough tutorial for setting up a LEMP server.  The tutorial was written for someone on a debian server, though, and I am on CentOS 7.  I also used <a href="https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-centos-7" target="_blank">this server</a> for some of the CentOS 7 differences.  I still ran into several issues during the process.  Here are the issues I encountered and how I resolved them.</p>
<p>Table of Contents for this post (click on links to go to the appropriate section):<br />
<a href="#one#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Issue #1: No feedback from systemctl</a><br />
<a href="#two#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Issue #2: Permission denied error when starting nginx</a><br />
<a href="#three#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Issue #3: nginx blank PHP pages</a><br />
<a href="#four#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Issue #4: WordPress error &#8211; 502 Bad Gateway</a><br />
<a href="#five#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Issue #5: Some Blog Posts were displaying blanks</a></p>
<h3 id="one"><u><b>Issue #1: No feedback from systemctl</b></u></h3>
<p>The first thing I noticed about CentOS 7 is that the commands for starting/stopping are different than what I&#8217;m used to on redhat systems.  /etc/init.d or service refers you over to systcmctl.  For example, to start nginx:<br />
<code>systemctl start nginx</code><br />
I&#8217;m used to seeing feedback with [ OK ] or something like that when stopping or starting services.  On CentOS 7 it gives you nothing.  After some googling, apparently this is by desing, and it only gives you an error when there are issues with the systemctl command.  For example:<br />
<code># systemctl restart nginx<br />
Job for nginx.service failed. See 'systemctl status nginx.service' and 'journalctl -xn' for details.<br />
</code><br />
You can then run the command systemctl status nginx.service to get the details about what went wrong during the start.  This one really wasn&#8217;t technically an issue with the install, but was something that I learned while using CentOS 7 for the first time.</p>
<h3 id="two"><u><b>Issue #2: Permission denied error when starting nginx</b></u></h3>
<p>After setting up the virtualhost in nginx, I was getting the following error when starting nginx:<br />
<code>nginx: [emerg] open() ".../logs/access.log" failed (13: Permission denied)<br />
nginx: configuration file /etc/nginx/nginx.conf test failed<br />
nginx.service: control process exited, code=exited status=1<br />
Failed to start The nginx HTTP and reverse proxy server.<br />
Unit nginx.service entered failed state.<br />
</code><br />
Running &#8220;nginx -t&#8221; did not return any errors.  I verified that the entire directory tree up to logs was 755 and that the user I was running nginx as has permission to it all.  After a lot of googling, the issue ended up being with CentOS 7 SELinux.  It was set to Enforcing.  Changing it to Permissive resolved the issue.  <a href="http://kb.odin.com/en/121838" target="_blank" class="broken_link">This website</a> helped resolve the issue for me.  First, I ran the command getenforce, which returned Enforcing:<br />
<code># getenforce<br />
Enforcing<br />
</code><br />
Then I set it to permissive:<br />
<code># setenforce 0<br />
</code><br />
After that, it returned Permissive:<br />
<code># getenforce<br />
Permissive<br />
</code><br />
Then a restart of nginx and the error went away:<br />
<code># systemctl start nginx<br />
</code></p>
<h3 id="three"><u><b>Issue #3: nginx blank PHP pages</b></u></h3>
<p>Once I got the virtualhost issue with SELinux resolved, I could get regular HTMl pages to render just fine, but any PHP page would not work.    nginx doesn&#8217;t actually do the php processing.  It hands off any PHP pages to PHP-FPM for the processing.  PHP-FPM runs as a separate process on the server.  The tutorial for the debian setup uses the unix sock setup, whereas CentOS 7 uses regular process listening on a port.  At the end of the day, the following two configs needed to match to get PHP to render:<br />
In /etc/php-fpm.d/www.conf :<br />
<code>listen = 127.0.0.1:9000<br />
</code><br />
The fastcgi_pass line in the location section of the virtualhost configuration for nginx:<br />
<code>location ~ \.php$ {<br />
&nbsp;&nbsp;&nbsp;&nbsp;try_files $uri =404;<br />
&nbsp;&nbsp;&nbsp;&nbsp;fastcgi_split_path_info ^(.+\.php)(/.+)$;<br />
&nbsp;&nbsp;&nbsp;&nbsp;fastcgi_pass 127.0.0.1:9000;<br />
&nbsp;&nbsp;&nbsp;&nbsp;fastcgi_index index.php;<br />
&nbsp;&nbsp;&nbsp;&nbsp;include fastcgi.conf;<br />
}<br />
</code></p>
<p>The debian instructions had the line like this:<br />
<code>fastcgi_pass unix:/var/run/php5-fpm.sock;<br />
</code></p>
<p>With the sock location, it didn&#8217;t match the php-fpm config.  Once I updated it to point to 127.0.0.1:9000 then nginx was able to properly pass the PHP requests to the php-fpm process.  Totally makes sense now, but I was sure hitting my head against a brick wall until I figured this out.</p>
<h3 id="four"><u><b>Issue #4: WordPress error &#8211; 502 Bad Gateway</b></u></h3>
<p>I migrated my wordpress installation over by to the new server and was receiving a 502 Bad Gateway error when attempting to hit the site.  After much Googling, apparently nginx does not like PHP shortcuts, whereas Apache is more forgiving.  For example, to properly do a php block of code, you are supposed to start it like this:<br />
<code>&lt;?php<br />
...your php code<br />
?&gt;<br />
</code><br />
If you are lazy and using Apache, you can use a shortcut for your PHP like this:<br />
<code>&lt;?<br />
...your php code<br />
?&gt;<br />
</code><br />
I was seeing the following errors in the nginx virtualhost error log:<br />
<code>[error] *15 FastCGI sent in stderr: "PHP message: PHP Parse error:  syntax error, unexpected 'else' (T_ELSE) in wp-content/plugins/wp-gravatar/gravatars.php on line 752" while reading response header from upstream<br />
</code><br />
I opened up the referenced file (gravatars.php) and found two spots in it that had the php shortcut.  I just added php after the open &#038;lt? and saved the file.  In googling there were other people referencing this as well.  I will need to keep this in mind after future wordpress updates.  If there are any other PHP shortcuts, they&#8217;ll need to be edited like this in order for nginx to work with it.  I found this solution at <a href="https://wordpress.org/support/topic/plugin-wp-gravatar-error-500" target="_blank">here</a>.</p>
<h3 id="five"><u><b>Issue #5: Some Blog Posts were displaying blanks</b></u></h3>
<p>PHP message: PHP Warning:  Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session)</p>
<p><code>; Set session path to a directory owned by process user<br />
php_value[session.save_handler] = files<br />
php_value[session.save_path] = /var/lib/php/session<br />
</code></p>
<p>This directory was owned by root:apache.<br />
<code># ls -l /var/lib/php<br />
total 4<br />
drwxrwx---. 2 root apache 4096 Jun 23 17:20 session<br />
</code><br />
I changed ownership on the session directory to the user and group that nginx is running as.<br />
<code># chown user:group /var/lib/php/session<br />
</code></p>
<p>After doing that, the session errors went away in my virtual host error.log, but there were still proxy errors:</p>
<p><code>[crit] 1295#0: *1369 open() "/var/lib/nginx/tmp/fastcgi/1/17/0000000171" failed (13: Permission denied) while reading upstream, client: 62.210.101.170, server: houseofhepworths.com, request: "GET /2012/01/10/mounting-your-tv-to-the-wall-and-hiding-all-the-cords/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.houseofhepworths.com"<br />
</code><br />
In the virtualhost error.log, I was seeing a lot of these errors.  When I punched in the URL from any of the GET calls, it was blank.  Upon further analysis, it looked like it was trying to access /var/lib/nginx/tmp.  When I first setup nginx, it was set to run as the ngnix id and group.  I updated it to the user and group that I am running nginx as now since it didn&#8217;t have permission to that directory:<br />
<code># cd /var/lib<br />
# chown -R user:group nginx<br />
</code><br />
As soon as I made the nginx user and group own /var/lib/nginx recursively, the errors went away in the virtualhost error log and the blog posts loaded.</p>
<p>After working through all of these issues, I have a functioning LEMP server.  I still need to do some other things like setup caching, but everything looks god for now.  Hopefully if you have seen any of these errors, this post will help you so you don&#8217;t have to spend hours googling and digging through posts to find the answers.</p>
]]></content:encoded>
							<wfw:commentRss>http://www.benhepworth.com/blog/2015/12/14/resolving-issues-during-lemp-server-installation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
							</item>
	</channel>
</rss>
