<?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>Bobjunior</title>
	<atom:link href="http://bobjunior.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://bobjunior.com</link>
	<description>Electrical Engineering, Programming, &#38; Internet Bits</description>
	<lastBuildDate>Sat, 19 May 2012 17:05:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>PHP Include versus Require</title>
		<link>http://bobjunior.com/linux/php-include-versus-require/</link>
		<comments>http://bobjunior.com/linux/php-include-versus-require/#comments</comments>
		<pubDate>Tue, 15 May 2012 06:52:11 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1711</guid>
		<description><![CDATA[PHP allows several ways to include other PHP files: Include, Include Once, Require, and Require Once. The difference between Include and Require is whether or not to halt script execution. [...]]]></description>
			<content:encoded><![CDATA[<p>PHP allows several ways to include other PHP files: Include, Include Once, Require, and Require Once.  The difference between Include and Require is whether or not to halt script execution.  Appending Once simply checks if the file has been required or included previously.</p>
<h3>Include</h3>
<p>The include() statement includes and evaluates the specified file.</p>
<h3>Include Once</h3>
<p>The include_once() statement includes and evaluates the specified file during the execution of the script. This is a behavior similar to the include() statement, with the only difference being that if the code from a file has already been included, it will not be included again. As the name suggests, it will be included just once.</p>
<h3>Require</h3>
<p>require() and include() are identical in every way except how they handle failure. They both produce a Warning, but require() results in a Fatal Error. In other words, don’t hesitate to use require() if you want a missing file to halt processing of the page.</p>
<h3>Require Once</h3>
<p>The require_once() statement includes and evaluates the specified file during the execution of the script. This is a behavior similar to the require() statement, with the only difference being that if the code from a file has already been included, it will not be included again.</p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/linux/php-include-versus-require/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Reset</title>
		<link>http://bobjunior.com/linux/css-reset/</link>
		<comments>http://bobjunior.com/linux/css-reset/#comments</comments>
		<pubDate>Tue, 01 May 2012 07:21:42 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1679</guid>
		<description><![CDATA[CSS Reset is a common web practice to clear browser quirks and provide a common base for CSS styling. There are several versions of CSS Resets floating around on the [...]]]></description>
			<content:encoded><![CDATA[<p>CSS Reset is a common web practice to clear browser quirks and provide a common base for CSS styling. There are several versions of CSS Resets floating around on the web, the most popular being Eric Meyer&#8217;s, HTML5 Doctor and Yahoo&#8217;s.  For more information see <a href="http://www.cssreset.com/" title="CSS Reset">CSS Reset</a>.</p>
<h3><a href="http://www.cssreset.com/scripts/eric-meyer-reset-css/" title="Eric Meyer's Reset CSS">Eric Meyer’s “Reset CSS” 2.0</a></h3>
<h3>Minified</h3>
<p><code></p><pre class="crayon-plain-tag">html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{border:0;font-size:100%;font:inherit;vertical-align:baseline;margin:0;padding:0}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:none}table{border-collapse:collapse;border-spacing:0}</pre><p></code></p>
<h3>Full</h3>
<p><code></p><pre class="crayon-plain-tag">/* v2.0 | 20110126
  http://meyerweb.com/eric/tools/css/reset/ 
  License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
	display: block;
}
body {
	line-height: 1;
}
ol, ul {
	list-style: none;
}
blockquote, q {
	quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
}
table {
	border-collapse: collapse;
	border-spacing: 0;
}</pre><p></code></p>
<h3><a href="http://html5doctor.com/html-5-reset-stylesheet/" title="HTML 5 Doctor">HTML 5 Doctor</a></h3>
<h3>Minified</h3>
<p><code></p><pre class="crayon-plain-tag">html,body,div,span,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,abbr,address,cite,code,del,dfn,em,img,ins,kbd,q,samp,small,strong,sub,sup,var,b,i,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,figcaption,figure,footer,header,hgroup,menu,nav,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent}body{line-height:1}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}nav ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:none}a{margin:0;padding:0;font-size:100%;vertical-align:baseline;background:transparent}ins{background-color:#ff9;color:#000;text-decoration:none}mark{background-color:#ff9;color:#000;font-style:italic;font-weight:bold}del{text-decoration:line-through}abbr[title],dfn[title]{border-bottom:1px dotted;cursor:help}table{border-collapse:collapse;border-spacing:0}hr{display:block;height:1px;border:0;border-top:1px solid #ccc;margin:1em 0;padding:0}input,select{vertical-align:middle}</pre><p></code></p>
<h3>Full</h3>
<p><code></p><pre class="crayon-plain-tag">/* html5doctor.com Reset Stylesheet v1.6.1
Last Updated: 2010-09-17
Author: Richard Clark - http://richclarkdesign.com
*/
html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, address, cite, code,
del, dfn, em, img, ins, kbd, q, samp,
small, strong, sub, sup, var,
b, i,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, figcaption, figure,
footer, header, hgroup, menu, nav, section, summary,
time, mark, audio, video {
    margin:0;
    padding:0;
    border:0;
    outline:0;
    font-size:100%;
    vertical-align:baseline;
    background:transparent;
}
body {
    line-height:1;
}
article,aside,details,figcaption,figure,
footer,header,hgroup,menu,nav,section {
    display:block;
}
nav ul {
    list-style:none;
}
blockquote, q {
    quotes:none;
}
blockquote:before, blockquote:after,
q:before, q:after {
    content:'';
    content:none;
}
a {
    margin:0;
    padding:0;
    font-size:100%;
    vertical-align:baseline;
    background:transparent;
}
/* change colours to suit your needs */
ins {
    background-color:#ff9;
    color:#000;
    text-decoration:none;
}
/* change colours to suit your needs */
mark {
    background-color:#ff9;
    color:#000;
    font-style:italic;
    font-weight:bold;
}
del {
    text-decoration: line-through;
}
abbr[title], dfn[title] {
    border-bottom:1px dotted;
    cursor:help;
}
table {
    border-collapse:collapse;
    border-spacing:0;
}
/* change border colour to suit your needs */
hr {
    display:block;
    height:1px;
    border:0;
    border-top:1px solid #cccccc;
    margin:1em 0;
    padding:0;
}
input, select {
    vertical-align:middle;
}</pre><p></code></p>
<h3>Link</h3>
<p><code></p><pre class="crayon-plain-tag">&lt;link rel=&quot;stylesheet&quot; href=&quot;http://html5resetcss.googlecode.com/files/html5reset-1.6.1.css&quot; /&gt;</pre><p></code></p>
<h3><a href="http://www.cssreset.com/scripts/yahoo-css-reset-yui-3/" title="Yahoo CSS Reset">Yahoo! CSS Reset (YUI 3)</a></h3>
<h3>Minified</h3>
<p><code></p><pre class="crayon-plain-tag">html{color:#000;background:#FFF}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0}table{border-collapse:collapse;border-spacing:0}fieldset,img{border:0}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal}ol,ul{list-style:none}caption,th{text-align:left}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal}q:before,q:after{content:''}abbr,acronym{border:0;font-variant:normal}sup{vertical-align:text-top}sub{vertical-align:text-bottom}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit}input,textarea,select{*font-size:100%}legend{color:#000}#yui3-css-stamp.cssreset{display:none}</pre><p></code></p>
<h3>Full</h3>
<p><code></p><pre class="crayon-plain-tag">/* YUI 3.5.0 (build 5089)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
/*
	TODO will need to remove settings on HTML since we can't namespace it.
	TODO with the prefix, should I group by selector or property for weight savings?
*/
html{
	color:#000;
	background:#FFF;
}
/*
	TODO remove settings on BODY since we can't namespace it.
*/
/*
	TODO test putting a class on HEAD.
		- Fails on FF. 
*/
body,
div,
dl,
dt,
dd,
ul,
ol,
li,
h1,
h2,
h3,
h4,
h5,
h6,
pre,
code,
form,
fieldset,
legend,
input,
textarea,
p,
blockquote,
th,
td {
	margin:0;
	padding:0;
}
table {
	border-collapse:collapse;
	border-spacing:0;
}
fieldset,
img {
	border:0;
}
/*
	TODO think about hanlding inheritence differently, maybe letting IE6 fail a bit...
*/
address,
caption,
cite,
code,
dfn,
em,
strong,
th,
var {
	font-style:normal;
	font-weight:normal;
}

ol,
ul {
	list-style:none;
}

caption,
th {
	text-align:left;
}
h1,
h2,
h3,
h4,
h5,
h6 {
	font-size:100%;
	font-weight:normal;
}
q:before,
q:after {
	content:'';
}
abbr,
acronym {
	border:0;
	font-variant:normal;
}
/* to preserve line-height and selector appearance */
sup {
	vertical-align:text-top;
}
sub {
	vertical-align:text-bottom;
}
input,
textarea,
select {
	font-family:inherit;
	font-size:inherit;
	font-weight:inherit;
}
/*to enable resizing for IE*/
input,
textarea,
select {
	*font-size:100%;
}
/*because legend doesn't inherit in IE */
legend {
	color:#000;
}
/* YUI CSS Detection Stamp */
#yui3-css-stamp.cssreset { display: none; }</pre><p></code></p>
<h3>Link</h3>
<p><code></p><pre class="crayon-plain-tag">&lt;link rel=&quot;stylesheet&quot; href=&quot;http://yui.yahooapis.com/3.5.0/build/cssreset/cssreset-min.css&quot; /&gt;</pre><p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/linux/css-reset/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NSDictionary Iteration</title>
		<link>http://bobjunior.com/blog/nsdictionary-iteration/</link>
		<comments>http://bobjunior.com/blog/nsdictionary-iteration/#comments</comments>
		<pubDate>Sun, 22 Apr 2012 03:08:16 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[enumerator]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[nsdictionary]]></category>
		<category><![CDATA[obj-c]]></category>
		<category><![CDATA[objective-c]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1660</guid>
		<description><![CDATA[As with any software solution, there are usually several ways to do the same thing. Iterating through NSDictionary on iOS certainly has it&#8217;s own set of ways. iOs allows you [...]]]></description>
			<content:encoded><![CDATA[<p>As with any software solution, there are usually several ways to do the same thing.  Iterating through NSDictionary on iOS certainly has it&#8217;s own set of ways.</p>
<p>iOs allows you to get all all the keys to dictionaries which can be iterated over:<br />
<code></p><pre class="crayon-plain-tag">NSArray *keyArray =  [dict allKeys];
int count = [keyArray count];
for (int i=0; i &lt; count; i++) {
  NSDictionary *tmp = [dict objectForKey:[ keyArray objectAtIndex:i]];
}</pre><p></code></p>
<p>Alternatively, iOS supports enumerators (similar to JAVA):<br />
<code></p><pre class="crayon-plain-tag">NSEnumerator *enumerator = [dict keyEnumerator];
id key;
while ((key = [enumerator nextObject])) {
  NSDictionary *tmp = [dict objectForKey:key];
}</pre><p></code></p>
<p>Dictionaries can also be directly iterated in single for-loop lines:<br />
<code></p><pre class="crayon-plain-tag">for( NSString *aKey in [dict allKeys] )
{
}</pre><p></code></p>
<p>Or somewhat faster:<br />
<code></p><pre class="crayon-plain-tag">for( NSString *aKey in dict )
{
}</pre><p></code></p>
<p>Or better yet, if your target OS supports blocks:<br />
<code></p><pre class="crayon-plain-tag">[dict enumerateKeysAndObjectsUsingBlock: ^(id key, id obj, BOOL *stop) {
}];</pre><p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/blog/nsdictionary-iteration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WebDAV</title>
		<link>http://bobjunior.com/linux/webdav/</link>
		<comments>http://bobjunior.com/linux/webdav/#comments</comments>
		<pubDate>Thu, 12 Apr 2012 06:52:48 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1611</guid>
		<description><![CDATA[WebDAV is a technology that has been around since the mid 90&#8242;s designed to make web documents readable and writable. Similar to FTP and SFTP, WebDAV protocols allow users to [...]]]></description>
			<content:encoded><![CDATA[<p>WebDAV is a technology that has been around since the mid 90&#8242;s designed to make web documents readable and writable.  Similar to FTP and SFTP, WebDAV protocols allow users to create, change, and move documents.  Each flavor of operating system has their own way to incorporate WebDav locations which mount rather seamlessly into most file browsers.</p>
<p>WebDav requires files to be owned by the web server user.  This means there could be ownership issues if both FTP and WebDAV are used simultaneously.  As WebDav files are owned by the web server user, they may not execute without changing the user names.</p>
<h3>Install</h3>
<p>Assuming Apache is already installed, enable the modules for WebDAV:<br />
<code></p><pre class="crayon-plain-tag">#a2enmod dav_fs
#a2enmod dav</pre><p></code></p>
<h3>Web Directory</h3>
<p>Normally, Apache on linux puts web directories under <code>/var/www/</code>.  Create a directory in this location and change the user to www-data, the apache user.<br />
<code></p><pre class="crayon-plain-tag">mkdir -p /var/www/webdav
chown www-data /var/www/webdav</pre><p></code></p>
<h3>WebDAV Password</h3>
<p>The WebDAV directory should be password protected.<br />
<code></p><pre class="crayon-plain-tag">htpasswd -c /var/www/webdav/passwd.dav username
chown root:www-data /var/www/webdav/passwd.dav
chmod 640 /var/www/webdav/passwd.dav</pre><p></code></p>
<h3>Virual Host</h3>
<p>Under <code>/etc/apache2/sites-available/webdav</code> create a new virtual host.</p>
<p><code></p><pre class="crayon-plain-tag">vi /etc/apache2/sites-available/webdav</pre><p></code></p>
<p><code></p><pre class="crayon-plain-tag">NameVirtualHost *
&lt;VirtualHost *&gt;
        ServerAdmin webmaster@localhost

        DocumentRoot /var/www/webdav/
        &lt;Directory /var/www/webdav/&gt;
                Options Indexes MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        &lt;/Directory&gt;

        Alias /webdav /var/www/webdav

        &lt;Location /webdav&gt;
           DAV On
           AuthType Basic
           AuthName &quot;webdav&quot;
           AuthUserFile /var/www/webdav/passwd.dav
           Require valid-user
       &lt;/Location&gt;
&lt;/VirtualHost&gt;</pre><p></code></p>
<h3>Restart Apache</h3>
<p><code></p><pre class="crayon-plain-tag">#/etc/init.d/apache2 reload</pre><p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/linux/webdav/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Tools</title>
		<link>http://bobjunior.com/linux/web-tools/</link>
		<comments>http://bobjunior.com/linux/web-tools/#comments</comments>
		<pubDate>Thu, 12 Apr 2012 05:13:00 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tool]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1603</guid>
		<description><![CDATA[User Agent IP Address Traceroute]]></description>
			<content:encoded><![CDATA[<p><a href="http://bobjunior.com/linux/user-agent/" title="Traceroute">User Agent</a><br />
<a href="http://bobjunior.com/linux/ip-address/" title="IP Address">IP Address</a><br />
<a href="http://bobjunior.com/linux/traceroute/" title="Traceroute">Traceroute</a></p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/linux/web-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Traceroute</title>
		<link>http://bobjunior.com/linux/traceroute/</link>
		<comments>http://bobjunior.com/linux/traceroute/#comments</comments>
		<pubDate>Wed, 11 Apr 2012 07:17:03 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1599</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[Tracerouting to destination: 74.125.224.83
<hr />  1   *                0.215 ms  *
  2   *                0.150 ms  
  3   *                0.157 ms  
  4   *                0.130 ms  
  5   *                0.128 ms  
  6   *                0.126 ms  
  7   *                0.114 ms  
  8   *                0.116 ms  
  9   *                0.117 ms  
 10   *                0.124 ms  
 11   *                0.126 ms  
 12   *                0.114 ms  
 13   *                0.123 ms  
 14   *                0.117 ms  
 15   *                0.114 ms  
 16   *                0.126 ms  
 17   *                0.114 ms  
 18   *                0.126 ms  
 19   *                0.114 ms  
 20   *                0.130 ms  
 21   *                0.117 ms  
 22   *                0.126 ms  
 23   *                0.123 ms  
 24   *                0.114 ms  
 25   *                0.114 ms  
 26   *                0.118 ms  
 27   *                0.114 ms  
 28   *                0.115 ms  
 29   *                0.116 ms  

]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/linux/traceroute/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IP Address</title>
		<link>http://bobjunior.com/linux/ip-address/</link>
		<comments>http://bobjunior.com/linux/ip-address/#comments</comments>
		<pubDate>Wed, 11 Apr 2012 06:52:12 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tool]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1593</guid>
		<description><![CDATA[Your IP address:]]></description>
			<content:encoded><![CDATA[<p>Your IP address:</p>
<h1><b>38.107.179.217</b></h1>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/linux/ip-address/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Regex in iOS</title>
		<link>http://bobjunior.com/blog/regex-in-ios/</link>
		<comments>http://bobjunior.com/blog/regex-in-ios/#comments</comments>
		<pubDate>Wed, 11 Apr 2012 06:26:56 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1586</guid>
		<description><![CDATA[Regular expressions can be used on the iOS platform as iOS 4.0 comes with the foundation framework courtesy of the . Pattern syntax currently is specified by ICU. PHP Example [...]]]></description>
			<content:encoded><![CDATA[<p>Regular expressions can be used on the iOS platform as iOS 4.0 comes with the <a href="https://developer.apple.com/library/ios/#documentation/Foundation/Reference/NSRegularExpression_Class/Reference/Reference.html">foundation framework</a> courtesy of the .  Pattern syntax currently is specified by ICU.</p>
<p><span id="more-1586"></span></p>
<h3>PHP Example</h3>
<p><code></p><pre class="crayon-plain-tag">preg_replace('/^(http&brvbar;ftp&brvbar;news)s?:\/+/i', '', $url_to_check)</pre><p></code></p>
<h3>Find http Link</h3>
<p><code></p><pre class="crayon-plain-tag">-(NSString *)findHttp:(NSString *)string {
	// Setup regular expression
	NSError *error = NULL;	
	NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@&quot;https?://([-\\w\\.]+)+(:\\d+)?(/([\\w/_\\.]*(\\?\\S+)?)?)?&quot; options:NSRegularExpressionCaseInsensitive error:&amp;error];

	// Perform Regex
	NSRange range = [regex rangeOfFirstMatchInString:string options:0 range:NSMakeRange(0, [string length])];

	// Return Link
	if (NSEqualRanges(range, NSMakeRange(NSNotFound, 0)))
		return NULL
	else
		return [string substringWithRange:range];
}</pre><p></code></p>
<h3>Remove All Links</h3>
<p><code></p><pre class="crayon-plain-tag">NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@&quot;(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#\!:.?+=&amp;%@\!\\-\\/]))?&quot; options:0 error:nil];
        newText = [regex stringByReplacingMatchesInString:text options:0 range:NSMakeRange(0, text.length) withTemplate:@&quot;&quot;];</pre><p></code></p>
<h3>Substitution</h3>
<p><code></p><pre class="crayon-plain-tag">-(NSString *)stringReplace:(NSString *)string pattern:(NSString *)pattern template:(NSString *)template {

	NSError *error = NULL;
	NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:pattern options:NSRegularExpressionCaseInsensitive error:&amp;error];

	return [regex stringByReplacingMatchesInString:string options:0 range:NSMakeRange(0, [string length]) withTemplate:template];	
}</pre><p></code></p>
<h3>Resources</h3>
<p>O&#8217;Reilly Media put out a book by Jeffrey Friedl, <a href="http://shop.oreilly.com/product/9781565922570.do">Mastering Regular Expressions: Powerful Techniques for Perl and Other Tools</a>, which is still relevant today.</p>
<p>Alternative Library: <a href="http://regexkit.sourceforge.net/">RegexKitLite</a></p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/blog/regex-in-ios/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>get_browser() and browscap.ini</title>
		<link>http://bobjunior.com/linux/get_browser-and-browscap-ini/</link>
		<comments>http://bobjunior.com/linux/get_browser-and-browscap-ini/#comments</comments>
		<pubDate>Wed, 11 Apr 2012 04:32:50 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1575</guid>
		<description><![CDATA[Php has some very useful ways to garner browser information. One of the most basic ways is inquire about user agent with [crayon-4fb9da661ffa7/] There is another function get_broswer() which holds [...]]]></description>
			<content:encoded><![CDATA[<p>Php has some very useful ways to garner browser information. One of the most basic ways is inquire about <a href="http://bobjunior.com/linux/user-agent/" title="User Agent">user agent</a> with<br />
<code></p><pre class="crayon-plain-tag">$_SERVER['HTTP_USER_AGENT']</pre><p></code></p>
<p>There is another function get_broswer() which holds a whole slew of additional, useful information. However it is not available by default. A special configuration file is needed, <a href="http://browsers.garykeith.com/stream.asp?PHP_BrowsCapINI">browscap.ini</a> which should be set in the php.ini file. There are ways around this if php.ini is not accessible/editable on a shared system.</p>
<p><code></p><pre class="crayon-plain-tag">[browscap]
browscap = /path/to/php_browscap.ini</pre><p></code></p>
<p>In PHP&#8217;s manual it reads:</p>
<blockquote><p>In order for this to work, your browscap configuration setting in php.ini must point to the correct location of the browscap.ini file on your system.</p></blockquote>
<p>The process for getting this function to work is worth the minimal effort. A few usage examples:</p>
<p><code></p><pre class="crayon-plain-tag">$browser = get_browser(null, true);

// Get Everything
$browser = get_browser();
foreach ($browser as $name =&amp;gt; $value) {
$output = $output . &quot;&lt;strong&gt;$name&lt;/strong&gt; $value
\n&quot;;
}

// Individual
$browser['platform']
$browser['browser']
$browser['majorver']
$browser['cssversion']
$browser['issyndicationreader']
$browser['ismobiledevice']</pre><p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/linux/get_browser-and-browscap-ini/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>User Agent</title>
		<link>http://bobjunior.com/linux/user-agent/</link>
		<comments>http://bobjunior.com/linux/user-agent/#comments</comments>
		<pubDate>Sun, 08 Apr 2012 18:03:32 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tool]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1567</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[CCBot/1.0 (+http://www.commoncrawl.org/bot.html)<hr />
<b>[browser_name_regex]</b> = ^.*$ <br />
<b>[browser_name_pattern]</b> = * <br />
<b>[browser]</b> = Default Browser <br />
<b>[version]</b> = 0 <br />
<b>[majorver]</b> = 0 <br />
<b>[minorver]</b> = 0 <br />
<b>[platform]</b> = unknown <br />
<b>[alpha]</b> =  <br />
<b>[beta]</b> =  <br />
<b>[win16]</b> =  <br />
<b>[win32]</b> =  <br />
<b>[win64]</b> =  <br />
<b>[frames]</b> =  <br />
<b>[iframes]</b> =  <br />
<b>[tables]</b> =  <br />
<b>[cookies]</b> =  <br />
<b>[backgroundsounds]</b> =  <br />
<b>[javascript]</b> =  <br />
<b>[vbscript]</b> =  <br />
<b>[javaapplets]</b> =  <br />
<b>[activexcontrols]</b> =  <br />
<b>[isbanned]</b> =  <br />
<b>[ismobiledevice]</b> =  <br />
<b>[issyndicationreader]</b> =  <br />
<b>[crawler]</b> =  <br />
<b>[cssversion]</b> = 0 <br />
<b>[aolversion]</b> = 0 <br />

]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/linux/user-agent/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python Repeat Timer</title>
		<link>http://bobjunior.com/blog/python-repeat-timer/</link>
		<comments>http://bobjunior.com/blog/python-repeat-timer/#comments</comments>
		<pubDate>Fri, 06 Apr 2012 20:31:40 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[repeat]]></category>
		<category><![CDATA[repeat timer]]></category>
		<category><![CDATA[schedule]]></category>
		<category><![CDATA[scheduling]]></category>
		<category><![CDATA[timer]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1539</guid>
		<description><![CDATA[Python is a great scripting language&#8211;very flexible and easy to incorporate the plethora packages readily available online. For a particular proejct, I needed a Python timer that repeated. The standard [...]]]></description>
			<content:encoded><![CDATA[<p>Python is a great scripting language&#8211;very flexible and easy to incorporate the plethora packages readily available online.  For a particular proejct, I needed a Python timer that repeated.  The standard Timer class only occurs once.  Alternatively there are some approaches to using a schedular and repeatedly sleeping.  However I found a nice class implementation of Timer by Bohdan Mushkevych that creates a self-repeating timer.</p>
<p>Add this to a project:<br />
<code></p><pre class="crayon-plain-tag">&quot;&quot;&quot;
Created on 2011-02-10

@author: Bohdan Mushkevych
@author: Brian Curtin
http://code.activestate.com/lists/python-ideas/8982/
&quot;&quot;&quot;
from datetime import datetime

import threading

class RepeatTimer(threading.Thread):
    def __init__(self, interval, callable, args=[], kwargs={}):
        threading.Thread.__init__(self)
        # interval_current shows number of milliseconds in currently triggered &lt;tick&gt;
        self.interval_current = interval
        # interval_new shows number of milliseconds for next &lt;tick&gt;
        self.interval_new = interval
        self.callable = callable
        self.args = args
        self.kwargs = kwargs
        self.event = threading.Event()
        self.event.set()
        self.activation_dt = None
        self.__timer = None

    def run(self):
        while self.event.is_set():
            self.activation_dt = datetime.utcnow()
            self.__timer = threading.Timer(self.interval_new,
                                          self.callable,
                                          self.args,
                                          self.kwargs)
            self.interval_current = self.interval_new
            self.__timer.start()
            self.__timer.join()

    def cancel(self):
        self.event.clear()
        if self.__timer is not None:
            self.__timer.cancel()

    def trigger(self):
        self.callable(*self.args, **self.kwargs)
        if self.__timer is not None:
            self.__timer.cancel()

    def change_interval(self, value):
        self.interval_new = value</pre><p></code></p>
<p>This makes Usage fairly straight forward:<br />
<code></p><pre class="crayon-plain-tag">import RepeatTimer
timerName = RepeatTimer( time_in_sec, function )
timerName.start()</pre><p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/blog/python-repeat-timer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iOS NSNotifications</title>
		<link>http://bobjunior.com/blog/ios-nsnotifications/</link>
		<comments>http://bobjunior.com/blog/ios-nsnotifications/#comments</comments>
		<pubDate>Fri, 06 Apr 2012 05:09:41 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[nsnotifications]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1533</guid>
		<description><![CDATA[NSNotifications is a way to message other classes and objects within iOS. Unlike protocols and delegates, NSNotifications are blind in that they do not directly know which objects and methods [...]]]></description>
			<content:encoded><![CDATA[<p>NSNotifications is a way to message other classes and objects within iOS.  Unlike protocols and delegates, NSNotifications are blind in that they do not directly know which objects and methods are responding to their messages.  This allows different parts of the code to be independent and not coupled which can be a very good thing.  The passing of the notification is handled by he Notification center which each thread shares.</p>
<p>Register a Message<br />
<code></p><pre class="crayon-plain-tag">[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(methodName:) name:@&quot;NotificationName&quot; object:nil];</pre><p></code></p>
<p>Post a Message<br />
<code></p><pre class="crayon-plain-tag">[[NSNotificationCenter defaultCenter] postNotificationName:@&quot;NotifiationName&quot; object:self];</pre><p></code><br />
postNotificationName: simply the name of the notification<br />
object: any object may be passed with the notification, normally this is the sender<br />
<br />
Cleanup of the registration should be done in the dealloc method.<br />
<code></p><pre class="crayon-plain-tag">[[NSNotificationCenter defaultCenter] removeObserver:self];</pre><p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/blog/ios-nsnotifications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unpacking mySQL from App Bundle</title>
		<link>http://bobjunior.com/blog/unpacking-mysql-from-app-bundle/</link>
		<comments>http://bobjunior.com/blog/unpacking-mysql-from-app-bundle/#comments</comments>
		<pubDate>Thu, 05 Apr 2012 07:15:25 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1529</guid>
		<description><![CDATA[I was watching the Carnegie Mellon iOS dev series on iTunesU. Very briefly in the lecture on core data, was a section of code that copied a database out of [...]]]></description>
			<content:encoded><![CDATA[<p>I was watching the Carnegie Mellon iOS dev series on iTunesU.  Very briefly in the lecture on core data, was a section of code that copied a database out of the bundle and into the local directory in order to editable during the program.  The code wasn&#8217;t discussed in any sort of detail, but seemed useful enough to clip and save&#8211;hence this blog entry:</p>
<p><code></p><pre class="crayon-plain-tag">- (void) initializeDatabase {
	NSFileManager *fileManager = [NSFileManager defaultManger];
	NSURL *toURL = [self documentDatabaseURL];
	
	if ([fileManager fileExistsAtPath:[toURL path]]) {
		// ALready Copied
		NSLog(@&quot;Already copied.&quot;)
	} else {
		// Copy from Bundle
		NSURL *fromURL = [self bundleDatabaseURL];
		NSError *error;
		if ([fileManager copyItemAtURL:formURL toURL:toURL error:&amp;error]) {
			NSLog(@&quot;Copied database.&quot;)
		} else {
			NSLog(@&quot;Failed to copy '%@' to '%@', fromURL, toURL, [error localizedDescription]);
		}
	}
}</pre><p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/blog/unpacking-mysql-from-app-bundle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>google-code-prettify</title>
		<link>http://bobjunior.com/linux/google-code-prettify/</link>
		<comments>http://bobjunior.com/linux/google-code-prettify/#comments</comments>
		<pubDate>Mon, 02 Apr 2012 05:02:12 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1677</guid>
		<description><![CDATA[Google provides many tools to aid web development. One such tool for code snippet beautification is known as google-code-prettify or prettify. It provides basic syntax highlighting for code in various [...]]]></description>
			<content:encoded><![CDATA[<p>Google provides many tools to aid web development.  One such tool for code snippet beautification is known as <a href="http://code.google.com/p/google-code-prettify/">google-code-prettify</a> or prettify.  It provides basic syntax highlighting for code in various languages including:</p>
<p>bash, c, cc, c++, c#, c shell, CycL, cv, htm, html, java, javascript, matlab, mxml, perl, pl, pm, python, ruby, shell, xhtml, xml, xslt</p>
<h3>Usage</h3>
<p>Add the <a href="http://code.google.com/p/google-code-prettify/downloads/list" title="Code">css and javascript</a> to the document, preferably in the footer to help load times:<br />
<code></p><pre class="crayon-plain-tag">&lt;link href=&quot;prettify.css&quot; type=&quot;text/css&quot; rel=&quot;stylesheet&quot; /&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;prettify.js&quot;&gt;&lt;/script&gt;</pre><p></code></p>
<p>Run the javascript in the HTML.  Google suggest doing this with onload in the bodytag:<br />
<code></p><pre class="crayon-plain-tag">&lt;body onload=&quot;prettyPrint()&quot;&gt;</pre><p></code></p>
<p>Include a prettyprint class either as a prepending pre tag or within the code tag itself:<br />
<code></p><pre class="crayon-plain-tag">class=&quot;prettyprint&quot;</pre><p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/linux/google-code-prettify/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python GUIs</title>
		<link>http://bobjunior.com/linux/python-guis/</link>
		<comments>http://bobjunior.com/linux/python-guis/#comments</comments>
		<pubDate>Sun, 01 Apr 2012 05:22:32 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[gui]]></category>
		<category><![CDATA[gui2exe]]></category>
		<category><![CDATA[py2app]]></category>
		<category><![CDATA[py2exe]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1510</guid>
		<description><![CDATA[Working with Python in a scripting environment where Python is already installed is pretty straight forward. OSX comes already installed with Python and it&#8217;s fairly easy to find installs in [...]]]></description>
			<content:encoded><![CDATA[<p>Working with Python in a scripting environment where Python is already installed is pretty straight forward.  OSX comes already installed with Python and it&#8217;s fairly easy to find installs in either apt-get repositories on debian-based Linux machines or by simply installing Active Python on Windows. There are essentially two standard releases of Python <a href="http://python.org/download/releases/2.7.2/">2.7.2</a> and <a href="http://python.org/download/releases/3.2.2/">3.2.2</a>.  Python has a <strong>very</strong> slow refresh cycle and 2.7.2 is usually a version that has very good support with additional libraries and packages.<br />
<span id="more-1510"></span><br />
For GUIs there are several options.  I&#8217;ve been working with <a href="http://www.wxpython.org">wxPython</a> which tries to utilize native OS widgets to render and draw windows.  Layouts are done with various flow layouts&#8211;as opposed to absolute grids.  There are a number of WYSIWYG editors to help put forms together such as <a href="http://wxglade.sourceforge.net">wxglade</a>, but I&#8217;ve been most recently using <a href="http://wxformbuilder.org">wxFormBuilder</a>.</p>
<p>The traditional ways of compiling python scripts for distribution usually involve the likes of py2exe or py2app.  I&#8217;ve found that these projects have not be updated in a considerable amount of time&#8211;therefore newer packages that tend to break during or during runtime.  There is a handy tool called <a href="http://code.google.com/p/gui2exe/">GUI2exe</a> now a google code project which can help to make py2exe&#8217;s setup.py file or even compile for OSX.  This tool has been absolutely invaluable for providing a quick and easy decode process for py2exe&#8217;s compiler configuration files and significantly improves the entire python executable compiling process.</p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/linux/python-guis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>#import versus #include</title>
		<link>http://bobjunior.com/blog/import-versus-include/</link>
		<comments>http://bobjunior.com/blog/import-versus-include/#comments</comments>
		<pubDate>Fri, 30 Mar 2012 08:17:48 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1507</guid>
		<description><![CDATA[Objective-C introduced a new way to reference header files. Traditionally, a #include statement would literally drop in the header file of a respective file into a location indicated by the [...]]]></description>
			<content:encoded><![CDATA[<p>Objective-C introduced a new way to reference header files.  Traditionally, a #include statement would literally drop in the header file of a respective file into a location indicated by the compiler directive #include.  This would be akin to inserting the contents of the header file into each and every #include reference.  The reference table and linker would then be responsible to ensure that the correct references and functions are associated with the final compiled program.</p>
<p>Apple, always thinking differently for things like changing boolean logic to Yes and No, created the #import compiler directive.  #import is supposed to be a smarter way to reference header files in order to prevent redundant or recursive header files.</p>
<p>However, there are already precautions in C for redundancy.  Normally in basic C guard directives are added to header files such as:<br />
<code></p><pre class="crayon-plain-tag">#ifndef _hfile_h_
#define _hfile_h_

Stuff

#endif</pre><p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/blog/import-versus-include/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inno Setup and Python</title>
		<link>http://bobjunior.com/blog/inno-setup-and-python/</link>
		<comments>http://bobjunior.com/blog/inno-setup-and-python/#comments</comments>
		<pubDate>Thu, 29 Mar 2012 07:58:37 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1505</guid>
		<description><![CDATA[Inno Setup is a nice little compile program to package up and distribute windows applications. If you have ever tried to package up and distribute a program programmed on windows, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.jrsoftware.org/isinfo.php">Inno Setup</a> is a nice little compile program to package up and distribute windows applications.  If you have ever tried to package up and distribute a program programmed on windows, you quickly run into install/distribution problems.  It&#8217;s nice to know there are some alternatives out there in this area.</p>
<p>I came across this piece of software looking for a good solution to distribute compiled python files as many windows systems simply do not have python and users don&#8217;t want to install it.  For full installs, I would recommend <a href="http://www.activestate.com/activepython">Active Python</a> or <a href="http://www.enthought.com/">Enthought</a>. Both of which have free distributions if you look hard enough.</p>
<p>Python and Inno Setup<br />
<iframe src="http://blip.tv/play/Af_OCQI.html?p=1" width="596" height="334" frameborder="0" allowfullscreen></iframe><embed type="application/x-shockwave-flash" src="http://a.blip.tv/api.swf#Af_OCQI" style="display:none"></embed></p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/blog/inno-setup-and-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ARC Singleton</title>
		<link>http://bobjunior.com/blog/arc-singleton/</link>
		<comments>http://bobjunior.com/blog/arc-singleton/#comments</comments>
		<pubDate>Sun, 25 Mar 2012 07:04:03 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[arc]]></category>
		<category><![CDATA[automatic reference counter]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[singleton]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1496</guid>
		<description><![CDATA[Singleton example using the automatic reference counter (ARC): Interface [crayon-4fb9da662afd0/] Implementation [crayon-4fb9da662aff5/]]]></description>
			<content:encoded><![CDATA[<p>Singleton example using the automatic reference counter (ARC):</p>
<p><strong>Interface</strong><br />
<code></p><pre class="crayon-plain-tag">#import &lt;foundation/Foundation.h&gt;
 
@interface MyManager : NSObject {
    NSString *someProperty;
}
@property (nonatomic, retain) NSString *someProperty;
+ (id)sharedManager;
@end</pre><p></code></p>
<p><strong>Implementation</strong><br />
<code></p><pre class="crayon-plain-tag">#import &quot;MyManager.h&quot;
static MyManager *sharedMyManager = nil;

@implementation MyManager 
@synthesize someProperty;
 
#pragma mark Singleton Methods
+ (id)sharedManager {
    @synchronized(self) {
        if (sharedMyManager == nil)
            sharedMyManager = [[self alloc] init];
    }
    return sharedMyManager;
}
- (id)init {
    if (self = [super init]) {
        someProperty = [[NSString alloc] initWithString:@&quot;Default Property Value&quot;];
    }
    return self;
}
- (void)dealloc {
    // Should never be called, but just here for clarity really.
}
@end</pre><p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/blog/arc-singleton/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>User Agent Spoofing on OSX Safari</title>
		<link>http://bobjunior.com/blog/user-agent-spoofing-on-osx-safari/</link>
		<comments>http://bobjunior.com/blog/user-agent-spoofing-on-osx-safari/#comments</comments>
		<pubDate>Fri, 09 Mar 2012 01:28:18 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[safari]]></category>
		<category><![CDATA[spoof]]></category>
		<category><![CDATA[user agent]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1476</guid>
		<description><![CDATA[There are many applications for spoofing user-agents on web browsers. Most solutions from Firefox or Chrome utilize plug-ins to achieve this. Safari on OSX has the ability to perform this [...]]]></description>
			<content:encoded><![CDATA[<p>There are many applications for spoofing user-agents on web browsers.  Most solutions from Firefox or Chrome utilize plug-ins to achieve this.  Safari on OSX has the ability to perform this feature in the application itself.</p>
<ol>
<li>Under Preferences->Advanced, check the box for &#8216;Show Develop menu in menu bar&#8217;</li>
<li>In the new Develop Menubar, select User Agent->Other</li>
</ol>
<p>If you want to simulate browsing with an iPad which uses the same WebKit rendering engine, you can customize the user agent string to be something like:</p>
<p><code></p><pre class="crayon-plain-tag">Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.04 Mobile/7B320c Safari/531.21.10</pre><p></code></p>
<p>This will deliver the same viewing experience as the iPad, prompting things like mobile versions for websites.</p>
<p>For more information, see Apple&#8217;s Tech Note <a href="https://developer.apple.com/library/safari/#technotes/tn2010/tn2262/_index.html">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/blog/user-agent-spoofing-on-osx-safari/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MIT Hackers</title>
		<link>http://bobjunior.com/blog/mit-hackers/</link>
		<comments>http://bobjunior.com/blog/mit-hackers/#comments</comments>
		<pubDate>Wed, 22 Feb 2012 01:01:39 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[hackers]]></category>
		<category><![CDATA[MIT]]></category>
		<category><![CDATA[steven levy]]></category>
		<category><![CDATA[Tech Model Railroad Club]]></category>
		<category><![CDATA[TMRC]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1458</guid>
		<description><![CDATA[Steven Levy wrote a book entited Hackers, Heroes of the Computer Revolution. It&#8217;s story of the computer gurus, the wizards who drove the burgeoning computer era. What really appeals to [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-1461" title="Hackers" src="http://bobjunior.com/wp-content/uploads/2012/02/200px-Hackersz_.jpg" alt="" width="200" height="200" />Steven Levy wrote a book entited <a title="Hackers, Heroes of the Computer Revolution" href="http://en.wikipedia.org/wiki/Hackers:_Heroes_of_the_Computer_Revolution">Hackers, Heroes of the Computer Revolution</a>. It&#8217;s story of the computer gurus, the wizards who drove the burgeoning computer era. What really appeals to me is the humanity of the it. The people that spawned the computing age and the attitude of the hacker which is to know by tinkering. The hack was the expression of knowledge through finessing skills. In truth the original hacker community could be said to have started on campuses like MIT in the late 1950s. These were some of the few places with accessible machines like the <a href="http://en.wikipedia.org/wiki/IBM_704" title="IBM 704">IBM 704</a> with its punchcard reader and limited memory space. It was the attitude of open learning on the technology playground that spurned their group to explore the steam tunnels of the MIT campus underground following cabling and relays and ultimately finding ways to get access to the campus computing machinery.<br />
<br />
Peter Samson, an original MIT hacker, wrote a poem about an attitude of hacking for the Tech Model Railroad Club:</p>
<blockquote><p>
Switch Thrower for the World,<br />
Fuze Tester, Maker of Routes,<br />
Player wit the Railroads and the System&#8217;s Advance Chopper;<br />
Grungy, hairy, sprawling,<br />
Machine of the Point-Function Line-o-lite:<br />
They tell me you are wicked and I believe them; for I have seen your painted lights bulbs under the lucite luring the sytem coolies&#8230;<br />
Under the tower, dust all over teh place, hacking with bifurcated springs&#8230;<br />
Hacking even as an ignorant freshman acts who has never lost occupancy and has dropped out<br />
Hacking the M-Boards, for under its locks are teh switches, and under its control the advance around the layout,<br />
Hacking!</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/blog/mit-hackers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cocoa for Scientists</title>
		<link>http://bobjunior.com/blog/cocoa-for-scientists/</link>
		<comments>http://bobjunior.com/blog/cocoa-for-scientists/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 06:34:23 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1418</guid>
		<description><![CDATA[This is a few years old now, but Drew over at macresearch.org has provided a host of cocoa examples: Author: Drew McCormack Articles in this series include: Hello Brave New [...]]]></description>
			<content:encoded><![CDATA[<p>This is a few years old now, but Drew over at macresearch.org has provided a host of cocoa examples:</p>
<div class="content">
<p>Author: <a href="http://www.mentalfaculty.com">Drew McCormack</a></p>
<p>Articles in this series include:</p>
<ol>
<li><a href="http://www.macresearch.org/cocoa_for_scientists_part_i_hello_brave_new_world">Hello Brave New World</a></li>
<li><a href="http://www.macresearch.org/cocoa_for_scientists_part_ii_classy_cocoa">Classy Cocoa</a></li>
<li><a href="http://www.macresearch.org/cocoa_for_scientists_part_iii_living_objects">Living Objects</a></li>
<li><a href="http://www.macresearch.org/cocoa_for_scientists_part_iv_good_references">Good References</a></li>
<li><a href="http://www.macresearch.org/cocoa_for_scientists_part_v_its_all_in_the_genes">It&#8217;s All in the Genes</a></li>
<li><a href="http://www.macresearch.org/cocoa_for_scientists_part_vi_jekyll_and_hyde">Jekyll and Hyde</a></li>
<li><a href="http://www.macresearch.org/cocoa_for_scientists_part_vii_into_xcode">Into Xcode</a></li>
<li><a href="http://www.macresearch.org/cocoa_for_scientists_part_viii_ib_therefore_i_am">IB, Therefore I am</a></li>
<li><a href="http://www.macresearch.org/cocoa_for_scientists_part_ix_mvc_is_not_the_motor_vehicle_commission">MVC is not the &#8216;Motor Vehicle Commission&#8217;</a></li>
<li><a href="http://www.macresearch.org/cocoa_for_scientists_part_x_popping_up_all_over_the_place">Popping Up All Over the Place</a></li>
<li><a href="http://www.macresearch.org/cocoa_for_scientists_part_xi_the_value_in_keys">The Value in Keys</a></li>
<li><a href="http://www.macresearch.org/cocoa_for_scientists_part_xii_observe_and_learn">Observe and Learn</a></li>
<li><a href="http://www.macresearch.org/cocoa_for_scientists_part_xiii_in_a_bind">In a Bind</a></li>
<li><a href="http://www.macresearch.org/cocoa_for_scientists_part_xiv_beginning_3d_visualization">Beginning 3D Visualization</a></li>
<li><a href="http://www.macresearch.org/cocoa_for_scientists_part_xv_continuing_3d_visualization">Continuing 3D Visualization</a></li>
<li><a href="http://www.macresearch.org/cocoa_for_scientists_part_xvi_finalizing_3d_visualization">Finalizing 3D Visualization</a></li>
<li><a href="http://www.macresearch.org/cocoa_for_scientists_part_xvii_representing_data_in_tables">Representing Data in Tables</a></li>
<li><a href="http://www.macresearch.org/cocoa_for_scientists_part_xviii_graphing_data_with_sm2dgraphview">Graphing Data with SM2DGraphView</a></li>
<li><a href="http://www.macresearch.org/cocoa_for_scientists_part_ixx_telling_your_story_with_narrative">Telling Your Story with Narrative</a></li>
<li><a href="http://www.macresearch.org/node/4527">Python Scripters&#8230;Meet Cocoa</a></li>
<li><a href="http://www.macresearch.org/node/4567">Multi-threading Your App with NSOperation and NSOperationQueue</a></li>
<li><a href="http://www.macresearch.org/cocoa-scientists-part-xxii-core-data-models">Core Data Models</a></li>
<li><a href="http://www.macresearch.org/cocoa-scientists-part-xxiii-itunes-ifying-core-data-app">iTunes-ifying Core Data Apps</a></li>
<li><a href="http://www.macresearch.org/cocoa-scientists-xxiv-core-animation-first-steps">Core Animation First Steps</a></li>
<li><a href="http://www.macresearch.org/cocoa-scientists-part-xxv-core-animation-layer-trees">Core Animation Layer Trees</a></li>
<li><a href="http://www.macresearch.org/cocoa-scientists-part-xxvi-parsing-csv-data">Parsing CSV Data</a></li>
<li><a href="http://www.macresearch.org/cocoa-scientists-part-xxvii-getting-closure-objective-c">Getting Closure with Objective-C</a></li>
<li><a href="http://www.macresearch.org/cocoa-scientists-part-xxviii-bonjour-and-how-do-you-do">Bonjour and How Do You Do?</a></li>
<li><a href="http://www.macresearch.org/cocoa-scientists-part-xxix-message">This is the Message</a></li>
<li><a href="/cocoa-scientists-xxx-developing-iphone">Developing for iPhone</a></li>
<li><a href="/cocoa-scientists-xxxi-all-aboard-grand-central">All Aboard Grand Central</a></li>
<li><a href="/cocoa-scientists-xxxii-physics-sumos-flirtation-iphone-game-development">The Physics of Sumos (A Flirtation with iPhone Game Development)</a></li>
<li><a href="/cocoa-scientists-xxxii-10-uses-blocks-cobjective-c">10 Uses for Blocks in C/Objective-C</a></li>
<li><a href="/cocoa-scientists-xxxiv-scrapbook-advanced-core-animation-view">Scrapbook of an Advanced Core Animation View</a></li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/blog/cocoa-for-scientists/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Core-plot</title>
		<link>http://bobjunior.com/blog/core-plot/</link>
		<comments>http://bobjunior.com/blog/core-plot/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 06:26:21 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1415</guid>
		<description><![CDATA[Have you ever wanted to pull in some decent-looking plots into an iPhone app or OSX application? Core-plot is a google code project for plotting framework for ios. It has [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://bobjunior.com/wp-content/uploads/2012/01/Promo-slide-for-core-plot-301x226.jpg" alt="" title="Promo slide for core plot" width="301" height="226" class="size-medium wp-image-1416" /><br />
<br />
Have you ever wanted to pull in some decent-looking plots into an iPhone app or OSX application?  <a href="http://code.google.com/p/core-plot/" title="Core-plot">Core-plot</a> is a google code project for plotting framework for ios.  It has some beautiful basic plotting features including: Line, Bar, Pie, Scatter, and Range.  The next time you need a quick plotting source code, try core-plot.</p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/blog/core-plot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Self-Reporting IP Changes</title>
		<link>http://bobjunior.com/linux/self-reporting-ip-changes/</link>
		<comments>http://bobjunior.com/linux/self-reporting-ip-changes/#comments</comments>
		<pubDate>Thu, 15 Dec 2011 05:16:43 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[ip]]></category>
		<category><![CDATA[monitor]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1392</guid>
		<description><![CDATA[I&#8217;ve been wanting to have a script that checks for changes in IP addresses and alerts via email if there has been a change. I also wanted the script to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been wanting to have a script that checks for changes in IP addresses and alerts via email if there has been a change.  I also wanted the script to work with gmail and on servers that may not be configured as full mail servers&#8211;</p>
<p><span id="more-1392"></span></p>
<p>As it turns out there exists a linux program called sendEmail that fits the bill nicely.  It&#8217;s written in perl and can talk to mail servers over secure ports without any additional mail configuration. </p>
<p><code></p><pre class="crayon-plain-tag">sudo apt-get install sendEmail libio-socket-ssl-perl libnet-ssleay-perl perl</pre><p></code></p>
<p>
The bash script constantly logs and checks the IP address and emails any changes.  It&#8217;s especially helpful on networks with dynamic IP addresses.
</p>
<p><code></p><pre class="crayon-plain-tag">#!/bin/bash
# Alert IP Address changes over email.

MAIL_TO=recipient@gmail.com
MAIL_SERVER=smtp.gmail.com:587
MAIL_FROM=sender@gmail.com
USERNAME=username
PASSWORD=password
SUBJECT=&quot;IP Address Change Notification&quot;

LOG=/path/to/log/ip_address
OLD_IP=( $( cat $LOG ) )

# Get IP Address
NEW_IP=( $(curl -s http://www.ipchicken.com/ | awk '/[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*/ {print $1}' | uniq) )

# Check for Change
if [ &quot;$NEW_IP&quot; != &quot;$OLD_IP&quot; ]
then

    # log current ip
    echo $NEW_IP &gt; $LOG

    # Send Email
    sendEmail -v -f $MAIL_FROM -s $MAIL_SERVER -xu $USERNAME -xp $PASSWORD -t $MAIL_TO -o tls=yes -u $SUBJECT -m $NEW_IP
fi

exit 0</pre><p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/linux/self-reporting-ip-changes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Privacy Exploitation</title>
		<link>http://bobjunior.com/blog/privacy-exploitation/</link>
		<comments>http://bobjunior.com/blog/privacy-exploitation/#comments</comments>
		<pubDate>Mon, 12 Dec 2011 07:53:55 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1389</guid>
		<description><![CDATA[The future trend of web technology will be the exploitation of personal information. The money behind this is too great for web companies not to figure out ways to acquire, [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://bobjunior.com/wp-content/uploads/2011/12/chrome_logo-226x226.jpg" alt="" title="chrome_logo" width="226" height="226" class="alignleft size-medium wp-image-1390" />The future trend of web technology will be the exploitation of personal information.  The money behind this is too great for web companies not to figure out ways to acquire, compile, and repackage for sale every scrap of web presence you have and action you take online.  The likes of Facebook and Google are already breaching the walls of personal information exchanging free servies for personal email addresses, contact lists, geographic locale and browsing history.  This information elicits big bucks when sold to right companies anonymously or otherwise.<br />
<span id="more-1389"></span><br />
Google released Google Chrome.  The sleekness of this new browser quickly swayed many web savvy users and even major linux installations, but there is flipside to free software.  Although chrome, the free browser, comes with helpful features like in-url web searching and streamlined tabbed browsing, it comes at a price. The <a href="http://support.google.com/chrome/bin/answer.py?hl=en&#038;answer=180655">Omnibox</a> from Google records every keystroke made in the browser, every url undertaken, and every click of browser history.  The feature of in-url web searching and autocompletion of url addresses communicates with google performing search faster than the request can be made.  Unbeknownst to most users, chrome by default associates email logins, search and web history of each device in the browser.  This means that Google knows what sites you have visited and who is visiting them.</p>
<p>A couple of days ago I received an email on one of my junk mail accounts.  Usually this type of unsolicited request receives little notice&#8211;however this particular email had some interesting information.  It knew what website I had visited and what I had clicked on.  The only way for this to take place would be if Google&#8217;s Chrome shared web information through its doubleclick cookies, passing email information to a website that in turn sent an automated promotion.  This type of behavior is despicable.  Email is personal information&#8211;and not something I am adept at handing out even though the address was a junk account.</p>
<p>Recently Gmail has been offering me to tie my phone number to my email account.  The premise is that if I ever lose my password, I would need a way to log back in.  Right?  A phone number tied to an email address and name is a very useful correlation of information.  How much is this information worth.  A name, a phone number, an email, search history&#8230;apparently billions and its all at the expense of users.  Don&#8217;t even get me started about Google Checkout and the desire to tie credit cards to your google account.</p>
<p>There are a couple of tools to mitigate Google Chrome (and other browsers behavior) by simply installing some Browser Extensions:<br />
<a href="http://adblockplus.org/en/4tsWjBg&#038;usg=AFQjCNFCGY64c-2BklE28i2BFidRbbLL5A">Ad Block Plus</a> &#8211; Remove unwanted advertising within the browser including Google&#8217;s textual listing, YouTube in-video advertising, and banner ads</p>
<p><a href="https://chrome.google.com/webstore/detail/gbiekjoijknlhijdjbaadobpkdhmoebb">IBA Opt-Out</a> &#8211; Opt out of double-click unscrupulous privacy breeches.  By default you have opted-in to have Google sell your online identity and behavior.</p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/blog/privacy-exploitation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Serving Up Directories with Apache</title>
		<link>http://bobjunior.com/linux/serving-up-directories-with-apache/</link>
		<comments>http://bobjunior.com/linux/serving-up-directories-with-apache/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 07:41:20 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1374</guid>
		<description><![CDATA[There are a number of web-based applications to allow file viewing and directory traversing over normal web pages. None of which are as clean and simple to employ, let alone [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://bobjunior.com/wp-content/uploads/2011/11/indices-comparison-big-200x200.png" alt="" title="Indices" width="200" height="200" class="alignleft size-full wp-image-1375" /></p>
<p>There are a number of web-based applications to allow file viewing and directory traversing over normal web pages.  None of which are as clean and simple to employ, let alone as secure as letting Apache itself do all the work.  With a simple flick of a .htaccess parameter, &#8216;+Indexes&#8217;, an unsuspecting directory becomes accessible albeit an eye sore.<br />
<br />
There is a great way to make better listing using apache with mod_autoindex and CSS.  The best piece of code I&#8217;ve found is called <a href="http://antisleep.com/indices/">Indices</a>.  It takes Apache&#8217;s default listing and displays them in their minimalist, clean beauty.<br />
<br />
More details about <a href="http://httpd.apache.org/docs/2.2/mod/mod_autoindex.html">mod_autoindex</a> can be found from Apache&#8217;s documentation.</p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/linux/serving-up-directories-with-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mobile Legacy</title>
		<link>http://bobjunior.com/blog/movile-legacy/</link>
		<comments>http://bobjunior.com/blog/movile-legacy/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 17:20:15 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://bobjunior.com/blog/movile-legacy/</guid>
		<description><![CDATA[Intel and Microsoft are always concerned with legacy support and for the bussiness desktop space this has been a prerequisite. However the mobile spaces are quite different. The demands of [...]]]></description>
			<content:encoded><![CDATA[<p>Intel and Microsoft are always concerned with legacy support and for the bussiness desktop space this has been a prerequisite.  However the mobile spaces are quite different.  The demands of these platforms and the flexiility of software does not require the same archaic support.  You still need a software platform, but there are no constraints on  two or more old software.  This space develops faster than ever before and the criteria is set moreover by experience and integration.</p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/blog/movile-legacy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dropbox CLI</title>
		<link>http://bobjunior.com/linux/dropbox-cli/</link>
		<comments>http://bobjunior.com/linux/dropbox-cli/#comments</comments>
		<pubDate>Mon, 24 Oct 2011 08:55:47 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1357</guid>
		<description><![CDATA[Dropbox is a great tool to share documents over the cloud. It has been begging for a CLI linux install for some time and now there is way to do [...]]]></description>
			<content:encoded><![CDATA[<p>Dropbox is a great tool to share documents over the cloud.  It has been begging for a CLI linux install for some time and now there is way to do this.  Directions available <a href="http://wiki.dropbox.com/TipsAndTricks/TextBasedLinuxInstall">here</a> and <a href="http://wiki.dropbox.com/TipsAndTricks/TextBasedLinuxInstall/UbuntuStartup">here</a>.<br />
<span id="more-1357"></span><br />
1) Download<br />
<code></p><pre class="crayon-plain-tag">wget -O dropbox.tar.gz &quot;http://www.dropbox.com/download/?plat=lnx.x86&quot;</pre><p></code></p>
<p>2) Extract<br />
<code></p><pre class="crayon-plain-tag">tar -xvzf dropbox.tar.gz</pre><p></code></p>
<p>3) Install<br />
<code></p><pre class="crayon-plain-tag">env - LANG=&quot;$LANG&quot; ~/.dropbox-dist/dropboxd</pre><p></code></p>
<p>4) Login and Visit the website given by install.</p>
<p>5) Add startup script to /etc/init.d/dropbox (changing DROPBOX_USERS)<br />
<code></p><pre class="crayon-plain-tag">#!/bin/sh
# dropbox service
DROPBOX_USERS=&quot;user1 user2&quot;

DAEMON=.dropbox-dist/dropbox

start() {
    echo &quot;Starting dropbox...&quot;
    for dbuser in $DROPBOX_USERS; do
        HOMEDIR=`getent passwd $dbuser | cut -d: -f6`
        if [ -x $HOMEDIR/$DAEMON ]; then
            HOME=&quot;$HOMEDIR&quot; start-stop-daemon -b -o -c $dbuser -S -u $dbuser -x $HOMEDIR/$DAEMON
        fi
    done
}

stop() {
    echo &quot;Stopping dropbox...&quot;
    for dbuser in $DROPBOX_USERS; do
        HOMEDIR=`getent passwd $dbuser | cut -d: -f6`
        if [ -x $HOMEDIR/$DAEMON ]; then
            start-stop-daemon -o -c $dbuser -K -u $dbuser -x $HOMEDIR/$DAEMON
        fi
    done
}

status() {
    for dbuser in $DROPBOX_USERS; do
        dbpid=`pgrep -u $dbuser dropbox`
        if [ -z $dbpid ] ; then
            echo &quot;dropboxd for USER $dbuser: not running.&quot;
        else
            echo &quot;dropboxd for USER $dbuser: running (pid $dbpid)&quot;
        fi
    done
}

case &quot;$1&quot; in

    start)
        start
        ;;

    stop)
        stop
        ;;

    restart|reload|force-reload)
        stop
        start
        ;;

    status)
        status
        ;;

    *)
        echo &quot;Usage: /etc/init.d/dropbox {start|stop|reload|force-reload|restart|status}&quot;
        exit 1

esac

exit 0</pre><p></code></p>
<p>6) Add script to Startup:<br />
<code></p><pre class="crayon-plain-tag">sudo chmod +x /etc/init.d/dropbox
sudo update-rc.d dropbox defaults</pre><p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/linux/dropbox-cli/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPad Save To PDF</title>
		<link>http://bobjunior.com/blog/ipad-save-to-pdf/</link>
		<comments>http://bobjunior.com/blog/ipad-save-to-pdf/#comments</comments>
		<pubDate>Mon, 24 Oct 2011 08:46:31 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1355</guid>
		<description><![CDATA[I&#8217;ve been looking for good ways to annotate PDF files directly on the iPad. One of the biggest problems is actually getting documents onto the device. The combination of Good [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been looking for good ways to annotate PDF files directly on the iPad.  One of the biggest problems is actually getting documents onto the device.  The combination of Good Reader and iAnnotate have been the best ways available to easily get and annotate on PDF documents.</p>
<p>I&#8217;ve finally found a way <a href="http://slife.dudeney.com/?p=597">here</a>.</p>
<p>After installing Good Reader, saving PDF files is as simple as using a bookmark.  On the iPad make a bookmark with the following link:<br />
<code>javascript:pdf_url=location.href;location.href=’ghttp://pdfmyurl.com?url=’+escape(pdf_url)</code></p>
<p>or<br />
<code>javascript:pdf_url=location.href;location.href=’ghttp://api.joliprint.com/api/rest/url/print/s/joliprint.com?url=’+escape(pdf_url)+’&#038;disposition=attachment’</code></p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/blog/ipad-save-to-pdf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SynthesizeSingleton.h</title>
		<link>http://bobjunior.com/blog/synthesizesingleton-h/</link>
		<comments>http://bobjunior.com/blog/synthesizesingleton-h/#comments</comments>
		<pubDate>Tue, 11 Oct 2011 04:48:00 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1343</guid>
		<description><![CDATA[Singletons are single-instance objects for OSX or iOS programming projects. In objective-c they are only invoked once and have special handling for retain and release during memory management. There is [...]]]></description>
			<content:encoded><![CDATA[<p>Singletons are single-instance objects for OSX or iOS programming projects.  In objective-c they are only invoked once and have special handling for retain and release during memory management.  There is a good <a href="http://developer.apple.com/library/mac/#documentation/General/Conceptual/DevPedia-CocoaCore/Singleton.html" title="Apple Singleton">example</a> from Apple about how to make your own Singleton, but I found a great <a href="https://github.com/kstenerud/SynthesizeSingleton/blob/master/SynthesizeSingleton.h" title="SynthesizeSingleton">project</a> on GITHub to a simple .h which is essentially a macro that can be included with any project.  The macro will generate all the necessary methods automatically and make an object into a singleton.</p>
<p>Additional Links<br />
<a href="http://cocoawithlove.com/2008/11/singletons-appdelegates-and-top-level.html">Singletons, AppDelegates and top-level data</a><br />
<a href="http://gigaom.com/apple/iphone-dev-sessions-using-singletons/">iPhone Dev Sessions: Using Singletons</a></p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/blog/synthesizesingleton-h/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>i.e. e.g.</title>
		<link>http://bobjunior.com/blog/i-e-e-g/</link>
		<comments>http://bobjunior.com/blog/i-e-e-g/#comments</comments>
		<pubDate>Sun, 18 Sep 2011 04:42:09 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1312</guid>
		<description><![CDATA[A couple of the most misused latin abbreviations: i.e. = id est &#8216;that is&#8217; or &#8216;in other words&#8217; e.g. = exempli gratia &#8221;for example&#8217;]]></description>
			<content:encoded><![CDATA[<p>A couple of the most misused latin abbreviations:</p>
<p>i.e. = id est &#8216;that is&#8217; or &#8216;in other words&#8217;</p>
<p>e.g. = exempli gratia &#8221;for example&#8217;</p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/blog/i-e-e-g/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Net Send</title>
		<link>http://bobjunior.com/blog/net-send/</link>
		<comments>http://bobjunior.com/blog/net-send/#comments</comments>
		<pubDate>Fri, 24 Jun 2011 01:25:59 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1267</guid>
		<description><![CDATA[Net Send is a simple command-line communicator built into windows that utilizes basic IP protocol to send characters. A simple bat script might be something like:@echo off cls echo NET [...]]]></description>
			<content:encoded><![CDATA[<p>Net Send is a simple command-line communicator built into windows that utilizes basic IP protocol to send characters.  A simple bat script might be something like:<code>@echo off<br />
cls<br />
echo NET SEND<br />
set /p n=IP:<br />
:A<br />
set/p m=><br />
net send %n% %m%<br />
Goto A<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/blog/net-send/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Photodiode References</title>
		<link>http://bobjunior.com/blog/photodiode-references/</link>
		<comments>http://bobjunior.com/blog/photodiode-references/#comments</comments>
		<pubDate>Tue, 21 Jun 2011 17:28:52 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1253</guid>
		<description><![CDATA[Good Online Resources for learning about photodiodes: Hamatsu is also available as a pdf.]]></description>
			<content:encoded><![CDATA[<p>Good Online Resources for learning about photodiodes:<br />
<br />
<a href="http://sales.hamamatsu.com/assets/html/ssd/si-photodiode/"><img src="http://bobjunior.com/wp-content/uploads/2011/06/photodiode_hamamatsu-282x226.jpg" alt="" title="Hamamatsu" width="282" height="226" class="size-medium wp-image-1254" /></a><a href="http://ecee.colorado.edu/~bart/book/book/chapter4/ch4_7.htm?pagewanted=all"><img src="http://bobjunior.com/wp-content/uploads/2011/06/photodiode_colorado-282x226.jpg" alt="Coloradu.edu" title="Colorado.edu" width="282" height="226" class="alignleft size-medium wp-image-1255" /></a><br />
<br />
Hamatsu is also <a href="http://www.google.com/url?sa=t&#038;source=web&#038;cd=1&#038;ved=0CBwQFjAA&#038;url=http%3A%2F%2Fsales.hamamatsu.com%2Fassets%2Fapplications%2FSSD%2Fphotodiode_technical_information.pdf&#038;ei=OdcATubEL4K4sQO7ssChDQ&#038;usg=AFQjCNEwHfm02U4JmlmWqPElpTMR2aHtTA">available</a> as a pdf.</p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/blog/photodiode-references/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OSX Terminal Tricks</title>
		<link>http://bobjunior.com/blog/osx-terminal-tricks/</link>
		<comments>http://bobjunior.com/blog/osx-terminal-tricks/#comments</comments>
		<pubDate>Mon, 06 Jun 2011 02:28:55 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1240</guid>
		<description><![CDATA[Dragging Folders Command terminals support dragging and dropping of folders into the terminal itself. This is great if you need to quickly cd into a location that is otherwise easy [...]]]></description>
			<content:encoded><![CDATA[<p>Dragging Folders<br />
Command terminals support dragging and dropping of folders into the terminal itself.  This is great if you need to quickly cd into a location that is otherwise easy to get to.</p>
<p><strong>Open Command</strong><br />
Open specific application or web pages from the command line.<br />
<code>open -a <application name><br />
open http://google.com</code></p>
<p><strong>Say Command</strong><br />
Use the text-to-speech features of a Mac to speak out loud.<br />
<code>say type things here</code></p>
<p><strong>pbcopy and pbpaste</strong><br />
Copy and Paste texted is available in the terminal as &#8216;pbcopy&#8217; and &#8216;pbpase&#8217;.  By piping these words into files or out from scripts gives quick access to anything pasted into the clip board.</p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/blog/osx-terminal-tricks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ALT-Shortcuts</title>
		<link>http://bobjunior.com/blog/alt-shortcuts/</link>
		<comments>http://bobjunior.com/blog/alt-shortcuts/#comments</comments>
		<pubDate>Wed, 18 May 2011 19:01:55 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1224</guid>
		<description><![CDATA[In Windows is the friendly charmap tool to find any character in any font. Sometimes it&#8217;s just easier to type the character directly without hunting through the charmap itself. Alternatively, [...]]]></description>
			<content:encoded><![CDATA[<p>In Windows is the friendly charmap tool to find any character in any font.  Sometimes it&#8217;s just easier to type the character directly without hunting through the charmap itself.  Alternatively, many characters can be typed by holding alt and typing the numeric code.</p>
<p>ALT Codes for Greek Letters<br />
Alt Code	Symbol	Description<br />
Alt 224	α		Alpha<br />
Alt 225	ß		Beta<br />
Alt 226	Γ		Gamma<br />
Alt 235	δ		Delta<br />
Alt 238	ε		Epsilon<br />
Alt 233	Θ		Theta<br />
Alt 227	π		Pi<br />
Alt 230	µ		Mu<br />
Alt 228	Σ		Uppercase Sigma<br />
Alt 229	σ		Lowercase sigma<br />
Alt 231	τ		Tau<br />
Alt 232	Φ		Uppercase Phi<br />
Alt 237	φ		Lowercase Phi<br />
Alt 234	Ω		Omega</p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/blog/alt-shortcuts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iOS Resolution</title>
		<link>http://bobjunior.com/blog/ios-resolution/</link>
		<comments>http://bobjunior.com/blog/ios-resolution/#comments</comments>
		<pubDate>Sat, 14 May 2011 15:24:27 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1220</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://bobjunior.com/wp-content/uploads/2011/05/iOS_resolution.png" rel="thumbnail"><img src="http://bobjunior.com/wp-content/uploads/2011/05/iOS_resolution.png" alt="" title="iOS_resolution" width="800" height="600" class="alignleft size-full wp-image-1221" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/blog/ios-resolution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IconFX</title>
		<link>http://bobjunior.com/blog/iconfx/</link>
		<comments>http://bobjunior.com/blog/iconfx/#comments</comments>
		<pubDate>Fri, 13 May 2011 22:06:00 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1217</guid>
		<description><![CDATA[IconFX is a free Icon Creator for executables or favicons. It handles both Windows and OSX. Best of all, it comes with the ability to extract and change default exe [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://bobjunior.com/wp-content/uploads/2011/05/icofx.png" rel="thumbnail"><img src="http://bobjunior.com/wp-content/uploads/2011/05/icofx.png" alt="" title="icofx" width="263" height="75" class="alignleft size-full wp-image-1218" /></a><a href="http://icofx.ro/">IconFX</a> is a free Icon Creator for executables or favicons.  It handles both Windows and OSX.  Best of all, it comes with the ability to extract and change default exe icons from compiled binaries.</p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/blog/iconfx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shell Pump Error</title>
		<link>http://bobjunior.com/blog/shell-pump-error/</link>
		<comments>http://bobjunior.com/blog/shell-pump-error/#comments</comments>
		<pubDate>Tue, 10 May 2011 04:01:07 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://bobjunior.com/blog/shell-pump-error/</guid>
		<description><![CDATA[The advertising portal of Shell&#8217;s pumps uses Windows. I really hope the transaction queue isn&#8217;t on the same system.]]></description>
			<content:encoded><![CDATA[<p>The advertising portal of Shell&#8217;s pumps uses Windows.  I really hope the transaction queue isn&#8217;t on the same system.</p>
<p><a href="http://bobjunior.com/wp-content/uploads/2011/06/p_2048_1536_57CA1907-5AE9-46A3-A55F-62C7511EBF13.jpeg" rel="thumbnail"><img src="http://bobjunior.com/wp-content/uploads/2011/06/p_2048_1536_57CA1907-5AE9-46A3-A55F-62C7511EBF13.jpeg" alt="" width="225" height="300" class="alignnone size-full wp-image-364" /></a> <a href="http://bobjunior.com/wp-content/uploads/2011/06/l_2048_1536_031F2BE6-A225-4A0A-81B6-5255B24ED25D.jpeg" rel="thumbnail"><img src="http://bobjunior.com/wp-content/uploads/2011/06/l_2048_1536_031F2BE6-A225-4A0A-81B6-5255B24ED25D.jpeg" alt="" width="300" height="225" class="alignnone size-full wp-image-364" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/blog/shell-pump-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MacPorts</title>
		<link>http://bobjunior.com/blog/macports/</link>
		<comments>http://bobjunior.com/blog/macports/#comments</comments>
		<pubDate>Fri, 06 May 2011 07:20:24 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1210</guid>
		<description><![CDATA[MacPorts is a friendly way to get open-source programs installed and accessible at the command line. There are nearly 8000 ported programs ready to be installed. Mimms is one such [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.macports.org/">MacPorts</a> is a friendly way to get open-source programs installed and accessible at the command line.  There are nearly 8000 ported programs ready to be installed.  Mimms is one such item that allows for downloading streaming video.</p>
<p>Installing on Snow Leopard (OSX 10.6) is a breeze:<br />
<code>sudo port install mimms</code></p>
<p>Installing on Leopard (OSX 10.5) required a slight hack.  After attempting:<br />
<code>sudo port install mimms</code></p>
<p>You&#8217;ll notice a not so friendly error message.  Digging deeper into the log files reveals an undefined parameter &#8216;error: AI_NUMERICSERV not defined&#8217;.  To properly install and compile, you need to edit source code; the mms.c file is located in the MacPorts install directory under macports_sources_rsync.macports.org_release_ports_multimedia_libmss/work/libmms-0.6.2/src/mms.c</p>
<p>Adding the following code did the trick:<br />
<code>#ifndef AI_NUMERICSERV<br />
#define AI_NUMERICSERV 0<br />
#endif<br />
</code></p>
<p>Trying again should work:<br />
<code>sudo port install mimms</code></p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/blog/macports/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone Wallpaper</title>
		<link>http://bobjunior.com/apple/iphone-wallpape/</link>
		<comments>http://bobjunior.com/apple/iphone-wallpape/#comments</comments>
		<pubDate>Mon, 07 Mar 2011 18:19:39 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Apple]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1181</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://bobjunior.com/wp-content/uploads/2011/03/spinner_wallpaper.png" rel="thumbnail"><img src="http://bobjunior.com/wp-content/uploads/2011/03/spinner_wallpaper.png" alt="" title="spinner_wallpaper" width="320" height="480" class="size-full wp-image-1184" /></a><br /></p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/apple/iphone-wallpape/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sharepoint in Windows 7 Explorer</title>
		<link>http://bobjunior.com/windows/sharepoint-in-windows-7-explorer/</link>
		<comments>http://bobjunior.com/windows/sharepoint-in-windows-7-explorer/#comments</comments>
		<pubDate>Wed, 02 Mar 2011 17:53:33 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1177</guid>
		<description><![CDATA[Sharepoint folders can be made available in windows file explorers for easier file management. In Windows XP you can use &#8220;My Network Places&#8221; to easily add an http locations. In [...]]]></description>
			<content:encoded><![CDATA[<p>Sharepoint folders can be made available in windows file explorers for easier file management.<br />
In Windows XP you can use &#8220;My Network Places&#8221; to easily add an http locations.</p>
<p>In windows 7:<br />
1.  Browse to the Sharepoint location<br />
2.  In SharePoint click the ‘Action’ button, and select ‘Open in Windows Explorer’. If this action is not available, grab the url without default.aspx<br />
3.  Right-click Computer, and click &#8216;Add a network location&#8217;</p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/windows/sharepoint-in-windows-7-explorer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HandbrakeCLI Bash Script</title>
		<link>http://bobjunior.com/apple/handbrakecli-bash-script/</link>
		<comments>http://bobjunior.com/apple/handbrakecli-bash-script/#comments</comments>
		<pubDate>Mon, 21 Feb 2011 06:22:47 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Apple]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1167</guid>
		<description><![CDATA[HandbrakeCLI is the command-line version of Handbrake, a popular (and free) video encoding software for OSX.  Place this script in a bin directory and run it inside a folder that [...]]]></description>
			<content:encoded><![CDATA[<p>HandbrakeCLI is the command-line version of Handbrake, a popular (and free) video encoding software for OSX.  Place this script in a bin directory and run it inside a folder that has files that all need to be converted.</p>
<h3>BASH Script</h3>
<p><code></p><pre class="crayon-plain-tag">#!/bin/bash

for file in `ls -1` ; do
	/Applications/HandBrakeCLI -i $file -o $file.m4v --preset=&quot;iPhone &amp; iPod Touch&quot;
done</pre><p></code></p>
<h3>Enumerating Filenames</h3>
<p><code></p><pre class="crayon-plain-tag">#!/bin/bash
total=1
for file in `ls -1` ; do
if [ $total -lt 10 ] ; then
	/Applications/HandBrakeCLI -i $file -o ${1}0${total}.mp4 --preset=&quot;iPhone &amp; iPod Touch&quot;

else
	/Applications/HandBrakeCLI -i $file -o ${1}${total}.mp4 --preset=&quot;iPhone &amp; iPod Touch&quot;
fi
total=$(($total + 1))

done</pre><p></code></p>
<h3>Example</h3>
<p><code>/dir/with/files$/usr/bin/handbrake-dir2iPhone.sh filename</code></p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/apple/handbrakecli-bash-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sphider</title>
		<link>http://bobjunior.com/linux/sphider/</link>
		<comments>http://bobjunior.com/linux/sphider/#comments</comments>
		<pubDate>Fri, 18 Feb 2011 05:55:00 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1050</guid>
		<description><![CDATA[Over time one gains quite a library of PDF files. Everything from how-tos and tutorials to eBooks. I&#8217;ve been searching for quite some time to find a good way to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://bobjunior.com/wp-content/uploads/2011/01/sphider.gif" rel="thumbnail"><img class="alignleft size-thumbnail wp-image-1051" title="sphider" src="http://bobjunior.com/wp-content/uploads/2011/01/sphider-168x108.gif" alt="" width="168" height="108" /></a>Over time one gains quite a library of PDF files.  Everything from how-tos and tutorials to eBooks.  I&#8217;ve been searching for quite some time to find a good way to index these types of documents on a linux-based server.  Microsoft has their solution with Sharepoint and you can get close to a full-indexed solution with tools like Google desktop.  What I really wanted was a good web-based solutions.  Enter Sphider.  It&#8217;s fairly straight forward to give Sphider pdf indexing capability.<br />
<span id="more-1050"></span><br />
<a href="http://www.sphider.eu/">Sphider</a> and <a href="http://www.sphider-plus.eu/">Sphider-plus</a> provide a simple solution for web-based indexing.  They provide a collection of php scripts and commands for administration, indexing, and searching.</p>
<p>Instead of using the built-in converter try this:<br />
1. Download the linux related pre-compiled binary of pdftotext included in the xpdf bundle from: www.foolabs.com/xpdf/download.html<br />
2. Unzip/untar the package and save only the pdftotext file (it has no extension, that&#8217;s ok)<br />
3. Rename &#8220;pdftotext&#8221; to &#8220;pdftotext.script&#8221;<br />
4. Upload via FTP this file to the &#8220;converter&#8221; directory of Sphider-plus<br />
5. Identify the physical path of your web site (your hoster should provide this information anywhere)<br />
6. Create an empty text file and into this write two lines:<br />
#!/bin/sh<br />
/PATH/TO/YOUR/WEB/DOWN/TO/converter/pdftotext.script $1 -<br />
7. Adapt the full path above to your needs and use simple slashes (not double backslashes)<br />
Second line begins with a slash and ends WITH the minus sign!<br />
(Thanks to the user posted this hint sometimes ago)<br />
8. Save this file as &#8220;pdftotext&#8221; (without the quotes)<br />
9. Upload it to the converter dir<br />
10. Set permissions of both pdftotext and pdftotext.script to 755 or 777 (whatever needed to run correctly)<br />
11. Set permissions of the converter dir to 777! Otherwise indexing fails because of pdftotext is unable to write a temp file needed!<br />
12. Last: change the pdftotext path in conf.php to:<br />
$pdftotext_path = &#8216;/PATH/TO/YOUR/WEB/DOWN/TO/converter/pdftotext&#8217;;</p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/linux/sphider/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convmv</title>
		<link>http://bobjunior.com/linux/convmv/</link>
		<comments>http://bobjunior.com/linux/convmv/#comments</comments>
		<pubDate>Thu, 17 Feb 2011 16:55:16 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1163</guid>
		<description><![CDATA[Convmv is a handy little tool to take the headache out of filename changing. If you find yourself moving files around between OSes, you may have come across limitations for [...]]]></description>
			<content:encoded><![CDATA[<p>Convmv is a handy little tool to take the headache out of filename changing.  If you find yourself moving files around between OSes, you may have come across limitations for file names that throw errors like &#8216;incorrect character codes&#8217; or &#8216;Invalid or incomplete multibyte or wide character (84)&#8217; when transferring files between FAT32 and NTFS.  This simple tool renames files to proper utf8 encodings.</p>
<p><strong>Install</strong><br />
<code>#sudo apt-get install convmv</code></p>
<p><strong>Recursive Usage</strong><br />
<code>$convmv -r --notest -f latin1 -t utf-8 /dir</code></p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/linux/convmv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Killing Hidden OS Files</title>
		<link>http://bobjunior.com/linux/killing-hidden-os-files/</link>
		<comments>http://bobjunior.com/linux/killing-hidden-os-files/#comments</comments>
		<pubDate>Thu, 17 Feb 2011 05:27:25 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1156</guid>
		<description><![CDATA[Plugging USB drives into various operating systems automatically starts a rampant process of dropping hidden files all over the place used for indexing, trash directories, and other annoying bit. Here [...]]]></description>
			<content:encoded><![CDATA[<p>Plugging USB drives into various operating systems automatically starts a rampant process of dropping hidden files all over the place used for indexing, trash directories, and other annoying bit.  Here is a list of culprits and how to get rid of them:</p>
<p><strong>Stop OSX Spotlight Indexing</strong><br />
Put an empty file called &#8216;.metadata_never_index&#8217; in the root directory of the removable drive.<br />
<code></p><pre class="crayon-plain-tag">touch .metadata_never_index</pre><p></code></p>
<p><strong>Prevent OSX .Trashes directory</strong><br />
Put an empty file called &#8216;.Trashes&#8217; in the root directory of the removable drive.<br />
<code></p><pre class="crayon-plain-tag">touch .Trashes</pre><p></code></p>
<p><strong>Prevent OSX Event-logging</strong><br />
Make a directory called .fseventsd and inside that folder put a single file named no_log<br />
<code></p><pre class="crayon-plain-tag">mkdir .fseventsd
cd .fseventsd
touch no_log</pre><p></code></p>
<p><strong>Prevent Windows Recycling Bin Files</strong><br />
<code></p><pre class="crayon-plain-tag">touch \$recycling.bin
touch Recycled</pre><p></code></p>
<p><strong>Prevent Windows Recovery Files</strong><br />
<code></p><pre class="crayon-plain-tag">touch System\ Volume\ Information</pre><p></code></p>
<p><strong>BASH script to remove pesky hidden files generated by OSX and Windows</strong><br />
<code></p><pre class="crayon-plain-tag">#!/bin/bash
#Routinely Cleans unnecessary files by OSX and Winows systems
#Place in /etc/cron.weekly

LOCATION=/mnt/dir/
REMOVELIST=( &quot;thumbs.db&quot; &quot;desktop.ini&quot; &quot;.DS_Store&quot; &quot;.desktop&quot; )

echo &quot;Removing Unnecessary Files...&quot;
if [ -d $LOCATION ]; then
    for removefile in ${REMOVELIST[@]}; do
        find $LOCATION -name ${removefile} -exec rm {} \;
    done
fi</pre><p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/linux/killing-hidden-os-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NTFS Headless Linux</title>
		<link>http://bobjunior.com/linux/ntfs-headless-linux/</link>
		<comments>http://bobjunior.com/linux/ntfs-headless-linux/#comments</comments>
		<pubDate>Fri, 11 Feb 2011 05:51:52 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1143</guid>
		<description><![CDATA[NTFS may be the best file format for large-sized drives. To get things working under linux&#8211;especially Ubuntu headless linux servers&#8211;simply install the ntfs-3g drivers: sudo apt-get install ntfs-3g If the [...]]]></description>
			<content:encoded><![CDATA[<p>NTFS may be the best file format for large-sized drives.  To get things working under linux&#8211;especially Ubuntu headless linux servers&#8211;simply install the ntfs-3g drivers:</p>
<p><code>sudo apt-get install ntfs-3g</code></p>
<p>If the drives are on external USBs, add them to the /etc/fstab to get them to load on boot:</p>
<p><code>/dev/hdd1 /media/disk1 ntfs defaults 0 0</code></p>
<p>and with a label:</p>
<p><code>LABEL=NAME /media/disk1 ntfs defaults 0 0</code></p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/linux/ntfs-headless-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Removing SmartWare</title>
		<link>http://bobjunior.com/blog/removing-smartware/</link>
		<comments>http://bobjunior.com/blog/removing-smartware/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 05:27:22 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1133</guid>
		<description><![CDATA[USB and mass storage manufacturers are always coming up with new, annoying ways to get software onto their storage devices. The most cruel of these variants show up as hidden [...]]]></description>
			<content:encoded><![CDATA[<p>USB and mass storage manufacturers are always coming up with new, annoying ways to get software onto their storage devices.  The most cruel of these variants show up as hidden drive or specialty autorun tools.  Normally with the likes of U3 and related technologies, it was fairly easy to remove these with a quick formatting.  The newest incarnation Western Digital called SmartWare is a beast that defies removal.  It keeps a hefty 500GB hidden storage partition made completely unaccessible.  What&#8217;s worse is that it attempts to load SES drivers onto every system it gets attached&#8211;making it nearly useless on systems that you may not have the ability to install drivers.</p>
<p>The solution: Format with <a href="http://files.extremeoverclocking.com/file.php?f=197">HP USB Disk Storage Tool</a>.</p>
<p>Reference from <a href="http://www.dedoimedo.com/computers/passport-vcd.html">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/blog/removing-smartware/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NTFS OSX</title>
		<link>http://bobjunior.com/blog/ntfs-osx/</link>
		<comments>http://bobjunior.com/blog/ntfs-osx/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 05:14:49 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1131</guid>
		<description><![CDATA[With all of the larger drive sizes becoming readily available, it would be nice to have large USB drives to swap between OSs. Usually I&#8217;ve gone with FAT32 to keep [...]]]></description>
			<content:encoded><![CDATA[<p>With all of the larger drive sizes becoming readily available, it would be nice to have large USB drives to swap between OSs.  Usually I&#8217;ve gone with FAT32 to keep things simple and cross compatible, but there are significant issues of partitioning (<2TB) and moving around very large files (over 4GB) on a FAT32 system.</p>
<p>OSX doesn't natively support NTFS, but this can be overcome by installing two free applications:</p>
<p><a href="http://code.google.com/p/macfuse/">macFuse</a> &#038; <a href="http://www.apple.com/downloads/macosx/system_disk_utilities/ntfs3g.html">NTFS-3G for Mac</a></p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/blog/ntfs-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Chrome Fix</title>
		<link>http://bobjunior.com/apple/google-chrome-fix/</link>
		<comments>http://bobjunior.com/apple/google-chrome-fix/#comments</comments>
		<pubDate>Tue, 08 Feb 2011 04:49:10 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Apple]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1129</guid>
		<description><![CDATA[Google Chrome was failing its update application. These steps will get a new install onto OSX: 1) Delete your Google Chrome application from the applications folder; 2) Delete the folder [...]]]></description>
			<content:encoded><![CDATA[<p>Google Chrome was failing its update application.  These steps will get a new install onto OSX:</p>
<p>1) Delete your Google Chrome application from the applications folder;<br />
2) Delete the folder HD/Library/Google<br />
3) Go to HD/Library/Caches and delete any reference of google there;<br />
4) Go to ~/Library/Cache and delete any reference to google;<br />
5) Delete the folder ~/Library/Google<br />
6) Go to ~/Library/Application/Support and delete the Google folder</p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/apple/google-chrome-fix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EzyFit</title>
		<link>http://bobjunior.com/blog/ezyfit/</link>
		<comments>http://bobjunior.com/blog/ezyfit/#comments</comments>
		<pubDate>Wed, 26 Jan 2011 21:00:04 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1087</guid>
		<description><![CDATA[EzyFit is a free Matlab utility to find fitted solutions to data. Never before has linear regressions and fitting algorithms been so easy to apply. This is a wonderful tool [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.fast.u-psud.fr/ezyfit/">EzyFit</a><a href="http://bobjunior.com/wp-content/uploads/2011/01/ezyfit.png" rel="thumbnail"><img src="http://bobjunior.com/wp-content/uploads/2011/01/ezyfit.png" alt="" title="ezyfit" width="65" height="67" class="alignleft size-full wp-image-1093" /></a> is a free Matlab utility to find fitted solutions to data.  Never before has linear regressions and fitting algorithms been so easy to apply.  This is a wonderful tool to measure any dataset.  The most useful feature is the ability to fit to arbitrary equations&#8211;perfect to fit a data sample to a known ideal equation.  In my case, fitting IV curves to an ideal diode equation.</p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/blog/ezyfit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wget Crawler</title>
		<link>http://bobjunior.com/linux/wget-crawler/</link>
		<comments>http://bobjunior.com/linux/wget-crawler/#comments</comments>
		<pubDate>Thu, 20 Jan 2011 16:39:17 +0000</pubDate>
		<dc:creator>BJ</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://bobjunior.com/?p=1063</guid>
		<description><![CDATA[Wget is a simple command line tool to pull down http, ftp, and other web-based resources. Crawling an entire website is as simple as adding the switch -r for recursive. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://bobjunior.com/wp-content/uploads/2010/09/terminal.png" rel="thumbnail"><img src="http://bobjunior.com/wp-content/uploads/2010/09/terminal-168x108.png" alt="" title="terminal" width="168" height="108" class="alignleft size-thumbnail wp-image-961" /></a><a href="http://www.gnu.org/software/wget/">Wget</a> is a simple command line tool to pull down http, ftp, and other web-based resources.  Crawling an entire website is as simple as adding the switch -r for recursive.  Adding a couple of additional options like waiting to pull pages and limiting the bandwidth make for a powerful tool.<br />
<code><br />
wget --wait=20 --limit-rate=20K -r -p -U Mozilla http://www.somewebsite.com<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://bobjunior.com/linux/wget-crawler/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

