<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss 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:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>ByteChemist</title>
	
	<link>http://www.bytechemist.com</link>
	<description />
	<pubDate>Fri, 17 Oct 2008 00:49:30 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
	<language>en</language>
			<geo:lat>36.517261</geo:lat><geo:long>-121.894361</geo:long><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/bytechemist" type="application/rss+xml" /><item>
		<title>SVN Clients</title>
		<link>http://feeds.feedburner.com/~r/bytechemist/~3/423456423/</link>
		<comments>http://www.bytechemist.com/2008/10/16/svn-clients/#comments</comments>
		<pubDate>Fri, 17 Oct 2008 00:49:29 +0000</pubDate>
		<dc:creator>CHEMiST</dc:creator>
		
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.bytechemist.com/?p=21</guid>
		<description><![CDATA[Mac SVN Clients


		Versions
	

		Cornerstone
	

		svnX
	

		SCPlugin
	

		Syncro SVN
	

Windows SVN Clients


		TortoiseSVN
	


<script type="text/javascript">
SHARETHIS.addEntry(
	{
	title: "SVN Clients",
	url: "http://www.bytechemist.com/2008/10/16/svn-clients/"
	}
	
	
);
</script>
	]]></description>
			<content:encoded><![CDATA[<h3>Mac SVN Clients</h3>
<ul>
<li>
		<a href="http://www.versionsapp.com/">Versions</a>
	</li>
<li>
		<a href="http://www.zennaware.com/cornerstone/">Cornerstone</a>
	</li>
<li>
		<a href="http://www.lachoseinteractive.net/en/community/subversion/svnx/features/">svnX</a>
	</li>
<li>
		<a href="http://scplugin.tigris.org/">SCPlugin</a>
	</li>
<li>
		<a href="http://www.syncrosvnclient.com/">Syncro SVN</a>
	</li>
</ul>
<h3>Windows SVN Clients</h3>
<ul>
<li>
		<a href="http://tortoisesvn.tigris.org/">TortoiseSVN</a>
	</li>
</ul>
<p><a href="http://sharethis.com/item?&wp=2.6.1&amp;publisher=00d0df21-bd6e-4d2c-9a41-acd27099c2e9&amp;title=SVN+Clients&amp;url=http%3A%2F%2Fwww.bytechemist.com%2F2008%2F10%2F16%2Fsvn-clients%2F">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.bytechemist.com/2008/10/16/svn-clients/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.bytechemist.com/2008/10/16/svn-clients/</feedburner:origLink></item>
		<item>
		<title>Recover the MySQL Root Password in Linux</title>
		<link>http://feeds.feedburner.com/~r/bytechemist/~3/323612882/</link>
		<comments>http://www.bytechemist.com/2008/06/30/recover-the-mysql-root-password-in-linux/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 23:06:05 +0000</pubDate>
		<dc:creator>CHEMiST</dc:creator>
		
		<category><![CDATA[System Administration]]></category>

		<category><![CDATA[Web Development]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.bytechemist.com/2008/06/30/recover-the-mysql-root-password-in-linux/</guid>
		<description><![CDATA[Step 1 - At the linux shell, stop the current mysqld process, start the mysqld_safe process with &#8211;skip-grant-tables switch and login as root (no password).

/etc/init.d/mysql stop
mysqld_safe --skip-grant-tables &#38;
mysql -u root

Step 2 - At the mysql shell set the root password and flush privileges.

USE mysql;
UPDATE user SET password=PASSWORD&#40;&#34;new-password-here&#34;&#41; WHERE User='root';
FLUSH PRIVILEGES;
QUIT;

Step 3 - Back at the [...]
<script type="text/javascript">
SHARETHIS.addEntry(
	{
	title: "Recover the MySQL Root Password in Linux",
	url: "http://www.bytechemist.com/2008/06/30/recover-the-mysql-root-password-in-linux/"
	}
	
	
);
</script>
	]]></description>
			<content:encoded><![CDATA[<p><strong>Step 1</strong> - At the linux shell, stop the current mysqld process, start the mysqld_safe process with &#8211;skip-grant-tables switch and login as root (no password).</p>

<div class="wp_syntax"><div class="code"><pre class="bash">/etc/init.d/mysql stop
mysqld_safe --skip-grant-tables &amp;
mysql -u root</pre></div></div>

<p><strong>Step 2</strong> - At the mysql shell set the root password and flush privileges.</p>

<div class="wp_syntax"><div class="code"><pre class="mysql"><span style="color: #993333; font-weight: bold;">USE</span> mysql;
<span style="color: #993333; font-weight: bold;">UPDATE</span> user <span style="color: #993333; font-weight: bold;">SET</span> password=PASSWORD<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;new-password-here&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">WHERE</span> User=<span style="color: #ff0000;">'root'</span>;
FLUSH <span style="color: #993333; font-weight: bold;">PRIVILEGES</span>;
QUIT;</pre></div></div>

<p><strong>Step 3</strong> - Back at the linux shell stop the mysqld_safe process and start the normal mysqld process.  At this point you should be able to successfully login as root using the password from Step 2.</p>

<div class="wp_syntax"><div class="code"><pre class="bash">/etc/init.d/mysql stop
/etc/init.d/mysql start
mysql -u root -p</pre></div></div>

<p><a href="http://sharethis.com/item?&wp=2.6.1&amp;publisher=00d0df21-bd6e-4d2c-9a41-acd27099c2e9&amp;title=Recover+the+MySQL+Root+Password+in+Linux&amp;url=http%3A%2F%2Fwww.bytechemist.com%2F2008%2F06%2F30%2Frecover-the-mysql-root-password-in-linux%2F">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.bytechemist.com/2008/06/30/recover-the-mysql-root-password-in-linux/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.bytechemist.com/2008/06/30/recover-the-mysql-root-password-in-linux/</feedburner:origLink></item>
		<item>
		<title>Set MySQL Root Password</title>
		<link>http://feeds.feedburner.com/~r/bytechemist/~3/323612883/</link>
		<comments>http://www.bytechemist.com/2008/06/30/set-mysql-root-password/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 22:45:11 +0000</pubDate>
		<dc:creator>CHEMiST</dc:creator>
		
		<category><![CDATA[System Administration]]></category>

		<category><![CDATA[Web Development]]></category>

		<category><![CDATA[mysql]]></category>

		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.bytechemist.com/2008/06/30/set-mysql-root-password/</guid>
		<description><![CDATA[To reset the MySQL root password, login to the mysql shell and run the following commands.

SET PASSWORD FOR root@localhost=PASSWORD&#40;'RootPasswordHere'&#41;;
FLUSH PRIVILEGES;


<script type="text/javascript">
SHARETHIS.addEntry(
	{
	title: "Set MySQL Root Password",
	url: "http://www.bytechemist.com/2008/06/30/set-mysql-root-password/"
	}
	
	
);
</script>
	]]></description>
			<content:encoded><![CDATA[<p>To reset the MySQL root password, login to the mysql shell and run the following commands.</p>

<div class="wp_syntax"><div class="code"><pre class="mysql"><span style="color: #993333; font-weight: bold;">SET</span> PASSWORD FOR root@localhost=PASSWORD<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'RootPasswordHere'</span><span style="color: #66cc66;">&#41;</span>;
FLUSH <span style="color: #993333; font-weight: bold;">PRIVILEGES</span>;</pre></div></div>

<p><a href="http://sharethis.com/item?&wp=2.6.1&amp;publisher=00d0df21-bd6e-4d2c-9a41-acd27099c2e9&amp;title=Set+MySQL+Root+Password&amp;url=http%3A%2F%2Fwww.bytechemist.com%2F2008%2F06%2F30%2Fset-mysql-root-password%2F">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.bytechemist.com/2008/06/30/set-mysql-root-password/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.bytechemist.com/2008/06/30/set-mysql-root-password/</feedburner:origLink></item>
		<item>
		<title>Grant MySQL Privileges</title>
		<link>http://feeds.feedburner.com/~r/bytechemist/~3/323612884/</link>
		<comments>http://www.bytechemist.com/2008/06/30/grant-mysql-privileges/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 22:41:32 +0000</pubDate>
		<dc:creator>CHEMiST</dc:creator>
		
		<category><![CDATA[System Administration]]></category>

		<category><![CDATA[Web Development]]></category>

		<category><![CDATA[mysql]]></category>

		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.bytechemist.com/2008/06/30/grant-mysql-privileges/</guid>
		<description><![CDATA[To grant all privileges to a user from any location login to the mysql shell and run the following queries.

GRANT ALL PRIVILEGES ON *.* TO username@localhost IDENTIFIED BY 'PasswordHere' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO username@&#34;%&#34; IDENTIFIED BY 'PasswordHere' WITH GRANT OPTION;
FLUSH PRIVILEGES;


<script type="text/javascript">
SHARETHIS.addEntry(
	{
	title: "Grant MySQL Privileges",
	url: "http://www.bytechemist.com/2008/06/30/grant-mysql-privileges/"
	}
	
	
);
</script>
	]]></description>
			<content:encoded><![CDATA[<p>To grant all privileges to a user from any location login to the mysql shell and run the following queries.</p>

<div class="wp_syntax"><div class="code"><pre class="mysql"><span style="color: #993333; font-weight: bold;">GRANT</span> ALL <span style="color: #993333; font-weight: bold;">PRIVILEGES</span> ON *.* TO username@localhost IDENTIFIED <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #ff0000;">'PasswordHere'</span> WITH <span style="color: #993333; font-weight: bold;">GRANT</span> <span style="color: #993333; font-weight: bold;">OPTION</span>;
<span style="color: #993333; font-weight: bold;">GRANT</span> ALL <span style="color: #993333; font-weight: bold;">PRIVILEGES</span> ON *.* TO username@<span style="color: #ff0000;">&quot;%&quot;</span> IDENTIFIED <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #ff0000;">'PasswordHere'</span> WITH <span style="color: #993333; font-weight: bold;">GRANT</span> <span style="color: #993333; font-weight: bold;">OPTION</span>;
FLUSH <span style="color: #993333; font-weight: bold;">PRIVILEGES</span>;</pre></div></div>

<p><a href="http://sharethis.com/item?&wp=2.6.1&amp;publisher=00d0df21-bd6e-4d2c-9a41-acd27099c2e9&amp;title=Grant+MySQL+Privileges&amp;url=http%3A%2F%2Fwww.bytechemist.com%2F2008%2F06%2F30%2Fgrant-mysql-privileges%2F">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.bytechemist.com/2008/06/30/grant-mysql-privileges/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.bytechemist.com/2008/06/30/grant-mysql-privileges/</feedburner:origLink></item>
		<item>
		<title>Apache Cache Control using mod_expires with Expires By Type</title>
		<link>http://feeds.feedburner.com/~r/bytechemist/~3/321600941/</link>
		<comments>http://www.bytechemist.com/2008/06/27/apache-cache-control-using-mod_expires-with-expires-by-type/#comments</comments>
		<pubDate>Fri, 27 Jun 2008 17:14:54 +0000</pubDate>
		<dc:creator>CHEMiST</dc:creator>
		
		<category><![CDATA[System Administration]]></category>

		<category><![CDATA[Web Development]]></category>

		<category><![CDATA[apache]]></category>

		<category><![CDATA[caching]]></category>

		<category><![CDATA[optimization]]></category>

		<guid isPermaLink="false">http://www.bytechemist.com/2008/06/27/apache-cache-control-using-mod_expires-with-expires-by-type/</guid>
		<description><![CDATA[Use Apache&#8217;s mod_expires to explicitly set the expiration of a file by it&#8217;s type.  This will enable to browser to cache these static assets and greatly increase performance.

&#60;IfModule mod_expires.c&#62;
    ExpiresActive on
    ExpiresDefault &#34;now&#34;
    ExpiresByType text/html &#34;now&#34;
    ExpiresByType text/xml &#34;now&#34;
    [...]
<script type="text/javascript">
SHARETHIS.addEntry(
	{
	title: "Apache Cache Control using mod_expires with Expires By Type",
	url: "http://www.bytechemist.com/2008/06/27/apache-cache-control-using-mod_expires-with-expires-by-type/"
	}
	
	
);
</script>
	]]></description>
			<content:encoded><![CDATA[<p>Use Apache&#8217;s mod_expires to explicitly set the expiration of a file by it&#8217;s type.  This will enable to browser to cache these static assets and greatly increase performance.</p>

<div class="wp_syntax"><div class="code"><pre class="bash">&lt;IfModule mod_expires.c&gt;
    ExpiresActive on
    ExpiresDefault <span style="color: #ff0000;">&quot;now&quot;</span>
    ExpiresByType text/html <span style="color: #ff0000;">&quot;now&quot;</span>
    ExpiresByType text/xml <span style="color: #ff0000;">&quot;now&quot;</span>
    ExpiresByType text/css <span style="color: #ff0000;">&quot;access plus 8 hours&quot;</span>
    ExpiresByType text/plain <span style="color: #ff0000;">&quot;access plus 8 hours&quot;</span>
    ExpiresByType application/x-javascript <span style="color: #ff0000;">&quot;access plus 8 hours&quot;</span>
    ExpiresByType application/x-shockwave-flash <span style="color: #ff0000;">&quot;access plus 8 hours&quot;</span>
    ExpiresByType application/pdf <span style="color: #ff0000;">&quot;access plus 8 hours&quot;</span>
    ExpiresByType image/gif <span style="color: #ff0000;">&quot;access plus 8 hours&quot;</span>
    ExpiresByType image/png <span style="color: #ff0000;">&quot;access plus 8 hours&quot;</span>
    ExpiresByType image/jpeg <span style="color: #ff0000;">&quot;access plus 8 hours&quot;</span>
    ExpiresByType image/x-icon <span style="color: #ff0000;">&quot;access plus 8 hours&quot;</span>
    ExpiresByType video/x-flv <span style="color: #ff0000;">&quot;access plus 8 hours&quot;</span>
    ExpiresByType video/quicktime <span style="color: #ff0000;">&quot;access plus 8 hours&quot;</span>
&lt;/IfModule&gt;</pre></div></div>

<p><a href="http://sharethis.com/item?&wp=2.6.1&amp;publisher=00d0df21-bd6e-4d2c-9a41-acd27099c2e9&amp;title=Apache+Cache+Control+using+mod_expires+with+Expires+By+Type&amp;url=http%3A%2F%2Fwww.bytechemist.com%2F2008%2F06%2F27%2Fapache-cache-control-using-mod_expires-with-expires-by-type%2F">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.bytechemist.com/2008/06/27/apache-cache-control-using-mod_expires-with-expires-by-type/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.bytechemist.com/2008/06/27/apache-cache-control-using-mod_expires-with-expires-by-type/</feedburner:origLink></item>
		<item>
		<title>NewsGator, FeedDemon and NetNewsWire RSS Feed Readers</title>
		<link>http://feeds.feedburner.com/~r/bytechemist/~3/215873430/</link>
		<comments>http://www.bytechemist.com/2008/01/12/newsgator-feeddemon-and-netnewswire-rss-feed-readers/#comments</comments>
		<pubDate>Sat, 12 Jan 2008 16:44:44 +0000</pubDate>
		<dc:creator>CHEMiST</dc:creator>
		
		<category><![CDATA[Software]]></category>

		<category><![CDATA[rss]]></category>

		<guid isPermaLink="false">http://www.bytechemist.com/2008/01/12/newsgator-feeddemon-and-netnewswire-rss-feed-readers/</guid>
		<description><![CDATA[There are a ton a excellent desktop and web based RSS feed readers available to choose from.  My favorites by far are FeedDemon for Windows and NetNewsWire for Mac.  
The last few years I&#8217;ve been using both with NewsGator Online to read and sync my news feeds daily.  I&#8217;ve found this to [...]
<script type="text/javascript">
SHARETHIS.addEntry(
	{
	title: "NewsGator, FeedDemon and NetNewsWire RSS Feed Readers",
	url: "http://www.bytechemist.com/2008/01/12/newsgator-feeddemon-and-netnewswire-rss-feed-readers/"
	}
	
	
);
</script>
	]]></description>
			<content:encoded><![CDATA[<p>There are a ton a excellent desktop and web based RSS feed readers available to choose from.  My favorites by far are <a href="http://www.newsgator.com/Individuals/FeedDemon/Default.aspx" title="FeedDemon Product Page">FeedDemon</a> for Windows and <a href="http://www.newsgator.com/Individuals/NetNewsWire/Default.aspx" title="NetNewsWire Product Page">NetNewsWire</a> for Mac.  </p>
<p>The last few years I&#8217;ve been using both with <a href="http://www.newsgator.com/Individuals/NewsGatorOnline/Default.aspx" title="NewsGator Online Product Page">NewsGator Online</a> to read and sync my news feeds daily.  I&#8217;ve found this to be the perfect combo, allowing me to move from one machine to the other without seeing the same news item twice.</p>
<p>Earlier this week it was <a href="http://blogs.newsgator.com/daily/2008/01/in-the-news-new.html" title="NewsGator Press Page">announced</a> that both FeedDemon and NetNewsWire would be available for <strong>FREE</strong> (previously $30 each).  If you&#8217;ve been looking for a commercial quality RSS feed reader then I highly recommend you give these a shot!</p>
<h4>NewsGator Online</h4>
<p><a href="http://www.newsgator.com/Individuals/NewsGatorOnline/Default.aspx" title="NewsGator Online Product Page"><img src='http://www.bytechemist.com/wp-content/uploads/2008/01/newsgator-online-screenshot.jpg' alt='NewsGator Online Screenshot' /></a></p>
<h4>FeedDemon</h4>
<p><a href="http://www.newsgator.com/Individuals/FeedDemon/Default.aspx" title="FeedDemon Product Page"><img src='http://www.bytechemist.com/wp-content/uploads/2008/01/feeddemon-screenshot.jpg' alt='FeedDemon Screenshot' /></a></p>
<h4>NetNewsWire</h4>
<p><a href="http://www.newsgator.com/Individuals/NetNewsWire/Default.aspx" title="NetNewsWire Product Page"><img src='http://www.bytechemist.com/wp-content/uploads/2008/01/netnewswire-screenshot.jpg' alt='NetNewsWire Screenshot' /></a></p>
<p><a href="http://sharethis.com/item?&wp=2.6.1&amp;publisher=00d0df21-bd6e-4d2c-9a41-acd27099c2e9&amp;title=NewsGator%2C+FeedDemon+and+NetNewsWire+RSS+Feed+Readers&amp;url=http%3A%2F%2Fwww.bytechemist.com%2F2008%2F01%2F12%2Fnewsgator-feeddemon-and-netnewswire-rss-feed-readers%2F">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.bytechemist.com/2008/01/12/newsgator-feeddemon-and-netnewswire-rss-feed-readers/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.bytechemist.com/2008/01/12/newsgator-feeddemon-and-netnewswire-rss-feed-readers/</feedburner:origLink></item>
		<item>
		<title>Using the ternary operator in PHP</title>
		<link>http://feeds.feedburner.com/~r/bytechemist/~3/215826822/</link>
		<comments>http://www.bytechemist.com/2008/01/11/using-the-ternary-operator-in-php/#comments</comments>
		<pubDate>Sat, 12 Jan 2008 02:43:15 +0000</pubDate>
		<dc:creator>CHEMiST</dc:creator>
		
		<category><![CDATA[Web Development]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.bytechemist.com/2008/01/11/using-the-ternary-operator-in-php/</guid>
		<description><![CDATA[The ternary operator is an excellent and often underutilized way to quickly evaluate a variable in place of an if/else statement.  The syntax is clean and can greatly simplify code.

&#40; expr1 &#41; ? &#40; expr2 &#41; : &#40; expr3 &#41;

Take the following code for example where we determine how to greet a user.

&#60;?php
  [...]
<script type="text/javascript">
SHARETHIS.addEntry(
	{
	title: "Using the ternary operator in PHP",
	url: "http://www.bytechemist.com/2008/01/11/using-the-ternary-operator-in-php/"
	}
	
	
);
</script>
	]]></description>
			<content:encoded><![CDATA[<p>The ternary operator is an excellent and often underutilized way to quickly evaluate a variable in place of an if/else statement.  The syntax is clean and can greatly simplify code.</p>

<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #66cc66;">&#40;</span> expr1 <span style="color: #66cc66;">&#41;</span> ? <span style="color: #66cc66;">&#40;</span> expr2 <span style="color: #66cc66;">&#41;</span> : <span style="color: #66cc66;">&#40;</span> expr3 <span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>Take the following code for example where we determine how to greet a user.</p>

<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
    <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066;">isset</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$user</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        <span style="color: #000066;">echo</span> <span style="color: #0000ff;">$user</span>-&gt;<span style="color: #006600;">name</span>;
    <span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span>
        <span style="color: #000066;">echo</span> <span style="color: #ff0000;">&quot;Guest&quot;</span>;
    <span style="color: #66cc66;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>The code above is simple enough but let&#8217;s see how we can improve it by refactoring using a ternary operator.</p>

<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000066;">echo</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000066;">isset</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$user</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> ? <span style="color: #0000ff;">$user</span>-&gt;<span style="color: #006600;">name</span> : <span style="color: #ff0000;">&quot;Guest&quot;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p><strong>Update 1:</strong> There is a <a href="http://php.dzone.com/news/php-shorthand-if-else-examples">great collection</a> of examples over at dzone.</p>
<p><strong>Update 2:</strong> Found another nice <a href="http://php.dzone.com/news/tips-tricks-learning-ternary-o">tips and tricks</a> post over at dzone.</p>
<p><strong>Update 3:</strong> One more to <a href="http://mikebernat.com/blog/The_Ternary_Operator">check out</a>.</p>
<p><a href="http://sharethis.com/item?&wp=2.6.1&amp;publisher=00d0df21-bd6e-4d2c-9a41-acd27099c2e9&amp;title=Using+the+ternary+operator+in+PHP&amp;url=http%3A%2F%2Fwww.bytechemist.com%2F2008%2F01%2F11%2Fusing-the-ternary-operator-in-php%2F">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.bytechemist.com/2008/01/11/using-the-ternary-operator-in-php/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.bytechemist.com/2008/01/11/using-the-ternary-operator-in-php/</feedburner:origLink></item>
		<item>
		<title>Using Rsync over SSH</title>
		<link>http://feeds.feedburner.com/~r/bytechemist/~3/215826823/</link>
		<comments>http://www.bytechemist.com/2008/01/10/using-rsync-over-ssh/#comments</comments>
		<pubDate>Fri, 11 Jan 2008 04:42:02 +0000</pubDate>
		<dc:creator>CHEMiST</dc:creator>
		
		<category><![CDATA[System Administration]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[rsync]]></category>

		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.bytechemist.com/2008/01/10/using-rsync-over-ssh/</guid>
		<description><![CDATA[Prerequisites

First make sure that you are able to login to the remote host using ssh key authentication.

Basic Syntax

To sync files from a local directory to a remote directory use the following syntax:

rsync &#123;options&#125; -e ssh &#123;source&#125; &#123;dest&#125;


Example

Here is an example that exclude all .psd and .fla files:

rsync --exclude *.psd \
      [...]
<script type="text/javascript">
SHARETHIS.addEntry(
	{
	title: "Using Rsync over SSH",
	url: "http://www.bytechemist.com/2008/01/10/using-rsync-over-ssh/"
	}
	
	
);
</script>
	]]></description>
			<content:encoded><![CDATA[<h4>Prerequisites</h4>
<p>
First make sure that you are able to login to the remote host using <a href="/2008/01/08/ssh-login-using-public-key-authentication/" title="SSH Login Using Public Key Authentication">ssh key authentication</a>.
</p>
<h4>Basic Syntax</h4>
<p>
To sync files from a local directory to a remote directory use the following syntax:</p>

<div class="wp_syntax"><div class="code"><pre class="bash">rsync <span style="color: #7a0874; font-weight: bold;">&#123;</span>options<span style="color: #7a0874; font-weight: bold;">&#125;</span> -e <span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">source</span><span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>dest<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

</p>
<h4>Example</h4>
<p>
Here is an example that exclude all .psd and .fla files:</p>

<div class="wp_syntax"><div class="code"><pre class="bash">rsync --exclude *.psd \
        --exclude *.fla \
        -avz -e <span style="color: #c20cb9; font-weight: bold;">ssh</span> /<span style="color: #7a0874; font-weight: bold;">local</span>/<span style="color: #c20cb9; font-weight: bold;">dir</span>/ user@remotehost:/remote/<span style="color: #c20cb9; font-weight: bold;">dir</span>/</pre></div></div>
</p>
<p><a href="http://sharethis.com/item?&wp=2.6.1&amp;publisher=00d0df21-bd6e-4d2c-9a41-acd27099c2e9&amp;title=Using+Rsync+over+SSH&amp;url=http%3A%2F%2Fwww.bytechemist.com%2F2008%2F01%2F10%2Fusing-rsync-over-ssh%2F">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.bytechemist.com/2008/01/10/using-rsync-over-ssh/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.bytechemist.com/2008/01/10/using-rsync-over-ssh/</feedburner:origLink></item>
		<item>
		<title>Using tar and gzip to Compress Files and Directories</title>
		<link>http://feeds.feedburner.com/~r/bytechemist/~3/215826824/</link>
		<comments>http://www.bytechemist.com/2008/01/09/using-tar-and-gzip-to-compress-files-and-directories/#comments</comments>
		<pubDate>Wed, 09 Jan 2008 22:04:00 +0000</pubDate>
		<dc:creator>CHEMiST</dc:creator>
		
		<category><![CDATA[System Administration]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[tar]]></category>

		<guid isPermaLink="false">http://www.bytechemist.com/2008/01/09/using-tar-and-gzip-to-compress-files-and-directories/</guid>
		<description><![CDATA[Create and Compress and Archive
Archive a group of files:

tar -czvf archive.tar.gz file1 file2 file3

Archive an entire directory:

tar -czvf archive.tar.gz directory/

Extract a Compressed Archive

tar -xzvf archive.tar.gz

List the Contents of a Compressed Archive

tar -tzvf archive.tar.gz

Common tar Switches

-c create a new archive
-x extract files from an archive
-t list the contents of an archive
-z filter the archive through gzip
-v [...]
<script type="text/javascript">
SHARETHIS.addEntry(
	{
	title: "Using tar and gzip to Compress Files and Directories",
	url: "http://www.bytechemist.com/2008/01/09/using-tar-and-gzip-to-compress-files-and-directories/"
	}
	
	
);
</script>
	]]></description>
			<content:encoded><![CDATA[<h4>Create and Compress and Archive</h4>
<h5>Archive a group of files:</h5>

<div class="wp_syntax"><div class="code"><pre class="bash"><span style="color: #c20cb9; font-weight: bold;">tar</span> -czvf archive.<span style="color: #c20cb9; font-weight: bold;">tar</span>.gz file1 file2 file3</pre></div></div>

<h5>Archive an entire directory:</h5>

<div class="wp_syntax"><div class="code"><pre class="bash"><span style="color: #c20cb9; font-weight: bold;">tar</span> -czvf archive.<span style="color: #c20cb9; font-weight: bold;">tar</span>.gz directory/</pre></div></div>

<h4>Extract a Compressed Archive</h4>

<div class="wp_syntax"><div class="code"><pre class="bash"><span style="color: #c20cb9; font-weight: bold;">tar</span> -xzvf archive.<span style="color: #c20cb9; font-weight: bold;">tar</span>.gz</pre></div></div>

<h4>List the Contents of a Compressed Archive</h4>

<div class="wp_syntax"><div class="code"><pre class="bash"><span style="color: #c20cb9; font-weight: bold;">tar</span> -tzvf archive.<span style="color: #c20cb9; font-weight: bold;">tar</span>.gz</pre></div></div>

<h4>Common tar Switches</h4>
<ul>
<li><code>-c</code> create a new archive</li>
<li><code>-x</code> extract files from an archive</li>
<li><code>-t</code> list the contents of an archive</li>
<li><code>-z</code> filter the archive through gzip</li>
<li><code>-v</code> verbosely list files processed</li>
<li><code>-f</code> filename of the archive (filename must always immediately follow)</li>
</ul>
<p><a href="http://sharethis.com/item?&wp=2.6.1&amp;publisher=00d0df21-bd6e-4d2c-9a41-acd27099c2e9&amp;title=Using+tar+and+gzip+to+Compress+Files+and+Directories&amp;url=http%3A%2F%2Fwww.bytechemist.com%2F2008%2F01%2F09%2Fusing-tar-and-gzip-to-compress-files-and-directories%2F">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.bytechemist.com/2008/01/09/using-tar-and-gzip-to-compress-files-and-directories/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.bytechemist.com/2008/01/09/using-tar-and-gzip-to-compress-files-and-directories/</feedburner:origLink></item>
		<item>
		<title>SSH Login Using Public Key Authentication</title>
		<link>http://feeds.feedburner.com/~r/bytechemist/~3/215826825/</link>
		<comments>http://www.bytechemist.com/2008/01/08/ssh-login-using-public-key-authentication/#comments</comments>
		<pubDate>Wed, 09 Jan 2008 05:36:38 +0000</pubDate>
		<dc:creator>CHEMiST</dc:creator>
		
		<category><![CDATA[System Administration]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www-bytechemist-com.hal.pixus.lan/2008/01/08/ssh-login-using-public-key-authentication/</guid>
		<description><![CDATA[Step 1: Generate Keypair on Localmachine

ssh-keygen -t dsa


When prompted for a passphrase you can leave it empty to enable logging in without a password (please note that there are potential security issues with doing this).


After confirming your passphrase at the second prompt you&#8217;ll find two new files (the keypair) in your ~/.ssh directory.  The [...]
<script type="text/javascript">
SHARETHIS.addEntry(
	{
	title: "SSH Login Using Public Key Authentication",
	url: "http://www.bytechemist.com/2008/01/08/ssh-login-using-public-key-authentication/"
	}
	
	
);
</script>
	]]></description>
			<content:encoded><![CDATA[<h4>Step 1: Generate Keypair on Localmachine</h4>

<div class="wp_syntax"><div class="code"><pre class="bash"><span style="color: #c20cb9; font-weight: bold;">ssh-keygen</span> -t dsa</pre></div></div>

<p>
When prompted for a passphrase you can leave it empty to enable logging in without a password (please note that there are potential security issues with doing this).
</p>
<p>
After confirming your passphrase at the second prompt you&#8217;ll find two new files (the keypair) in your <code>~/.ssh</code> directory.  The first file <code>id_dsa</code> is your private key, the second file <code>id_dsa.pub</code> your public key.
</p>
<h4>Step 2: Set Local ~/.ssh Permissions</h4>

<div class="wp_syntax"><div class="code"><pre class="bash"><span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">700</span> ~/.<span style="color: #c20cb9; font-weight: bold;">ssh</span></pre></div></div>

<h4>Step 3: Copy Public Key to Remote Server</h4>

<div class="wp_syntax"><div class="code"><pre class="bash"><span style="color: #c20cb9; font-weight: bold;">scp</span> ~/.<span style="color: #c20cb9; font-weight: bold;">ssh</span>/id_dsa.pub username@remoteserver:~/id_dsa.pub</pre></div></div>

<h4>Step 4: Login to Remote Server:</h4>

<div class="wp_syntax"><div class="code"><pre class="bash"><span style="color: #c20cb9; font-weight: bold;">ssh</span> username@remoteserver</pre></div></div>

<h4>Step 5: Update Authorized Keys on Remote Server</h4>

<div class="wp_syntax"><div class="code"><pre class="bash"><span style="color: #c20cb9; font-weight: bold;">cat</span> id_dsa.pub &gt;&gt; ~/.<span style="color: #c20cb9; font-weight: bold;">ssh</span>/authorized_keys</pre></div></div>

<h4>Step 6: Set Remote ~/.ssh Permissions</h4>

<div class="wp_syntax"><div class="code"><pre class="bash"><span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">600</span> ~/.<span style="color: #c20cb9; font-weight: bold;">ssh</span>/authorized_keys</pre></div></div>

<h4>Done!</h4>
<p>
At this point you should be able to login to the remote server without using a password.
</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span style="color: #c20cb9; font-weight: bold;">ssh</span> username@remoteserver
 - or - 
<span style="color: #c20cb9; font-weight: bold;">ssh</span> -i ~/.<span style="color: #c20cb9; font-weight: bold;">ssh</span>/id_dsa username@remoteserver</pre></div></div>

<p><a href="http://sharethis.com/item?&wp=2.6.1&amp;publisher=00d0df21-bd6e-4d2c-9a41-acd27099c2e9&amp;title=SSH+Login+Using+Public+Key+Authentication&amp;url=http%3A%2F%2Fwww.bytechemist.com%2F2008%2F01%2F08%2Fssh-login-using-public-key-authentication%2F">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.bytechemist.com/2008/01/08/ssh-login-using-public-key-authentication/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.bytechemist.com/2008/01/08/ssh-login-using-public-key-authentication/</feedburner:origLink></item>
	<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetFeedData?uri=bytechemist</feedburner:awareness></channel>
</rss><!-- Dynamic Page Served (once) in 0.250 seconds --><!-- Cached page served by WP-Cache -->
