<?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>Tech Jawa &#187; Code</title>
	<atom:link href="http://www.techjawa.com/category/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.techjawa.com</link>
	<description>www.techjawa.com</description>
	<lastBuildDate>Wed, 01 Feb 2012 01:58:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Guide: Setup Working SiriProxy (Three Little Pigs)</title>
		<link>http://www.techjawa.com/2012/01/31/guide-setup-working-siriproxy-three-little-pigs/</link>
		<comments>http://www.techjawa.com/2012/01/31/guide-setup-working-siriproxy-three-little-pigs/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 01:47:25 +0000</pubDate>
		<dc:creator>Corey DeGrandchamp</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Guides]]></category>

		<guid isPermaLink="false">http://www.techjawa.com/?p=2520</guid>
		<description><![CDATA[PREFACE This guide is originally written by Corey DeGrandchamp who is an author on Tech Jawa, so it is posted here as well. For the original article (same content) please visit http://corey.degrandchamp.com/2012/02/01/guide-setup-working-siriproxy-three-little-pigs/ This guide is to tell you how to setup your own PRIVATE (or I suppose public&#8230;) SiriProxy server using the extremely well put-together [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.techjawa.com/wp-content/uploads/2012/01/headerLogo.png" class="lightbox" ><img src="http://www.techjawa.com/wp-content/uploads/2012/01/headerLogo-150x123.png" alt="" title="headerLogo" width="0" height="0" class="alignleft size-thumbnail wp-image-2521" /></a><br />
<h3>PREFACE</h3>
<p>This guide is originally written by <a href="http://corey.degrandchamp.com" target="_blank">Corey DeGrandchamp</a> who is an author on Tech Jawa, so it is posted here as well. For the original article (same content) please visit http://corey.degrandchamp.com/2012/02/01/guide-setup-working-siriproxy-three-little-pigs/</p>
<p>This guide is to tell you how to setup your own PRIVATE (or I suppose public&#8230;) SiriProxy server using the extremely well put-together &#8220;Three Little Pigs&#8221; proxy. It allows iPhone 4S&#8217;s and in the future iPad 3&#8242;s to feed Siri authentication keys/tokens to the server for other iOS devices to use. It also allows the use of SiriProxy plugins which allows for some advanced commands and very tech-savvy individuals to use Siri for things like home automation. We won&#8217;t get into that much of it, we just are trying to get iPhone 4 users up on Siri!</p>
<p>&nbsp;</p>
<h3>REQUIREMENTS</h3>
<p>iPhone 4S (Or a friend/family member willing to help, even remotely).<br />
iPhone 4 or 3GS running iOS 5.0.1 jailbroken. Save time by installing <a href="http://blog.chpwn.com/post/14689740472" target="_blank">Spire</a> on it now!<br />
A dedicated, or VPS server running <a href="http://www.ubuntu.com/download" target="_blank">Ubuntu 11.10</a>.<br />
<a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/" target="_blank">PuTTY</a>, or a way to remotely access your server.</p>
<p>&nbsp;</p>
<h3>THANKS</h3>
<p>First off, this guide is based on one written by <a href="http://am3yrus.over-blog.com/article-installation-of-jimmykane-s-the-three-little-pigs-siri-proxy-on-ubuntu-11-10-vps-97476772.html" target="_blank">Jeudi</a>, but I had a ton of trouble with his. This should be some touch-ups and command changes, so thanks to him for the original, or else I would have been totally flying blind with all the Ruby stuff that follows (even though that&#8217;s where I had the most trouble&#8230;) Also thanks to <a href="http://www.jacobwolfrum.com/" target="_blank">Jacob</a> and <a href="http://stalincopter.com/" target="_blank">James</a> who were kind enough to feed me some keys during testing stages.</p>
<p>&nbsp;</p>
<h3>STEP 1 &#8211; SERVER SETUP</h3>
<p>Get your server setup!<br />
If you haven&#8217;t already, go ahead and install <a href="http://www.ubuntu.com/download" target="_blank">Ubuntu 11.10</a>.</p>
<p>Install all available updates, this can usually be done while installing the OS even.</p>
<p>Once all that is set, be sure to update your root password if it&#8217;s a brand new server.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">passwd</span> root</pre></div></div>

<p>Once you&#8217;ve changed your root password login as root, if you&#8217;re using a server with a GUI, make sure you log in as &#8220;Other&#8221; and then put root as the username and the password you just created.</p>
<p>&nbsp;</p>
<h3>STEP 2 &#8211; INSTALL BASICS</h3>
<p>Issue all the following commands, if you get errors for dnsmasq that&#8217;s ok, but you shouldn&#8217;t get any other errors at this point.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> update
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-y</span> <span style="color: #c20cb9; font-weight: bold;">nano</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-y</span> dnsmasq
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-y</span> build-essential
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-y</span> openssl
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-y</span> libreadline6
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-y</span> libreadline6-dev
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-y</span> curl
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-y</span> git-core
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-y</span> zlib1g
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-y</span> zlib1g-dev
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-y</span> libssl-dev
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-y</span> libyaml-dev
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-y</span> libsqlite3-<span style="color: #000000;">0</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-y</span> sqlite3
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-y</span> libxml2-dev
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-y</span> libxslt-dev
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-y</span> <span style="color: #c20cb9; font-weight: bold;">autoconf</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-y</span> libc6-dev
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-y</span> ncurses-dev
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-y</span> <span style="color: #c20cb9; font-weight: bold;">automake</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-y</span> libtool
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-y</span> <span style="color: #c20cb9; font-weight: bold;">bison</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-y</span> subversion
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-y</span> <span style="color: #c20cb9; font-weight: bold;">gcc</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-y</span> <span style="color: #c20cb9; font-weight: bold;">g++</span></pre></div></div>

<p>If you get a dnsmasq starting error.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>dnsmasq.conf</pre></div></div>

<p>At around line 78, change</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#user=</span></pre></div></div>

<p>to</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">user</span>=root</pre></div></div>

<p>Sane and close by pressing CTRL+O then Enter then CTRL+X.</p>
<h3>STEP 3 &#8211; INSTALL RUBY</h3>
<p>Download &amp; Install RVM</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-y</span> rvm</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">bash</span> <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight: bold;">&lt;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>curl <span style="color: #660033;">-s</span> https:<span style="color: #000000; font-weight: bold;">//</span>raw.github.com<span style="color: #000000; font-weight: bold;">/</span>wayneeseguin<span style="color: #000000; font-weight: bold;">/</span>rvm<span style="color: #000000; font-weight: bold;">/</span>master<span style="color: #000000; font-weight: bold;">/</span>binscripts<span style="color: #000000; font-weight: bold;">/</span>rvm-installer<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>Activate RVM
</pre>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-s</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$HOME</span>/.rvm/scripts/rvm&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> . <span style="color: #ff0000;">&quot;<span style="color: #007800;">$HOME</span>/.rvm/scripts/rvm&quot;</span></pre></div></div>

<p>Add RVM to your .bash_profile</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'[[ -s &quot;$HOME/.rvm/scripts/rvm&quot; ]] &amp;&amp; . &quot;$HOME/.rvm/scripts/rvm&quot; # Load RVM function'</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt;<span style="color: #000000; font-weight: bold;">&amp;</span>gt; ~<span style="color: #000000; font-weight: bold;">/</span>.bash_profile</pre></div></div>

<p>If you're using putty or remote terminal access, restart it now.</p>
<p>Next install Ruby 1.9.3</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rvm <span style="color: #c20cb9; font-weight: bold;">install</span> 1.9.3</pre></div></div>

<p>If you get a rvm command not found error, try this...</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>rvm<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rvm <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>and then retry the previous step.</p>
<p>Set RVM to use 1.9.3 by default.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rvm use 1.9.3 <span style="color: #660033;">--default</span></pre></div></div>

<p>&nbsp;</p>
<h3>STEP 4 - RUBY SETUP</h3>
<p>Run the following commands.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rvm gem update</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rvm gem update <span style="color: #660033;">--system</span></pre></div></div>

<p>Edit gemrc</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> ~<span style="color: #000000; font-weight: bold;">/</span>.gemrc</pre></div></div>

<p>Add this line with a return at the end.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">gem: <span style="color: #660033;">--bindir</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin <span style="color: #660033;">--no-ri</span> <span style="color: #660033;">--no-rdoc</span></pre></div></div>

<p>To save and close .gemrc, press CTRL+O then Enter then CTRL+X.</p>
<p>Install the following gems.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rvm gem <span style="color: #c20cb9; font-weight: bold;">install</span> eventmachine - <span style="color: #660033;">-with-ssl-dir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>openssl
rvm gem <span style="color: #c20cb9; font-weight: bold;">install</span> httparty
rvm gem <span style="color: #c20cb9; font-weight: bold;">install</span> rails
rvm gem <span style="color: #c20cb9; font-weight: bold;">install</span> json
rvm gem <span style="color: #c20cb9; font-weight: bold;">install</span> uuidtools
rvm gem <span style="color: #c20cb9; font-weight: bold;">install</span> rake
rvm gem <span style="color: #c20cb9; font-weight: bold;">install</span> bundler
rvm gem <span style="color: #c20cb9; font-weight: bold;">install</span> CFPropertyList</pre></div></div>

<p>&nbsp;</p>
<h3>STEP 5 - INSTALL WEB INTERFACE</h3>
<p>Run the following commands.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-y</span> libmysqlclient-dev</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rvm gem <span style="color: #c20cb9; font-weight: bold;">install</span> mysql</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-y</span> apache2</pre></div></div>

<p>Test if your server is online by going to <strong>http://server.ip-or.hostname/</strong></p>
<p>Next we need to get PHP ready.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-y</span> php5</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-y</span> libapache2-mod-php5</pre></div></div>

<p>Restart Apache</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>apache2 restart</pre></div></div>

<p>Install MySQL</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-y</span> mysql-server</pre></div></div>

<p>Connect to MySQL</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mysql <span style="color: #660033;">-h</span> localhost <span style="color: #660033;">-u</span> root <span style="color: #660033;">-p</span></pre></div></div>

<p>Create the required database</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #990099; font-weight: bold;">DATABASE</span> siri<span style="color: #000033;">;</span></pre></div></div>

<p>Type exit to close the MySQL session.</p>
<p>Install phpMyAdmin</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-y</span> phpmyadmin</pre></div></div>

<p>When it asks you which package to reconfigure automatically choose apache2, and answer yes to the second question.<br />
This will also ask for your password three times.</p>
<p>Edit php.ini</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>php5<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>php.ini</pre></div></div>

<p>Change around line 932, find</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">;   <span style="color: #007800;">extension</span>=msql.so</pre></div></div>

<p>Change to</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">extension</span>=msql.so</pre></div></div>

<p>To save and close, press CTRL+O then Enter then CTRL+X.</p>
<p>Prepare phpMyAdmin</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>phpmyadmin <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>phpmyadmin</pre></div></div>

<p>Then restart Apache</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>apache2 restart</pre></div></div>

<p>You can test by going to <strong>http://server.ip-or.hostname/phpmyadmin/</strong></p>
<p>&nbsp;</p>
<h3>STEP 6 - INSTALL THREE LITTLE PIGS SIRIPROXY</h3>
<p>Clone the git repo.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">git</span> clone https:<span style="color: #000000; font-weight: bold;">//</span>github.com<span style="color: #000000; font-weight: bold;">/</span>jimmykane<span style="color: #000000; font-weight: bold;">/</span>The-Three-Little-Pigs-Siri-Proxy</pre></div></div>

<p>Change your directory.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> The-Three-Little-Pigs-Siri-Proxy</pre></div></div>

<p>If you have a security alert, continue with yes.</p>
<p>Generate the SiriProxy gem.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rvm all <span style="color: #000000; font-weight: bold;">do</span> rake <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>Make a .sirproxy directory.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> ~<span style="color: #000000; font-weight: bold;">/</span>.siriproxy</pre></div></div>

<p>Move the config.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cp</span> .<span style="color: #000000; font-weight: bold;">/</span>config.example.yml ~<span style="color: #000000; font-weight: bold;">/</span>.siriproxy<span style="color: #000000; font-weight: bold;">/</span>config.yml</pre></div></div>

<p>Set up your own config.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">nano</span> ~<span style="color: #000000; font-weight: bold;">/</span>.siriproxy<span style="color: #000000; font-weight: bold;">/</span>config.yml</pre></div></div>

<p>You'll need to set your database password and change your.siri.proxy.server.com to your IP or hostname.<br />
Save the file. CTRL+O then Enter then CTRL+X.<br />
Edit openssl.cnf</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssl<span style="color: #000000; font-weight: bold;">/</span>openssl.cnf</pre></div></div>

<p>Around line 148, find this...</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">commonName  = Common Name <span style="color: #7a0874; font-weight: bold;">&#40;</span>eg, YOUR name<span style="color: #7a0874; font-weight: bold;">&#41;</span>
commonName_max  = <span style="color: #000000;">64</span></pre></div></div>

<p>And directly below it, add this.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000;">0</span>.commonName = Common Name <span style="color: #7a0874; font-weight: bold;">&#40;</span>eg, YOUR name<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000;">0</span>.commonName_default = guzzoni.apple.com
<span style="color: #000000;">0</span>.commonName_max = <span style="color: #000000;">64</span>
<span style="color: #000000;">1</span>.commonName = Common Name <span style="color: #7a0874; font-weight: bold;">&#40;</span>eg, YOUR name<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000;">1</span>.commonName_default = YOUR.IP.OR.HOSTNAME.HERE
<span style="color: #000000;">1</span>.commonName_max = <span style="color: #000000;">64</span></pre></div></div>

<p>Close by pressing CTRL+O then Enter then CTRL+X. </p>
<p>Time to generate the certificate.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rvm all <span style="color: #000000; font-weight: bold;">do</span> siriproxy gencerts</pre></div></div>

<p>Now you MUST install this ca.pem on the iPhone 4S and the iPhone 4/3GS that will be using Siri via Spire...<br />
Email it to yourself, or you can put it on the web portion of your server for quick access via Mobile Safari.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #660033;">-R</span> <span style="color: #000000;">777</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.siriproxy<span style="color: #000000; font-weight: bold;">/</span>ca.pem <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>ca.pem</pre></div></div>

<p>With the above method your ca.pem is located at <strong>http://server.ip-or.hostname/ca.pem</strong></p>
<p>Now we must bundle SiriProxy.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rvm all <span style="color: #000000; font-weight: bold;">do</span> siriproxy bundle</pre></div></div>

<p>Then create the tables in the siri database.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rvm all <span style="color: #000000; font-weight: bold;">do</span> siriproxy gentables</pre></div></div>

<p>&nbsp;</p>
<h3>STEP 7 - SETTING UP DNSMASQ</h3>
<p>Setting up the dnsmasq.conf</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>dnsmasq.conf</pre></div></div>

<p>At around line 63, find the following</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#address=double-click.net/127.0.0.1</span></pre></div></div>

<p>Under it, add this...</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">address</span>=<span style="color: #000000; font-weight: bold;">/</span>guzzoni.apple.com<span style="color: #000000; font-weight: bold;">/</span>YOUR.IP.OR.HOSTNAME</pre></div></div>

<p>To close dnsmasq.conf, press CTRL+O then Enter then CTRL+X.<br />
Then restart dnsmasq with the following.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>dnsmasq restart</pre></div></div>

<p>&nbsp;</p>
<h3>STEP 8 - INSTALL WEB INTERFACE</h3>
<p>We need to move some files, issue each of these commands.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">777</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-R</span> The-Three-Little-Pigs-Siri-Proxy<span style="color: #000000; font-weight: bold;">/</span>webInterface<span style="color: #000000; font-weight: bold;">/*</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #660033;">-R</span> <span style="color: #000000;">777</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www</pre></div></div>

<p>Next we need to edit the config, if it gives an error ignore it for now.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>inc<span style="color: #000000; font-weight: bold;">/</span>config.inc.php</pre></div></div>

<p>In this file, you'll want to replace your hostname with your hostname or IP address, as well as set an admin username and password for the web interface. Be sure to update your MySQL password here as well to your root password!<br />
Close the file by pressing CTRL+O then Enter then CTRL+X.<br />
Now we test...</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>index.html <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>index.html.bk</pre></div></div>

<p>Head to <strong>http://server.ip-or.hostname/</strong><br />
You should see the Three Little Pigs interface!</p>
<p>&nbsp;</p>
<h3>STEP 9 - START SIRI PROXY</h3>
<p>First let us make sure named isn't interfering with dnsmasq.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>dnsmasq stop</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">killall</span> named</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>dnsmasq start</pre></div></div>

<p>Let's start SiriProxy now...</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>The-Three-Little-Pigs-Siri-Proxy</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rvm all <span style="color: #000000; font-weight: bold;">do</span> siriproxy server</pre></div></div>

<p>If you'd like a way for the server to restart on crash, launch via this method.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>The-Three-Little-Pigs-Siri-Proxy</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>siriproxy-restarter</pre></div></div>

<p>&nbsp;</p>
<h3>STEP 10 - Configure Phones</h3>
<p>If your server is behind a firewall make sure you forward all the proper ports, including 53, 80, and 443 for the server!</p>
<p>Start with the iPhone 4S, make sure you installed that ca.pem from earlier, that we dumped to the web address. From there you'll want to edit the DNS settings on your iPhone 4S that MUST be connected to (any) WiFi access point. Add your server IP address followed by a comma to the front of the DNS server list. This allows the proxy server to take requests for Siri (guzzoni.apple.com).</p>
<p>After that, have the 4S user use Siri, it should work fine, and it will feed it's authentication key to the proxy. Be sure at least one iPhone 4S user is using that DNS server to feed a key to the server once every 24 hours!!!</p>
<p>Next just point Spire to your proxy, https://your.server.ip.or.hostname.com/. Use siri...</p>
<p>&nbsp;</p>
<h3>SOURCES</h3>
<p>http://www.paradox-productions.net/</p>
<p>http://am3yrus.over-blog.com/article-installation-of-jimmykane-s-the-three-little-pigs-siri-proxy-on-ubuntu-11-10-vps-97476772.html</p>
<p>http://k2designlab.wordpress.com/2012/01/01/multi-process-siri-proxy-with-automatic-authentication-for-iphone-43gsipod-touch/</p>
<p>https://github.com/jimmykane/The-Three-Little-Pigs-Siri-Proxy</p>
<p>http://www.howtoforge.com/ubuntu_lamp_for_newbies</p>
<p>https://github.com/plamoni/SiriProxy/issues/145</p>
<p>http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=514214</p>
<p>http://www.ubuntugeek.com/screen-manages-multiple-sessions-on-one-terminal.html#more-1415</p>
<p>http://doc.ubuntu-fr.org/phpmyadmin</p>
<p>http://www.rackaid.com/resources/linux-screen-tutorial-and-how-to/</p>
<p>http://doc.ubuntu-fr.org/rubyonrails</p>
<p>http://www.liberiangeek.net/2011/03/login-root-ubuntu-11-04-natty-narwhal/</p>
<p>http://www.the-tech-tutorial.com/?p=1868</p>
<p>http://www..linuxquestions.org/questions/linux-software-2/ruby-rake-install-error-on-siriproxy-925111/</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techjawa.com/2012/01/31/guide-setup-working-siriproxy-three-little-pigs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shell Script &#8211; Server Maintenance</title>
		<link>http://www.techjawa.com/2009/06/24/shell-script-server-maintenance/</link>
		<comments>http://www.techjawa.com/2009/06/24/shell-script-server-maintenance/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 15:17:38 +0000</pubDate>
		<dc:creator>Corey DeGrandchamp</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Videos]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://www.techjawa.com/?p=760</guid>
		<description><![CDATA[So here&#8217;s my first shell script, written for a server at work who has maintenance tasks that need to be completed, and the commands get tedious to input and remember, now all you have to remember is ./maintenance The script automates 4 tasks that our server has. Restarting out PostgreSQL database, restarting apache, vacuuming the [...]]]></description>
			<content:encoded><![CDATA[<p>So here&#8217;s my first shell script, written for a server at work who has maintenance tasks that need to be completed, and the commands get tedious to input and remember, now all you have to remember is ./maintenance</p>
<p>The script automates 4 tasks that our server has. Restarting out PostgreSQL database, restarting apache, vacuuming the database, and running our custom import scripts, which has to be done as a specific user each day, and NOT as root&#8230; which has caused issues in the past, but now if you run them with the script I wrote, there&#8217;s no issue at all.</p>
<p>When launched, the script displays a menu for you, on which you make your choices.</p>
<p><a href="http://www.techjawa.com/wp-content/uploads/2009/06/scriptmenu.jpg" class="lightbox" ><img src="http://www.techjawa.com/wp-content/uploads/2009/06/scriptmenu-300x86.jpg" alt="scriptmenu" title="scriptmenu" width="300" height="86" class="aligncenter size-medium wp-image-762" /></a></p>
<p>You can then make your choice, via number, and it will complete the task and prompt you to continue.<br />
When a wrong choice is made it tells you that you need to select a number from the list. The help command gives you an idea of what each other command does, and exit obviously exits the script.</p>
<p>So here&#8217;s a video to demonstrate how the menu system works.</p>
<p><center><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/bQs59NQMQDo&#038;hl=en&#038;fs=1&#038;color1=0xFF6600f&#038;color2=0xFF6600"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/bQs59NQMQDo&#038;hl=en&#038;fs=1&#038;color1=0xFF6600&#038;color2=FF6600" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></center></p>
<p>Its a simple shell script, but it works, and it works well for what it does.<br />
And of course I&#8217;d want to share the actual script with you, and document it in my blog,<br />
so here it is, Frank&#8217;s maintenance script!</p>
<pre>
#######################################################
#  _______        _            _                      #
# |__   __|      | |          | |                     #
#    | | ___  ___| |__        | | __ ___      ____ _  #
#    | |/ _ \/ __|  _ \   _   | |/ _` \ \ /\ / / _` | #
#    | |  __/ (__| | | | | |__| | (_| |\ V  V / (_| | #
#    |_|\___|\___|_| |_|  \____/ \__,_| \_/\_/ \__,_| #
#                                                     #
#           www.techjawa.com/category/code            #
#             www.corey.degrandchamp.com              #
#                                                     #
#######################################################
#                                                     #
# Written  By: Corey DeGrandchamp                     #
# Written  On: June 18, 2009                          #
# Written For: Michigan Drill Corporation             #
# Description: This shell script will automate all of #
#              the maintenance tasks on Frank.        #
#                                                     #
#######################################################
#                                                     #
# Edit   Date: June 24, 2009                          #
# Edit     By: Corey DeGrandchamp                     #
# About  Edit: Fixed script so the heading/title will #
#              show every time now, also made it      #
#              pause and wait for the ENTER key to    #
#              be pressed before it continues.        #
#                                                     #
#######################################################

#!/bin/bash

# Display the title.
clear
echo '
     __  __    __    ____  _  _  ____  ____  _  _    __    _  _  ___  ____
    (  \/  )  /__\  (_  _)( \( )(_  _)( ___)( \( )  /__\  ( \( )/ __)( ___)
     )    (  /(__)\  _)(_  )  (   )(   )__)  )  (  /(__)\  )  (( (__  )__)
    (_/\/\_)(__)(__)(____)(_)\_) (__) (____)(_)\_)(__)(__)(_)\_)\___)(____)

	'
# Display possible choices.
CHOICES="RESTART_POSTGRESQL RESTART_APACHE VACUUM_DATABASE RUN_IMPORTS HELP EXIT"
# Define commands for choices.
select choice in $CHOICES; do
	if [ "$choice" = "RESTART_POSTGRESQL" ]; then
		/etc/rc.d/init.d/postgresql restart
		echo ""
		echo ""
		echo ""
		echo ""
		echo "Finished restarting PostgreSQL."
		echo ""
		echo "Press ENTER to continue."
		read
		clear
	elif [ "$choice" = "RESTART_APACHE" ]; then
		service httpsd restart
		echo ""
		echo ""
		echo ""
		echo ""
		echo "Finished restarting Apache."
		echo ""
		echo "Press ENTER to continue."
		read
		clear
	elif [ "$choice" = "VACUUM_DATABASE" ]; then
		su ********-c "/usr/bin/vacuumdb -* *******"
		echo ""
		echo ""
		echo ""
		echo ""
		echo "Finished vacuuming the database."
		echo ""
		echo "Press ENTER to continue."
		read
		clear
	elif [ "$choice" = "RUN_IMPORTS" ]; then
		su ********-c "/home/********/********/********/IMPORT"
		echo ""
		echo ""
		echo ""
		echo ""
		echo "Finished running the imports."
		echo ""
		echo "Press ENTER to continue."
		read
		clear
	elif [ "$choice" = "HELP" ]; then
		clear
		echo "RESTART_POSTGRES"
		echo "     - Useful for when SOEFIE giving errors, or functioning slowly."
		echo ""
		echo "RESTART_APACHE"
		echo "     - When changes are made to websites, or websites are not working."
		echo ""
		echo "VACUUM_DATABASE"
		echo "     - This will vacuum the veritime database, clearing our all of the junk."
		echo ""
		echo "RUN_IMPORTS"
		echo "     - Runs the imports from the AS/400 to SOEFIEs database."
		echo ""
		echo "HELP"
		echo "     - Displays this menu"
		echo ""
		echo "EXIT"
		echo "     - Exits the program."
		echo ""
		echo ""
		echo ""
		echo ""
		echo "Press ENTER to continue."
		read
		clear
	elif [ "$choice" = "EXIT" ]; then
		clear
		exit
	else
		echo ""
		echo ""
		echo ""
		echo ""
		echo "Please choose a number from the list."
		echo ""
		echo "Press ENTER to continue."
		read
		clear
	fi
# Display the title after each choice again.
	echo '
     __  __    __    ____  _  _  ____  ____  _  _    __    _  _  ___  ____
    (  \/  )  /__\  (_  _)( \( )(_  _)( ___)( \( )  /__\  ( \( )/ __)( ___)
     )    (  /(__)\  _)(_  )  (   )(   )__)  )  (  /(__)\  )  (( (__  )__)
    (_/\/\_)(__)(__)(____)(_)\_) (__) (____)(_)\_)(__)(__)(_)\_)\___)(____)

	'
done
</pre>
<p>Some parts taken out to protect our security&#8230;.</p>
<p>I know there are other ways to do what I achived here, but as I said before, this is my VERY FIRST shell script.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techjawa.com/2009/06/24/shell-script-server-maintenance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Excel VBScript &#8211; Delete Row if Column &#8220;X&#8221; = &#8220;Value&#8221;</title>
		<link>http://www.techjawa.com/2009/06/18/excel-vbscript-delete-row-if-column-x-value/</link>
		<comments>http://www.techjawa.com/2009/06/18/excel-vbscript-delete-row-if-column-x-value/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 17:18:54 +0000</pubDate>
		<dc:creator>Corey DeGrandchamp</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://www.techjawa.com/?p=726</guid>
		<description><![CDATA[This is the first entry in my new &#8220;Code&#8221; category, as I do a LOT of coding for work lately. So the following script is one of my firsts that I wrote for work. Sub Delete_Unchanged_Prices() ''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' _______ _ _ ' ' &#124;__ __&#124; &#124; &#124; &#124; &#124; ' ' &#124; &#124; ___ ___&#124; [...]]]></description>
			<content:encoded><![CDATA[<p>This is the first entry in my new &#8220;Code&#8221; category, as I do a LOT of coding for work lately.</p>
<p>So the following script is one of my firsts that I wrote for work.</p>
<pre>
Sub Delete_Unchanged_Prices()

'''''''''''''''''''''''''''''''''''''''''''''''''''''''
'  _______        _            _                      '
' |__   __|      | |          | |                     '
'    | | ___  ___| |__        | | __ ___      ____ _  '
'    | |/ _ \/ __|  _ \   _   | |/ _` \ \ /\ / / _` | '
'    | |  __/ (__| | | | | |__| | (_| |\ V  V / (_| | '
'    |_|\___|\___|_| |_|  \____/ \__,_| \_/\_/ \__,_| '
'                                                     '
'           www.techjawa.com/category/code            '
'             www.corey.degrandchamp.com              '
'                                                     '
'''''''''''''''''''''''''''''''''''''''''''''''''''''''
'                                                     '
' Written  By: Corey DeGrandchamp                     '
' Written  On: December 10, 2008                      '
' Written For: Michigan Drill Corporation             '
' Description: This Excel VBScript will search column '
'              B, and if a cell in B has a null value '
'              then the script deltes the entire row. '
'              This is mainly used for our end of the '
'              year cost changes, but can be modified '
'              to suit your own needs.                '
'                                                     '
'''''''''''''''''''''''''''''''''''''''''''''''''''''''
'                                                     '
' Edit   Date: June 18, 2009                          '
' About  Edit: Added information.                     '
'                                                     '
'''''''''''''''''''''''''''''''''''''''''''''''''''''''

  Application.ScreenUpdating = False
  Application.Calculation = xlCalculationManual
  Dim Rng As Range, ix As Long
  Set Rng = Intersect(Range("B:B"), ActiveSheet.UsedRange)
  For ix = Rng.Count To 1 Step -1
      If Trim(Replace(Rng.Item(ix).Text, Chr(160), Chr(32))) = "" Then
        Rng.Item(ix).EntireRow.Delete
      End If
  Next
done:
  Application.Calculation = xlCalculationAutomatic
  Application.ScreenUpdating = True
End Sub
</pre>
<p>It basically goes through and checks every row in column B, and if there is a cell with a value of &#8220;&#8221; (AKA null) then it removes the entire row.</p>
<p>This can be changed to any column/value combination, but this is the specific combination we need at work.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techjawa.com/2009/06/18/excel-vbscript-delete-row-if-column-x-value/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

