<?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>Star Dot Hosting</title>
	<atom:link href="http://www.stardothosting.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stardothosting.com</link>
	<description>Managed Hosting, Managed VPS, Managed AWS, Managed Dedicated Services</description>
	<lastBuildDate>Tue, 07 May 2013 21:40:22 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>A Web based system to push your SVN code through development, staging and production environments</title>
		<link>http://www.stardothosting.com/blog/2013/02/a-web-based-system-to-push-your-svn-code-through-development-staging-and-production-environments/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=a-web-based-system-to-push-your-svn-code-through-development-staging-and-production-environments</link>
		<comments>http://www.stardothosting.com/blog/2013/02/a-web-based-system-to-push-your-svn-code-through-development-staging-and-production-environments/#comments</comments>
		<pubDate>Sat, 02 Feb 2013 22:14:04 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP Development]]></category>
		<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[SVN]]></category>
		<category><![CDATA[code export]]></category>
		<category><![CDATA[php development]]></category>
		<category><![CDATA[svn code]]></category>
		<category><![CDATA[svn export]]></category>
		<category><![CDATA[svn php]]></category>
		<category><![CDATA[svn push]]></category>
		<category><![CDATA[web based svn]]></category>

		<guid isPermaLink="false">http://www.stardothosting.com/?p=1449</guid>
		<description><![CDATA[Hello there! In development, having a seamlessly integrated process where you can propagate your code through whatever QA, testing and development policy you have is invaluable and a definite time saver. We work with SVN as well as GIT code repository systems and have developed a web based system to &#8220;Export&#8221; or &#8220;Push&#8221; the code [...]]]></description>
				<content:encoded><![CDATA[<p>Hello there!</p>
<p>In development, having a seamlessly integrated process where you can propagate your code through whatever QA, testing and development policy you have is invaluable and a definite time saver.</p>
<p>We work with SVN as well as GIT code repository systems and have developed a web based system to &#8220;Export&#8221; or &#8220;Push&#8221; the code through development, staging and production environments as such.</p>
<p>I have already talked about sanitizing your code during the commit process, to ensure commit messages are standard and there are no PHP fatal errors, so now I will be showcasing you a simple web based system for propagating your code  through development, staging and production servers.</p>
<p>This system should be on a secure web accessible page on each server. For the sake of argument , I&#8217;ll call each server the following :</p>
<p><b>dev.server.com</b> &#8212; development server</p>
<p><b>staging.server.com</b> &#8212; staging server</p>
<p><b>www.server.com</b> &#8212; production server</p>
<p>We will be using PHP for the web based interface, and we will assume that you will be password protecting access to this page via htpasswd, as well as forcing SSL. I am also assuming that within your SVN repository, you have multiple &#8220;sites&#8221; that you will be individually pushing or exporting (svn export). Once you have the secure, password protected page (lets call it https://dev.server.com/svn) , the following PHP page will be the main index :</p>
<p><b>svnupdate.php</b></p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;?<br />
<br />
$sites[] = array(<br />
&quot;name&quot; =&gt; &quot;Site A&quot;,<br />
&quot;url&quot; =&gt; &quot;http://site-a.server.com&quot;,<br />
&quot;path&quot; =&gt; &quot;/usr/local/www/site-a.server.com&quot;,<br />
&quot;source&quot; =&gt; &quot;svn://svn.server.com/repository/branches/site-a&quot;,<br />
&quot;login&quot; =&gt; &quot;svnlogin&quot;,<br />
&quot;base&quot; =&gt; &quot;1.00&quot;,<br />
&quot;notes&quot; =&gt; &quot;Standard build for Site A&quot;<br />
);<br />
<br />
&quot;name&quot; =&gt; &quot;Site B&quot;,<br />
&quot;url&quot; =&gt; &quot;http://site-b.server.com&quot;,<br />
&quot;path&quot; =&gt; &quot;/usr/local/www/site-b.server.com&quot;,<br />
&quot;source&quot; =&gt; &quot;svn://svn.server.com/repository/branches/site-b&quot;,<br />
&quot;login&quot; =&gt; &quot;svnlogin&quot;,<br />
&quot;base&quot; =&gt; &quot;1.00&quot;,<br />
&quot;notes&quot; =&gt; &quot;Standard build for Site B&quot;<br />
);<br />
<br />
?&gt;<br />
<br />
&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;&gt;<br />
<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;title&gt;SVN Update Page&lt;/title&gt;<br />
<br />
&lt;style&gt;<br />
body {<br />
&nbsp; &nbsp; &nbsp; &nbsp; background-color:#eeeeee;<br />
}<br />
<br />
.tdheader {<br />
&nbsp; &nbsp; &nbsp; &nbsp; background-color:#0f2c66;<br />
&nbsp; &nbsp; &nbsp; &nbsp; color:#FFFFFF;<br />
&nbsp; &nbsp; &nbsp; &nbsp; font-weight: bold;<br />
}<br />
<br />
.tdheader2 {<br />
&nbsp; &nbsp; &nbsp; &nbsp; background-color:#000000;<br />
&nbsp; &nbsp; &nbsp; &nbsp; color:#FFFFFF;<br />
&nbsp; &nbsp; &nbsp; &nbsp; font-weight: bold;<br />
}<br />
<br />
.tdrow {<br />
&nbsp; &nbsp; &nbsp; &nbsp; background-color:#ffffff;<br />
&nbsp; &nbsp; &nbsp; &nbsp; color:#000000;<br />
&nbsp; &nbsp; &nbsp; &nbsp; font-weight: normal;<br />
}<br />
<br />
a:link,a:active,a:visited {<br />
&nbsp; &nbsp; &nbsp; &nbsp; color:#0f2c66;<br />
}<br />
<br />
a:hover {<br />
&nbsp; &nbsp; &nbsp; &nbsp; color:#6A9CD3;<br />
}<br />
.menuon {<br />
&nbsp; &nbsp; &nbsp; &nbsp; background-color:#6699cc;<br />
&nbsp; &nbsp; &nbsp; &nbsp; color:white;<br />
&nbsp; &nbsp; &nbsp; &nbsp; font-weight: bold;<br />
}<br />
<br />
.menuoff {<br />
&nbsp; &nbsp; &nbsp; &nbsp; background-color:white;<br />
&nbsp; &nbsp; &nbsp; &nbsp; color:black;<br />
&nbsp; &nbsp; &nbsp; &nbsp; font-weight: bold;<br />
}<br />
<br />
table {<br />
&nbsp; &nbsp; &nbsp; &nbsp; border-style: solid;<br />
&nbsp; &nbsp; &nbsp; &nbsp; border-width: 1px;<br />
&nbsp; &nbsp; &nbsp; &nbsp; border-color: #000000;<br />
}<br />
<br />
&lt;/style&gt;<br />
&lt;script type=&quot;text/javascript&quot;&gt;<br />
function confirmexport(text) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; if (confirm(text)) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; document.getElementById('framecont').style.display = '';<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; document.getElementById(&quot;processframe&quot;).contentWindow.document.body.innerHTML = &quot;&lt;div align='center'&gt;Exporting...&lt;/div&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return true;<br />
&nbsp; &nbsp; &nbsp; &nbsp; } else return false;<br />
}<br />
function viewframe() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; document.getElementById('framecont').style.display = '';<br />
}<br />
function closeframe() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; document.getElementById('framecont').style.display = 'none';<br />
}<br />
<br />
&lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;table width=&quot;750px&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot; bgcolor=&quot;#000000&quot; border=&quot;0&quot;&gt;<br />
&lt;tr&gt;<br />
&lt;td class=&quot;tdheader2&quot;&gt;Server: &lt;/td&gt;<br />
&lt;td class=&quot;menuon&quot; align=&quot;center&quot;&gt;Development Server&lt;/td&gt;<br />
&lt;td class=&quot;menuoff&quot; align=&quot;center&quot;&gt;&lt;a href=&quot;https://staging.server.com/svn/svnupdate.php&quot;&gt;Staging Server&lt;/a&gt;&lt;/td&gt;<br />
&lt;td class=&quot;menuoff&quot; align=&quot;center&quot;&gt;&lt;a href=&quot;https://www.server.com/svn/svnupdate.php&quot;&gt;Production Server&lt;/a&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
<br />
&lt;hr size=&quot;1&quot; noshade=&quot;noshade&quot; /&gt;<br />
&lt;a href=&quot;log.php&quot; target=&quot;processframe&quot; onclick=&quot;closeframe();viewframe()&quot;&gt;View Development Export Log&lt;/a&gt; <br />
&lt;br&gt;&lt;br&gt;<br />
&lt;table cellpadding=&quot;2&quot; width=&quot;1000px&quot; cellspacing=&quot;1&quot; bgcolor=&quot;#000000&quot; border=&quot;0&quot;&gt;<br />
&lt;tr class=&quot;tdheader&quot;&gt;<br />
&lt;td&gt;Site&lt;/td&gt;<br />
&lt;td&gt;Source&lt;/td&gt;<br />
&lt;td&gt;UN/PW&lt;/td&gt;<br />
&lt;td&gt;Base&lt;/td&gt;<br />
&lt;td&gt;Revision&lt;/td&gt;<br />
&lt;td&gt;Export&lt;/td&gt;<br />
&lt;td&gt;Pending Updates&lt;/td&gt;<br />
&lt;td&gt;Notes&lt;/td&gt;<br />
&lt;/tr&gt;<br />
<br />
&lt;?<br />
if($sites) {<br />
foreach($sites as $key =&gt; $value) {<br />
?&gt;<br />
&lt;form method=&quot;post&quot; action=&quot;svnupdate_process.php&quot; target=&quot;processframe&quot;&gt;<br />
&lt;tr class=&quot;tdrow&quot;&gt;<br />
&lt;td&gt;&lt;a href=&quot;&lt;?=$value['url']?&gt;&quot; target=&quot;_blank&quot;&gt;&lt;?=$value['name']?&gt;&lt;/a&gt;&lt;/td&gt;<br />
&lt;td&gt;&lt;?=preg_replace(&quot;/svn:\/\/svn\.server\.com\//&quot;,&quot;&quot;,$value['source'])?&gt;&lt;input type=&quot;hidden&quot; name=&quot;source&quot; value=&quot;&lt;?=$value['source']?&gt;&quot;&gt;&lt;/td&gt;<br />
&lt;td&gt;&lt;?=$value['login']?&gt;&lt;/td&gt;<br />
&lt;td&gt;&lt;?=$value['base']?&gt;&lt;/td&gt;<br />
&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;revision&quot; size=&quot;5&quot;&gt;&lt;/td&gt;<br />
&lt;td&gt;&lt;input type=&quot;hidden&quot; name=&quot;site&quot; value=&quot;&lt;?=$value['path']?&gt;&quot;&gt;<br />
&lt;input type=&quot;submit&quot; name=&quot;submitbutton&quot; value=&quot;Export&quot; onClick=&quot;javascript:return confirmexport('This will overwrite the current files on development. Are you sure?');&quot;&gt;<br />
&lt;/td&gt;<br />
&lt;td width=&quot;150px&quot;&gt;&lt;center&gt;&lt;a href=&quot;viewcommit.php?name=&lt;?=$value['name']?&gt;&amp;path=&lt;?=$value['path']?&gt;&amp;svn=&lt;?=$value['source']?&gt;&quot; target=&quot;processframe&quot; onclick=&quot;closeframe();viewframe()&quot;&gt;View&lt;/a&gt;&lt;/center&gt;&lt;/td&gt;<br />
&lt;td&gt;&lt;?=$value['notes']?&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/form&gt;<br />
&lt;? } ?&gt;<br />
&lt;? } ?&gt;<br />
&lt;/table&gt;<br />
&lt;br&gt;&lt;div id='framecont' style=&quot;text-align: left; display: none&quot;&gt;<br />
&lt;iframe name=&quot;processframe&quot; id=&quot;processframe&quot; width=&quot;1000px&quot; height=&quot;300px&quot; align=&quot;left&quot; scrolling=&quot;yes&quot; frameborder=&quot;0&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/iframe&gt;<br />
&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</div></div>
<p>If you carefully look at the above code, you will see that this page will be dependent on 3 external scripts, which I will describe below. The page itself generates a list of whatever sites you want to include in the push process, within a PHP based Array. The array details important info per site such as the name, svn location, location of the files on the server as well as whatever other notes and additional info you want to provide.</p>
<p>Each time a site is &#8220;exported&#8221; by clicking the export button, it calls an external script called <b>svnupdate_process.php</b>. This executes the SVN EXPORT command, as well as logging which user requested the action into a simple text based log file. The user is determined by the authentication user that is accessing the page. The htpassword credentials you will be providing to your users should be set per-user so that it can be easier to determine who pushed the code and whatnot.</p>
<p>The other two external scripts are one that will view the log file in an iframe on the same page, as well as a script to extrapolate the pending commits that are in the queue since the LAST code push / svn export. That is really useful, as you can imagine.</p>
<p><big><b>Script to view the export log</b></big></p>
<p>This script, <b>log.php</b> is used to dump the contents of the log.txt export log file. Very simple</p>
<p><b>log.php</b></p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;&gt;<br />
<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;title&gt;Untitled&lt;/title&gt;<br />
&lt;/head&gt;<br />
<br />
&lt;body&gt;<br />
&lt;b&gt;Development Export Log:&lt;/b&gt;&lt;hr&gt;<br />
&lt;?<br />
include(&quot;./functions.inc.php&quot;);<br />
$logfile = new logfile();<br />
$logfile-&gt;display();<br />
?&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</div></div>
<p>Simple, right? The log.php code includes a functions.inc.php file, used for writing and reading the log.txt file. The above code depends on it, as well as the svnupdate_process.php code (described below), in order to log each time someone hits the export code button </p>
<p><b>functions.inc.php</b></p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;?<br />
class logfile {<br />
&nbsp; &nbsp; &nbsp; &nbsp; function logfile() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;filename = &quot;log.txt&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;Username = $_SERVER['PHP_AUTH_USER'];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;logfile = $this-&gt;filename;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; function write($data) { // write to logfile<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $handle = fopen($this-&gt;logfile, &quot;a+&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $date = date(&quot;Y-m-d H:i:s&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $IP = getenv('REMOTE_ADDR');<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $data = &quot;[$date] {$this-&gt;Username}:{$IP} - &quot; . $data . &quot;\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $return = fwrite($handle, $data);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fclose($handle);<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; function display() { // display logfile<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $handle = fopen($this-&gt;logfile, &quot;a+&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while(!feof($handle)) { // Pull lines into array<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $lines[] = fgets($handle, 1024);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $count = count($lines);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $count = $count - 2;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for($i=$count;$i&gt;=0;$i--) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo $lines[$i] . &quot;&lt;br&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fclose($handle);<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
}<br />
?&gt;</div></div>
<p>The code of the svn export process is handled by the following script below. Again its self explanatory. PHP executes a shell command to export the svn code based on the array variables defined in the very first script. Make sure all the variables match up to whats in svn and the location of the files, and even execute a test run of the command manually with the variables. If there are problems, you can modify the command to pipe the output to a log file for further analysis. Additionally you may need to alter the permissions of the apache user so that the command can be properly run. Avoid setting the apache user to have a shell (big no-no) ,but maybe a nologin shell or something along those lines. Its completely up to you , but be very careful about the choices you make to get it to run properly.</p>
<p><b>svnupdate_process.php</b></p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;b&gt;Update/Status Window&lt;/b&gt;<br />
&lt;hr&gt;<br />
<br />
<br />
&lt;?<br />
include(&quot;./functions.inc.php&quot;);<br />
$logfile = new logfile();<br />
<br />
if($_POST['submitbutton']) {<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; if($_POST['revision'] != &quot;&quot;) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $revision = &quot;-r &quot;.$_POST['revision'];<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; $command = &quot;/usr/bin/svn export --force --username svnuser --password 'svnpassword' $revision --config-dir /tmp &quot;.$_POST['source']. &quot; &quot; . $_POST['site'].&quot; 2&gt;&amp;1&quot;;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; if($_POST['submitbutton'] == &quot;Export&quot;) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $output = shell_exec(&quot;umask 022;&quot;.$command);<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;&lt;pre&gt;$output&lt;/pre&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $logtext = &quot;Exported to {$_POST['site']}&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $logfile-&gt;write($logtext);<br />
&nbsp; &nbsp; &nbsp; &nbsp; eaccelerator_clear();<br />
}<br />
<br />
?&gt;</div></div>
<p>Finally the last script will be the script that parses the SVN log output with a date/time range from the last time the export button was pushed, until the current date and time. This will load the output in the same iframe log window on the svn page so the user can see what pending commits are in the code since the last time it was exported. Invaluable information, right?</p>
<p>Note that this has a function to filter out additional illegal characters to avoid cross site scripting injections. This code should be completely 100% restricted from outside public use, however it might be worth it to put this function in the svnupdate_process.php script as well. Can&#8217;t be too careful. I thought I&#8217;d include it here for you to use.</p>
<p><b>viewcommit.php</b></p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;?<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; if(($_GET['svn'] != &quot;&quot;) &amp;&amp; ($_GET['path'] != &quot;&quot;) &amp;&amp; ($_GET['name'] != &quot;&quot;)) {<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; // Cross Site Script &nbsp;&amp; Code Injection Sanitization<br />
&nbsp; &nbsp; &nbsp; &nbsp; function xss_cleaner($input_str) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; $return_str = str_replace( array('&lt;',';','|','&amp;','&gt;',&quot;'&quot;,'&quot;',')','('), array('&amp;lt;','&amp;#58;','&amp;#124;','&amp;#38;','&amp;gt;','&amp;apos;','&amp;#x22;','&amp;#x29;','&amp;#x28;'), $input_str );<br />
&nbsp; &nbsp; &nbsp; &nbsp; $return_str = str_ireplace( '%3Cscript', '', $return_str );<br />
&nbsp; &nbsp; &nbsp; &nbsp; return $return_str;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; $xss_path=xss_cleaner($_GET['path']);<br />
&nbsp; &nbsp; &nbsp; &nbsp; $xss_svn=xss_cleaner($_GET['svn']);<br />
&nbsp; &nbsp; &nbsp; &nbsp; $xss_name=xss_cleaner($_GET['name']);<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;&lt;b&gt;Viewing Pending Updates For : &quot;. $xss_name . &quot;&lt;/b&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;&lt;hr&gt;&quot;;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; $command = &quot;/usr/bin/svn --username svnuser --password 'svnpassword' --config-dir /tmp log &quot; . $xss_svn . &quot; -r {\&quot;`grep \&quot;&quot; . $xss_path . &quot;\&quot; log.txt | tail -n 1 | awk -F \&quot; \&quot; '{printf \&quot;%s %s\&quot;, $1,$2}' | sed -e 's/\[//g' -e 's/\]//g'`\&quot;}:{\&quot;`date \&quot;+%Y-%m-%d %H:%M:%S\&quot;`\&quot;}&quot;;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; $output = shell_exec(&quot;umask 022;&quot;.$command);<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;&lt;pre&gt;$output&lt;/pre&gt;&quot;;<br />
}<br />
&nbsp; &nbsp; &nbsp; &nbsp; else {<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;No queries passed!&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
?&gt;</div></div>
<p>Lets break down the SVN log command, so you know whats going on. I&#8217;m grabbing the SVN site array variables when the &#8220;view log&#8221; link is clicked on the svn page. I am also parsing the export log text file to get the last entry for the particular site in question, grabbing the date and time. </p>
<p>I am then getting the current date and time to complete the date/time range in the svn log query. The finished query should look something like this :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">svn --username svnuser --password 'svnpassword' --config-dir /tmp log svn://svn.server.com -r {&quot;2013-01-01 12:01:00&quot;}:{&quot;2013-02-01 12:01:00&quot;}</div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.stardothosting.com/blog/2013/02/a-web-based-system-to-push-your-svn-code-through-development-staging-and-production-environments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to detect and mitigate DoS (Denial of Service) Attacks</title>
		<link>http://www.stardothosting.com/blog/2013/01/how-to-detect-and-mitigate-dos-denial-of-service-attacks/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-detect-and-mitigate-dos-denial-of-service-attacks</link>
		<comments>http://www.stardothosting.com/blog/2013/01/how-to-detect-and-mitigate-dos-denial-of-service-attacks/#comments</comments>
		<pubDate>Tue, 29 Jan 2013 21:05:51 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[denial of service]]></category>
		<category><![CDATA[detect dos]]></category>
		<category><![CDATA[hacking and security]]></category>
		<category><![CDATA[netstat]]></category>
		<category><![CDATA[security detection]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[shell scripting]]></category>
		<category><![CDATA[systems administartion]]></category>
		<category><![CDATA[uniq]]></category>

		<guid isPermaLink="false">http://www.stardothosting.com/?p=1443</guid>
		<description><![CDATA[Greetings, Occasionally with a very busy site, being behind a hefty web stack does not always have enough capacity to mitigate a significant surge in artificial (DoS) requests. Detecting and mitigating denial of service attacks is an important and time sensitive exercise that will determine the next mitigating steps that you may need to take [...]]]></description>
				<content:encoded><![CDATA[<p>Greetings,</p>
<p>Occasionally with a very busy site, being behind a hefty web stack does not always have enough capacity to mitigate a significant surge in artificial (DoS) requests. Detecting and mitigating denial of service attacks is an important and time sensitive exercise that will determine the next mitigating steps that you may need to take to reduce or null route the offending traffic.</p>
<p>These steps are very basic and use the everyday system utilities and tools that are found in vanilla linux implementations. The idea is to utilize these tools to identify connection and request patterns.</p>
<p>I&#8217;m going to assume that your potential or assumed attack is going straight to port 80 (HTTP), which would be a common assumption. A typical DoS attack would just be a generation of thousands of requests to a particular page, or perhaps just to the homepage.</p>
<p><big><b>Check your Process and Connection Counts</big></b></p>
<p>It is a good idea to get a picture of how overworked your system is currently, other than the initial reports of slow site performance or perhaps mysql errors such as &#8220;The MySQL server has gone away&#8221;, or anything of the sort.</p>
<p>Count how many apache/httpd processes you currently have to get an idea :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># ps auxw | grep httpd | wc -l<br />
96</div></div>
<p>Check what the CPU load is currently on the server :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># w<br />
&nbsp;15:41:52 up 74 days, 17:05, &nbsp;1 user, &nbsp;load average: 6.36, 9.89, 8.68</div></div>
<p>So you can see the load is quite high and there are 96 apache processes that have spawned. Looks to be quite a busy server! You should take it a step further and perhaps identify how many open port 80 (HTTP) connections you have :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># netstat -nap | grep &quot;:80 &quot; | wc -l<br />
1627</div></div>
<p>So thats quite a significant number of HTTP connections on this server. It could be a substantial DoS attack, especially when you consider that this may be one server in a 3 server load balanced pool. That means the numbers here are likely multiplied by three.</p>
<p>Still, it could be legitimate traffic! The spike could be attributed to a link on reddit, or perhaps the site was mentioned on a popular news site. We need to look further at what requests are coming in to be able to determine if perhaps the traffic is organic or artificial. Artificial traffic would typically have thousands and thousands of identical requests, possibly coming from a series of IP addresses.</p>
<p>How distributed a DoS attack probably depends on the skill and resources of the offending party (potentially). If its a DoS, hopefully it will be easily identifiable.</p>
<p>Lets take a closer look at the open connections. Maybe we can see how many connections from singular IP addresses are currently open on the server. That may help identify if the majority of the traffic is from a single or single set of sources. This information can be kept aside after our analysis is complete so that we can use that information to report and block the traffic to ultimately mitigate the attack.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># /bin/netstat -ntu | grep &quot;:80&quot; | awk '{print $5}'| cut -d: -f1 | sort | uniq -c | sort -n | \<br />
grep -v 127.0.0.1 | awk '{if ($1 &gt; 45) print $2;}'</div></div>
<p>What the above line essentially does is scan the open connections specifically to port 80 and filters only the IP addresses that have 45 or more open connections. This number can obviously be adjusted to whatever you like. Take a look at the different results and see what it produces. </p>
<p>For potentially offending IP addresses, whois them and see where they are originating from. Are they from a Country that typically isn&#8217;t interested in your site? If the site is an English language site about local school programs in a small North American city, chances are someone from China or Russia has little legitimate interest in the site. </p>
<p><big><b>Analyze the Requests</big></b></p>
<p>In this scenario, we would be analyzing the apache access logs in order to get a clearer picture of what exactly is happening that is generating the DoS. Access logs in apache are a great resource to get the source IP, request URI and other useful information that may help identify an automated tool such as LOIC or an automated botnet perhaps that is sending thousands of identical requests to your server.</p>
<p>Lets filter our the actual GET requests from the apache logs, sort them and count each request in order to show the highest number of requests for the same URI. If we can take this information and then cross reference it with the connection stats we gathered earlier, we should have a clear picture of who is conducting the attack and how they are doing it.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">cat access_log | awk -F &quot;\&quot;&quot; '{printf &quot;%s\n&quot;, $2}' | sed -e 's/GET //' | awk -F &quot; &quot; '{printf &quot;%s\n&quot; ,$1}' | sort | uniq -c | sort -n | awk '{if ($1 &gt; 45) print $2;}' | more</div></div>
<p>This code filters GET requests from the logs, cleans them up, sorts the results, counts all the duplicate requests , sorts it by highest number of requests, and prints the results.</p>
<p>Again the 45 in the last portion of the command can be changed to whatever you feel is necessary. It all depends on whats a normal request, what is legitimate traffic and how busy your server is normally.</p>
<p>All the data you have gathered thus far should be enough to complete a preliminary investigation into your DoS attack. As for mitigating , there are many options. I wont go too much into it because that could be considered a completely separate topic. I&#8217;ll give some suggestions for you, either way :</p>
<p>Block offending IPs with IPTABLES :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">iptables -A INPUT -s 1.2.3.4 -j DROP</div></div>
<p>Use software layer mitigation such as <a href="http://www.zdziarski.com/blog/?page_id=442" target="_new">mod_evasive</a> or <a href="http://www.modsecurity.org/" target="_new">mod_security</a> to reduce the ability of attackers to generate significant numbers of requests. Most importantly of all, use your best judgement! </p>
]]></content:encoded>
			<wfw:commentRss>http://www.stardothosting.com/blog/2013/01/how-to-detect-and-mitigate-dos-denial-of-service-attacks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SVN Offsite Backup Script : Secure offsite backup solution for SVN to Amazon S3</title>
		<link>http://www.stardothosting.com/blog/2012/11/svn-offsite-backup-script-secure-offsite-backup-solution-for-svn-to-amazon-s3/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=svn-offsite-backup-script-secure-offsite-backup-solution-for-svn-to-amazon-s3</link>
		<comments>http://www.stardothosting.com/blog/2012/11/svn-offsite-backup-script-secure-offsite-backup-solution-for-svn-to-amazon-s3/#comments</comments>
		<pubDate>Tue, 13 Nov 2012 20:03:42 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Amazon S3]]></category>
		<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[SVN]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[systems administration]]></category>

		<guid isPermaLink="false">http://www.stardothosting.com/?p=1391</guid>
		<description><![CDATA[Hi there! Backing up your code repository is important. Backing up your code repository to an off-site location in a secure manner is imperative. Throughout our travels and experience utilizing the SVN code repository system, we have developed a quick bash script to export the entire SVN repository, encrypt it, compress it into an archive, [...]]]></description>
				<content:encoded><![CDATA[<p>Hi there!</p>
<p>Backing up your code repository is important. Backing up your code repository to an off-site location in a secure manner is imperative. Throughout our travels and experience utilizing the SVN code repository system, we have developed a quick bash script to export the entire SVN repository, encrypt it, compress it into an archive, and then ship it (over an encrypted network connection) to Amazon S3 storage.</p>
<p>We will be using the (familiar) s3sync Ruby script to do the actual transport to Amazon S3, which you can find <a href="http://s3sync.net/wiki" target="_new"><u>here</u></a>.</p>
<p>Note also that this script also keeps a local copy of the backups, taken each day, for a maximum of 7 days of retention. This might be redundant since all revisions are kept within SVN itself, but I thought it would provide an additional layer of backup redundancy. The script can be easily modified to only backup a single file every night, overwriting the older copy after every backup.</p>
<p>Here&#8217;s the script :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#!/bin/sh<br />
# SVN Off Site Backup script<br />
# www.stardothosting.com<br />
<br />
currentmonth=`date &quot;+%Y-%m-%d %H:%M:%S&quot;`<br />
threedays=`date -v-5d &quot;+%Y-%m-%d&quot;`<br />
todaysdate=`date &quot;+%Y-%m-%d&quot;`<br />
<br />
export AWS_ACCESS_KEY_ID=&quot;YOUR-S3-KEY-ID&quot;<br />
export AWS_SECRET_ACCESS_KEY=&quot;YOUR-S3-ACCESS-KEY&quot;<br />
<br />
<br />
echo &quot;SVN Offsite Backup Log: &quot; $currentmonth &gt; /var/log/offsite-backup.log<br />
echo -e &quot;--------------------------------------------&quot; &gt;&gt; /var/log/offsite-backup.log<br />
echo -e &quot;&quot; &gt;&gt; /var/log/offsite-backup.log<br />
<br />
# Archive Repository Dump Files and remove files older than 7 days<br />
/usr/bin/find /subversion/svn_backups -type f -mtime +7 -delete<br />
<br />
# Backup SVN and encrypt it<br />
svnadmin dump /subversion/repo_name | /usr/bin/openssl enc -aes-256-cbc -pass pass:YOUR-ENCRYPTION-PASSWORD -e &gt; /subversion/svn_backups/repo_name-backup-$todaysdate.enc<br />
<br />
#fyi to decrypt :<br />
#openssl aes-256-cbc -d -pass pass:YOUR-ENCRYPTION-PASSWORD -in repo_name-backup.enc -out decrypted.dump<br />
<br />
# Transfer the files to Amazon S3 Storage via HTTPS<br />
/usr/local/bin/ruby /usr/local/bin/s3sync/s3sync.rb --ssl -v --delete -r /subversion/svn_backups S3_BACKUPS:svn/svnbackup &gt;&gt; /var/log/offsite-backup.log 2&gt;&amp;1<br />
<br />
if [ &quot;$?&quot; -eq 1 ]<br />
then<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo -e &quot;***SVN OFFSITE BACKUP JOB, THERE WERE ERRORS***&quot; &gt;&gt; /var/log/offsite-backup.log 2&gt;&amp;1<br />
&nbsp; &nbsp; &nbsp; &nbsp; cat /var/log/offsite-backup.log | mail -s &quot;SVN Offsite Backup Job failed&quot; your@email.com<br />
&nbsp; &nbsp; &nbsp; &nbsp; exit 1<br />
else<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo -e &quot;Script Completed Successfully!&quot; &gt;&gt; /var/log/offsite-backup.log 2&gt;&amp;1<br />
&nbsp; &nbsp; &nbsp; &nbsp; cat /var/log/offsite-backup.log | mail -s &quot;SVN Offsite Backup Job Completed&quot; your@email.com<br />
&nbsp; &nbsp; &nbsp; &nbsp; exit 0<br />
fi</div></div>
<p>Note how I have provided an example , commented out within the script, on how you can go about decrypting the encrypted SVN dump file. You can also modify this script to back up to any offsite location, obviously. Just remove the s3sync related entries and replace with rsync or your preferred transport method.</p>
<p>I hope this makes your life easier!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stardothosting.com/blog/2012/11/svn-offsite-backup-script-secure-offsite-backup-solution-for-svn-to-amazon-s3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Blog</title>
		<link>http://www.stardothosting.com/blog/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=blog</link>
		<comments>http://www.stardothosting.com/blog/#comments</comments>
		<pubDate>Mon, 05 Nov 2012 17:34:19 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
		
		<guid isPermaLink="false">http://www.stardothosting.com/?page_id=1356</guid>
		<description><![CDATA[]]></description>
				<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://www.stardothosting.com/blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Star Dot Hosting Corporate Website Relaunched!</title>
		<link>http://www.stardothosting.com/blog/2012/09/star-dot-hosting-corporate-website-relaunched/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=star-dot-hosting-corporate-website-relaunched</link>
		<comments>http://www.stardothosting.com/blog/2012/09/star-dot-hosting-corporate-website-relaunched/#comments</comments>
		<pubDate>Tue, 18 Sep 2012 19:52:08 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Company Announcements]]></category>
		<category><![CDATA[Managed Hosting Services]]></category>
		<category><![CDATA[Managed VPS Hosting]]></category>
		<category><![CDATA[stardot site]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[website relaunch]]></category>

		<guid isPermaLink="false">http://www.stardothosting.com/blog/?p=602</guid>
		<description><![CDATA[We are very pleased to announce the re-launch of our corporate website! We have completely redesigned the look, feel and user interface. I think its much nicer, modern and slick CHECK IT OUT TO SEE FOR YOURSELF!]]></description>
				<content:encoded><![CDATA[<p>We are very pleased to announce the re-launch of our corporate website!</p>
<p>We have completely redesigned the look, feel and user interface. I think its much nicer, modern and slick <img src='http://www.stardothosting.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><center><big><b><a href="http://www.stardothosting.com">CHECK IT OUT TO SEE FOR YOURSELF!</a></center></big></b></p>
]]></content:encoded>
			<wfw:commentRss>http://www.stardothosting.com/blog/2012/09/star-dot-hosting-corporate-website-relaunched/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Client Area</title>
		<link>https://secure.stardothosting.com?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=client-support-2</link>
		<comments>https://secure.stardothosting.com#comments</comments>
		<pubDate>Mon, 17 Sep 2012 20:07:34 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
		
		<guid isPermaLink="false">http://www.shift8web.com/projects/stardothosting.com/?page_id=1291</guid>
		<description><![CDATA[]]></description>
				<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>https://secure.stardothosting.com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Designers in Toronto : 30% OFF All Web Design Services!</title>
		<link>http://www.stardothosting.com/blog/2012/09/web-designers-in-toronto-30-off-all-web-design-services/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=web-designers-in-toronto-30-off-all-web-design-services</link>
		<comments>http://www.stardothosting.com/blog/2012/09/web-designers-in-toronto-30-off-all-web-design-services/#comments</comments>
		<pubDate>Thu, 13 Sep 2012 14:02:52 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Toronto Web Design]]></category>
		<category><![CDATA[shift8]]></category>
		<category><![CDATA[toronto web design]]></category>
		<category><![CDATA[web design coupon]]></category>

		<guid isPermaLink="false">http://www.stardothosting.com/blog/?p=600</guid>
		<description><![CDATA[Your in luck! Our web design division is offering an amazing deal for anyone looking to kick off their design (or re-design) project. Shift8web is offering 30% off All web design services through the Kijiji coupon service. Click the link below for more information : 30% Off Web Design]]></description>
				<content:encoded><![CDATA[<p>Your in luck!</p>
<p>Our <a href="http://www.shift8web.com">web design division</a> is offering an amazing deal for anyone looking to kick off their design (or re-design) project. </p>
<p>Shift8web is offering 30% off All web design services through the Kijiji coupon service. Click the link below for more information :</p>
<p><center><big><b><a href="http://www.kijijideals.ca/coupons/peel/30-off-all-web-design-professional-service" target="_new">30% Off Web Design</a></big></b></center></p>
]]></content:encoded>
			<wfw:commentRss>http://www.stardothosting.com/blog/2012/09/web-designers-in-toronto-30-off-all-web-design-services/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SVN Pre Commit Hook : Sanitize your Code!</title>
		<link>http://www.stardothosting.com/blog/2012/09/svn-pre-commit-hook-sanitize-your-code/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=svn-pre-commit-hook-sanitize-your-code</link>
		<comments>http://www.stardothosting.com/blog/2012/09/svn-pre-commit-hook-sanitize-your-code/#comments</comments>
		<pubDate>Wed, 12 Sep 2012 18:27:04 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[SVN]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[systems administration]]></category>

		<guid isPermaLink="false">http://www.stardothosting.com/blog/?p=597</guid>
		<description><![CDATA[Hello, Dealing with several different development environments can be tricky. With SVN specifically, it is ideal to have some &#8220;pre-flight&#8221; checks in order to make sure some basic standards have been followed. Some of the things you would want to check might be : - Does the code generate a fatal PHP error? - Is [...]]]></description>
				<content:encoded><![CDATA[<p>Hello,</p>
<p>Dealing with several different development environments can be tricky. With SVN specifically, it is ideal to have some &#8220;pre-flight&#8221; checks in order to make sure some basic standards have been followed.</p>
<p>Some of the things you would want to check might be :</p>
<p>- Does the code generate a fatal PHP error?<br />
- Is there any syntax errors?<br />
- Has valid commit messages been attached to the code commit?</p>
<p>I thought I&#8217;d share our pre-commit hook in one of our SVN code repositories in order to let you utilize and perhaps expand on it to include many more checks. Additional checks that may be specific to your code environment might benefit you. Feel free to share if improvements are made!</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#!/bin/bash<br />
# pre-commit hooks<br />
# www.stardothosting.com<br />
<br />
REPOS=&quot;$1&quot;<br />
TXN=&quot;$2&quot;<br />
<br />
PHP=&quot;/usr/bin/php&quot;<br />
SVNLOOK=&quot;/usr/bin/svnlook&quot;<br />
AWK=&quot;/usr/bin/awk&quot;<br />
GREP=&quot;/bin/egrep&quot;<br />
SED=&quot;/bin/sed&quot;<br />
<br />
# Make sure that the commit message is not empty<br />
SVNLOOKOK=1<br />
$SVNLOOK log -t &quot;$TXN&quot; &quot;$REPOS&quot; | grep &quot;[a-zA-Z0-9]&quot; &gt; /dev/null || SVNLOOKOK=0<br />
<br />
if [ $SVNLOOKOK = 0 ]; then<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo -e &quot;Empty commit messages are not allowed. Please provide a descriptive comment when committing code.&quot; 1&gt;&amp;2<br />
&nbsp; &nbsp; &nbsp; &nbsp; exit 1<br />
fi<br />
<br />
# Make sure the commit message is more than 5 characters long.<br />
LOGMSG=$($SVNLOOK log -t &quot;$TXN&quot; &quot;$REPOS&quot; | grep [a-zA-Z0-9] | wc -c)<br />
<br />
if [ &quot;$LOGMSG&quot; -le 5 ]; then<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo -e &quot;Please provide a verbose comment when committing changes.&quot; 1&gt;&amp;2<br />
&nbsp; &nbsp; &nbsp; &nbsp; exit 1<br />
fi<br />
<br />
<br />
# Check for PHP parse errors<br />
CHANGED=`$SVNLOOK changed -t &quot;$TXN&quot; &quot;$REPOS&quot; | $GREP &quot;^[U|A]&quot; | $AWK '{print $2}' | $GREP \.php$`<br />
<br />
for FILE in $CHANGED<br />
do<br />
&nbsp; &nbsp; MESSAGE=`$SVNLOOK cat -t &quot;$TXN&quot; &quot;$REPOS&quot; &quot;$FILE&quot; | $PHP -l`<br />
&nbsp; &nbsp; if [ $? -ne 0 ]<br />
&nbsp; &nbsp; then<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo 1&gt;&amp;2<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;-----------------------------------&quot; 1&gt;&amp;2<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;PHP error in: $FILE:&quot; 1&gt;&amp;2<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo `echo &quot;$MESSAGE&quot; | $SED &quot;s| -| $FILE|g&quot;` 1&gt;&amp;2<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;-----------------------------------&quot; 1&gt;&amp;2<br />
&nbsp; &nbsp; &nbsp; &nbsp; exit 1<br />
&nbsp; &nbsp; fi<br />
done<br />
<br />
exit 0</div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.stardothosting.com/blog/2012/09/svn-pre-commit-hook-sanitize-your-code/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Shift8 : Toronto Web Design At its Finest</title>
		<link>http://www.stardothosting.com/blog/2012/08/shift8-toronto-web-design-at-its-finest/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=shift8-toronto-web-design-at-its-finest</link>
		<comments>http://www.stardothosting.com/blog/2012/08/shift8-toronto-web-design-at-its-finest/#comments</comments>
		<pubDate>Fri, 31 Aug 2012 20:19:45 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Toronto Web Design]]></category>
		<category><![CDATA[shift8]]></category>
		<category><![CDATA[toronto web design]]></category>

		<guid isPermaLink="false">http://www.stardothosting.com/blog/?p=591</guid>
		<description><![CDATA[If you&#8217;re a Toronto (Canada) based business and are looking for a web design company to launch your new project, or revamp an old and tired website, take a look at our web design friends at Shift8. You may also be interested in their intro youtube video : Shift8 Youtube Video]]></description>
				<content:encoded><![CDATA[<p>If you&#8217;re a Toronto (Canada) based business and are looking for a web design company to launch your new project, or revamp an old and tired website, take a look at our web design friends at <a href="http://www.shift8web.com" target="_new">Shift8</a>.</p>
<p>You may also be interested in their intro youtube video : <big><b><a href="http://www.youtube.com/watch?v=rfLx1qF9dC8" target="_new">Shift8 Youtube Video</a></big></b></p>
]]></content:encoded>
			<wfw:commentRss>http://www.stardothosting.com/blog/2012/08/shift8-toronto-web-design-at-its-finest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Managed Dedicated Servers</title>
		<link>http://www.stardothosting.com/managed-dedicated-servers/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=managed-dedicated-servers</link>
		<comments>http://www.stardothosting.com/managed-dedicated-servers/#comments</comments>
		<pubDate>Thu, 23 Aug 2012 18:53:02 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
		
		<guid isPermaLink="false">http://www.shift8web.com/projects/stardothosting.com/?page_id=14</guid>
		<description><![CDATA[Fully Managed 24x7x365 Our Managed Dedicated Server hosting service catalog is designed to offload the responsibility of hiring a systems administrator to manage your systems. Our staff are highly trained and experienced in a wide assortment of high availability dependent industries including financial, health, news and more! Integrated Reporting and Alerting Growth planning and trending [...]]]></description>
				<content:encoded><![CDATA[<p><center></p>
<table border="0" cellspacing="15">
<tr>
<td width="10%"><img src="http://www.stardothosting.com/icon3.png"></td>
<td width="30%"><b>Fully Managed 24x7x365</b></td>
<td width="60%"><small>Our Managed Dedicated Server hosting service catalog is designed to offload the responsibility of hiring a systems administrator to manage your systems. Our staff are highly trained and experienced in a wide assortment of high availability dependent industries including financial, health, news and more! </small></td>
</tr>
<tr>
<td width="10%"><img src="http://www.stardothosting.com/icon12.png"></td>
<td width="30%"><b>Integrated Reporting and Alerting</td>
<td width="60%"><small>Growth planning and trending can be tough. We offer an integrated SNMP based graphing system to track all aspects of your dedicated hardware : traffic, hard disks, cpu load, database reads/writes, web server statistics and many more metrics. Synthetic monitoring from multiple geographic end-points give a full picture when ensuring your critical web property is not only up, but responding in a reasonable amount of time and rendering the page to your own parameters.</small></td>
</tr>
<tr>
<td width="10%"><img src="http://www.stardothosting.com/icon10.png"></td>
<td width="30%"><b>Dedicated Firewall and IPS</b></td>
<td width="60%"><small>With ALL of our managed dedicated hosting packages, we offer dedicated firewall and intrusion prevention devices. We utilize dedicated high availability security and firewall protection devices on the edge of your network. This service is fully managed by us to give you the reassurance that all traffic is stringently monitored and blocked appropriately.</small></td>
</tr>
<tr>
<td width="10%"><img src="http://www.stardothosting.com/icon1.png"></td>
<td width="30%"><b>Offsite Secure Backups</b></td>
<td width="60%"><small>We offer offsite secure backup services to all our managed dedicated hosting clients. This can be arranged for an extra fee.</small></td>
</tr>
<tr>
<td width="10%"><img src="http://www.stardothosting.com/icon5.png"></td>
<td width="30%"><b>Proactive maintenance and Support</b></td>
<td width="60%"><small>Support is offered 24x7x365 through our ticketing system. Proactive maintenance, configuration, installation and administration is offered for all of our managed dedicated hosting packages. We also can assist in migrating all of your web properties to our systems as part of your transition strategy. Our support ticket response time is consistently fast and highly reliable.</small></td>
</tr>
<tr>
<td width="10%"><img src="http://www.stardothosting.com/icon14.png"></td>
<td width="30%"><b>99.99% Uptime SLA</b></td>
<td width="60%"><small>Through our managed hosting <a href="http://www.stardothosting.com/legal/master-service-agreement/">service agreement</a> we offer a 99.99% uptime guarantee with an crediting system in the unlikely event of downtime, as well as hardware replacement guarantees.</small></td>
</tr>
</table>
<p></center></p>
<p>With Stardot’s Fully Managed Infrastructure services we offer complete end-to-end management of your mission-critical IT environment. We provide data retention, IPS, Load balancing, Database clustering among many more offerings from our service catalog.</p>
<p>Star Dot Hosting is a leading provider of managed hosting services in Canada for American and Canadian clients. We work with you to develop your mission critical strategies and ensure all of your requirements are met.</p>
<p>Our network is designed to provide you with the fastest and most reliable connections possible. Our routing policy is designed to choose the highest quality and fastest connection to any destination, not simply the network that offers the cheapest rates. We connect our network to as many other networks as possible. The closer you are to other networks, the faster and more reliable your service will be.</p>
<p>Between our peering and transit relationships, we are directly connected to every major cable company and telecommunications company across Canada.</p>
<p>Fill out the form below to give our sales associates the initial information required to generate a quotation for our managed services.</p>
<p><br/></p>
<h1>Managed Hosting Services Quote Form</h1>
<p><br/><br/></p>
<p><center>[contact-form-7]</center></p>
]]></content:encoded>
			<wfw:commentRss>http://www.stardothosting.com/managed-dedicated-servers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Managed VPS / Managed Amazon Cloud</title>
		<link>http://www.stardothosting.com/managed-vps/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=managed-vps</link>
		<comments>http://www.stardothosting.com/managed-vps/#comments</comments>
		<pubDate>Thu, 23 Aug 2012 18:52:43 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
		
		<guid isPermaLink="false">http://www.shift8web.com/projects/stardothosting.com/?page_id=12</guid>
		<description><![CDATA[Fully Managed 24x7x365 Our managed VPS hosting packages provide you with the peace of mind that you need, so that you can focus on running your business. Our multiple endpoint monitoring, graphing and alerting systems are just one of the many systems we utilized to ensure your systems are up and attended to. Integrated Control [...]]]></description>
				<content:encoded><![CDATA[<p><center></p>
<table border="0" cellspacing="15">
<tr>
<td width="10%"><img src="http://www.stardothosting.com/icon3.png"></td>
<td width="30%"><b>Fully Managed 24x7x365</b></td>
<td width="60%"><small>Our managed VPS hosting packages provide you with the peace of mind that you need, so that you can focus on running your business. Our multiple endpoint monitoring, graphing and alerting systems are just one of the many systems we utilized to ensure your systems are up and attended to.</small></td>
</tr>
<tr>
<td width="10%"><img src="http://www.stardothosting.com/icon12.png"></td>
<td width="30%"><b>Integrated Control Panel</td>
<td width="60%"><small>Need to see how much bandwidth you&#8217;re using? Want to attach to the server&#8217;s console? Need to initiate a power cycle? Our integrated control panel allows you to connect to your managed VPS instances to get critical information, statistics and control.</small></td>
</tr>
<tr>
<td width="10%"><img src="http://www.stardothosting.com/icon10.png"></td>
<td width="30%"><b>Dedicated Firewall and IPS</b></td>
<td width="60%"><small>With ALL of our managed VPS packages, we offer dedicated firewall and intrusion prevention devices. We utilize dedicated high availability security and firewall protection devices on the edge of your network. This service is fully managed by us to give you the reassurance that all traffic is stringently monitored and blocked appropriately.</small></td>
</tr>
<tr>
<td width="10%"><img src="http://www.stardothosting.com/icon1.png"></td>
<td width="30%"><b>Integrated Weekly Backups</b></td>
<td width="60%"><small>For additional redundancy, your managed VPS instance is imaged and backed up on a weekly basis. Secure offsite backups are offered at an additional fee.</small></td>
</tr>
<tr>
<td width="10%"><img src="http://www.stardothosting.com/icon5.png"></td>
<td width="30%"><b>Proactive maintenance and Support</b></td>
<td width="60%"><small>Support is offered 24x7x365 through our ticketing system. Proactive maintenance, configuration, installation and administration is offered for all of our managed VPS hosting packages. Our response time is consistently fast and reliable.</small></td>
</tr>
<tr>
<td width="10%"><img src="http://www.stardothosting.com/aws.jpg"></td>
<td width="30%"><b>Fully Managed Amazon Cloud</b></td>
<td width="60%"><small>Want to establish your business with the Amazon Cloud infrastructure? We&#8217;ve been managing Amazon Cloud instances for our clients for years. We consider ourselves highly experienced at implementing, monitoring, integrating, maintaining and transitioning businesses to the Amazon Cloud infrastructure. Amazon offers a wide assortment of services that could help bring your business to the next level on the largest cloud platform in the world.</small></td>
</tr>
</table>
<p></center></p>
<p>Star Dot Hosting&#8217;s Managed Virtual Private Server service catalog is the preferred solution for clients who need to have the full control similar to a dedicated server, and the assurances of a fully staffed 24x7x365 managed services team ensuring their services are stable.</p>
<p>Managed VPS customers can choose any Operating System that meets their requirements (Linux,Windows,Unix). Our monitoring services are included that provides 24x7x365 alerting, trending, monitoring and graphing of their VPS instances health and also helps growth and expansion planning.</p>
<p>We provide the exact same service catalog as our managed dedicated services, except on a virtual platform. Everything from failover, load balancing, data and database replication, monitoring/alerting, trending and graphing are fair game.</p>
<p>We would love to work with you to design your architecture from the ground up, without the added expenses of deploying dedicated hardware. Please fill out the contact form below and one of our technical agents will quickly follow up with you to ensure we have all the information we need to provide an accurate and thorough quotation for managed vps hosting services. Please fill out the form below to have one of our sales associates build a Managed VPS quotation to suit your needs.<br />
<br /><br/ ></p>
<h4>Create A Custom Quote</h4>
<p></br><br />
<center>[contact-form-7]</center></p>
]]></content:encoded>
			<wfw:commentRss>http://www.stardothosting.com/managed-vps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unmanaged VPS</title>
		<link>http://www.stardothosting.com/unmanaged-vps/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=unmanaged-vps</link>
		<comments>http://www.stardothosting.com/unmanaged-vps/#comments</comments>
		<pubDate>Thu, 23 Aug 2012 18:52:29 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
		
		<guid isPermaLink="false">http://www.shift8web.com/projects/stardothosting.com/?page_id=10</guid>
		<description><![CDATA[99.99% Uptime Guarantee Star Dot Hosting will provide a minimum 99.99% uninterrupted access to your web site, email, VPS and other related services. Should your services become unavailable for a cumulative period beyond the allowed 0.01% in any month of service, the client will receive a credit equivalent to 5% of the client&#8217;s pro-rated recurring [...]]]></description>
				<content:encoded><![CDATA[<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="950"><div class="p_table_1 p_table_1_10 css3_grid_clearfix"><div class="caption_column"><ul><li class="header_row_1 align_center radius5_topleft"></li><li class="header_row_2"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><h2 class="caption">choose <span>your</span> plan</h2></span></span></li><li class="row_style_4"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span>Amount of RAM</span></span></span></li><li class="row_style_2"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span>Hard Drive Space</span></span></span></li><li class="row_style_4"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span>Bandwidth Per Month</span></span></span></li><li class="row_style_2"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span>24/7/365 Support</span></span></span></li><li class="row_style_4"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span>24/7/365 Monitoring</span></span></span></li><li class="row_style_2"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span>Remote Console</span></span></span></li><li class="row_style_4"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span>Remote Power Control</span></span></span></li><li class="row_style_2"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span>Cpanel Available</span></span></span></li><li class="row_style_4"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span>Dedicated Firewalls</span></span></span></li><li class="row_style_2"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span>99.99% Uptime</span></span></span></li><li class="row_style_4"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span>Weekly Backups</span></span></span></li><li class="footer_row"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"></span></span></li></ul></div><div class="column_1"><div class="column_ribbon ribbon_style1_best"></div><ul><li class="header_row_1 align_center"><h2 class="col1">star.1000</h2></li><li class="header_row_2 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><h1 class="col1">$<span>22</span></h1><h3 class="col1">per month</h3></span></span></li><li class="row_style_3 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span>306 MB of RAM</span></span></span></li><li class="row_style_1 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span>5GB Hard Drive </span></span></span></li><li class="row_style_3 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span>250GB Bandwidth</span></span></span></li><li class="row_style_1 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span><img src='http://www.stardothosting.com/wp-content/plugins/css3_web_pricing_tables_grids/img/tick_01.png' alt='yes' /></span></span></span></li><li class="row_style_3 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span><img src='http://www.stardothosting.com/wp-content/plugins/css3_web_pricing_tables_grids/img/tick_01.png' alt='yes' /></span></span></span></li><li class="row_style_1 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span><img src='http://www.stardothosting.com/wp-content/plugins/css3_web_pricing_tables_grids/img/tick_01.png' alt='yes' /></span></span></span></li><li class="row_style_3 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span><img src='http://www.stardothosting.com/wp-content/plugins/css3_web_pricing_tables_grids/img/tick_01.png' alt='yes' /></span></span></span></li><li class="row_style_1 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span><img src='http://www.stardothosting.com/wp-content/plugins/css3_web_pricing_tables_grids/img/tick_16.png' alt='yes' /></span></span></span></li><li class="row_style_3 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span><img src='http://www.stardothosting.com/wp-content/plugins/css3_web_pricing_tables_grids/img/tick_01.png' alt='yes' /></span></span></span></li><li class="row_style_1 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span><span class="css3_grid_tooltip"><span>Star Dot Hosting will provide a minimum 99.99% uninterrupted access to your web site, email, VPS and other related services. Should your services become unavailable for a cumulative period beyond the allowed 0.01% in any month of service, the client will receive a credit equivalent to 5% of the client’s pro-rated recurring monthly fees for that month and then an additional 5% for every additional 15 minutes the web site and/or other related services are unavailable. </span><img src='http://www.stardothosting.com/wp-content/plugins/css3_web_pricing_tables_grids/img/tick_01.png' alt='yes' /></span></span></span></span></li><li class="row_style_3 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span><img src='http://www.stardothosting.com/wp-content/plugins/css3_web_pricing_tables_grids/img/tick_01.png' alt='yes' /></span></span></span></li><li class="footer_row"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span class="css3_grid_tooltip"><span>Sign up for Star.1000</span><a href='https://secure.stardothosting.com/cart.php?a=add&pid=33' class='sign_up sign_up_orange radius3'>sign up!</a></span></span></span></li></ul></div><div class="column_2"><ul><li class="header_row_1 align_center"><h2 class="col2">Star.1060</h2></li><li class="header_row_2 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><h1 class="col1">$<span>41</span></h1><h3 class="col1">per month</h3></span></span></li><li class="row_style_4 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span>562 MB of RAM</span></span></span></li><li class="row_style_2 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span>10GB Hard Drive </span></span></span></li><li class="row_style_4 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span>500GB Bandwidth</span></span></span></li><li class="row_style_2 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span><img src='http://www.stardothosting.com/wp-content/plugins/css3_web_pricing_tables_grids/img/tick_01.png' alt='yes' /></span></span></span></li><li class="row_style_4 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span><img src="http://www.stardothosting.com/wp-content/plugins/css3_web_pricing_tables_grids/img/tick_01.png" alt="yes"></span></span></span></li><li class="row_style_2 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span><img src='http://www.stardothosting.com/wp-content/plugins/css3_web_pricing_tables_grids/img/tick_01.png' alt='yes' /></span></span></span></li><li class="row_style_4 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span><img src='http://www.stardothosting.com/wp-content/plugins/css3_web_pricing_tables_grids/img/tick_01.png' alt='yes' /></span></span></span></li><li class="row_style_2 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span><img src='http://www.stardothosting.com/wp-content/plugins/css3_web_pricing_tables_grids/img/tick_16.png' alt='yes' /></span></span></span></li><li class="row_style_4 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span><img src='http://www.stardothosting.com/wp-content/plugins/css3_web_pricing_tables_grids/img/tick_01.png' alt='yes' /></span></span></span></li><li class="row_style_2 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span><span class="css3_grid_tooltip"><span>Star Dot Hosting will provide a minimum 99.99% uninterrupted access to your web site, email, VPS and other related services. Should your services become unavailable for a cumulative period beyond the allowed 0.01% in any month of service, the client will receive a credit equivalent to 5% of the client’s pro-rated recurring monthly fees for that month and then an additional 5% for every additional 15 minutes the web site and/or other related services are unavailable. </span><img src='http://www.stardothosting.com/wp-content/plugins/css3_web_pricing_tables_grids/img/tick_01.png' alt='yes' /></span></span></span></span></li><li class="row_style_4 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span><img src='http://www.stardothosting.com/wp-content/plugins/css3_web_pricing_tables_grids/img/tick_01.png' alt='yes' /></span></span></span></li><li class="footer_row"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span class="css3_grid_tooltip"><span>Sign up for Star.1060</span><a href='https://secure.stardothosting.com/cart.php?a=add&pid=39' class='sign_up sign_up_orange radius3'>sign up!</a></span></span></span></li></ul></div><div class="column_3"><ul><li class="header_row_1 align_center"><h2 class="col1">Star.1130</h2></li><li class="header_row_2 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><h1 class="col1">$<span>80</span></h1><h3 class="col1">per month</h3></span></span></li><li class="row_style_3 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span>818 MB of RAM</span></span></span></li><li class="row_style_1 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span>20GB Hard Drive </span></span></span></li><li class="row_style_3 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span>1250GB Bandwidth</span></span></span></li><li class="row_style_1 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span><img src='http://www.stardothosting.com/wp-content/plugins/css3_web_pricing_tables_grids/img/tick_01.png' alt='yes' /></span></span></span></li><li class="row_style_3 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span><img src="http://www.stardothosting.com/wp-content/plugins/css3_web_pricing_tables_grids/img/tick_01.png" alt="yes"></span></span></span></li><li class="row_style_1 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span><img src='http://www.stardothosting.com/wp-content/plugins/css3_web_pricing_tables_grids/img/tick_01.png' alt='yes' /></span></span></span></li><li class="row_style_3 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span><img src='http://www.stardothosting.com/wp-content/plugins/css3_web_pricing_tables_grids/img/tick_01.png' alt='yes' /></span></span></span></li><li class="row_style_1 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span><img src='http://www.stardothosting.com/wp-content/plugins/css3_web_pricing_tables_grids/img/tick_16.png' alt='yes' /></span></span></span></li><li class="row_style_3 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span><img src='http://www.stardothosting.com/wp-content/plugins/css3_web_pricing_tables_grids/img/tick_01.png' alt='yes' /></span></span></span></li><li class="row_style_1 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span><span class="css3_grid_tooltip"><span>Star Dot Hosting will provide a minimum 99.99% uninterrupted access to your web site, email, VPS and other related services. Should your services become unavailable for a cumulative period beyond the allowed 0.01% in any month of service, the client will receive a credit equivalent to 5% of the client’s pro-rated recurring monthly fees for that month and then an additional 5% for every additional 15 minutes the web site and/or other related services are unavailable. </span><img src='http://www.stardothosting.com/wp-content/plugins/css3_web_pricing_tables_grids/img/tick_01.png' alt='yes' /></span></span></span></span></li><li class="row_style_3 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span><img src='http://www.stardothosting.com/wp-content/plugins/css3_web_pricing_tables_grids/img/tick_01.png' alt='yes' /></span></span></span></li><li class="footer_row"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span class="css3_grid_tooltip"><span>Sign up for Star.1130</span><a href='https://secure.stardothosting.com/cart.php?a=add&pid=48' class='sign_up sign_up_orange radius3'>sign up!</a></span></span></span></li></ul></div><div class="column_4"><ul><li class="header_row_1 align_center radius5_topright"><h2 class="col1">Custom VPS</h2></li><li class="header_row_2 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><h2 class='caption'>Custom <span>Price</span></h2></span></span></li><li class="row_style_4 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span>Custom RAM!</span></span></span></li><li class="row_style_2 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span>Custom Hard Drive!</span></span></span></li><li class="row_style_4 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span>Custom Bandwidth!</span></span></span></li><li class="row_style_2 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span><img src='http://www.stardothosting.com/wp-content/plugins/css3_web_pricing_tables_grids/img/tick_01.png' alt='yes' /></span></span></span></li><li class="row_style_4 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span><img src="http://www.stardothosting.com/wp-content/plugins/css3_web_pricing_tables_grids/img/tick_01.png" alt="yes"></span></span></span></li><li class="row_style_2 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span><img src='http://www.stardothosting.com/wp-content/plugins/css3_web_pricing_tables_grids/img/tick_01.png' alt='yes' /></span></span></span></li><li class="row_style_4 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span><img src='http://www.stardothosting.com/wp-content/plugins/css3_web_pricing_tables_grids/img/tick_01.png' alt='yes' /></span></span></span></li><li class="row_style_2 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span><img src='http://www.stardothosting.com/wp-content/plugins/css3_web_pricing_tables_grids/img/tick_16.png' alt='yes' /></span></span></span></li><li class="row_style_4 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span><img src='http://www.stardothosting.com/wp-content/plugins/css3_web_pricing_tables_grids/img/tick_01.png' alt='yes' /></span></span></span></li><li class="row_style_2 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span><span class="css3_grid_tooltip"><span>Star Dot Hosting will provide a minimum 99.99% uninterrupted access to your web site, email, VPS and other related services. Should your services become unavailable for a cumulative period beyond the allowed 0.01% in any month of service, the client will receive a credit equivalent to 5% of the client’s pro-rated recurring monthly fees for that month and then an additional 5% for every additional 15 minutes the web site and/or other related services are unavailable. </span><img src='http://www.stardothosting.com/wp-content/plugins/css3_web_pricing_tables_grids/img/tick_01.png' alt='yes' /></span></span></span></span></li><li class="row_style_4 align_center"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span><img src='http://www.stardothosting.com/wp-content/plugins/css3_web_pricing_tables_grids/img/tick_01.png' alt='yes' /></span></span></span></li><li class="footer_row"><span class="css3_grid_vertical_align_table"><span class="css3_grid_vertical_align"><span class="css3_grid_tooltip"><span>Sign up for a Custom VPS</span><a href='https://secure.stardothosting.com/cart.php?a=add&pid=73' class='sign_up sign_up_orange radius3'>sign up!</a></span></span></span></li></ul></div></div></td>
<td>
<h1>99.99% Uptime Guarantee</h1>
<p>Star Dot Hosting will provide a minimum 99.99% uninterrupted access to your web site, email, VPS and other related services. </p>
<p>Should your services become unavailable for a cumulative period beyond the allowed 0.01% in any month of service, the client will receive a credit equivalent to 5% of the client&#8217;s pro-rated recurring monthly fees for that month and then an additional 5% for every additional 15 minutes the web site and/or other related services are unavailable.<img class="aligncenter size-full wp-image-1157" title="increasing-performance-graph-backgrounds-wallpapers" src="http://www.stardothosting.com/wp-content/uploads/2012/08/increasing-performance-graph-backgrounds-wallpapers.jpg" alt="" width="250" height="188" /></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.stardothosting.com/unmanaged-vps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>About</title>
		<link>http://www.stardothosting.com/company/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=company</link>
		<comments>http://www.stardothosting.com/company/#comments</comments>
		<pubDate>Sun, 19 Aug 2012 04:52:15 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
		
		<guid isPermaLink="false">http://www.shift8web.com/projects/stardothosting.com/?page_id=8</guid>
		<description><![CDATA[Tired of navigating an endless sea of “resellers” utilizing larger managed hosting company resources and pretending to be something they are not? Star Dot Hosting was founded over 6 years ago with 3 goals in mind : simplicity, trust and reliability. We are a small full-service facility built around ensuring ongoing client satisfaction in the [...]]]></description>
				<content:encoded><![CDATA[<p><img src="http://www.stardothosting.com/wp-content/uploads/2012/08/bulding-300x205.jpg" alt="bulding" width="300" height="205" class="alignright size-medium wp-image-1436" /><br />
Tired of navigating an endless sea of “resellers” utilizing larger managed hosting company resources and pretending to be something they are not?</p>
<p>Star Dot Hosting was founded over 6 years ago with 3 goals in mind : simplicity, trust and reliability.</p>
<p>We are a small full-service facility built around ensuring ongoing client satisfaction in the face of constantly changing business requirements.</p>
<p>We were built on the idea that we would like to offer our clients the best return for their IT endeavors without the maximum investment.</p>
<p>Our professional team of experts can help your company find an affordable solution that fits your hosting needs. If web hosting is a serious part of your business then choose a company who is serious about providing quality web hosting solutions. We have worked hard to build a reputation of customer satisfaction through technical excellence, implicit reliability, and friendly staff.<br />
</br></p>
<h1>Our Team</h1>
<p><img src="http://www.stardothosting.com/wp-content/uploads/2012/08/lobby-300x205.jpg" alt="lobby" width="300" height="205" class="alignright size-medium wp-image-1437" />Our team has several decades of collective experience in the hosting industry. We have been around to see the evolution of the industry and have the clarity to see where it is headed. We have the confidence and vision to take our customers into new ventures while utilizing bleeding edge technologies with a concise understanding of the underlying structure.</p>
<p>We believe that one of the main distinguishing factors of any service oriented company is customer service and customer satisfaction. Our #1 goal is ensuring that the service you receive is exemplary and that it exceeds your expectations.</p>
<p>We are passionate about this industry. We love solving problems, developing new solutions and watching your business grow.</p>
<p>We take great pride in knowing that our customers are consistently impressed with our high standards and fast response times. Our ultimate goal with our clients is to ease uncertainty, reduce stress and solve problems. Period.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stardothosting.com/company/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add your Dynamic IPs to Apache HTACCESS files</title>
		<link>http://www.stardothosting.com/blog/2012/05/add-your-dynamic-ips-to-apache-htaccess-files/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=add-your-dynamic-ips-to-apache-htaccess-files</link>
		<comments>http://www.stardothosting.com/blog/2012/05/add-your-dynamic-ips-to-apache-htaccess-files/#comments</comments>
		<pubDate>Mon, 28 May 2012 17:49:12 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[systems administration]]></category>

		<guid isPermaLink="false">http://www.stardothosting.com/blog/?p=580</guid>
		<description><![CDATA[Hello! We threw together a quick &#038; simple script to dynamically update your .htaccess files within apache to add your dynamic IP address to the allow / deny fields. If you&#8217;re looking to password protect an admin area (for example) but your office only has a dynamic IP address, then this script might be handy [...]]]></description>
				<content:encoded><![CDATA[<p>Hello!</p>
<p>We threw together a quick &#038; simple script to dynamically update your .htaccess files within apache to add your dynamic IP address to the allow / deny fields.</p>
<p>If you&#8217;re looking to password protect an admin area (for example) but your office only has a dynamic IP address, then this script might be handy for you.</p>
<p>Its an extremely simple script that polls your dynamic hostname (if you use no-ip.org or dyndns.org for example) every 15 minutes as a cron job and, if it has changed, updates the .htaccess file</p>
<p>Hopefully it will make your life just a little bit easier <img src='http://www.stardothosting.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Sample Cron entry :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">*/15 * * * * /bin/sh /usr/local/bin/htaccessdynamic.sh yourhostname.dyndns.org /var/www/website.com/public_html/.htaccess &gt; /dev/null 2&gt;&amp;1</div></div>
<p>And now the script :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#!/bin/bash<br />
# Dynamic IP .htaccess file generator<br />
# Written by Star Dot Hosting<br />
# www.stardothosting.com<br />
<br />
dynDomain=&quot;$1&quot;<br />
htaccessLoc=&quot;$2&quot;<br />
<br />
dynIP=$(/usr/bin/dig +short $dynDomain)<br />
<br />
echo &quot;dynip: $dynIP&quot;<br />
# verify dynIP resembles an IP<br />
if ! echo -n $dynIP | grep -Eq &quot;[0-9.]+&quot;; then<br />
&nbsp; &nbsp; exit 1<br />
fi<br />
<br />
# if dynIP has changed<br />
if ! cat $htaccessLoc | /bin/grep -q &quot;$dynIP&quot;; then<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; # grab the old IP<br />
&nbsp; &nbsp; &nbsp; &nbsp; oldIP=`cat /usr/local/bin/htold-ip.txt`<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; # output .htaccess file<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;order deny,allow&quot; &gt; $htaccessLoc 2&gt;&amp;1<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;allow from $dynIP&quot; &gt;&gt; $htaccessLoc 2&gt;&amp;1<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;allow from x.x.x.x&quot; &gt;&gt; $htaccessLoc 2&gt;&amp;1<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;deny from all&quot; &gt;&gt; $htaccessLoc 2&gt;&amp;1<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; # save the new ip to remove next time it changes, overwriting previous old IP<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo $dynIP &gt; /usr/local/bin/htold-ip.txt<br />
fi</div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.stardothosting.com/blog/2012/05/add-your-dynamic-ips-to-apache-htaccess-files/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Automated Amazon EBS snapshot backup script with 7 day retention</title>
		<link>http://www.stardothosting.com/blog/2012/05/automated-amazon-ebs-snapshot-backup-script-with-7-day-retention/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=automated-amazon-ebs-snapshot-backup-script-with-7-day-retention</link>
		<comments>http://www.stardothosting.com/blog/2012/05/automated-amazon-ebs-snapshot-backup-script-with-7-day-retention/#comments</comments>
		<pubDate>Wed, 16 May 2012 18:50:24 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Amazon API]]></category>
		<category><![CDATA[Cloud Hosting]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Managed Hosting Services]]></category>
		<category><![CDATA[Managed VPS Hosting]]></category>
		<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[amazon cloud]]></category>
		<category><![CDATA[amazon ebs]]></category>
		<category><![CDATA[amazon ebs snapshot]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[shell scripting]]></category>
		<category><![CDATA[systems administration]]></category>

		<guid isPermaLink="false">http://www.stardothosting.com/blog/?p=573</guid>
		<description><![CDATA[Hello there! We have recently been implementing several different backup strategies for properties that reside on the Amazon cloud platform. These strategies include scripts that incorporate s3sync and s3fs for offsite or redundant &#8220;limitless&#8221; backup storage capabilities. One of the more recent strategies we have implemented for several clients is an automated Amazon EBS volume [...]]]></description>
				<content:encoded><![CDATA[<p>Hello there!</p>
<p>We have recently been implementing several different backup strategies for properties that reside on the Amazon cloud platform.</p>
<p>These strategies include scripts that incorporate s3sync and s3fs for offsite or redundant &#8220;limitless&#8221; backup storage capabilities. One of the more recent strategies we have implemented for several clients is an automated Amazon EBS volume snapshot script that only keeps 7 day retention on all snapshot backups.</p>
<p>The script itself is fairly straightforward, but took several dry-runs in order to fine tune it so that it would reliably create the snapshots, but more importantly would clear out old snapshots older than 7 days. </p>
<p>You can see the for loop for deleting older snapshots. This is done by parsing snapshot dates, converting the dates to a pure numeric value and comparing said numeric value to a &#8220;7 days ago&#8221; date variable.</p>
<p>Take a look at the script below, hopefully it will be useful to you! There could be more error checking, but that should be fairly easy to do.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#!/bin/sh<br />
# EBS Snapshot volume script<br />
# Written by Star Dot Hosting<br />
# www.stardothosting.com<br />
<br />
# Constants<br />
ec2_bin=&quot;/opt/aws/bin&quot;<br />
my_cert=&quot;/opt/aws/cert.txt&quot;<br />
my_key=&quot;/opt/aws/key.txt&quot;<br />
instance_id=`wget -q -O- http://169.254.169.254/latest/meta-data/instance-id`<br />
<br />
# Dates<br />
datecheck_7d=`date +%Y-%m-%d --date '7 days ago'`<br />
datecheck_s_7d=`date --date=&quot;$datecheck_7d&quot; +%s`<br />
<br />
# Get all volume info and copy to temp file<br />
$ec2_bin/ec2-describe-volumes -C $my_cert -K $my_key &nbsp;--filter &quot;attachment.instance-id=$instance_id&quot; &gt; /tmp/volume_info.txt 2&gt;&amp;1<br />
<br />
<br />
# Get all snapshot info<br />
$ec2_bin/ec2-describe-snapshots -C $my_cert -K $my_key | grep &quot;$instance_id&quot; &gt; /tmp/snap_info.txt 2&gt;&amp;1<br />
<br />
# Loop to remove any snapshots older than 7 days<br />
for obj0 in $(cat /tmp/snap_info.txt)<br />
do<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; snapshot_name=`cat /tmp/snap_info.txt | grep &quot;$obj0&quot; | awk '{print $2}'`<br />
&nbsp; &nbsp; &nbsp; &nbsp; datecheck_old=`cat /tmp/snap_info.txt | grep &quot;$snapshot_name&quot; | awk '{print $5}' | awk -F &quot;T&quot; '{printf &quot;%s\n&quot;, $1}'`<br />
&nbsp; &nbsp; &nbsp; &nbsp; datecheck_s_old=`date &quot;--date=$datecheck_old&quot; +%s`<br />
<br />
# &nbsp; &nbsp; &nbsp; echo &quot;snapshot name: $snapshot_name&quot;<br />
# &nbsp; &nbsp; &nbsp; echo &quot;datecheck 7d : $datecheck_7d&quot;<br />
# &nbsp; &nbsp; &nbsp; echo &quot;datecheck 7d s : $datecheck_s_7d&quot;<br />
# &nbsp; &nbsp; &nbsp; echo &quot;datecheck old : $datecheck_old&quot;<br />
# &nbsp; &nbsp; &nbsp; echo &quot;datecheck old s: $datecheck_s_old&quot;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; if (( $datecheck_s_old &lt;= $datecheck_s_7d ));<br />
&nbsp; &nbsp; &nbsp; &nbsp; then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &quot;deleting snapshot $snapshot_name ...&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $ec2_bin/ec2-delete-snapshot -C $my_cert -K $my_key $snapshot_name<br />
&nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &quot;not deleting snapshot $snapshot_name ...&quot;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; fi<br />
<br />
done<br />
<br />
<br />
# Create snapshot<br />
for volume in $(cat /tmp/volume_info.txt | grep &quot;VOLUME&quot; | awk '{print $2}')<br />
do<br />
&nbsp; &nbsp; &nbsp; &nbsp; description=&quot;`hostname`_backup-`date +%Y-%m-%d`&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Creating Snapshot for the volume: $volume with description: $description&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $ec2_bin/ec2-create-snapshot -C $my_cert -K $my_key -d $description $volume<br />
done</div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.stardothosting.com/blog/2012/05/automated-amazon-ebs-snapshot-backup-script-with-7-day-retention/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Managed VPS hosting services from Star Dot Hosting</title>
		<link>http://www.stardothosting.com/blog/2012/02/managed-vps-hosting-services-from-star-dot-hosting/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=managed-vps-hosting-services-from-star-dot-hosting</link>
		<comments>http://www.stardothosting.com/blog/2012/02/managed-vps-hosting-services-from-star-dot-hosting/#comments</comments>
		<pubDate>Wed, 15 Feb 2012 21:49:09 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Company Announcements]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Managed Hosting Services]]></category>
		<category><![CDATA[Managed VPS Hosting]]></category>
		<category><![CDATA[company announcements]]></category>
		<category><![CDATA[managd hosting services]]></category>
		<category><![CDATA[managed vps hosting]]></category>

		<guid isPermaLink="false">http://www.stardothosting.com/blog/?p=561</guid>
		<description><![CDATA[Click here for a free quote for managed vps hosting! Hello, I thought I&#8217;d update our blog to let everyone know that we offer our extensive managed services catalog on our VPS infrastructure! If you are looking for high quality managed services from systems administrators with extensive experience, then contact our sales department for a [...]]]></description>
				<content:encoded><![CDATA[<p>
<center><big><b><a href="http://www.stardothosting.com/managed-hosting/" target="_new">Click here for a free quote for managed vps hosting!</a></b></big></center></p>
<p>Hello,</p>
<p>I thought I&#8217;d update our blog to let everyone know that we offer our extensive managed services catalog on our VPS infrastructure!</p>
<p>If you are looking for high quality managed services from systems administrators with extensive experience, then contact our sales department for a consultation / quotation!</p>
<p>Find below just a SAMPLE of some of the managed services we provide :</p>
<p><b><big>Support Services</b></big><br />
- 24/7/365 Technical Support (Ticketing system)<br />
- 24/7/365 Alert monitoring on-call rotation pager system<br />
- Online Customer Service Center 		</p>
<p><b><big>Linux Administration</b></big><br />
- Installs, reinstalls and updates<br />
- Trouble Shooting and configuration<br />
- Apache configuration, optimization &#038; Setup<br />
- Linux X64 installation, optimization and maintenance<br />
- Security optimizations<br />
- Proactive and reactive maintenance<br />
- Installs, reinstalls and updates<br />
- Trouble Shooting and configuration</p>
<p><b><big>Managed MySQL and MSSQL</b></big><br />
- MySQL and MS SQL first time install service<br />
- MySQL maintenance and troubleshooting</p>
<p><b><big>24/7/365 System Availability</b></big><br />
- Availability monitoring (Ping and Synthetic Transactions)<br />
- Performance monitoring of key server parameters<br />
- Graphing and trending		</p>
<p><b><big>Security Services</b></big><br />
- Routine Security Patching<br />
- Routine Security scanning and auditing<br />
- Penetration testing, SQL Injection<br />
- Quarterly security audit reporting<br />
- Dedicated hardware firewalls for all clients	</p>
<p><b><big>Hardware Maintenance</b></big><br />
- Hardware failure alerting and monitoring		</p>
<p><b><big>Offsite Backups</b></big><br />
- Remote off-site backups per 50gb nightly		</p>
<p>
<center><big><b><a href="http://www.stardothosting.com/managed-hosting/" target="_new">Click here for a free quote for managed vps hosting!</a></b></big></center></p>
]]></content:encoded>
			<wfw:commentRss>http://www.stardothosting.com/blog/2012/02/managed-vps-hosting-services-from-star-dot-hosting/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Massive Amazon Route53 API Bind Zone Import Script</title>
		<link>http://www.stardothosting.com/blog/2012/02/massive-amazon-route53-api-bind-zone-import-script/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=massive-amazon-route53-api-bind-zone-import-script</link>
		<comments>http://www.stardothosting.com/blog/2012/02/massive-amazon-route53-api-bind-zone-import-script/#comments</comments>
		<pubDate>Fri, 03 Feb 2012 16:39:31 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Amazon API]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[bind]]></category>
		<category><![CDATA[route53]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[systems administration]]></category>
		<category><![CDATA[systems automation]]></category>

		<guid isPermaLink="false">http://www.stardothosting.com/blog/?p=491</guid>
		<description><![CDATA[Hello there, Occasionally some of our managed services work has us dealing directly with other cloud providers such as Amazon. One of our clients set a requirement to migrate over 5,000 domain&#8217;s to Amazon&#8217;s Route53 DNS service. There was little doubt that this could be automated, but since we have never done this massive of [...]]]></description>
				<content:encoded><![CDATA[<p>Hello there,</p>
<p>Occasionally some of our managed services work has us dealing directly with other cloud providers such as Amazon. One of our clients set a requirement to migrate over 5,000 domain&#8217;s to Amazon&#8217;s Route53 DNS service. </p>
<p>There was little doubt that this could be automated, but since we have never done this massive of a deployment through Amazon&#8217;s API directly, we thought it might be interesting to post the process as well as the script through which we managed the import process.</p>
<p>Essentially the script utilizes a master domain name list file as its basis for looping through the import. The master list refers to the bind zone files and imports them into Amazon&#8217;s Route53 via the Cli53 tool package.</p>
<p>One final note, the script outputs all completed domain imports into a CSV file with the following format :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">domain.com,ns1.nameserver.com,ns2.nameserver.com,ns3.nameserver.com,ns4.nameserver.com</div></div>
<p>This is because when facilitating the actual nameserver change request, all the nameservers assigned to domains when imported to Route53 are randomly generated, so the script has to keep track of these nameserver/domain associations.</p>
<p>The script isn&#8217;t perfect and could benefit from some optimizations and more error checking (it does a lot of error checking already, however), but here it is in its entirety. We hope you will have some use for it!</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#!/bin/sh<br />
# Import all zone files into amazon<br />
# Star Dot Hosting 2012<br />
# www.stardothosting.com<br />
<br />
currentmonth=`date &quot;+%Y-%m-%d&quot;`<br />
<br />
#sanitize input and verify input was given<br />
command=`echo &quot;$1&quot; | sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`<br />
<br />
if [ -z &quot;$1&quot; ];<br />
then<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;AWS ZONE IMPORT&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;---------------&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Usage : ./importzone.sh file.txt&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; exit 0<br />
fi<br />
<br />
<br />
echo &quot;zone import log : $currentmonth&quot; &gt; /var/log/importzone.log 2&gt;&amp;1<br />
echo &quot; &quot; &gt;&gt; /var/log/importzone.log 2&gt;&amp;1<br />
<br />
<br />
<br />
for obj0 in $(cat $1);<br />
do<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;checking if $obj0 was already migrated ...&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; ls -la /usr/local/zones/$1-zones/complete | grep -w $obj0 &gt;&gt; /dev/null 2&gt;&amp;1<br />
&nbsp; &nbsp; &nbsp; &nbsp; if [ &quot;$?&quot; -eq 1 ]<br />
&nbsp; &nbsp; &nbsp; &nbsp; then<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;importing $obj0 ...&quot;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; #check if zone file has NS records<br />
&nbsp; &nbsp; &nbsp; &nbsp; cat /usr/local/zones/$1-zones/$obj0.txt | grep NS &gt;&gt; /dev/null 2&gt;&amp;1<br />
&nbsp; &nbsp; &nbsp; &nbsp; if [ &quot;$?&quot; -eq 0 ]<br />
&nbsp; &nbsp; &nbsp; &nbsp; then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Nameserver exists, continuing...&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Adding nameserver to record...&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &quot;$obj0. 43201 IN NS ns1.nameserver.com.&quot; &gt;&gt; /usr/local/zones/$1-zones/$obj0.txt<br />
&nbsp; &nbsp; &nbsp; &nbsp; fi<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; #check if zone exists<br />
&nbsp; &nbsp; &nbsp; &nbsp; /usr/local/zones/cli53/bin/cli53 info $obj0 &gt;&gt; /var/log/importzone.log 2&gt;&amp;1<br />
&nbsp; &nbsp; &nbsp; &nbsp; if [ &quot;$?&quot; -eq 0 ]<br />
&nbsp; &nbsp; &nbsp; &nbsp; then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # grab NAMESERVERS<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nameservers=`/usr/local/zones/cli53/bin/cli53 rrlist $obj0 | grep &quot;NS&quot; | awk -F &quot;NSt&quot; '{printf &quot;%sn&quot;, $2}' | sed 's/.$/g' | sed ':a;N;$!ba;s/n/,/g'`<br />
&nbsp; &nbsp;# import zone file<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /usr/local/zones/cli53/bin/cli53 import $obj0 -r -f /usr/local/zones/$1-zones/$obj0.txt<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if [ &quot;$?&quot; -eq 0 ]<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #move to complete folder<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mv /usr/local/zones/$1-zones/$obj0.txt /usr/local/zones/$1-zones/complete<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &quot;There was an error in importing the zone file!&quot; &gt;&gt; /var/log/importzone.log<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit 1<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fi<br />
&nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #create on route53<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /usr/local/zones/cli53/bin/cli53 create $obj0 &gt;&gt; /var/log/importzone.log 2&gt;&amp;1<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # grab NAMESERVERS<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nameservers=`/usr/local/zones/cli53/bin/cli53 rrlist $obj0 | grep &quot;NS&quot; | awk -F &quot;NSt&quot; '{printf &quot;%sn&quot;, $2}' | sed 's/.$/g' | sed ':a;N;$!ba;s/n/,/g'`<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # import zone file<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /usr/local/zones/cli53/bin/cli53 import $obj0 -r -f /usr/local/zones/$1-zones/$obj0.txt<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if [ &quot;$?&quot; -eq 0 ]<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #move to complete folder<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mv /usr/local/zones/$1-zones/$obj0.txt /usr/local/zones/$1-zones/complete<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &quot;There was an error in importing the zone file!&quot; &gt;&gt; /var/log/importzone.log<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit 1<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fi<br />
&nbsp; &nbsp; &nbsp; &nbsp; fi<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; # output domain + nameservers in a CSV with format : domain.com,ns1,ns2,ns3,ns4<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;$obj0,$nameservers&quot; &gt;&gt; nameserver_registrar_request.txt 2&amp;&gt;1<br />
&nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Domain already migrated .. !&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; fi<br />
done</div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.stardothosting.com/blog/2012/02/massive-amazon-route53-api-bind-zone-import-script/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Checking and repairing mysql replication automatically</title>
		<link>http://www.stardothosting.com/blog/2012/02/checking-and-repairing-mysql-replication-automatically/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=checking-and-repairing-mysql-replication-automatically</link>
		<comments>http://www.stardothosting.com/blog/2012/02/checking-and-repairing-mysql-replication-automatically/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 17:15:02 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql replication]]></category>
		<category><![CDATA[systems administration]]></category>

		<guid isPermaLink="false">http://www.stardothosting.com/blog/?p=486</guid>
		<description><![CDATA[Hello! MySQL replication has been known to easily break, as a result of a large multitude of potential causes. Sometimes the replication can even break if an erroneous query is executed on the master server. With all the potential issues that may break replication, we thought it prudent to write an automated check script that [...]]]></description>
				<content:encoded><![CDATA[<p>Hello!</p>
<p>MySQL replication has been known to easily break, as a result of a large multitude of potential causes.</p>
<p>Sometimes the replication can even break if an erroneous query is executed on the master server.</p>
<p>With all the potential issues that may break replication, we thought it prudent to write an automated check script that can run on a scheduled basis (i.e. every 10-15 minutes), check the Slave status, report on any errors if applicable and attempt to repair replication.</p>
<p>We have built this script to exit and send mail alerts if any step of the checking and repairing process fails or generates an error in itself.</p>
<p>The script also generates a lock file to ensure that no more than one check process can run at any given time. We feel this script could be best used for scenarios for remote MySQL slaves, for example. Adding this extra layer may ensure a more reliable replication. </p>
<p>The repair process is simply 3 MySQL Commands :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">stop slave;<br />
reset slave;<br />
slave start;</div></div>
<p>The above directives assume that you have a master.info with the mysql master server information statically set. No CHANGE MASTER commands have to be executed as a result. Resetting the slave clears the error and resumes replication, and all the queries missed during the time it failed should be queued and applied after it starts again.</p>
<p>Here is the script :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#!/bin/sh<br />
# Slave replication auto recovery and alert<br />
# Star Dot Hosting 2012<br />
<br />
currentmonth=`date &quot;+%Y-%m-%d&quot;`<br />
lock_file=/tmp/slave_alert.lck<br />
<br />
echo &quot;MySQL Replication Check Script&quot; &gt; /var/log/replication_check.log 2&gt;&amp;1<br />
echo &quot;------------------------------&quot; &gt;&gt; /var/log/replication_check.log 2&gt;&amp;1<br />
echo &quot;$currentmonth&quot; &gt;&gt; /var/log/replication_check.log 2&gt;&amp;1<br />
echo &quot;&quot; &gt;&gt; /var/log/replication_check.log 2&gt;&amp;1<br />
<br />
<br />
# Check if lock file exists<br />
if [ -f $lock_file ];<br />
then<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Lock file exists! Possible conflict!&quot; &gt;&gt; /var/log/replication_check.log 2&gt;&amp;1<br />
&nbsp; &nbsp; &nbsp; &nbsp; mail_alert<br />
&nbsp; &nbsp; &nbsp; &nbsp; exit 1<br />
else<br />
&nbsp; &nbsp; &nbsp; &nbsp; touch $lock_file<br />
fi<br />
<br />
# Fix slave<br />
function fix_replication () {<br />
&nbsp; &nbsp; &nbsp; &nbsp; mysql -u root --password=&quot;XXXXX&quot; -Bse &quot;stop slave&quot; &gt;&gt; /var/log/replication_check.log 2&gt;&amp;1<br />
&nbsp; &nbsp; &nbsp; &nbsp; if [ &quot;$?&quot; -eq 0 ];<br />
&nbsp; &nbsp; &nbsp; &nbsp; then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Stop slave succeeded...&quot; &gt;&gt; /var/log/replication_check.log 2&gt;&amp;1<br />
&nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Slave recover function failed&quot; &gt;&gt; /var/log/replication_check.log 2&gt;&amp;1<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mail_alert<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit 1<br />
&nbsp; &nbsp; &nbsp; &nbsp; fi<br />
&nbsp; &nbsp; &nbsp; &nbsp; mysql -u root --password=&quot;XXXXX&quot; -Bse &quot;reset slave&quot; &gt;&gt; /var/log/replication_check.log 2&gt;&amp;1<br />
&nbsp; &nbsp; &nbsp; &nbsp; if [ &quot;$?&quot; -eq 0 ];<br />
&nbsp; &nbsp; &nbsp; &nbsp; then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Reset slave succeeded...&quot; &gt;&gt; /var/log/replication_check.log 2&gt;&amp;1<br />
&nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Slave recover function failed&quot; &gt;&gt; /var/log/replication_check.log 2&gt;&amp;1<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mail_alert<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit 1<br />
&nbsp; &nbsp; &nbsp; &nbsp; fi<br />
&nbsp; &nbsp; &nbsp; &nbsp; mysql -u root --password=&quot;XXXXX&quot; -Bse &quot;slave start&quot; &gt;&gt; /var/log/replication_check.log 2&gt;&amp;1<br />
&nbsp; &nbsp; &nbsp; &nbsp; if [ &quot;$?&quot; -eq 0 ];<br />
&nbsp; &nbsp; &nbsp; &nbsp; then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Slave start succeeded.&quot; &gt;&gt; /var/log/replication_check.log 2&gt;&amp;1<br />
&nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Slave recover function failed&quot; &gt;&gt; /var/log/replication_check.log 2&gt;&amp;1<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mail_alert<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit 1<br />
&nbsp; &nbsp; &nbsp; &nbsp; fi<br />
}<br />
<br />
<br />
# Alert function<br />
function mail_alert () {<br />
&nbsp; &nbsp; &nbsp; &nbsp; cat /var/log/replication_check.log | mail -s &quot;Replication check errors!&quot; your@email.com<br />
}<br />
<br />
<br />
# Check if Slave is running properly<br />
Slave_IO_Running=`mysql -u root --password=&quot;XXXXX&quot; -Bse &quot;show slave statusG&quot; | grep Slave_IO_Running | awk '{ print $2 }'`<br />
Slave_SQL_Running=`mysql -u root --password=&quot;XXXXX&quot; -Bse &quot;show slave statusG&quot; | grep Slave_SQL_Running | awk '{ print $2 }'`<br />
Last_error=`mysql -u root --password=&quot;XXXXX&quot; -Bse &quot;show slave statusG&quot; | grep Last_error | awk -F : '{ print $2 }'`<br />
<br />
<br />
# If no values are returned, slave is not running<br />
if [ -z $Slave_IO_Running -o -z $Slave_SQL_Running ];<br />
then<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Replication is not configured or you do not have the required access to MySQL&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; exit 1<br />
fi<br />
<br />
# If everythings running, remove lockfile if it exists and exit<br />
if [ $Slave_IO_Running == 'Yes' ] &amp;&amp; [ $Slave_SQL_Running == 'Yes' ];<br />
then<br />
&nbsp; &nbsp; &nbsp; &nbsp; rm $lock_file<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Replication slave is running&quot; &gt;&gt; /var/log/replication_check.log 2&gt;&amp;1<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Removed Alert Lock&quot; &gt;&gt; /var/log/replication_check.log 2&gt;&amp;1<br />
elif [ $Slave_SQL_Running == 'No' ] || [ $Slave_IO_Running == 'No' ];<br />
then<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;SQL thread not running on server `hostname -s`!&quot; &gt;&gt; /var/log/replication_check.log 2&gt;&amp;1<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Last Error:&quot; $Last_error &gt;&gt; /var/log/replication_check.log 2&gt;&amp;1<br />
&nbsp; &nbsp; &nbsp; &nbsp; fix_replication<br />
&nbsp; &nbsp; &nbsp; &nbsp; mail_alert<br />
&nbsp; &nbsp; &nbsp; &nbsp; rm $lock_file<br />
fi<br />
<br />
echo &quot;Script complete!&quot; &gt;&gt; /var/log/replication_check.log 2&gt;&amp;1<br />
exit 0</div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.stardothosting.com/blog/2012/02/checking-and-repairing-mysql-replication-automatically/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Managed hosting services from Star Dot Hosting</title>
		<link>http://www.stardothosting.com/blog/2012/01/managed-hosting-services-from-star-dot-hosting/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=managed-hosting-services-from-star-dot-hosting</link>
		<comments>http://www.stardothosting.com/blog/2012/01/managed-hosting-services-from-star-dot-hosting/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 14:36:51 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Company Announcements]]></category>
		<category><![CDATA[company announcements]]></category>
		<category><![CDATA[managed hosting services]]></category>
		<category><![CDATA[star dot hosting]]></category>
		<category><![CDATA[stardothosting]]></category>

		<guid isPermaLink="false">http://blog.stardothosting.com/?p=481</guid>
		<description><![CDATA[Hello There, This update is to highlight the managed hosting services and systems administration services offered by Star Dot Hosting. We are proud to offer some of the highest standards of managed hosting services in the industry. Here are some of the services we offer : - 24x7x365 Monitoring, Alerting &#038; Trending - 24x7x365 ~15minute [...]]]></description>
				<content:encoded><![CDATA[<p>Hello There,</p>
<p>This update is to highlight the managed hosting services and systems administration services offered by Star Dot Hosting.</p>
<p>We are proud to offer some of the highest standards of managed hosting services in the industry. Here are some of the services we offer :</p>
<p>- 24x7x365 Monitoring, Alerting &#038; Trending<br />
- 24x7x365 ~15minute response time support ticketing system<br />
- Quarterly Security Auditing &#038; Reporting<br />
- Patch management &#038; Maintenance<br />
- Administration, troubleshooting, deployment and code pushes<br />
- Hardware upgrades, deployments, expansion<br />
- Dedicated load balancing<br />
- Dedicated firewalls<br />
- Database replication &#038; clustering<br />
- Dedicated edge content caching</p>
<p>Those are just some of the services we would provide to you! Our quotation process involves rigorous consultations which includes technology assessment and especially a complete understanding of how your scenario can be designed and where improvements can be made, if any.</p>
<p>Feel free to click the link below to visit our managed hosting page, and fill out a quotation request form! </p>
<p><center><br />
<a href="http://www.stardothosting.com/managed-hosting/" target="_new"><big><b>http://www.stardothosting.com/managed-hosting/</big></b></a><br />
</center></p>
]]></content:encoded>
			<wfw:commentRss>http://www.stardothosting.com/blog/2012/01/managed-hosting-services-from-star-dot-hosting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Backup, compress and encrpyt your git repository</title>
		<link>http://www.stardothosting.com/blog/2011/11/backup-compress-and-encrpyt-your-git-repository/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=backup-compress-and-encrpyt-your-git-repository</link>
		<comments>http://www.stardothosting.com/blog/2011/11/backup-compress-and-encrpyt-your-git-repository/#comments</comments>
		<pubDate>Fri, 25 Nov 2011 17:45:57 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[GIT]]></category>
		<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[git backup]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://blog.stardothosting.com/?p=471</guid>
		<description><![CDATA[Greetings, I thought I&#8217;d share a quick script in the scope of backing up GIT repositories for the purposes of encrypted and compressed off-site backups. Unfortunately git does not have an equivalent of svnadmin dump or export, which can conveniently be piped to stdout. What the above scenario would do is shorten the amount of [...]]]></description>
				<content:encoded><![CDATA[<p>Greetings,</p>
<p>I thought I&#8217;d share a quick script in the scope of backing up GIT repositories for the purposes of encrypted and compressed off-site backups.</p>
<p>Unfortunately git does not have an equivalent of svnadmin dump or export, which can conveniently be piped to stdout.</p>
<p>What the above scenario would do is shorten the amount of commands a script would require in order to accomplish a similar task.</p>
<p>Find below a quick bash script that clones a repository, tar/gzip&#8217;s it, encrypts the archive and keeps 7 days worth of archive files :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#!/bin/sh<br />
# GIT Backup script<br />
# Written by Star Dot Hosting<br />
<br />
todaysdate=`date &quot;+%Y-%m-%d&quot;`<br />
<br />
#check command input<br />
if [ -z &quot;$1&quot; ];<br />
then<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;GIT BACKUP SCRIPT&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;-----------------&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Usage : ./backup.sh reponame , i.e. yourdomain.git&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; exit 0<br />
fi<br />
<br />
echo &quot;GIT Backup Log: &quot; $currentmonth &gt; /var/log/backup.log<br />
echo -e &quot;----------------------------------------&quot; &gt;&gt; /var/log/backup.log<br />
echo -e &quot;&quot; &gt;&gt; /var/log/backup.log<br />
<br />
# Find and remove files older than 7 days<br />
/usr/bin/find /data/git/git-backups -type f -mtime +7 -delete &gt;&gt; /var/log/backup.log 2&gt;&amp;1<br />
<br />
# Begin creating working directory to clone into<br />
/bin/mkdir /data/git/git-backup/working &gt;&gt; /var/log/backup.log 2&gt;&amp;1<br />
/usr/bin/git clone /data/git/$1 /data/git/git-backup/working &gt;&gt; /var/log/backup.log 2&gt;&amp;1<br />
<br />
# Archive working directory into repo name encrpyted tar file<br />
/bin/tar -czvf - /data/git/git-backup/working | /usr/bin/openssl enc -aes-256-cbc -pass pass:abcABC123 -e | dd of=/data/git/git-backup/$1.tar.gz.enc &gt;&gt; /var/log/backup.log 2&gt;&amp;1<br />
<br />
# Remove working directory<br />
/bin/rm -rf /data/git/git-backup/working &gt;&gt; /var/log/backup.log 2&gt;&amp;1</div></div>
<p>FYI if you ever needed to decrypt the openssl encrypted backup archive, the command below should do the job :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">openssl aes-256-cbc -d -pass pass:abcABC123 -in $1.tar.gz.enc -out decrypted.tar.gz</div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.stardothosting.com/blog/2011/11/backup-compress-and-encrpyt-your-git-repository/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
