<?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>sudo -s</title>
	<atom:link href="http://sudoers.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://sudoers.org</link>
	<description>Got root?</description>
	<lastBuildDate>Mon, 13 Jul 2009 07:53:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Mail log fu</title>
		<link>http://sudoers.org/2009/07/mail-log-fu/</link>
		<comments>http://sudoers.org/2009/07/mail-log-fu/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 22:49:25 +0000</pubDate>
		<dc:creator>limed</dc:creator>
				<category><![CDATA[sys admin]]></category>

		<guid isPermaLink="false">http://sudoers.org/?p=27</guid>
		<description><![CDATA[Ever had someone go &#8220;I need you to look through the logs and get me every email address this From address sent to&#8221;. Well heres how (or at least the easiest way I can think of doing it)
grep "from=&#60;foo@example.com&#62;" /var/log/mail.log &#124; awk '{if ($6 != "NOQUEUE:"){print $6}}' &#124; sed 's/\://g' &#124; while read SEARCH; do [...]]]></description>
			<content:encoded><![CDATA[<p>Ever had someone go &#8220;I need you to look through the logs and get me every email address this From address sent to&#8221;. Well heres how (or at least the easiest way I can think of doing it)</p>
<blockquote><p><code>grep "from=&lt;foo@example.com&gt;" /var/log/mail.log | awk '{if ($6 != "NOQUEUE:"){print $6}}' | sed 's/\://g' | while read SEARCH; do grep "${SEARCH}" /var/log/mail.log; done | grep "to=" | awk '{print $7}' | sed -r 's/^to=&lt;(.+)&gt;\,$/\1/g' | uniq</code></p></blockquote>
<p>Here is a step by step walkthrough of whats going on</p>
<ol>
<li>We grep the from address out of the mail log</li>
<li>Pipe the output to awk and get the 6th column which is the mail id, if the 6th column doesn&#8217;t start with NOQUEUE print the output</li>
<li>The output goes to sed which removes the &#8220;:&#8221; and</li>
<li>Read the output and put it into a variable and from that variable go through the mail log again</li>
<li>This time filter out the &#8220;to=&#8221; line from the mail log and print out the 7th column (which is the to address)</li>
<li>Use sed to filter out the to=&lt;&gt; line to print out the actual email addresses</li>
<li>Pass it through uniq to make sure there are no dupes</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://sudoers.org/2009/07/mail-log-fu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to remove duplicate file</title>
		<link>http://sudoers.org/2009/04/how-to-remove-duplicate-file/</link>
		<comments>http://sudoers.org/2009/04/how-to-remove-duplicate-file/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 19:16:13 +0000</pubDate>
		<dc:creator>limed</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sudoers.org/?p=25</guid>
		<description><![CDATA[Taken from shell-fu
OUTF=rem-duplicates.sh;
echo "#! /bin/sh" &#62; $OUTF;
find "$@" -type f -print0 &#124;
xargs -0 -n1 md5sum &#124;
sort --key=1,32 &#124; uniq -w 32 -d --all-repeated=separate &#124;
sed -r 's/^[0-9a-f]*( )*//;s/([^a-zA-Z0-9./_-])/\\\1/g;s/(.+)/#rm \1/' &#62;&#62; $OUTF;
chmod a+x $OUTF; ls -l $OUTF
]]></description>
			<content:encoded><![CDATA[<p>Taken from shell-fu</p>
<blockquote><p><code>OUTF=rem-duplicates.sh;<br />
echo "#! /bin/sh" &gt; $OUTF;<br />
find "$@" -type f -print0 |<br />
xargs -0 -n1 md5sum |<br />
sort --key=1,32 | uniq -w 32 -d --all-repeated=separate |<br />
sed -r 's/^[0-9a-f]*( )*//;s/([^a-zA-Z0-9./_-])/\\\1/g;s/(.+)/#rm \1/' &gt;&gt; $OUTF;<br />
chmod a+x $OUTF; ls -l $OUTF</code></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://sudoers.org/2009/04/how-to-remove-duplicate-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deleting special character files in UNIX</title>
		<link>http://sudoers.org/2009/04/deleting-special-character-files-in-unix/</link>
		<comments>http://sudoers.org/2009/04/deleting-special-character-files-in-unix/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 20:25:36 +0000</pubDate>
		<dc:creator>limed</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sudoers.org/?p=21</guid>
		<description><![CDATA[If you&#8217;re an idiot like me and managed to create a file with special characters like --exclude=*.svn and need to remove it, here&#8217;s how
rm ./'--exclude\=\*.svn'
Remember don&#8217;t be an idiot like me
]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re an idiot like me and managed to create a file with special characters like <code>--exclude=*.svn</code> and need to remove it, here&#8217;s how</p>
<blockquote><p><code>rm ./'--exclude\=\*.svn'</code></p></blockquote>
<p>Remember don&#8217;t be an idiot like me</p>
]]></content:encoded>
			<wfw:commentRss>http://sudoers.org/2009/04/deleting-special-character-files-in-unix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Checking expiration date for an SSL cert</title>
		<link>http://sudoers.org/2008/12/checking-expiration-date-for-an-ssl-cert/</link>
		<comments>http://sudoers.org/2008/12/checking-expiration-date-for-an-ssl-cert/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 01:17:15 +0000</pubDate>
		<dc:creator>limed</dc:creator>
				<category><![CDATA[sys admin]]></category>

		<guid isPermaLink="false">http://sudoers.org/?p=16</guid>
		<description><![CDATA[Here is you how you check whether an SSL cert is valid and hasn&#8217;t yet expired
1. Retrieve the certificate.
$ echo "" &#124; openssl s_client -connect server:443 &#62; certificate
2. Check the expiration date of the certificate.
$ openssl x509 -in certificate -noout -enddate
Or you can use ssl-cert-check or check-expire

]]></description>
			<content:encoded><![CDATA[<p>Here is you how you check whether an SSL cert is valid and hasn&#8217;t yet expired</p>
<p>1. Retrieve the certificate.</p>
<pre>$ echo "" | openssl s_client -connect server:443 &gt; certificate</pre>
<p>2. Check the expiration date of the certificate.</p>
<pre>$ openssl x509 -in certificate -noout -enddate</pre>
<p>Or you can use <a href="http://freshmeat.net/projects/ssl-cert-check/">ssl-cert-check</a> or <a href="http://sial.org/howto/openssl/check-expire/">check-expire<br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sudoers.org/2008/12/checking-expiration-date-for-an-ssl-cert/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Changing permissions for all directories in folder</title>
		<link>http://sudoers.org/2008/12/changing-permissions-for-all-directories-in-folder/</link>
		<comments>http://sudoers.org/2008/12/changing-permissions-for-all-directories-in-folder/#comments</comments>
		<pubDate>Sun, 07 Dec 2008 06:57:22 +0000</pubDate>
		<dc:creator>limed</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[sys admin]]></category>

		<guid isPermaLink="false">http://sudoers.org/?p=13</guid>
		<description><![CDATA[Ever run into a situation where you have a mixture of both files and folders in a directory and you only need to change the permission of the folder? Naturally the first thing that comes to mind is to do something like this
find . -type d -print &#124; xargs chmod 755
But what happens if your [...]]]></description>
			<content:encoded><![CDATA[<p>Ever run into a situation where you have a mixture of both files and folders in a directory and you only need to change the permission of the folder? Naturally the first thing that comes to mind is to do something like this</p>
<pre>find . -type d -print | xargs chmod 755</pre>
<p>But what happens if your folders have spaces? Using find that way will not escape the spaces instead the solution to this is to use find but in a slightly different manner</p>
<pre>find . -type d -print0 | xargs -0 chmod 755</pre>
<p>The -print0 tells find to terminate with zero so that whitespaces are recognized and the same goes for xargs as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://sudoers.org/2008/12/changing-permissions-for-all-directories-in-folder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Taken from Shell-fu</title>
		<link>http://sudoers.org/2008/12/taken-from-shell-fu/</link>
		<comments>http://sudoers.org/2008/12/taken-from-shell-fu/#comments</comments>
		<pubDate>Tue, 02 Dec 2008 22:20:59 +0000</pubDate>
		<dc:creator>limed</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[sys admin]]></category>

		<guid isPermaLink="false">http://sudoers.org/?p=9</guid>
		<description><![CDATA[This is taken from shell-fu.org still a pretty handy one liner though
aptitude search ~c &#124; awk '{ print $2 }' &#124; xargs aptitude -y purge
This will delete any packages that are not installed anymore which still has configuration files on the box
]]></description>
			<content:encoded><![CDATA[<p>This is taken from shell-fu.org still a pretty handy one liner though</p>
<pre>aptitude search ~c | awk '{ print $2 }' | xargs aptitude -y purge</pre>
<p>This will delete any packages that are not installed anymore which still has configuration files on the box</p>
]]></content:encoded>
			<wfw:commentRss>http://sudoers.org/2008/12/taken-from-shell-fu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>deborphan and for loops</title>
		<link>http://sudoers.org/2008/12/deborphan-and-for-loops/</link>
		<comments>http://sudoers.org/2008/12/deborphan-and-for-loops/#comments</comments>
		<pubDate>Tue, 02 Dec 2008 18:29:59 +0000</pubDate>
		<dc:creator>limed</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[sys admin]]></category>

		<guid isPermaLink="false">http://sudoers.org/?p=7</guid>
		<description><![CDATA[deborphan is a package in debian that list orphaned libraries in debian. Handy for removing libraries that is no longer needed on a server. The problem with deborphan is that it only lists packages that are orphaned but doesnt remove them, so I do this:
for i in `deborphan`; do sudo aptitude remove $i; done
I love [...]]]></description>
			<content:encoded><![CDATA[<p>deborphan is a package in debian that list orphaned libraries in debian. Handy for removing libraries that is no longer needed on a server. The problem with deborphan is that it only lists packages that are orphaned but doesnt remove them, so I do this:</p>
<pre>for i in `deborphan`; do sudo aptitude remove $i; done</pre>
<p>I love BASH <img src='http://sudoers.org/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://sudoers.org/2008/12/deborphan-and-for-loops/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hello world!</title>
		<link>http://sudoers.org/2008/11/hello-world/</link>
		<comments>http://sudoers.org/2008/11/hello-world/#comments</comments>
		<pubDate>Wed, 26 Nov 2008 18:25:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sudoers.org/wordpress/?p=1</guid>
		<description><![CDATA[Hello World
]]></description>
			<content:encoded><![CDATA[<p>Hello World</p>
]]></content:encoded>
			<wfw:commentRss>http://sudoers.org/2008/11/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
