<?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>Cheat Monk</title>
	<atom:link href="http://cheatmonk.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://cheatmonk.com</link>
	<description>Quick codes, one liners and cheats courtesy of the Monk</description>
	<lastBuildDate>Thu, 29 Dec 2011 18:09:19 +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>Convert Videos to MP4 Playable on iTunes/iPhone/iPad</title>
		<link>http://cheatmonk.com/2011/12/convert-videos-to-mp4-playable-on-itunes-iphone-ipad/</link>
		<comments>http://cheatmonk.com/2011/12/convert-videos-to-mp4-playable-on-itunes-iphone-ipad/#comments</comments>
		<pubDate>Thu, 29 Dec 2011 18:08:31 +0000</pubDate>
		<dc:creator>Code Monk</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://cheatmonk.com/?p=46</guid>
		<description><![CDATA[ffmpeg -i original-file.avi -r 30 -vcodec libx264 -threads 0 -ar 48000 -ab 128k -ac 2 -y -crf 21 converted_file.mp4]]></description>
			<content:encoded><![CDATA[<p><code>ffmpeg -i original-file.avi -r 30 -vcodec libx264 -threads 0 -ar 48000 -ab 128k -ac 2 -y -crf 21 converted_file.mp4</code></p>
]]></content:encoded>
			<wfw:commentRss>http://cheatmonk.com/2011/12/convert-videos-to-mp4-playable-on-itunes-iphone-ipad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Split A Big File Into Multiple TAR Files</title>
		<link>http://cheatmonk.com/2011/12/split-a-big-file-into-multiple-tar-files/</link>
		<comments>http://cheatmonk.com/2011/12/split-a-big-file-into-multiple-tar-files/#comments</comments>
		<pubDate>Wed, 28 Dec 2011 20:26:46 +0000</pubDate>
		<dc:creator>Code Monk</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://cheatmonk.com/?p=42</guid>
		<description><![CDATA[So you have a big archive or big file that you can&#8217;t fit on a single storage (are there still such things that does not fit onto a USB these days? ). How do you split them up on Linux? tar czvfp - /your/one/big/file-or-archive &#124; split -d -b 102400000 - multifile-prefix The result would be [...]]]></description>
			<content:encoded><![CDATA[<p>So you have a big archive or big file that you can&#8217;t fit on a single storage (are there still such things that does not fit onto a USB these days? <img src='http://cheatmonk.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> ). How do you split them up on Linux?</p>
<p><code>tar czvfp - /your/one/big/file-or-archive | split -d -b 102400000 - multifile-prefix</code></p>
<p>The result would be files like multifile-prefix00 .. multifile-prefixNN.</p>
<p>You can then put them back together with:</p>
<p><code>cat multifile-prefix* | tar xzvfp -</code></p>
<p>Nevertheless, go buy yourself bigger USB drives!</p>
]]></content:encoded>
			<wfw:commentRss>http://cheatmonk.com/2011/12/split-a-big-file-into-multiple-tar-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Process Monitor and Email Alert In One Line</title>
		<link>http://cheatmonk.com/2011/09/process-monitor-and-email-alert-in-one-line/</link>
		<comments>http://cheatmonk.com/2011/09/process-monitor-and-email-alert-in-one-line/#comments</comments>
		<pubDate>Wed, 21 Sep 2011 09:43:57 +0000</pubDate>
		<dc:creator>Code Monk</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://cheatmonk.com/?p=39</guid>
		<description><![CDATA[ps aux&#124;grep PROCESSNAME > /dev/null; if [ $? -ne 0 ]; then echo "Process is not running!" &#124; mail -s "ALERT: Process is not running" alert@yourdomain.com; fi Substitute PROCESSNAME with the name of the daemon or script you want to monitor. This is good if you have a long running script that you want to [...]]]></description>
			<content:encoded><![CDATA[<p><code>ps aux|grep PROCESSNAME > /dev/null; if [ $? -ne 0 ]; then echo "Process is not running!" | mail -s "ALERT: Process is not running" alert@yourdomain.com; fi</code></p>
<p>Substitute PROCESSNAME with the name of the daemon or script you want to monitor. This is good if you have a long running script that you want to be alerted of when it finishes (you can do more within the <code>then</code> clause of the <code>if</code> construct). It is best run from cron, perhaps every 5 mins, something like:</p>
<p><code>*/5 * * * * ps aux|grep PROCESSNAME > /dev/null; if [ $? -ne 0 ]; then echo "Process is not running!" | mail -s "ALERT: Process is not running" alert@yourdomain.com; fi</code></p>
]]></content:encoded>
			<wfw:commentRss>http://cheatmonk.com/2011/09/process-monitor-and-email-alert-in-one-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Copy and Uncompress (ssh, gunzip, tar) from Remote Server</title>
		<link>http://cheatmonk.com/2011/06/copy-and-uncompress-ssh-gunzip-tar-from-remote-server/</link>
		<comments>http://cheatmonk.com/2011/06/copy-and-uncompress-ssh-gunzip-tar-from-remote-server/#comments</comments>
		<pubDate>Sun, 26 Jun 2011 08:03:06 +0000</pubDate>
		<dc:creator>Code Monk</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[gunzip]]></category>
		<category><![CDATA[large files]]></category>
		<category><![CDATA[restore]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[tar]]></category>

		<guid isPermaLink="false">http://cheatmonk.com/?p=36</guid>
		<description><![CDATA[So you have a remote backup and you want to quickly have it restored locally or to another server without transferring, then uncompressing as 2 or 3 steps. ssh user@remote-server "cat /path/to/compressed/backup.tar.gz" &#124; tar xzvf -]]></description>
			<content:encoded><![CDATA[<p>So you have a remote backup and you want to quickly have it restored locally or to another server without transferring, then uncompressing as 2 or 3 steps.</p>
<p><code>ssh user@remote-server "cat /path/to/compressed/backup.tar.gz" | tar xzvf -</code></p>
]]></content:encoded>
			<wfw:commentRss>http://cheatmonk.com/2011/06/copy-and-uncompress-ssh-gunzip-tar-from-remote-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find Out Which Repository an RPM is Installed From</title>
		<link>http://cheatmonk.com/2011/02/find-out-which-repository-an-rpm-is-installed-from/</link>
		<comments>http://cheatmonk.com/2011/02/find-out-which-repository-an-rpm-is-installed-from/#comments</comments>
		<pubDate>Tue, 08 Feb 2011 03:02:30 +0000</pubDate>
		<dc:creator>Code Monk</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[packages]]></category>
		<category><![CDATA[repository]]></category>
		<category><![CDATA[rpm]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://cheatmonk.com/?p=30</guid>
		<description><![CDATA[You might be wondering which an rpm package came from. When yum info will list &#8220;installed&#8221; instead of which repository, well here is a one liner that can help: rpm -q gpg-pubkey --provides &#124; grep `rpm -qi &#124;grep Signature&#124;awk '{print $(NF)}'&#124;tail -1` Here is a sample: [root@vm-linux-01 ~]# rpm -q gpg-pubkey --provides &#124; grep `rpm [...]]]></description>
			<content:encoded><![CDATA[<p>You might be wondering which an rpm package came from. When <code>yum info
<packagename></code> will list &#8220;installed&#8221; instead of which repository, well here is a one liner that can help:</p>
<p><code>rpm -q gpg-pubkey --provides | grep `rpm -qi <PACKAGENAME>|grep Signature|awk '{print $(NF)}'|tail -1`</code></p>
<p>Here is a sample:<br />
<code><br />
[root@vm-linux-01 ~]# rpm -q gpg-pubkey --provides | grep `rpm -qi mysql-server|grep Signature|awk '{print $(NF)}'|tail -1`<br />
gpg(Atomic Rocket Turtle <admin@atomicrocketturtle.com>) = 4:32a951145ebd2744-418ffac9<br />
gpg(5ebd2744) = 4:32a951145ebd2744-418ffac9<br />
</code></p>
<p>So we know that mysql-server came from the Atomic repo <img src='http://cheatmonk.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://cheatmonk.com/2011/02/find-out-which-repository-an-rpm-is-installed-from/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Copy Large Files Over the Network with Netcat + tar + Qpress compression</title>
		<link>http://cheatmonk.com/2010/11/copy-large-files-over-the-network-with-netcat-tar-qpress-compression/</link>
		<comments>http://cheatmonk.com/2010/11/copy-large-files-over-the-network-with-netcat-tar-qpress-compression/#comments</comments>
		<pubDate>Wed, 01 Dec 2010 05:38:13 +0000</pubDate>
		<dc:creator>Code Monk</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[disk quota]]></category>
		<category><![CDATA[large files]]></category>
		<category><![CDATA[netcat]]></category>
		<category><![CDATA[qpress]]></category>
		<category><![CDATA[tar]]></category>

		<guid isPermaLink="false">http://cheatmonk.com/?p=28</guid>
		<description><![CDATA[On the target host, change directory to the folder you want to copy the files to: nc -l 9999 &#124; qpress -vdio &#124; tar xvf - On the source host, change directory to the folder containing the files to be copied: tar -cf - . &#124; qpress -vio - . &#124; nc [TARGET_HOST_IP] 9999]]></description>
			<content:encoded><![CDATA[<p>On the target host, change directory to the folder you want to copy the files to:</p>
<p><code>nc -l 9999 | qpress -vdio | tar xvf -</code></p>
<p>On the source host, change directory to the folder containing the files to be copied:</p>
<p><code>tar -cf - . | qpress -vio - . | nc [TARGET_HOST_IP] 9999</code></p>
]]></content:encoded>
			<wfw:commentRss>http://cheatmonk.com/2010/11/copy-large-files-over-the-network-with-netcat-tar-qpress-compression/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convert Videos to AVI Using mencoder 3-pass Method</title>
		<link>http://cheatmonk.com/2010/11/convert-videos-to-avi-using-mencoder-3-pass-method/</link>
		<comments>http://cheatmonk.com/2010/11/convert-videos-to-avi-using-mencoder-3-pass-method/#comments</comments>
		<pubDate>Sun, 14 Nov 2010 02:57:16 +0000</pubDate>
		<dc:creator>Code Monk</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[mencoder]]></category>
		<category><![CDATA[video conversion]]></category>

		<guid isPermaLink="false">http://cheatmonk.com/?p=25</guid>
		<description><![CDATA[Have you downloaded a video file you can&#8217;t play or you want to share but others will not be able to play? Convert them to AVI: for i in 1 3 3; do mencoder /path/to/original-video -forceidx -ovc lavc -lavcopts vcodec=mpeg4:vpass=$i -lameopts ratio=75 -oac mp3lame -o /path/to/desired-output.avi; done]]></description>
			<content:encoded><![CDATA[<p>Have you downloaded a video file you can&#8217;t play or you want to share but others will not be able to play? Convert them to AVI:</p>
<p><code>for i in 1 3 3; do mencoder /path/to/original-video -forceidx -ovc lavc -lavcopts vcodec=mpeg4:vpass=$i -lameopts ratio=75 -oac mp3lame -o /path/to/desired-output.avi; done</code></p>
]]></content:encoded>
			<wfw:commentRss>http://cheatmonk.com/2010/11/convert-videos-to-avi-using-mencoder-3-pass-method/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>List Distinct IPs on Your Apache Access Log</title>
		<link>http://cheatmonk.com/2010/01/list-distinct-ips-on-your-apache-access-log/</link>
		<comments>http://cheatmonk.com/2010/01/list-distinct-ips-on-your-apache-access-log/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 02:17:29 +0000</pubDate>
		<dc:creator>Code Monk</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[access_log]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[ip address]]></category>

		<guid isPermaLink="false">http://cheatmonk.com/?p=22</guid>
		<description><![CDATA[If you ever need to look at the IPs on your access_log at some point here is a quick reference. cat access_log&#124;awk '{print $1}'&#124;sort&#124;uniq -c This will list all IP, sort them ascending and count their occurrence and prepend that count for each IP found.]]></description>
			<content:encoded><![CDATA[<p>If you ever need to look at the IPs on your access_log at some point here is a quick reference. </p>
<p><code>cat access_log|awk '{print $1}'|sort|uniq -c</code></p>
<p>This will list all IP, sort them ascending and count their occurrence and prepend that count for each IP found.</p>
]]></content:encoded>
			<wfw:commentRss>http://cheatmonk.com/2010/01/list-distinct-ips-on-your-apache-access-log/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Retrieve Plesk &#8216;admin&#8217; Password on Windows</title>
		<link>http://cheatmonk.com/2009/11/retrieve-plesk-admin-password-on-windows/</link>
		<comments>http://cheatmonk.com/2009/11/retrieve-plesk-admin-password-on-windows/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 10:24:02 +0000</pubDate>
		<dc:creator>Code Monk</dc:creator>
				<category><![CDATA[Plesk Control Panel]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Parallels]]></category>
		<category><![CDATA[Virtuozzo]]></category>

		<guid isPermaLink="false">http://cheatmonk.com/?p=19</guid>
		<description><![CDATA[If you have forgotten access to your Plesk Control Panel and have physical or remote desktop access to your Windows server here&#8217;s how. From the command prompt browse to you Plesk installation directory i.e. C:\Parallels\Plesk or C:\SWSoft\Plesk then issue the command: admin\bin\plesksrvclient.exe -get A popup should appear listing your password.]]></description>
			<content:encoded><![CDATA[<p>If you have forgotten access to your Plesk Control Panel and have physical or remote desktop access to your Windows server here&#8217;s how.</p>
<p>From the command prompt browse to you Plesk installation directory i.e. C:\Parallels\Plesk or C:\SWSoft\Plesk then issue the command:</p>
<p><code>admin\bin\plesksrvclient.exe -get</code></p>
<p>A popup should appear listing your password.</p>
]]></content:encoded>
			<wfw:commentRss>http://cheatmonk.com/2009/11/retrieve-plesk-admin-password-on-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find Large Files using `find` Command</title>
		<link>http://cheatmonk.com/2009/11/find-large-files-using-find-command/</link>
		<comments>http://cheatmonk.com/2009/11/find-large-files-using-find-command/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 03:47:15 +0000</pubDate>
		<dc:creator>Code Monk</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[disk quota]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[large files]]></category>

		<guid isPermaLink="false">http://cheatmonk.com/?p=15</guid>
		<description><![CDATA[Oftentimes you will be maintaining disk space on your servers or nearing your account&#8217;s disk space quota. Quickly you want to know which files are taking up your disk space, here&#8217;s a quick rundown to find files greater than 10MB. find . -type f -size +10240k -exec ls -lh {} \; &#124; awk '{ print [...]]]></description>
			<content:encoded><![CDATA[<p>Oftentimes you will be maintaining disk space on your servers or nearing your account&#8217;s disk space quota. Quickly you want to know which files are taking up your disk space, here&#8217;s a quick rundown to find files greater than 10MB.</p>
<p><code>find . -type f -size +10240k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'</code></p>
<p>This will find files from your current working directory and list them alongside their corresponding sizes.</p>
]]></content:encoded>
			<wfw:commentRss>http://cheatmonk.com/2009/11/find-large-files-using-find-command/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

