<?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>spechal.com &#187; Linux</title>
	<atom:link href="http://spechal.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://spechal.com</link>
	<description>[spesh-uhl]</description>
	<lastBuildDate>Sat, 24 Dec 2011 03:41:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Very simple MySQL backup bash script</title>
		<link>http://spechal.com/2011/12/23/very-simple-mysql-backup-bash-script/</link>
		<comments>http://spechal.com/2011/12/23/very-simple-mysql-backup-bash-script/#comments</comments>
		<pubDate>Fri, 23 Dec 2011 09:07:07 +0000</pubDate>
		<dc:creator>Spechal</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[Commands]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://spechal.com/?p=308</guid>
		<description><![CDATA[This code backups up mysql databases and gzips them into the current working directory. If you want to backup the mysql table, remove it from the for loop. #!/bin/bash usage(){ echo "Usage $0 &#60;mysql_user&#62; &#60;mysql_password&#62;" exit 1 } if [[ &#8230; <a href="http://spechal.com/2011/12/23/very-simple-mysql-backup-bash-script/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This code backups up mysql databases and gzips them into the current working directory.  If you want to backup the mysql table, remove it from the for loop.</p>
<pre language="bash">#!/bin/bash

usage(){
        echo "Usage $0 &lt;mysql_user&gt; &lt;mysql_password&gt;"
        exit 1
}

if [[ "$2" != "" &#038;&#038; "$2" == "" ]]
then
        usage
fi

USER=$1
PASS=$2
if [ "$3" != "" ]
then
  DB_HOST=$3
else
  DB_HOST="localhost"
fi

for db in `mysql -u$USER -p$PASS -h$DB_HOST -e 'show databases' | cut -f2 | awk '{ print $1 }' | grep -v "Database\|mysql\|information_schema\|test"`;
do
  echo "Working with $db"
  mysqldump -u$USER -p$PASS -h$DB_HOST $db > $db.sql
  gzip $db.sql
done;

echo "Finished";</pre>
]]></content:encoded>
			<wfw:commentRss>http://spechal.com/2011/12/23/very-simple-mysql-backup-bash-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing php-ffmpeg on CentOS 5.x</title>
		<link>http://spechal.com/2011/07/25/installing-php-ffmpeg-on-centos-5-x/</link>
		<comments>http://spechal.com/2011/07/25/installing-php-ffmpeg-on-centos-5-x/#comments</comments>
		<pubDate>Mon, 25 Jul 2011 16:24:58 +0000</pubDate>
		<dc:creator>Spechal</dc:creator>
				<category><![CDATA[Commands]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[phpize]]></category>

		<guid isPermaLink="false">http://spechal.com/?p=305</guid>
		<description><![CDATA[This can be a pain due to a bug in the ffpmeg_frame.c file &#8230; here are the commands to get up and going yum -y install ffmpeg ffmpeg-devel wget http://sourceforge.net/projects/ffmpeg-php/files/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2/download tar jxvf ffmpeg-php-0.6.0.tbz2 sed -i 's/PIX_FMT_RGBA32/PIX_FMT_RGBA/g' ffmpeg-php-0.6.0/ffmpeg_frame.c cd ffmpeg-php-0.6.0 &#038;&#038; &#8230; <a href="http://spechal.com/2011/07/25/installing-php-ffmpeg-on-centos-5-x/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This can be a pain due to a bug in the ffpmeg_frame.c file &#8230; here are the commands to get up and going</p>
<pre>yum -y install ffmpeg ffmpeg-devel
wget http://sourceforge.net/projects/ffmpeg-php/files/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2/download
tar jxvf ffmpeg-php-0.6.0.tbz2
sed -i 's/PIX_FMT_RGBA32/PIX_FMT_RGBA/g' ffmpeg-php-0.6.0/ffmpeg_frame.c
cd ffmpeg-php-0.6.0 &#038;&#038; phpize
./configure &#038;&#038; make &#038;&#038; make install
echo 'extension=ffmpeg.so' > /etc/php.d/ffmpeg.ini &#038;&#038; /etc/init.d/httpd restart
php -v &#038;&#038; php -m | grep ffmpeg
</pre>
<p>In this process you:<br />
use yum to install ffmpeg and the ffmpeg development files<br />
download php-ffmepg from sourceforge and extract it<br />
apply the bug fix to the ffmpeg_frace.c file<br />
change directories to the php-ffmpeg directory and phpize the module<br />
configure, make and install the shared object (extension)<br />
add the extension to the loaded php extensions<br />
restart apache and verify no errors are shown on php startup and that ffmepg is loaded</p>
<p>If all is well, you should see your version of PHP with the copyrights on 3 lines and the last line showing ffmpeg</p>
]]></content:encoded>
			<wfw:commentRss>http://spechal.com/2011/07/25/installing-php-ffmpeg-on-centos-5-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Search / Replace in files with Linux</title>
		<link>http://spechal.com/2011/06/20/search-replace-in-files-with-linux/</link>
		<comments>http://spechal.com/2011/06/20/search-replace-in-files-with-linux/#comments</comments>
		<pubDate>Mon, 20 Jun 2011 17:39:58 +0000</pubDate>
		<dc:creator>Spechal</dc:creator>
				<category><![CDATA[Commands]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://spechal.com/?p=293</guid>
		<description><![CDATA[I used this command to search over some Apache 2 vhost files to change them from port 8080 to port 80 with Debian. find /etc/apache2/sites-enabled -name "*com" -exec sed -i 's/8080/80/g' {} \;]]></description>
			<content:encoded><![CDATA[<p>I used this command to search over some Apache 2 vhost files to change them from port 8080 to port 80 with Debian.</p>
<pre>find /etc/apache2/sites-enabled -name "*com" -exec sed -i 's/8080/80/g' {} \;</pre>
]]></content:encoded>
			<wfw:commentRss>http://spechal.com/2011/06/20/search-replace-in-files-with-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Low Level Format Disk Drive with Linux</title>
		<link>http://spechal.com/2011/06/13/low-level-format-disk-drive-with-linux/</link>
		<comments>http://spechal.com/2011/06/13/low-level-format-disk-drive-with-linux/#comments</comments>
		<pubDate>Mon, 13 Jun 2011 01:43:22 +0000</pubDate>
		<dc:creator>Spechal</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://spechal.com/?p=287</guid>
		<description><![CDATA[Doing a log level format with linux is super easy. Make sure the drive you want to format is not mounted and determine the device in /dev/ i.e. /dev/sdb Enter the following command to turn all the bits on the &#8230; <a href="http://spechal.com/2011/06/13/low-level-format-disk-drive-with-linux/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Doing a log level format with linux is super easy.  Make sure the drive you want to format is not mounted and determine the device in /dev/ i.e. /dev/sdb</p>
<p>Enter the following command to turn all the bits on the drive to 0</p>
<pre>dd if=/dev/zero of=/dev/sdb</pre>
<p>Wait a few hours and you have a completely wiped disk drive</p>
]]></content:encoded>
			<wfw:commentRss>http://spechal.com/2011/06/13/low-level-format-disk-drive-with-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use HackIt and Revolution ROM to sexify your HTC Inspire</title>
		<link>http://spechal.com/2011/05/15/use-hackit-and-revolution-rom-to-sexify-your-htc-inspire/</link>
		<comments>http://spechal.com/2011/05/15/use-hackit-and-revolution-rom-to-sexify-your-htc-inspire/#comments</comments>
		<pubDate>Sun, 15 May 2011 07:21:19 +0000</pubDate>
		<dc:creator>Spechal</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[HTC]]></category>
		<category><![CDATA[root]]></category>

		<guid isPermaLink="false">http://spechal.com/?p=282</guid>
		<description><![CDATA[Got an HTC Inspire 4G? Tired of all the bloatware and running apps. Tired of have to kill those apps over and over? Root your phone (root is the superuser account in Linux, which Android runs on)! This voids all &#8230; <a href="http://spechal.com/2011/05/15/use-hackit-and-revolution-rom-to-sexify-your-htc-inspire/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Got an HTC Inspire 4G?  Tired of all the bloatware and running apps.  Tired of have to kill those apps over and over?  Root your phone (root is the superuser account in Linux, which Android runs on)!  This voids all warranties, but it is worth it.  Use HackIt to permanently root your HTC, then download the HTC Revolution ROM and flash your phone with it.  Then install Terminal Emulator to access your phones root shell.  You&#8217;ll also want Gemini App Manager (Free), hit Menu to go into Expert Mode and you can uninstall ANYTHING, even your keyboard (which you should NOT do).</p>
<p>All you need to know is located at this web site: http://www.addictivetips.com/mobile/install-android-revolution-4g-rom-on-htc-inspire-4g/</p>
]]></content:encoded>
			<wfw:commentRss>http://spechal.com/2011/05/15/use-hackit-and-revolution-rom-to-sexify-your-htc-inspire/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use mogrify to rotate and scale your images on the Linux command line</title>
		<link>http://spechal.com/2011/05/14/use-mogrify-to-rotate-and-scale-your-images-on-the-linux-command-line/</link>
		<comments>http://spechal.com/2011/05/14/use-mogrify-to-rotate-and-scale-your-images-on-the-linux-command-line/#comments</comments>
		<pubDate>Sat, 14 May 2011 04:21:10 +0000</pubDate>
		<dc:creator>Spechal</dc:creator>
				<category><![CDATA[Commands]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ImageMagick]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[resize]]></category>
		<category><![CDATA[rotate]]></category>

		<guid isPermaLink="false">http://spechal.com/?p=279</guid>
		<description><![CDATA[First, make sure you have ImageMagick installed: #Ubuntu/Debian sudo apt-get install imagemagick #RedHat, Fedora, CentOS sudo yum install imagemagick After that, it&#8217;s super easy. mogrify -resize 800 -rotate 90 image.jpg The above command would resize image.jpg to 800 pixels wide &#8230; <a href="http://spechal.com/2011/05/14/use-mogrify-to-rotate-and-scale-your-images-on-the-linux-command-line/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>First, make sure you have ImageMagick installed:</p>
<pre>#Ubuntu/Debian
sudo apt-get install imagemagick

#RedHat, Fedora, CentOS
sudo yum install imagemagick</pre>
<p>After that, it&#8217;s super easy.</p>
<pre>mogrify -resize 800 -rotate 90 image.jpg</pre>
<p>The above command would resize image.jpg to 800 pixels wide maintaining aspect ratio and rotate the image 90 degrees clockwise.</p>
<p>To define your own dimensions (discarding aspect ratio) use the following:</p>
<pre>mogrify -resize 800x600! -rotate 90 image.jpg</pre>
<p>The above command does the same as the other, but resizes to 800 x 600.</p>
<p>No more need to open GIMP just to resize and rotate an image!</p>
]]></content:encoded>
			<wfw:commentRss>http://spechal.com/2011/05/14/use-mogrify-to-rotate-and-scale-your-images-on-the-linux-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple PostgreSQL and data backup script for Linux bash</title>
		<link>http://spechal.com/2011/03/28/simple-postgresql-and-data-backup-script-for-linux-bash/</link>
		<comments>http://spechal.com/2011/03/28/simple-postgresql-and-data-backup-script-for-linux-bash/#comments</comments>
		<pubDate>Mon, 28 Mar 2011 15:25:56 +0000</pubDate>
		<dc:creator>Spechal</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PostgreSQL]]></category>

		<guid isPermaLink="false">http://spechal.com/?p=262</guid>
		<description><![CDATA[backup-script.sh #!/bin/bash export PGPASSWORD=SUPERSECRETPASSWORD thedate=`date --rfc-3339=date` echo &#34;Making tarball for $thedate&#34; filename=&#34;$thedate.tar.gz&#34; `pg_dump -U postgres the_database &#62; /var/www/db_dump.sql` tar czf /backups/$filename /var/www Above is a simple bash script to backup a directory after making a PostgreSQL data dump. I left &#8230; <a href="http://spechal.com/2011/03/28/simple-postgresql-and-data-backup-script-for-linux-bash/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>backup-script.sh</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PGPASSWORD</span>=SUPERSECRETPASSWORD
<span style="color: #007800;">thedate</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> <span style="color: #660033;">--rfc-3339</span>=<span style="color: #c20cb9; font-weight: bold;">date</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Making tarball for <span style="color: #007800;">$thedate</span>&quot;</span>
<span style="color: #007800;">filename</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$thedate</span>.tar.gz&quot;</span>
<span style="color: #000000; font-weight: bold;">`</span>pg_dump <span style="color: #660033;">-U</span> postgres the_database <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>db_dump.sql<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #c20cb9; font-weight: bold;">tar</span> czf <span style="color: #000000; font-weight: bold;">/</span>backups<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$filename</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www</pre></div></div>

<p>Above is a simple bash script to backup a directory after making a PostgreSQL data dump.  I left a lot of my original code in place so you can see how to work with directories that have spaces.  The trick is to escape when you use double quotes and do nothing when you use no quotes.</p>
<p>I also told crontab to run this file every day by making a crontab file:</p>
<p>cron.txt</p>
<pre>30 5 * * * /home/user/cron/backup-script.sh</pre>
<p>Then telling crontab to use the file</p>
<pre>crontab -e cron.txt</pre>
]]></content:encoded>
			<wfw:commentRss>http://spechal.com/2011/03/28/simple-postgresql-and-data-backup-script-for-linux-bash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Set static IP address in Ubuntu</title>
		<link>http://spechal.com/2011/03/20/set-static-ip-address-in-ubuntu/</link>
		<comments>http://spechal.com/2011/03/20/set-static-ip-address-in-ubuntu/#comments</comments>
		<pubDate>Sun, 20 Mar 2011 06:05:42 +0000</pubDate>
		<dc:creator>Spechal</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[ip]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://spechal.com/?p=238</guid>
		<description><![CDATA[You will need to edit your /etc/network/interfaces file sudo nano /etc/network/interfaces auto lo iface lo inet loopback auto eth0 iface eth0 inet static address 192.168.1.10 netmask 255.255.255.0 gateway 192.168.1.1 network 192.168.1.0 broadcast 192.168.1.255 Restart networking via sudo /etc/init.d/networking restart]]></description>
			<content:encoded><![CDATA[<p>You will need to edit your /etc/network/interfaces file</p>
<pre>sudo nano /etc/network/interfaces</pre>
<pre>auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.1.1
network 192.168.1.0
broadcast 192.168.1.255</pre>
<p>Restart networking via</p>
<pre>sudo /etc/init.d/networking restart</pre>
]]></content:encoded>
			<wfw:commentRss>http://spechal.com/2011/03/20/set-static-ip-address-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Node.js and Socket.io on Ubuntu</title>
		<link>http://spechal.com/2011/03/19/installing-node-js-and-socket-io-on-ubuntu/</link>
		<comments>http://spechal.com/2011/03/19/installing-node-js-and-socket-io-on-ubuntu/#comments</comments>
		<pubDate>Sat, 19 Mar 2011 13:15:42 +0000</pubDate>
		<dc:creator>Spechal</dc:creator>
				<category><![CDATA[Commands]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Node.js / Socket.io]]></category>
		<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nodejs]]></category>
		<category><![CDATA[socketio]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://spechal.com/?p=235</guid>
		<description><![CDATA[Issue the following on the command line: cd ~ sudo apt-get install libv8-2.0.3 libv8-dev libv8-dbg libssl-dev curl wget http://nodejs.org/dist/node-v0.4.3.tar.gz tar zxvf node-v0.4.3.tar.gz cd node-v0.4.3 ./configure &#038;&#038; make &#038;&#038; make install sudo curl http://npmjs.org/install.sh &#124; sudo sh sudo npm install socket.io &#8230; <a href="http://spechal.com/2011/03/19/installing-node-js-and-socket-io-on-ubuntu/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Issue the following on the command line:</p>
<pre>cd ~
sudo apt-get install libv8-2.0.3 libv8-dev libv8-dbg libssl-dev curl
wget http://nodejs.org/dist/node-v0.4.3.tar.gz
tar zxvf node-v0.4.3.tar.gz
cd node-v0.4.3
./configure &#038;&#038; make &#038;&#038; make install
sudo curl http://npmjs.org/install.sh | sudo sh
sudo npm install socket.io
</pre>
<p>First we change to our home directory via cd ~ &#8230; even though the tilda in the code above looks like a hyphen.  Then we install Google V8, SSL development files and cURL.  Next we grab Node.js, configure and install it.  Nearly last, we download and install npm.  Finally, we tell npm to install socket.io for us.</p>
<p>fin.</p>
]]></content:encoded>
			<wfw:commentRss>http://spechal.com/2011/03/19/installing-node-js-and-socket-io-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux find string in files</title>
		<link>http://spechal.com/2011/03/09/linux-find-string-in-files/</link>
		<comments>http://spechal.com/2011/03/09/linux-find-string-in-files/#comments</comments>
		<pubDate>Wed, 09 Mar 2011 07:29:26 +0000</pubDate>
		<dc:creator>Spechal</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://spechal.com/?p=212</guid>
		<description><![CDATA[find . &#124; xargs grep &#8216;string_to_find&#8217; -l]]></description>
			<content:encoded><![CDATA[<p>find . | xargs grep &#8216;string_to_find&#8217; -l</p>
]]></content:encoded>
			<wfw:commentRss>http://spechal.com/2011/03/09/linux-find-string-in-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

