<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tech Blog is Tech &#187; Linux</title>
	<atom:link href="http://www.techblogistech.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.techblogistech.com</link>
	<description>Exploring technology in the modern world</description>
	<lastBuildDate>Sat, 04 May 2013 14:10:47 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>ImageMagick Tips and Tricks</title>
		<link>http://www.techblogistech.com/2013/05/imagemagick-tips-and-tricks/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=imagemagick-tips-and-tricks</link>
		<comments>http://www.techblogistech.com/2013/05/imagemagick-tips-and-tricks/#comments</comments>
		<pubDate>Sat, 04 May 2013 11:29:31 +0000</pubDate>
		<dc:creator>sean</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[annotate]]></category>
		<category><![CDATA[convert]]></category>
		<category><![CDATA[crop]]></category>
		<category><![CDATA[fonts]]></category>
		<category><![CDATA[imagemagick]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[rmagick]]></category>
		<category><![CDATA[trim]]></category>
		<category><![CDATA[whitespace]]></category>

		<guid isPermaLink="false">http://www.techblogistech.com/?p=1046</guid>
		<description><![CDATA[I&#8217;ve been using ImageMagick in one of my projects and I&#8217;ve had to do quite a bit of Googling. Below &#8230; <span class="more-link"><a href="http://www.techblogistech.com/2013/05/imagemagick-tips-and-tricks/">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.techblogistech.com/wp-content/uploads/2011/07/oxygen-utilities-terminal.png" rel="shadowbox[sbpost-1046];player=img;"><img class="lazy alignright size-full wp-image-104" title="Terminal" src="http://www.techblogistech.com/wp-content/plugins/jquery-image-lazy-loading/images/grey.gif" data-original="http://www.techblogistech.com/wp-content/uploads/2011/07/oxygen-utilities-terminal.png" alt="Terminal" width="77" height="77" /><noscript><img class="alignright size-full wp-image-104" title="Terminal" src="http://www.techblogistech.com/wp-content/uploads/2011/07/oxygen-utilities-terminal.png" alt="Terminal" width="77" height="77" /></noscript></a>I&#8217;ve been using ImageMagick in one of my projects and I&#8217;ve had to do quite a bit of Googling. Below are some tips and tricks I&#8217;ve collected that might be useful to others.</p>
<h3 class="more-space">Trim Whitespace From Your Image</h3>
<pre class="bash">
$ convert -trim img.png
</pre>
<h3 class="more-space">Create A New Image From Text</h3>
<p>Note: You can combine this with the &#8216;trim&#8217; tip above by passing the <strong>-trim</strong> argument.</p>
<pre class="bash">
$ convert -background white -fill black -pointsize 72 label:"Sean Fox" output.png
</pre>
<p>Output:<br />
<a href="http://www.techblogistech.com/wp-content/uploads/2013/05/imagemagick_convert_text.png" rel="shadowbox[sbpost-1046];player=img;"><img src="http://www.techblogistech.com/wp-content/plugins/jquery-image-lazy-loading/images/grey.gif" data-original="http://www.techblogistech.com/wp-content/uploads/2013/05/imagemagick_convert_text.png" alt="ImageMagick Converted Text" width="300" height="55" class="lazy alignnone size-full wp-image-1047" /><noscript><img src="http://www.techblogistech.com/wp-content/uploads/2013/05/imagemagick_convert_text.png" alt="ImageMagick Converted Text" width="300" height="55" class="alignnone size-full wp-image-1047" /></noscript></a></p>
<h3 class="more-space">List Fonts ImageMagick Can Use</h3>
<pre class="bash">
$ identify -list font
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.techblogistech.com/2013/05/imagemagick-tips-and-tricks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Normalizing Line Endings Across Multiple Files</title>
		<link>http://www.techblogistech.com/2012/10/normalizing-line-endings-across-multiple-files/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=normalizing-line-endings-across-multiple-files</link>
		<comments>http://www.techblogistech.com/2012/10/normalizing-line-endings-across-multiple-files/#comments</comments>
		<pubDate>Wed, 10 Oct 2012 15:55:47 +0000</pubDate>
		<dc:creator>sean</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[argdo]]></category>
		<category><![CDATA[args]]></category>
		<category><![CDATA[cr]]></category>
		<category><![CDATA[crlf]]></category>
		<category><![CDATA[dos]]></category>
		<category><![CDATA[dos2unix]]></category>
		<category><![CDATA[ffs]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[inconsistent]]></category>
		<category><![CDATA[lf]]></category>
		<category><![CDATA[line endings]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[unix2dos]]></category>
		<category><![CDATA[vim]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.techblogistech.com/?p=913</guid>
		<description><![CDATA[Recently I&#8217;ve been noticing some of my C# files have inconsistent line endings. The Problem The line endings in the &#8230; <span class="more-link"><a href="http://www.techblogistech.com/2012/10/normalizing-line-endings-across-multiple-files/">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.techblogistech.com/wp-content/uploads/2011/07/oxygen-utilities-terminal.png" rel="shadowbox[sbpost-913];player=img;"><img class="lazy alignright size-full wp-image-104" title="Terminal" src="http://www.techblogistech.com/wp-content/plugins/jquery-image-lazy-loading/images/grey.gif" data-original="http://www.techblogistech.com/wp-content/uploads/2011/07/oxygen-utilities-terminal.png" alt="Terminal" width="77" height="77" /><noscript><img class="alignright size-full wp-image-104" title="Terminal" src="http://www.techblogistech.com/wp-content/uploads/2011/07/oxygen-utilities-terminal.png" alt="Terminal" width="77" height="77" /></noscript></a> Recently I&#8217;ve been noticing some of my C# files have inconsistent line endings.</p>
<p><a href="http://www.techblogistech.com/wp-content/uploads/2012/10/visual_studio_inconsistent_line_endings.png" rel="shadowbox[sbpost-913];player=img;"><img src="http://www.techblogistech.com/wp-content/plugins/jquery-image-lazy-loading/images/grey.gif" data-original="http://www.techblogistech.com/wp-content/uploads/2012/10/visual_studio_inconsistent_line_endings.png" alt="Visual Studio: Inconsistent Line Endings" title="Visual Studio: Inconsistent Line Endings" width="447" height="238" class="lazy alignnone size-full wp-image-914" /><noscript><img src="http://www.techblogistech.com/wp-content/uploads/2012/10/visual_studio_inconsistent_line_endings.png" alt="Visual Studio: Inconsistent Line Endings" title="Visual Studio: Inconsistent Line Endings" width="447" height="238" class="alignnone size-full wp-image-914" /></noscript></a></p>
<h2>The Problem</h2>
<pre>
The line endings in the following file are not consistent. Do you want to normalize the line endings?
</pre>
<p>This probably means some of the developers have been editing our source code using a text-editor (instead of Visual Studio) and they had their line endings set to &#8220;Unix&#8221; or &#8220;Mac&#8221; instead of &#8220;Dos/Windows&#8221;. This isn&#8217;t a big deal, though it is annoying.</p>
<h2>Vim: Convert All Files to Dos/Windows Line Endings</h2>
<p>Since I don&#8217;t know which files have this problem, I decided to just normalize all the line endings. There are various ways to do this, but I chose to use <a href="http://www.vim.org/" title="Vim" target="_blank">vim</a> since the <a href="http://vim.wikia.com/wiki/File_format" title="Vim: File Format" target="_blank">documentation on this topic</a> is excellent.</p>
<p>To convert from any mixture of CRLF endings and LF-only endings, to CRLF endings:</p>
<pre class="bash">
:set ffs=dos
:args **\*.cs
:argdo w
</pre>
<p>We&#8217;re basically asking <strong>vim</strong> to assume Dos/Windows line endings, having it open all *.cs files (C# code files), then having it write the line-ending changes.</p>
<h2>Downsides</h2>
<p>This does change every single file that was found, regardless of the original line endings. It&#8217;s best to do this as one commit in source control to avoid any confusion.</p>
<h2>Alternatives</h2>
<p>You can also use <a href="http://en.wikipedia.org/wiki/Unix2dos" title="unix2dos" target="_blank">unix2dos</a> to do this conversion or any scripting language (python, perl, powershell).</p>
<p>Some people also let their source control handle their line endings. <a href="http://git-scm.com/" title="Git" target="_blank">Git</a> can enforce these line endings by updating them for you if you prefer. However, at my office, we choose not to let our source control alter our code in any way; we prefer to do that ourselves. <img src='http://www.techblogistech.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Now get back to coding!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.techblogistech.com/2012/10/normalizing-line-endings-across-multiple-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Regenerating Your SSH Public Key from Your SSH Private Key</title>
		<link>http://www.techblogistech.com/2012/07/regenerating-your-ssh-public-key/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=regenerating-your-ssh-public-key</link>
		<comments>http://www.techblogistech.com/2012/07/regenerating-your-ssh-public-key/#comments</comments>
		<pubDate>Tue, 24 Jul 2012 17:56:54 +0000</pubDate>
		<dc:creator>sean</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[bitbucket]]></category>
		<category><![CDATA[dsa]]></category>
		<category><![CDATA[generate]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[key]]></category>
		<category><![CDATA[keygen]]></category>
		<category><![CDATA[keypair]]></category>
		<category><![CDATA[private]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[public]]></category>
		<category><![CDATA[regenerate]]></category>
		<category><![CDATA[restore]]></category>
		<category><![CDATA[rsa]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[ssh-keygen]]></category>

		<guid isPermaLink="false">http://www.techblogistech.com/?p=892</guid>
		<description><![CDATA[Have you ever found yourself in a situation where you had your SSH private key, but not your public key? &#8230; <span class="more-link"><a href="http://www.techblogistech.com/2012/07/regenerating-your-ssh-public-key/">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.techblogistech.com/wp-content/uploads/2011/07/oxygen-utilities-terminal.png" rel="shadowbox[sbpost-892];player=img;"><img class="lazy alignright size-full wp-image-104" title="Terminal" src="http://www.techblogistech.com/wp-content/plugins/jquery-image-lazy-loading/images/grey.gif" data-original="http://www.techblogistech.com/wp-content/uploads/2011/07/oxygen-utilities-terminal.png" alt="Terminal" width="77" height="77" /><noscript><img class="alignright size-full wp-image-104" title="Terminal" src="http://www.techblogistech.com/wp-content/uploads/2011/07/oxygen-utilities-terminal.png" alt="Terminal" width="77" height="77" /></noscript></a> Have you ever found yourself in a situation where you had your SSH private key, but not your public key? Maybe you copied your private key to a new laptop, but then realized you need your public key so your coworker can add you to the new Git repo. Or maybe you just plain lost your public key or have no idea what happened to it. But guess what, that&#8217;s not a problem! Because you can regenerate it!</p>
<h2>Using ssh-keygen</h2>
<p>The <strong>ssh-keygen</strong> command allows you to regenerate a public key using the <strong>-y</strong> flag. Using the <strong>-t</strong> flag you can tell it whether the key is <strong>rsa</strong> or <strong>dsa</strong>.</p>
<h3>Is my key RSA or DSA?</h3>
<p>Chances are it doesn&#8217;t matter; <strong>ssh-keygen</strong> will try to guess based on the input key.  However, if you don&#8217;t know your key encryption, it&#8217;s probably <strong>rsa</strong> since that&#8217;s the default. The filename will also typically tell you, since it&#8217;s usually either <strong>id_rsa</strong> or <strong>id_dsa</strong>. And even beyond that, if you look at the text in the file, it should be present there as well.</p>
<h2>Regenerating a Public Key</h2>
<p>Here&#8217;s an example:</p>
<pre class="bigbash">
# ssh-keygen -y
Enter file in which the key is (/home/username/.ssh/id_rsa):
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAr3T65FaSononqBjGEZXMg8x0U3ZjYvZxAUZQA7H27VtPgrn9FhsP8Jn+sp0zOi2nFjDsbXWM5L6OPVg1N0OHpiNcg7I
lrc83GiqVGg2AWeHWWolnOwXIsrfwybVcS6ZSCGbGKVWWL5VB/mt/zzF5WD6bhU+TZXYLq8fZC4sa0sapqVccubKw2YbjA53n0wKxrYLfOjP1k56EfkHzm4n7fmlyFi
3kaCvPo31yaMD3zIVJnl/4wMntnnxqFkG7mEtQ29ngkc5ocgRvSbNNvD9IFNvL/9BqlUtiOUcV790cdoLyd0o1mFV8sGPY3zsL6l3lTkjYDmSXTTnxavjHEudC5w==
</pre>
<p>BAM! There&#8217;s your public key!</p>
<h2>Is this safe?</h2>
<p>Yes, regenerating your key is completely safe and there&#8217;s no reason why you wouldn&#8217;t want to do this. Public keys are <strong>public</strong>, just as their name implies. You can give your public key to anyone.</p>
<p>The private key is the one you should keep to yourself and safe-guard. You should be the only one with your private key, and there&#8217;s no reason you should not be able to get a copy of your own public key.</p>
<p>&#8211;</p>
<p>Now save that public key somewhere safe so you don&#8217;t have to generate it every time!</p>
<p>Happy authenticating!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techblogistech.com/2012/07/regenerating-your-ssh-public-key/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enabling SSH/SFTP Updates in WordPress on Amazon EC2 and CentOS</title>
		<link>http://www.techblogistech.com/2012/03/enabling-sshsftp-updates-in-wordpress-on-amazon-ec2-and-centos/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=enabling-sshsftp-updates-in-wordpress-on-amazon-ec2-and-centos</link>
		<comments>http://www.techblogistech.com/2012/03/enabling-sshsftp-updates-in-wordpress-on-amazon-ec2-and-centos/#comments</comments>
		<pubDate>Sun, 18 Mar 2012 19:30:00 +0000</pubDate>
		<dc:creator>sean</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[blogging]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[libssh2]]></category>
		<category><![CDATA[pear]]></category>
		<category><![CDATA[pecl]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[sftp]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[ssh2]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.techblogistech.com/?p=792</guid>
		<description><![CDATA[The WordPress blogging platform does support installing and updating your plugins using SSH/SFTP! So, why is it that it doesn&#8217;t &#8230; <span class="more-link"><a href="http://www.techblogistech.com/2012/03/enabling-sshsftp-updates-in-wordpress-on-amazon-ec2-and-centos/">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.techblogistech.com/wp-content/uploads/2012/03/wordpress-logo.png" rel="shadowbox[sbpost-792];player=img;"><img src="http://www.techblogistech.com/wp-content/plugins/jquery-image-lazy-loading/images/grey.gif" data-original="http://www.techblogistech.com/wp-content/uploads/2012/03/wordpress-logo-150x150.png" alt="Wordpress" title="Wordpress" width="77" height="77" class="lazy alignright size-thumbnail wp-image-793" /><noscript><img src="http://www.techblogistech.com/wp-content/uploads/2012/03/wordpress-logo-150x150.png" alt="Wordpress" title="Wordpress" width="77" height="77" class="alignright size-thumbnail wp-image-793" /></noscript></a>The WordPress blogging platform <strong>does</strong> support installing and updating your plugins using SSH/SFTP!  So, why is it that it doesn&#8217;t show up as an option when updating your plugins?</p>
<p>Well, as it turns out, your PHP installation must be configured to support SSH before this option will show up in your WordPress dashboard.  In this article I&#8217;ll explain how to set this up using <a href="#libssh2" title="Install libssh2">just a few simple commands</a> or <a href="#plugin" title="Install the plugin">a plugin</a>.</p>
<p><span id="more-792"></span></p>
<p><a name="libssh2"></a><br />
<h1>Option 1: Install libssh2 and use the built-in WordPress SSH/SFTP Support</h1>
<p>The upside of following this guide instead of installing <a href="#plugin" title="Install the plugin">the plugin</a> is you&#8217;ll be installing libssh2, which means you&#8217;re enabling SSH/SFTP support across all PHP applications.  You&#8217;re also be enabling and using the built-in WordPress support for SSH/SFTP, which is updated and supported with each new release.  I personally followed this method, so I can also confirm that it works first-hand.  The downside to this guide, of course, is that it takes a bit longer.</p>
<h2>Step 1: See if it&#8217;s enabled already</h2>
<p>Chances are SSH/SFTP is <strong>not</strong> enabled already, but it doesn&#8217;t hurt to check.  If SSH is <strong>not enabled</strong>, your WordPress connection info page should look like this when you go to install updates:<br />
<a href="http://www.techblogistech.com/wp-content/uploads/2012/03/php-ssh2-connection-info-1.png" rel="shadowbox[sbpost-792];player=img;"><img src="http://www.techblogistech.com/wp-content/plugins/jquery-image-lazy-loading/images/grey.gif" data-original="http://www.techblogistech.com/wp-content/uploads/2012/03/php-ssh2-connection-info-1-1024x270.png" alt="" title="php-ssh2-connection-info-1" width="768" height="202" class="lazy alignnone size-large wp-image-795" /><noscript><img src="http://www.techblogistech.com/wp-content/uploads/2012/03/php-ssh2-connection-info-1-1024x270.png" alt="" title="php-ssh2-connection-info-1" width="768" height="202" class="alignnone size-large wp-image-795" /></noscript></a></p>
<p>Notice the distinct lack of an SSH/SFTP option.  If this is what your page looks like, continue with the instructions below!</p>
<h2>Step 2: Install all the development tools you&#8217;ll need</h2>
<p>We&#8217;ll be installing the PHP package for <a href="http://www.libssh2.org/" title="LibSSH2" target="_blank">libssh2</a>, which will be compiled from source; this requires some development tools.  Run these commands to install the tools you need:</p>
<pre class="bash">$ sudo yum groupinstall "Development Tools"
$ sudo yum install kernel-devel kernel-headers
</pre>
<p></p>
<h2>Step 3: Install libssh2</h2>
<p>You&#8217;ll need libssh2 and some php development tools, so make sure those are installed by running the following command:</p>
<pre class="bash">$ sudo yum install php-devel php-pear libssh2 libssh2-devel
</pre>
<p></p>
<h2>Step 4: Use PECL to install SSH2 for PHP</h2>
<p><a href="http://pecl.php.net/" title="PECL" target="_blank">PECL</a> is the PHP Extension Community Library and we can use it to install SSH for PHP, like so:</p>
<pre class="bash">$ sudo pecl install -f ssh2
</pre>
<p>After running this command, you&#8217;ll notice that it stops at a line and waits for input from you.  It will look like this:</p>
<pre class="bash">..
........done: 22,740 bytes
5 source files, building
running: phpize
Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20060613
Zend Extension Api No:   220060519
libssh2 prefix? [autodetect] :
</pre>
<p>There&#8217;s no need to enter a specific prefix; just press the [enter] key to move forward and it will autodetect the prefix.</p>
<h2>Step 5: Configure PHP to load the SSH2 extension</h2>
<p>Now that the SSH2 extension has been installed, you just have to tell PHP to load it.  Configure PHP to load the extension by running the following commands:</p>
<pre class="bash">$ sudo touch /etc/php.d/ssh2.ini
$ echo 'extension=ssh2.so' | sudo tee -a /etc/php.d/ssh2.ini
</pre>
<p></p>
<h2>Step 6: Restart Apache</h2>
<p>You&#8217;re almost done!  Just restart the web server to have your changes take effect:</p>
<pre class="bash">$ sudo /etc/init.d/httpd restart
</pre>
<p></p>
<h2>Step 7: Verify the extension is loaded</h2>
<p>Finally, check to see if the extension has been loaded by running <strong>php -m</strong> to see the installed PHP modules:</p>
<pre class="bash">$ php -m | grep ssh2
ssh2
</pre>
<p></p>
<p>If you don&#8217;t see the ssh2 output from the above command, then something went wrong!  Try following the steps again carefully to see what you might have missed.</p>
<h2>Finish Line</h2>
<p>You&#8217;re all done!  You can now use SFTP to install and update plugins in WordPress.  If you did everything correctly, your WordPress connection info page should now look like this:<br />
<a href="http://www.techblogistech.com/wp-content/uploads/2012/03/php-ssh2-connection-info-2.png" rel="shadowbox[sbpost-792];player=img;"><img src="http://www.techblogistech.com/wp-content/plugins/jquery-image-lazy-loading/images/grey.gif" data-original="http://www.techblogistech.com/wp-content/uploads/2012/03/php-ssh2-connection-info-2-1024x350.png" alt="" title="php-ssh2-connection-info-2" width="768" height="262" class="lazy alignnone size-large wp-image-798" /><noscript><img src="http://www.techblogistech.com/wp-content/uploads/2012/03/php-ssh2-connection-info-2-1024x350.png" alt="" title="php-ssh2-connection-info-2" width="768" height="262" class="alignnone size-large wp-image-798" /></noscript></a></p>
<p>* Thanks to <a href="http://blog.dynamichosting.biz/" title="Dynamic Hosting Blog" target="_blank">Jacob</a> for the original <a href="http://blog.dynamichosting.biz/2011/01/10/installing-ssh2-extension-for-php-on-centos-5/" title="Installing SSH2 Extension for PHP on CentOS 5" target="_blank">guide</a> to installing libssh2 for PHP under CentOS.</p>
<p><a name="plugin"></a><br />
<h1>Option 2: Install a Plugin for WordPress</h1>
<p><strong>Update:</strong>  User &#8216;diamondback&#8217; pointed out that there&#8217;s also a <a href="http://wordpress.org/extend/plugins/ssh-sftp-updater-support/" title="SSH SFTP Updater Support" target="_blank">WordPress plugin</a> for this.  I haven&#8217;t used it myself, but it utilizes <a href="http://phpseclib.sourceforge.net/" title="phpseclib" target="_blank">phpseclib</a>, which is an implementation of SSH/SFTP entirely in PHP.</p>
<p>The upside to using a plugin is WordPress plugins are incredibly easy to install and uninstall.  Additionally, the plugin developer could incorporate features that the standard WordPress installation does not have.  The downside to using this plugin is this enables SSH/SFTP in WordPress <strong>only!</strong>  It will not enable it in any other PHP applications.  On top of that, you now have to rely on the author to update his plugin for new versions of WordPress instead of relying on the built-in WordPress support, which you get with the <a href="#libssh2" title="Install libssh2" target="_blank">libssh2 installation</a>.</p>
<h2>Step 1: Install the plugin</h2>
<p>Just install the <a href="http://wordpress.org/extend/plugins/ssh-sftp-updater-support/" title="SSH SFTP Updater Support" target="_blank">SSH SFTP Updater Support plugin</a>.  You&#8217;re done!</p>
<p><strong>Disclaimer:</strong> I haven&#8217;t used this plugin and do not endorse it in any way.</p>
<h3>Enjoy your SSH/SFTP support! Happy blogging!</h3>
]]></content:encoded>
			<wfw:commentRss>http://www.techblogistech.com/2012/03/enabling-sshsftp-updates-in-wordpress-on-amazon-ec2-and-centos/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Installing build-essentials in CentOS (make, gcc, gdb)</title>
		<link>http://www.techblogistech.com/2012/03/installing-build-essentials-in-centos-make-gcc-gdb/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=installing-build-essentials-in-centos-make-gcc-gdb</link>
		<comments>http://www.techblogistech.com/2012/03/installing-build-essentials-in-centos-make-gcc-gdb/#comments</comments>
		<pubDate>Sun, 18 Mar 2012 18:30:39 +0000</pubDate>
		<dc:creator>sean</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[build-essentials]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[gcc]]></category>
		<category><![CDATA[gdb]]></category>
		<category><![CDATA[kernel-devel]]></category>
		<category><![CDATA[kernel-headers]]></category>
		<category><![CDATA[make]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.techblogistech.com/?p=790</guid>
		<description><![CDATA[Once upon a time I was a very avid desktop user of Ubuntu Linux. As a software developer, I would &#8230; <span class="more-link"><a href="http://www.techblogistech.com/2012/03/installing-build-essentials-in-centos-make-gcc-gdb/">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.techblogistech.com/wp-content/uploads/2011/07/centos-icon.png" rel="shadowbox[sbpost-790];player=img;"><img class="lazy size-full wp-image-60 alignright" title="CentOS" src="http://www.techblogistech.com/wp-content/plugins/jquery-image-lazy-loading/images/grey.gif" data-original="http://www.techblogistech.com/wp-content/uploads/2011/07/centos-icon.png" alt="CentOS Icon" width="74" height="72" /><noscript><img class="size-full wp-image-60 alignright" title="CentOS" src="http://www.techblogistech.com/wp-content/uploads/2011/07/centos-icon.png" alt="CentOS Icon" width="74" height="72" /></noscript></a>Once upon a time I was a very avid desktop user of <a href="http://www.ubuntu.com/ubuntu" title="Ubuntu Linux" target="_blank">Ubuntu Linux</a>.  As a software developer, I would usually need the standard build tools installed on my machine.</p>
<h2>Installing build tools in Debian/Ubuntu</h2>
<p>In Debian/Ubuntu, you can install the typical build tools by installing the package <strong>build-essentials</strong>, which is just a pseudo-package that downloads all the popular development packages:</p>
<pre class="bash"># apt-get install build-essentials
</pre>
<p></p>
<h2>Installing build tools in CentOS</h2>
<p>Since I prefer <a href="http://www.centos.org/" title="CentOS" target="_blank">CentOS</a> as my server platform, I also occasionally need to install packages using <strong>yum</strong>.</p>
<p>To install the common build tools using yum in CentOS you&#8217;ll want to install the group package <strong>&#8220;Development Tools&#8221;</strong>, which is similar to build-essentials in Debian/Ubuntu flavors of linux.  You&#8217;ll probably also want to install <strong>kernel-devel</strong> and <strong>kernel-headers</strong> if they&#8217;re not already installed:</p>
<pre class="bash"># yum groupinstall "Development Tools"
# yum install kernel-devel kernel-headers
</pre>
<p>This should give you a copy of <strong>make</strong>, <strong>gcc</strong>, <strong>gdb</strong>, and all those other tools you were looking for.</p>
<p>Happy hacking!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techblogistech.com/2012/03/installing-build-essentials-in-centos-make-gcc-gdb/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Using xargs for file and directory recursion</title>
		<link>http://www.techblogistech.com/2011/12/using-xargs-for-recursion/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=using-xargs-for-recursion</link>
		<comments>http://www.techblogistech.com/2011/12/using-xargs-for-recursion/#comments</comments>
		<pubDate>Fri, 30 Dec 2011 18:15:46 +0000</pubDate>
		<dc:creator>sean</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[644]]></category>
		<category><![CDATA[755]]></category>
		<category><![CDATA[chmod]]></category>
		<category><![CDATA[exec]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[print0]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[xargs]]></category>

		<guid isPermaLink="false">http://www.techblogistech.com/?p=742</guid>
		<description><![CDATA[Occasionally I&#8217;m away from the bash shell for too long and I forget some things. This is just a quick &#8230; <span class="more-link"><a href="http://www.techblogistech.com/2011/12/using-xargs-for-recursion/">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.techblogistech.com/wp-content/uploads/2011/07/oxygen-utilities-terminal.png" rel="shadowbox[sbpost-742];player=img;"><img class="lazy alignright size-full wp-image-104" title="Terminal" src="http://www.techblogistech.com/wp-content/plugins/jquery-image-lazy-loading/images/grey.gif" data-original="http://www.techblogistech.com/wp-content/uploads/2011/07/oxygen-utilities-terminal.png" alt="Terminal" width="77" height="77" /><noscript><img class="alignright size-full wp-image-104" title="Terminal" src="http://www.techblogistech.com/wp-content/uploads/2011/07/oxygen-utilities-terminal.png" alt="Terminal" width="77" height="77" /></noscript></a> Occasionally I&#8217;m away from the bash shell for too long and I forget some things.  This is just a quick reminder to myself regarding the syntax and usefulness of <a href="http://en.wikipedia.org/wiki/Xargs" title="xargs at Wikipedia" target="_blank">xargs</a>.</p>
<h2>Why?</h2>
<p><strong>xargs</strong> takes a file list as input and performs some arbitrary operation on it.  This is obviously useful for scripting and bulk file operations.  Why use xargs?  Well, quite frankly, it&#8217;s <strong>faster than using find -exec</strong> because it splits the file list into sublists and calls the command once for every sublist instead of calling the command once for every file.  Also, because it uses sublists <strong>you never run into problems when trying to run commands with very large argument lists</strong> (it is actually possible to run a command and have bash reply that the maximum line length is exceeded).  Below is example usage.</p>
<h2>Example: fixing permissions</h2>
<p>Using <strong>xargs</strong> we can easily correct permissions recursively.  For instance, let&#8217;s improve our web security by locking down write privileges on our directories and files to only the owner:</p>
<pre class="bash">
find . -type d -print0 | xargs -0 -I {} chmod 755 {}
find . -type f -print0 | xargs -0 -I {} chmod 644 {}
</pre>
<p>Here&#8217;s what&#8217;s happening:</p>
<ul>
<li>we use <strong>find</strong> and <strong>-type d</strong> to locate all directories under the current directory</li>
<li>we use <strong>-print0</strong> so <strong>find</strong> will print the directories and separate the directory names by null characters instead of newlines; delimiting this way improves <strong>xargs</strong> ability to handle special characters in file names</li>
<li>then we pipe this list to <strong>xargs</strong> and use <strong>-0</strong> to tell <strong>xargs</strong> the list is null-character delimited</li>
<li>we also use <strong>-I {}</strong> to tell <strong>xargs</strong> to replace any occurrence of <strong>{}</strong> with each filename as it runs the following command</li>
<li>ultimately the command <strong>chmod 755 {}</strong> tells <strong>xargs</strong> to <strong>chmod 755</strong> each directory</li>
</ul>
<p>Of course we then do the same by running <strong>chmod 644</strong> on all files under the current directory.</p>
<h2>Efficiency</h2>
<p>Using <strong>xargs</strong> this way is faster than running these equivalent <strong>find</strong> commands:</p>
<pre class="bash">
find . -type d -exec chmod 755 '{}' \;
find . -type f -exec chmod 644 '{}' \;
</pre>
<p>Using find this way will run <strong>chmod</strong> individually for each directory and file, which is less efficient.  The general rule of thumb is to always opt for <strong>xargs</strong>.</p>
<p>You can use <strong>xargs</strong> for several other things, but this example is my most frequent use-case.  Happy hacking!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techblogistech.com/2011/12/using-xargs-for-recursion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to pass the &#8216;Yii Requirement Checker&#8217; in CentOS 5</title>
		<link>http://www.techblogistech.com/2011/12/how-to-pass-the-yii-requirement-checker-in-centos-5/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-pass-the-yii-requirement-checker-in-centos-5</link>
		<comments>http://www.techblogistech.com/2011/12/how-to-pass-the-yii-requirement-checker-in-centos-5/#comments</comments>
		<pubDate>Fri, 30 Dec 2011 17:27:10 +0000</pubDate>
		<dc:creator>sean</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[apc]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[gd]]></category>
		<category><![CDATA[ius community]]></category>
		<category><![CDATA[jeffery winesett]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mcrypt]]></category>
		<category><![CDATA[memcache]]></category>
		<category><![CDATA[memcached]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[pdo]]></category>
		<category><![CDATA[pear]]></category>
		<category><![CDATA[pgsql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php53]]></category>
		<category><![CDATA[php53u]]></category>
		<category><![CDATA[postgres]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[requirement checker]]></category>
		<category><![CDATA[soap]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[yii]]></category>

		<guid isPermaLink="false">http://www.techblogistech.com/?p=735</guid>
		<description><![CDATA[Recently I&#8217;ve been doing some PHP web development and I decided to check out the Yii Framework. They have a &#8230; <span class="more-link"><a href="http://www.techblogistech.com/2011/12/how-to-pass-the-yii-requirement-checker-in-centos-5/">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.techblogistech.com/wp-content/uploads/2011/12/yii-logo.png" rel="shadowbox[sbpost-735];player=img;"><img class="lazy alignright size-thumbnail wp-image-740" title="Yii" src="http://www.techblogistech.com/wp-content/plugins/jquery-image-lazy-loading/images/grey.gif" data-original="http://www.techblogistech.com/wp-content/uploads/2011/12/yii-logo-150x150.png" alt="Yii" width="81" height="81" /><noscript><img class="alignright size-thumbnail wp-image-740" title="Yii" src="http://www.techblogistech.com/wp-content/uploads/2011/12/yii-logo-150x150.png" alt="Yii" width="81" height="81" /></noscript></a>Recently I&#8217;ve been doing some PHP web development and I decided to check out the <a title="Yii Framework" href="http://www.yiiframework.com/" target="_blank">Yii Framework</a>. They have a great <a title="Yii Framework Screencasts" href="http://www.yiiframework.com/screencasts/" target="_blank">4-part screencast tutorial</a> from Jeffery Winesett that gets you up and running fast and Yii looks really cool!</p>
<p>During the installation Yii uses a &#8216;Requirement Checker&#8217; webpage that verifies you have the correct PHP version and the necessary plugins. If you&#8217;re like me, you like to see all your boxes turn green just to be sure you can get the full functionality out of your apps and frameworks instead of having to debug stuff like this later and going down a rabbit hole.</p>
<h2>Install All The Packages</h2>
<p>To make the best use of Yii (and several other things), you&#8217;ll need these packages: GD, mcrypt, MySQL, PDO, PEAR, APC, Memcache, PgSQL, SOAP, and XML. To get proper packages for these extensions on CentOS 5, I recommend adding the <a title="IUS Community Repository" href="http://iuscommunity.org/" target="_blank">IUS Community Repository</a>. Here&#8217;s a one-liner you can run with <strong>sudo</strong> or <strong>as root</strong> after you&#8217;ve set up that repo:</p>
<pre class="bigbash">yum install php53u php53u-cli php53u-common php53u-devel php53u-gd php53u-mcrypt php53u-mysql php53u-pdo \
php53u-pear php53u-pecl-apc.x86_64 php53u-pecl-memcache.x86_64 php53u-pgsql.x86_64 php53u-soap.x86_64 php53u-xml.x86_64</pre>
<p><a href="http://www.techblogistech.com/wp-content/uploads/2011/12/install_all_the_packages.jpg" rel="shadowbox[sbpost-735];player=img;"><img class="lazy alignnone size-medium wp-image-736" title="Install all the packages" src="http://www.techblogistech.com/wp-content/plugins/jquery-image-lazy-loading/images/grey.gif" data-original="http://www.techblogistech.com/wp-content/uploads/2011/12/install_all_the_packages-300x225.jpg" alt="Install all the packages" width="300" height="225" /><noscript><img class="alignnone size-medium wp-image-736" title="Install all the packages" src="http://www.techblogistech.com/wp-content/uploads/2011/12/install_all_the_packages-300x225.jpg" alt="Install all the packages" width="300" height="225" /></noscript></a></p>
<p>Have fun with Yii!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techblogistech.com/2011/12/how-to-pass-the-yii-requirement-checker-in-centos-5/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Installing Flash in BackTrack x64</title>
		<link>http://www.techblogistech.com/2011/09/installing-flash-in-backtrack-x64/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=installing-flash-in-backtrack-x64</link>
		<comments>http://www.techblogistech.com/2011/09/installing-flash-in-backtrack-x64/#comments</comments>
		<pubDate>Fri, 16 Sep 2011 03:10:06 +0000</pubDate>
		<dc:creator>sean</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[backtrack]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[nessus]]></category>
		<category><![CDATA[player]]></category>

		<guid isPermaLink="false">http://www.techblogistech.com/?p=689</guid>
		<description><![CDATA[Flash doesn&#8217;t work out-of-the-box on the 64-bit version of BackTrack 5. Unfortunately this just won&#8217;t do since Nessus uses a &#8230; <span class="more-link"><a href="http://www.techblogistech.com/2011/09/installing-flash-in-backtrack-x64/">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.techblogistech.com/wp-content/uploads/2011/09/adobe-flash.png" rel="shadowbox[sbpost-689];player=img;"><img class="lazy alignright size-full wp-image-690" title="Adobe Flash" src="http://www.techblogistech.com/wp-content/plugins/jquery-image-lazy-loading/images/grey.gif" data-original="http://www.techblogistech.com/wp-content/uploads/2011/09/adobe-flash.png" alt="Adobe Flash" width="69" height="65" /><noscript><img class="alignright size-full wp-image-690" title="Adobe Flash" src="http://www.techblogistech.com/wp-content/uploads/2011/09/adobe-flash.png" alt="Adobe Flash" width="69" height="65" /></noscript></a>Flash doesn&#8217;t work out-of-the-box on the 64-bit version of BackTrack 5. Unfortunately this just won&#8217;t do since <a title="Tenable: Nessus" href="http://www.tenable.com/products/nessus" target="_blank">Nessus</a> uses a Flash web interface! Luckily it&#8217;s easy enough to install it.</p>
<h2>Pre-installation</h2>
<p>First <strong>close Firefox</strong>! It&#8217;s safer to perform these instructions with all browsers closed.</p>
<p>Next, remove any existing Flash installations or files:</p>
<pre class="bigbash"># apt-get -y purge flashplugin-nonfree flashplugin-installer gnash gnash-common mozilla-plugin-gnash swfdec-mozilla
# rm -f /usr/lib/firefox/plugins/libflashplayer.so
# rm -f /usr/lib/mozilla/plugins/libflashplayer.so
# rm -f /usr/lib/mozilla/plugins/flashplugin-alternative.so
# rm -f /usr/lib/mozilla/plugins/npwrapper*flash*so
# rm -f ~/.mozilla/plugins/*flash*so</pre>
<h2>Installation</h2>
<p>Now <a title="Get Adobe Flash Player" href="http://get.adobe.com/flashplayer/" target="_blank">download Flash</a>.</p>
<p>Finally, extract and install the Flash player plugin you just downloaded:</p>
<pre class="bigbash"># tar xvfz install_flash_player_10_linux.tar.gz
# mkdir -p ~/.mozilla/plugins
# mv -f libflashplayer.so ~/.mozilla/plugins/</pre>
<p>Start up Firefox and you should have a working Flash installation! You can visit Adobe&#8217;s website to <a title="Adobe: About Flash" href="http://www.adobe.com/software/flash/about/" target="_blank">be sure it&#8217;s installed correctly</a>.</p>
<p><a href="http://www.techblogistech.com/wp-content/uploads/2011/09/flash-success.png" rel="shadowbox[sbpost-689];player=img;"><img class="lazy size-full wp-image-691 alignnone" title="Adobe Flash Installed" src="http://www.techblogistech.com/wp-content/plugins/jquery-image-lazy-loading/images/grey.gif" data-original="http://www.techblogistech.com/wp-content/uploads/2011/09/flash-success.png" alt="Adobe Flash Installed" width="365" height="221" /><noscript><img class="size-full wp-image-691 alignnone" title="Adobe Flash Installed" src="http://www.techblogistech.com/wp-content/uploads/2011/09/flash-success.png" alt="Adobe Flash Installed" width="365" height="221" /></noscript></a></p>
<p>Have fun using Nessus and enjoying the rest of the internet. <img src='http://www.techblogistech.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.techblogistech.com/2011/09/installing-flash-in-backtrack-x64/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Download Recursively from FTP at Command Line (mget and wget)</title>
		<link>http://www.techblogistech.com/2011/09/how-to-download-recursively-from-ftp-at-command-line-mget-and-wget/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-download-recursively-from-ftp-at-command-line-mget-and-wget</link>
		<comments>http://www.techblogistech.com/2011/09/how-to-download-recursively-from-ftp-at-command-line-mget-and-wget/#comments</comments>
		<pubDate>Mon, 12 Sep 2011 23:22:34 +0000</pubDate>
		<dc:creator>sean</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[get]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mget]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[wget]]></category>

		<guid isPermaLink="false">http://www.techblogistech.com/?p=664</guid>
		<description><![CDATA[Sometimes I want to download recursively from an FTP server and I don&#8217;t want to leave the command line. Depending &#8230; <span class="more-link"><a href="http://www.techblogistech.com/2011/09/how-to-download-recursively-from-ftp-at-command-line-mget-and-wget/">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.techblogistech.com/wp-content/uploads/2011/07/oxygen-utilities-terminal.png" rel="shadowbox[sbpost-664];player=img;"><img class="lazy alignright size-full wp-image-104" title="Terminal" src="http://www.techblogistech.com/wp-content/plugins/jquery-image-lazy-loading/images/grey.gif" data-original="http://www.techblogistech.com/wp-content/uploads/2011/07/oxygen-utilities-terminal.png" alt="Terminal" width="77" height="77" /><noscript><img class="alignright size-full wp-image-104" title="Terminal" src="http://www.techblogistech.com/wp-content/uploads/2011/07/oxygen-utilities-terminal.png" alt="Terminal" width="77" height="77" /></noscript></a>Sometimes I want to download recursively from an FTP server and I don&#8217;t want to leave the command line.  Depending on your FTP client, you may be lucky enough to have an option built-in for this but in many cases you don&#8217;t.  FTP clients often feature <strong>mget</strong>, which is good for downloading files based on a glob filter such as <strong>*.txt</strong> or <strong>*.c</strong>.  But still, this isn&#8217;t recursive.</p>
<h2>Wget</h2>
<p>Surprise!  Wget supports <strong>FTP</strong> and can download <strong>recursively</strong>!  You could download the full contents of an FTP server like this:</p>
<pre class="bash">
wget -r 'ftp://user:pass@host'
</pre>
<p>Or just grab a single directory like this:</p>
<pre class="bash">
wget -r 'ftp://user:pass@host/dir'
</pre>
<p>Cool, huh?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techblogistech.com/2011/09/how-to-download-recursively-from-ftp-at-command-line-mget-and-wget/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to fix Error: suffix or operands invalid for &#8216;push&#8217; or &#8216;pop&#8217;</title>
		<link>http://www.techblogistech.com/2011/08/error-suffix-or-operands-invalid-for-push-or-pop/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=error-suffix-or-operands-invalid-for-push-or-pop</link>
		<comments>http://www.techblogistech.com/2011/08/error-suffix-or-operands-invalid-for-push-or-pop/#comments</comments>
		<pubDate>Fri, 26 Aug 2011 02:28:10 +0000</pubDate>
		<dc:creator>sean</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[32-bit]]></category>
		<category><![CDATA[64-bit]]></category>
		<category><![CDATA[as]]></category>
		<category><![CDATA[assembly]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[compiling]]></category>
		<category><![CDATA[elf_i386]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[gcc]]></category>
		<category><![CDATA[invalid]]></category>
		<category><![CDATA[ld]]></category>
		<category><![CDATA[operands]]></category>
		<category><![CDATA[pop]]></category>
		<category><![CDATA[push]]></category>
		<category><![CDATA[suffix]]></category>

		<guid isPermaLink="false">http://www.techblogistech.com/?p=630</guid>
		<description><![CDATA[If you compile a 32-bit assembly program (or a C program that contains assembly instructions) on a 64-bit machine you &#8230; <span class="more-link"><a href="http://www.techblogistech.com/2011/08/error-suffix-or-operands-invalid-for-push-or-pop/">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.techblogistech.com/wp-content/uploads/2011/07/oxygen-utilities-terminal.png" rel="shadowbox[sbpost-630];player=img;"><img class="lazy alignright size-full wp-image-104" title="Terminal" src="http://www.techblogistech.com/wp-content/plugins/jquery-image-lazy-loading/images/grey.gif" data-original="http://www.techblogistech.com/wp-content/uploads/2011/07/oxygen-utilities-terminal.png" alt="Terminal" width="77" height="77" /><noscript><img class="alignright size-full wp-image-104" title="Terminal" src="http://www.techblogistech.com/wp-content/uploads/2011/07/oxygen-utilities-terminal.png" alt="Terminal" width="77" height="77" /></noscript></a>If you compile a 32-bit assembly program (or a C program that contains assembly instructions) on a 64-bit machine you may see the following error:</p>
<pre class="bash">
# as -o example32bit.o example32bit.s
example32bit.s: Assembler messages:
example32bit.s:10: Error: suffix or operands invalid for `pop'
</pre>
<p>To fix this problem you need to pass the compiler or assembler a flag telling it you want to compile the software as 32-bit and not 64-bit.</p>
<h4>The fix for C: Compiling with the -m32 flag</h4>
<p>If you&#8217;re using <strong>gcc</strong> to compile a C program, pass in <strong>-m32</strong>.  There&#8217;s a <a href="http://www.techblogistech.com/2011/08/how-to-compile-32-bit-software-on-a-64-bit-pc-in-linux/" title="How to Compile 32-bit C Programs on a 64-bit PC in Linux">complete example</a> here on my blog.</p>
<h4>The fix for assembly: Compiling with the &#8211;32 flag</h4>
<p>If you&#8217;re using <strong>as</strong> to compile an assembly program, pass in <strong>&#8211;32</strong>.  Then when you link with <strong>ld</strong> pass in <strong>-m elf_i386</strong>.  There&#8217;s a <a href="http://www.techblogistech.com/2011/08/how-to-compile-32-bit-assembly-programs-on-a-64-bit-pc-in-linux/" title="How to Compile 32-bit Assembly Programs on a 64-bit PC in Linux">complete example</a> here on my blog.</p>
<h4>Happy hacking!</h4>
]]></content:encoded>
			<wfw:commentRss>http://www.techblogistech.com/2011/08/error-suffix-or-operands-invalid-for-push-or-pop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
