<?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>Mon, 23 Apr 2012 01:30:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Linux Kernel &#8211; Unknown target with make rpm or rpmbin-pkg</title>
		<link>http://spechal.com/2012/04/18/linux-kernel-unknown-target-with-make-rpm-or-rpmbin-pkg/</link>
		<comments>http://spechal.com/2012/04/18/linux-kernel-unknown-target-with-make-rpm-or-rpmbin-pkg/#comments</comments>
		<pubDate>Wed, 18 Apr 2012 19:29:34 +0000</pubDate>
		<dc:creator>Spechal</dc:creator>
				<category><![CDATA[Commands]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[make]]></category>
		<category><![CDATA[rpm]]></category>

		<guid isPermaLink="false">http://spechal.com/?p=324</guid>
		<description><![CDATA[If you get the error saying &#8220;&#8211;target: unknown option&#8221;, install the rpm-build package and retry. sudo yum install -y rpm-build make clean make rpm]]></description>
			<content:encoded><![CDATA[<p>If you get the error saying &#8220;&#8211;target: unknown option&#8221;, install the rpm-build package and retry.</p>
<p>sudo yum install -y rpm-build<br />
make clean<br />
make rpm</p>
]]></content:encoded>
			<wfw:commentRss>http://spechal.com/2012/04/18/linux-kernel-unknown-target-with-make-rpm-or-rpmbin-pkg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Varnish init script</title>
		<link>http://spechal.com/2012/03/23/varnish-init-script/</link>
		<comments>http://spechal.com/2012/03/23/varnish-init-script/#comments</comments>
		<pubDate>Fri, 23 Mar 2012 14:53:37 +0000</pubDate>
		<dc:creator>Spechal</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Varnish]]></category>
		<category><![CDATA[init]]></category>
		<category><![CDATA[varnish]]></category>

		<guid isPermaLink="false">http://spechal.com/?p=319</guid>
		<description><![CDATA[*To update with more useful information* Bash script to handle Varnish start, stop, restart and reload. Built after Varnish 3 was compiled from source. #!/bin/bash &#160; # description: Varnish Start Stop Restart &#160; # processname: varnishd &#160; # chkconfig: 234 &#8230; <a href="http://spechal.com/2012/03/23/varnish-init-script/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>*To update with more useful information*</p>
<p>Bash script to handle Varnish start, stop, restart and reload.  Built after Varnish 3 was compiled from source.</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>
&nbsp;
<span style="color: #666666; font-style: italic;"># description: Varnish Start Stop Restart</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># processname: varnishd</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># chkconfig: 234 20 80</span>
&nbsp;
&nbsp;
&nbsp;
<span style="color: #007800;">NOW</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #000000; font-weight: bold;">%</span>s<span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
&nbsp;
&nbsp;
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #007800;">$1</span> <span style="color: #000000; font-weight: bold;">in</span>
&nbsp;
start<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>varnishd <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>varnish<span style="color: #000000; font-weight: bold;">/</span>default.vcl <span style="color: #660033;">-s</span> malloc,4G <span style="color: #660033;">-T</span> 127.0.0.1:<span style="color: #000000;">2000</span> <span style="color: #660033;">-a</span> :<span style="color: #000000;">80</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">;;</span>
&nbsp;
stop<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
        pkill varnishd
&nbsp;
<span style="color: #000000; font-weight: bold;">;;</span>
&nbsp;
restart<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
        <span style="color: #c20cb9; font-weight: bold;">sh</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>varnish stop
&nbsp;
        <span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">2</span>
&nbsp;
        <span style="color: #c20cb9; font-weight: bold;">sh</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>varnish start
&nbsp;
<span style="color: #000000; font-weight: bold;">;;</span>
&nbsp;
reload<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>varnishadm vcl.load reload<span style="color: #007800;">$NOW</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>varnish<span style="color: #000000; font-weight: bold;">/</span>default.vcl <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Error compiling config&quot;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>varnishadm vcl.use reload<span style="color: #007800;">$NOW</span> <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Error using config&quot;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">;;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;$0 [start|stop|restart|reload]&quot;</span>
&nbsp;
        <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
&nbsp;
&nbsp;
&nbsp;
<span style="color: #000000; font-weight: bold;">esac</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://spechal.com/2012/03/23/varnish-init-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache memory used per process</title>
		<link>http://spechal.com/2012/03/23/apache-memory-used-per-process/</link>
		<comments>http://spechal.com/2012/03/23/apache-memory-used-per-process/#comments</comments>
		<pubDate>Fri, 23 Mar 2012 14:48:39 +0000</pubDate>
		<dc:creator>Spechal</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Commands]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[memory]]></category>

		<guid isPermaLink="false">http://spechal.com/?p=317</guid>
		<description><![CDATA[*To update with more useful information* ps -ylC httpd --sort:rss &#124; grep -v RSS &#124; awk '{print &#34;Proccess &#34;++n&#34; is using &#34;$8/1024&#34;MB&#34;} {sum+=$8}; END {print &#34;\nTotal Memory Used: &#34;sum/1024/1024&#34;GB&#34;}'; Output: Proccess 1 is using 37.1914MB Proccess 2 is using 118.828MB &#8230; <a href="http://spechal.com/2012/03/23/apache-memory-used-per-process/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>*To update with more useful information*</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ps</span> <span style="color: #660033;">-ylC</span> httpd --sort:rss <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-v</span> RSS <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print &quot;Proccess &quot;++n&quot; is using &quot;$8/1024&quot;MB&quot;} {sum+=$8}; END {print &quot;\nTotal Memory Used: &quot;sum/1024/1024&quot;GB&quot;}'</span>;</pre></div></div>

<p>Output:</p>
<pre>Proccess 1 is using 37.1914MB
Proccess 2 is using 118.828MB
Proccess 3 is using 120.016MB
Proccess 4 is using 123.352MB
Proccess 5 is using 128.016MB
Proccess 6 is using 128.746MB
Proccess 7 is using 132.273MB
Proccess 8 is using 135.422MB
Proccess 9 is using 135.559MB
Proccess 10 is using 136.863MB
Proccess 11 is using 154.418MB
Proccess 12 is using 161.23MB
Proccess 13 is using 162.172MB
Proccess 14 is using 167.707MB
Proccess 15 is using 167.715MB
Proccess 16 is using 202.551MB
Proccess 17 is using 224.715MB
Proccess 18 is using 241.055MB
Proccess 19 is using 248.789MB
Proccess 20 is using 248.949MB

Total Memory Used: 3.10114GB
</pre>
]]></content:encoded>
			<wfw:commentRss>http://spechal.com/2012/03/23/apache-memory-used-per-process/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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; [host]" 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; [host]"
        exit 1
}

if [[ "$1" = "" || "$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>
	</channel>
</rss>

