<?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>GimmeSoda &#187; Development</title>
	<atom:link href="http://www.gimmesoda.com/category/programming/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gimmesoda.com</link>
	<description>The Blog of a Programmer</description>
	<lastBuildDate>Sun, 29 Jan 2012 10:26:09 +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>Thoughts on VPS Memory Management</title>
		<link>http://www.gimmesoda.com/thoughts-on-vps-memory-management/</link>
		<comments>http://www.gimmesoda.com/thoughts-on-vps-memory-management/#comments</comments>
		<pubDate>Mon, 21 Feb 2011 23:13:16 +0000</pubDate>
		<dc:creator>JuanJose</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[DreamHost]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[JJ's DreamHost VPS Memory Manager]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[Personal Projects]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.gimmesoda.com/?p=561</guid>
		<description><![CDATA[Recently, I have been spending a significant amount of time working on an application which manages the amount of memory assigned to a DreamHost Web VPS. During the time I&#8217;ve spent developing this several choices had to be made in what the real goal of the application had to be. When it comes to  [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I have been spending a significant amount of time working on an application which manages the amount of memory assigned to a DreamHost Web VPS. During the time I&#8217;ve spent developing this several choices had to be made in what the real goal of the application had to be. When it comes to memory management on a server there are really two goals which don&#8217;t always play well together.</p>
<h2>Goal One: Save Money</h2>
<p>Many people seem to have a belief that just because the site/s are on a VPS, even with memory set as low as possible (300MB of RAM assigned to a machine in the case of a DreamHost VPS), they will have perfect or near perfect uptime. Sadly, this is not the case and often times this misunderstanding/confusion can lead to serious downtime and frustration. Ideally, for people who are trying to have the lowest amount of memory usage possible, a memory management application would realize that there is a need for more memory, calculate an estimated amount of memory needed to handle the increased usage, resize the VPS as closely as possible to that need, then downsize as soon as the memory is no longer needed.</p>
<p>There is one major issue with this scenario:</p>
<p>Creating estimates regarding the amount of memory needed in an environment where usage is constantly changing, is a massive challenge. To be more specific; since the ability to resize a VPS tends to take some time (anywhere from 1-5 minutes), it is possible for memory requirements to have increased during the time that the need was detected and the memory estimate was created. This could create a resize on a VPS with too little memory, causing problems for the website/s on the VPS, as the machine is given too little memory to handle the increased need.</p>
<h2>Goal Two: Keep Services Running</h2>
<p>If you are on a VPS, chances are you&#8217;ve outgrown shared hosting or are looking for more stability and control over the environment your applications run on. If you&#8217;ve got a decent understanding of servers, applications, and websites, you may also understand that you need to have enough memory to run all the processes and handle the requests to your sites. Often times simply setting your service to the lowest amount of memory possible is going to be asking for failed script executions and the dreaded 500 error being displayed on your site.</p>
<p>So with this understanding, some people go to the extreme and max out their VPS resources. At DreamHost that means $200 a month for services (4GB worth of RAM) which may not be fully utilized (and most likely are not). So the question here becomes how to balance cost and the need for memory, in order to keep services running without paying the maximum amount at all times.</p>
<h2>A Hybrid Memory Manager Focused on Uptime</h2>
<p>With these two potential goals in mind, I had decided to mainly focus my attentions on goal two. While I do understand the need to keep price as low as possible, it is my personal belief, gleaned from experience, that a downed website is more damaging to the bottom line than a slightly larger payment for hosting services. So with this in mind, the memory manager was created to focus on uptime, while still saving time and money for those who manually resize throughout the day, and potentially over-allocate memory for their site/s.</p>
<p>All this being said, I am quite excited to be releasing this software soon. The status of this release is currently closed beta. However, if you are interested in testing this on your DreamHost VPS, please contact me. I am looking to increase the pool of Beta testers before the official release.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gimmesoda.com/thoughts-on-vps-memory-management/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A DreamHost VPS Memory Manager &#8211; Coming Soon</title>
		<link>http://www.gimmesoda.com/a-dreamhost-vps-memory-manager-coming-soon/</link>
		<comments>http://www.gimmesoda.com/a-dreamhost-vps-memory-manager-coming-soon/#comments</comments>
		<pubDate>Sat, 19 Feb 2011 12:09:22 +0000</pubDate>
		<dc:creator>JuanJose</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[DreamHost]]></category>
		<category><![CDATA[JJ's DreamHost VPS Memory Manager]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[Personal Projects]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.gimmesoda.com/?p=545</guid>
		<description><![CDATA[I&#8217;ve been working on this for awhile now and it&#8217;s almost ready! I&#8217;m just working out a better set of rules for figuring out what amount to resize to and I&#8217;ll be releasing the first beta!

]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working on this for awhile now and it&#8217;s almost ready! I&#8217;m just working out a better set of rules for figuring out what amount to resize to and I&#8217;ll be releasing the first beta!</p>
<p><a href="http://www.gimmesoda.com/wp-content/uploads/2011/02/JJsVPSMemoryManager.png"><img class="aligncenter size-large wp-image-546" title="JJsVPSMemoryManager" src="http://www.gimmesoda.com/wp-content/uploads/2011/02/JJsVPSMemoryManager-1024x874.png" alt="" width="1024" height="874" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gimmesoda.com/a-dreamhost-vps-memory-manager-coming-soon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MD5 with Dynamic Salt Class</title>
		<link>http://www.gimmesoda.com/md5-with-dynamic-salt-class/</link>
		<comments>http://www.gimmesoda.com/md5-with-dynamic-salt-class/#comments</comments>
		<pubDate>Wed, 26 Sep 2007 03:28:54 +0000</pubDate>
		<dc:creator>JuanJose</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.gimmesoda.com/?p=46</guid>
		<description><![CDATA[Remember my post about MD5 Hashing and Salt? Well I&#8217;ve taken some time to develop a PHP class which helps very easily implement dynamic salt when using MD5. This class can be easily expanded or modified to use a different hash function. Take a look at it and let me know if it becomes useful to  [...]]]></description>
			<content:encoded><![CDATA[<p>Remember my post about <a target="_blank" href="http://juanjose.blackfalconsolutions.com/2007/09/13/md5-hashing-and-salt/" title="MD5 Hashing and Salt">MD5 Hashing and Salt</a>? Well I&#8217;ve taken some time to develop a PHP class which helps very easily implement dynamic salt when using MD5. This class can be easily expanded or modified to use a different hash function. Take a look at it and let me know if it becomes useful to anyone!</p>
<p>You can <a href="http://juanjose.blackfalconsolutions.com/PasswordWithSalt.class.zip" title="MD5 with Dynamic Salt">download the PasswordWithSalt.class.php file here</a>. Also I setup a <a target="_blank" href="http://juanjose.blackfalconsolutions.com/PasswordWithSalt_Test.php">VERY simple demo</a> of how this works. I&#8217;m still working on developing this but comments and advice will definately be useful here.</p>
<p> The following is the rough text and instructions I&#8217;ve written for my &#8220;readme.txt&#8221; file.</p>
<p><font size="2"></p>
<blockquote>
<p align="left">The only thing you need to do in order to properly configure this class is set the location you want to store your salts at. For example in the class set $storageLocation = &#8220;/home/user/salts/&#8221;; and give permissions for your server to write to that folder  (777 will work). I recommend the folder to be one outside your normal webroot.</p>
<p align="left">The following demonstrates how to store salt for your user, then generate the hash using those salts. Don&#8217;t forget to store the final hash so you can compare against it later!</p>
<p align="left">&lt;?php<br />
require(&#8220;PasswordWithSalt.class.php&#8221;);</p>
<p align="left">//Init the class<br />
$SaltPlease = new PasswordWithSalt();</p>
<p align="left">//Store generated salts for user &#8220;admin&#8221;<br />
$SaltPlease-&gt;storeSalt(&#8220;admin&#8221;);</p>
<p align="left">//Get hash for user admin, password is &#8220;password&#8221;<br />
$hash = $SaltPlease-&gt;createHash(&#8220;admin&#8221;, &#8220;password&#8221;);<br />
?&gt;</p>
<p align="left">&nbsp;</p>
<p align="left">The following demonstrates how to duplicate the hash for a user who already has salt. $dbhash should be filled with the hash you have stored before.</p>
<p align="left">&lt;?php<br />
require(&#8220;PasswordWithSalt.class.php&#8221;);</p>
<p align="left">//Init the class<br />
$SaltPlease = new PasswordWithSalt();</p>
<p align="left">//Get hash for user admin, password is &#8220;password&#8221;<br />
$hash = $SaltPlease-&gt;createHash(&#8220;admin&#8221;, &#8220;password&#8221;);</p>
<p align="left">//Check to see if the generated hash match.<br />
if($dbhash == $hash) {<br />
echo &#8220;Password Hashes Match.&#8221;;<br />
} else {<br />
echo &#8220;Password Hashes DO NOT Match&#8221;;<br />
}<br />
?&gt;</p></blockquote>
<p></font></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gimmesoda.com/md5-with-dynamic-salt-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MD5 Hashing and Salt</title>
		<link>http://www.gimmesoda.com/md5-hashing-and-salt/</link>
		<comments>http://www.gimmesoda.com/md5-hashing-and-salt/#comments</comments>
		<pubDate>Thu, 13 Sep 2007 18:47:56 +0000</pubDate>
		<dc:creator>JuanJose</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.gimmesoda.com/?p=38</guid>
		<description><![CDATA[I just read a great post by Marcel Oelke who runs http://md5.rednoize.com/. He&#8217;s got a great way to access his webservice and then check if a user&#8217;s password is insecure. Even if you are using MD5 before storing the password, I certianly hope people aren&#8217;t storing passwords in cleartext, it may not  [...]]]></description>
			<content:encoded><![CDATA[<p>I just read a great post by Marcel Oelke who runs <a href="http://md5.rednoize.com/">http://md5.rednoize.com/</a>. He&#8217;s got a great way to access his webservice and then check if a user&#8217;s password is insecure. Even if you are using MD5 before storing the password, I certianly hope people aren&#8217;t storing passwords in cleartext, it may not be secure.</p>
<p>I know many people don&#8217;t add some salt before storing the password and MD5.rednoize.com really is the perfect example as to why you should be salting all passwords! Even if you have a single sitewide salt - prepending it to a user&#8217;s password before creating the hash is a powerful way to prevent the use of a database like the one which runs MD5.rednoize.com matching against your database. So basically in PHP:</p>
<p>$salt = &#8220;ThisSuperLongStringWillProtectMyUsersAgainstInsecurePasswords&#8221;;<br />
$userpass = $_POST['pass'];<br />
$md5pass = md5($salt . $userpass);</p>
<p>When your user then attempts to login you&#8217;ll duplicate the same process. I personally would keep the $salt in a file outside the normal webroot.</p>
<p>Now the chances of a site having the matching hash to your users password &#8211; even if the pass is &#8221;word&#8221; is MUCH less likely. I hope this explains what it means to salt your passwords.</p>
<p>You can read Marcel&#8217;s post and learn how to call his webservice here:<br />
<a href="http://blog.fl3x.de/2005/11/10/checking-password-strength-using-md5rednoizecom-and-ajax/">http://blog.fl3x.de/2005/11/10/checking-password-strength-using-md5rednoizecom-and-ajax/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gimmesoda.com/md5-hashing-and-salt/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Image Resizing Using PHP and the GD library</title>
		<link>http://www.gimmesoda.com/image-resizing-using-php-and-the-gd-library/</link>
		<comments>http://www.gimmesoda.com/image-resizing-using-php-and-the-gd-library/#comments</comments>
		<pubDate>Sun, 26 Nov 2006 10:48:00 +0000</pubDate>
		<dc:creator>JuanJose</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux Command Line]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.gimmesoda.com/?p=15</guid>
		<description><![CDATA[I&#8217;m developing a new system core, can&#8217;t really say what it&#8217;s about but I&#8217;m having some fun doing it. Coding it is interesting, I&#8217;m getting to pull out and update some of my php code. Below is some code for image resizing, I use config files to set some default information like directories to save  [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m developing a new system core, can&#8217;t really say what it&#8217;s about but I&#8217;m having some fun doing it. Coding it is interesting, I&#8217;m getting to pull out and update some of my php code. Below is some code for image resizing, I use config files to set some default information like directories to save to and max width/height requirements. Also the entire system uses language files so I don&#8217;t output the text directly either, except for what I&#8217;m going to remove which is the uploaded file information.</p>
<p>Resize JPG images using the GD library and PHP.</p>
<blockquote><p>function get_image_information($key) {<br /> global $thumbnail_dest, $image_dest, $thumb_max_height, $thumb_max_width, $image_max_height, $image_max_width;<br /> $filename = $_FILES[$key]["name"];<br /> $file_type = $_FILES[$key]["type"];<br /> $file_tmpname = $_FILES[$key]["tmp_name"];<br /> $file_error = $_FILES[$key]["error"];<br /> $file_size = $_FILES[$key]["size"];</p>
<p> if($file_error == 0 &&amp; $file_size > 0) {<br />  if($file_type == &#8220;image/pjpeg&#8221;  $file_type == &#8220;image/jpeg&#8221;  $file_type == &#8220;image/jpg&#8221;) {<br />   $image_name = md5(time() . rand(1001,10000)) . &#8220;.jpg&#8221;;<br />   $thumb_dest = $thumbnail_dest . $image_name;<br />   $image_dest = $image_dest . $image_name;<br />   create_image($file_tmpname, $thumb_max_height, $thumb_max_width, $thumb_dest);<br />   create_image($file_tmpname, $image_max_height, $image_max_width, $image_dest);<br />   return &#8220;thumbs/&#8221; . $image_name;<br />  } else {<br />   $success .= file_upload_success_1 . $filename . file_upload_success_2 . &#8220;<br />&#8220;;<br />   $success .= &#8220;We can only accept jpg uploads. Upload Failed.&#8221;;<br />   return $success;<br />  }<br /> } else {<br />  if($file_error == 1) {<br />   echo $file_upload_fail_1;<br />  } elseif($file_error == 2) {<br />   echo $file_upload_fail_2;<br />  } elseif($file_error == 3) {<br />   echo $file_upload_fail_3;<br />  } elseif($file_error == 4) {<br />   echo $file_upload_fail_4;<br />  } elseif($file_error == 6) {<br />   echo $file_upload_fail_6;<br />  }<br />  return false;<br /> }<br />}<br />function create_image($image, $max_width, $max_height, $dest) {<br /> $image = imagecreatefromjpeg($image);<br /> if ($image === false) {<br />  die (&#8216;Unable to open image&#8217;);<br /> }</p>
<p> $width = imagesx($image);<br /> $height = imagesy($image);</p>
<p> if($width < $max_width &#038;&#038; $height < $max_height) {<br />  $new_width = $width;<br />  $new_height = $height;<br /> } else {<br />  $scale = min($max_width/$width, $max_height/$height);<br />  $new_width = floor($scale * $width);<br />  $new_height = floor($scale * $height);<br /> }</p>
<p> $image_resized = imagecreatetruecolor($new_width, $new_height);<br /> imagecopyresampled($image_resized, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);<br /> imagejpeg($image_resized, $dest, 90);<br />}</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.gimmesoda.com/image-resizing-using-php-and-the-gd-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>API’s Gone Wild</title>
		<link>http://www.gimmesoda.com/apis-gone-wild/</link>
		<comments>http://www.gimmesoda.com/apis-gone-wild/#comments</comments>
		<pubDate>Fri, 14 Jul 2006 00:19:00 +0000</pubDate>
		<dc:creator>JuanJose</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.gimmesoda.com/?p=9</guid>
		<description><![CDATA[Google, Amazon, Ebay
For all those developers interested in making some seriously interesting or possibly revenue generating programs the google, amazon, and ebay api&#8217;s may be a good place to start. I&#8217;ve used them in the past always to make something small for a client.
Now it&#8217;s my turn, and  [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-weight: bold;">Google, Amazon, Ebay</span></p>
<p>For all those developers interested in making some seriously interesting or possibly revenue generating programs the google, amazon, and ebay api&#8217;s may be a good place to start. I&#8217;ve used them in the past always to make something small for a client.</p>
<p>Now it&#8217;s my turn, and although the programs I would like to make may be small they&#8217;ll be a great learning experience and my own! It&#8217;s just that special little feeling of accomplishment when that first XML transaction goes through and you recieve something other than an error code! Ah, yes that&#8217;s a good feeling indeed!</p>
<p>So yeah I went a little overboard today and signed up for every major API at the three.<br />
If you&#8217;re interested take a look!<br />
<a href="http://www.google.com/apis/maps/">Google Maps API</a> (This one is just fun.)<br />
<a href="http://code.google.com/apis/ajaxsearch/">Google Ajax Search API</a> (Might be interesting.)<br />
<a href="http://www.google.com/apis/adwords/">Google Adwords API</a> (Maybe make some money off this.)<br />
<a href="http://code.google.com/apis/checkout/">Google Checkout API</a> (Sign up for sandbox if developing. Looks great in my opinion.)<br />
<a href="http://www.amazon.com/b/104-6354470-1627946?ie=UTF8&amp;node=3435361">Amazon Web Services</a> (You can make some interesting things out of this!)<br />
<a href="http://developer.ebay.com/common/api">Ebay API</a> (Hmmm webservices with ebay&#8230; definately could build something interesting!)</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gimmesoda.com/apis-gone-wild/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced

Served from: www.gimmesoda.com @ 2012-02-10 09:08:31 -->
