<?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>damonparker.org &#187; Snippets</title>
	<atom:link href="http://damonparker.org/blog/category/technical/snippets/feed/" rel="self" type="application/rss+xml" />
	<link>http://damonparker.org</link>
	<description>code / ecommerce / life</description>
	<lastBuildDate>Mon, 14 Jun 2010 14:33:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0-RC3</generator>
		<item>
		<title>Debugging Wifi Connectivity and Routing</title>
		<link>http://damonparker.org/blog/2010/06/12/debugging-wifi-connectivity-and-routing/</link>
		<comments>http://damonparker.org/blog/2010/06/12/debugging-wifi-connectivity-and-routing/#comments</comments>
		<pubDate>Fri, 11 Jun 2010 21:33:32 +0000</pubDate>
		<dc:creator>damonp</dc:creator>
				<category><![CDATA[Snippets]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://damonparker.org/?p=525</guid>
		<description><![CDATA[Sometimes wifi connectivity issues can be massaged a little by getting a little pushy with it&#8230; turn your internal airport card off. Leave it off for a minute then turn it back on and see if by forcing it to attempt to re-connect to your local network.  Oftentimes this will clear up minor issues. Check [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Sometimes wifi connectivity issues can be massaged a little by getting a little pushy with it&#8230; turn your internal airport card off. Leave it off for a minute then turn it back on and see if by forcing it to attempt to re-connect to your local network.  Oftentimes this will clear up minor issues.</p>
<p>Check your routing tables:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">netstat -nr</div></div>
<p>Get just the default route:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">netstat -nr <span style="color: #66cc66;">|</span> grep default</div></div>
<p>In action:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">&#91;</span>root<span style="color: #66cc66;">@</span>howie ~<span style="color: #66cc66;">&#93;</span>$ netstat -nr <span style="color: #66cc66;">|</span> grep default<br />
<span style="color: #cc66cc;">5</span>:default &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;192.168.1.1 &nbsp; &nbsp; &nbsp; &nbsp;UGSc &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #cc66cc;">11</span> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #cc66cc;">5</span> &nbsp; &nbsp; en1</div></div>
 <img src="http://damonparker.org/wp-content/plugins/feed-statistics.php?view=1&post_id=525" width="1" height="1" style="display: none;" /><img src="http://damonparker.org/?ak_action=api_record_view&id=525&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://damonparker.org/blog/2010/06/12/debugging-wifi-connectivity-and-routing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enable Sendmail for PHP mail() in OSX</title>
		<link>http://damonparker.org/blog/2010/02/25/enable-sendmail-for-php-mail-in-osx/</link>
		<comments>http://damonparker.org/blog/2010/02/25/enable-sendmail-for-php-mail-in-osx/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 22:05:41 +0000</pubDate>
		<dc:creator>damonp</dc:creator>
				<category><![CDATA[Snippets]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[sendmail]]></category>

		<guid isPermaLink="false">http://damonparker.org/blog/?p=468</guid>
		<description><![CDATA[Since this didn&#8217;t dawn on me for thirty minutes while I pursued other avenues&#8230; In /etc/hostconfig add/edit a line like: MAILSERVER=-YES- Note to self: Look for more OSX server administration clients.]]></description>
			<content:encoded><![CDATA[<p></p><p>Since this didn&#8217;t dawn on me for thirty minutes while I pursued other avenues&#8230;</p>
<p>In /etc/hostconfig add/edit a line like:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">MAILSERVER=</span>-YES-</div></div>
<p>Note to self: Look for more OSX server administration clients.  </p>
 <img src="http://damonparker.org/wp-content/plugins/feed-statistics.php?view=1&post_id=468" width="1" height="1" style="display: none;" /><img src="http://damonparker.org/?ak_action=api_record_view&id=468&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://damonparker.org/blog/2010/02/25/enable-sendmail-for-php-mail-in-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache Log Grepping</title>
		<link>http://damonparker.org/blog/2009/09/14/apache-log-grepping/</link>
		<comments>http://damonparker.org/blog/2009/09/14/apache-log-grepping/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 18:34:51 +0000</pubDate>
		<dc:creator>damonp</dc:creator>
				<category><![CDATA[Snippets]]></category>

		<guid isPermaLink="false">http://damonparker.org/blog/?p=368</guid>
		<description><![CDATA[Nothing beats a full stats package, but with a little grepping and a logfile and we can figure out some quick statistics. Get only hits coming from Google.com/search: grep 'google.com/search' access_log &#124; head -1 Extract only the referrer field: grep 'google.com/search' access_log &#124; head -1 &#124; awk '{print $11}' Get the search terms only: grep [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Nothing beats a full stats package, but with a little grepping and a logfile and we can figure out some quick statistics.</p>
<p><strong>Get only hits coming from Google.com/search:</strong></p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">grep <span style="color: #ff0000;">'google.com/search'</span> access_log <span style="color: #66cc66;">|</span> head -<span style="color: #cc66cc;">1</span></div></div>
<p><strong>Extract only the referrer field:</strong></p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">grep <span style="color: #ff0000;">'google.com/search'</span> access_log <span style="color: #66cc66;">|</span> head -<span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">|</span> awk <span style="color: #ff0000;">'{print $11}'</span></div></div>
<p><strong>Get the search terms only:</strong></p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">grep <span style="color: #ff0000;">'google.com/search'</span> access_log <span style="color: #66cc66;">|</span> \<br />
&nbsp; head -<span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">|</span> \<br />
&nbsp; awk <span style="color: #ff0000;">'{print $11}'</span> <span style="color: #66cc66;">|</span> \<br />
&nbsp; cut -d\? -f2 <span style="color: #66cc66;">|</span> cut -d\<span style="color: #66cc66;">&amp;</span> -f1 <span style="color: #66cc66;">|</span> \<br />
&nbsp; sed <span style="color: #ff0000;">'s/+/ /g;s/%22/&quot;/g;s/q=//'</span></div></div>
<p>Here&#8217;s a little script that puts it all together.  It finds the unique search terms, cleans out the trash, sorts them and list the top twenty five in order of descending hit count.</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;">#!/bin/sh</span><br />
<span style="color: #0000ff;">LOG=</span><span style="color: #ff0000;">&quot;/var/logs/httpd/access_log&quot;</span><br />
grep <span style="color: #ff0000;">'google.com/search'</span> <span style="color: #0000ff;">$LOG</span> <span style="color: #66cc66;">|</span> \<br />
&nbsp; awk <span style="color: #ff0000;">'{print $11}'</span> <span style="color: #66cc66;">|</span> \<br />
&nbsp; cut -d\? -f2 <span style="color: #66cc66;">|</span> cut -d\<span style="color: #66cc66;">&amp;</span> -f1 <span style="color: #66cc66;">|</span> \<br />
&nbsp; sed <span style="color: #ff0000;">'s/+/ /g;s/%22/&quot;/g;s/q=//'</span> <span style="color: #66cc66;">|</span> \<br />
&nbsp; sed <span style="color: #ff0000;">'s/%[0-9a-fA-F][0-9a-fA-F]/ /g;s/&quot;//g'</span> <span style="color: #66cc66;">|</span> \<br />
&nbsp; grep -v <span style="color: #ff0000;">'='</span> <span style="color: #66cc66;">|</span> sort <span style="color: #66cc66;">|</span> uniq -c <span style="color: #66cc66;">|</span> sort -rn <span style="color: #66cc66;">|</span> head -<span style="color: #cc66cc;">25</span></div></div>
<p>To see them all remove the <code class="codecolorer bash default"><span class="bash"><span style="color: #66cc66;">|</span> head -<span style="color: #cc66cc;">25</span></span></code> statement at the end of the command.</p>
<p>Thanks to an article at <a href="http://www.linuxjournal.com/article/9417">Linux Journal</a> for the examples.</p>
 <img src="http://damonparker.org/wp-content/plugins/feed-statistics.php?view=1&post_id=368" width="1" height="1" style="display: none;" /><img src="http://damonparker.org/?ak_action=api_record_view&id=368&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://damonparker.org/blog/2009/09/14/apache-log-grepping/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Find setuid root Files</title>
		<link>http://damonparker.org/blog/2009/09/10/find-setuid-root-files/</link>
		<comments>http://damonparker.org/blog/2009/09/10/find-setuid-root-files/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 04:29:20 +0000</pubDate>
		<dc:creator>damonp</dc:creator>
				<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://damonparker.org/blog/?p=452</guid>
		<description><![CDATA[Find all setuid / setgid files owned by root:
find / -user root -type f \( -perm -4000 -o -perm -2000 \) -exec ls -ld '{}' \;

Find all setuid / setgid files owned by any user:
find / -type f \( -perm -4000 -o -perm -2000 \) -exec ls -ld '{}' \;]]></description>
			<content:encoded><![CDATA[<p></p><p>Find all setuid / setgid files owned by root:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">find <span style="color: #66cc66;">/</span> -user root -<span style="color: #000066;">type</span> f \<span style="color: #66cc66;">&#40;</span> -perm -<span style="color: #cc66cc;">4000</span> -o -perm -<span style="color: #cc66cc;">2000</span> \<span style="color: #66cc66;">&#41;</span> -<span style="color: #000066;">exec</span> ls -ld <span style="color: #ff0000;">'{}'</span> \;</div></div>
<p>Find all setuid / setgid files owned by any user:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">find <span style="color: #66cc66;">/</span> -<span style="color: #000066;">type</span> f \<span style="color: #66cc66;">&#40;</span> -perm -<span style="color: #cc66cc;">4000</span> -o -perm -<span style="color: #cc66cc;">2000</span> \<span style="color: #66cc66;">&#41;</span> -<span style="color: #000066;">exec</span> ls -ld <span style="color: #ff0000;">'{}'</span> \;</div></div>
 <img src="http://damonparker.org/wp-content/plugins/feed-statistics.php?view=1&post_id=452" width="1" height="1" style="display: none;" /><img src="http://damonparker.org/?ak_action=api_record_view&id=452&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://damonparker.org/blog/2009/09/10/find-setuid-root-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debugging HTTP Headers with cURL</title>
		<link>http://damonparker.org/blog/2009/08/31/debugging-http-headers-with-curl/</link>
		<comments>http://damonparker.org/blog/2009/08/31/debugging-http-headers-with-curl/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 16:05:39 +0000</pubDate>
		<dc:creator>damonp</dc:creator>
				<category><![CDATA[Snippets]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://damonparker.org/blog/?p=369</guid>
		<description><![CDATA[curl -I http://damonparker.org More info on cURL]]></description>
			<content:encoded><![CDATA[<p></p><div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">curl -I http:<span style="color: #66cc66;">//</span>damonparker.org</div></div>
<p><a href="http://curl.haxx.se/docs/manpage.html">More info on cURL</a></p>
 <img src="http://damonparker.org/wp-content/plugins/feed-statistics.php?view=1&post_id=369" width="1" height="1" style="display: none;" /><img src="http://damonparker.org/?ak_action=api_record_view&id=369&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://damonparker.org/blog/2009/08/31/debugging-http-headers-with-curl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OSX Scrollbars Top and Bottom</title>
		<link>http://damonparker.org/blog/2007/11/05/osx-scrollbars-top-and-bottom/</link>
		<comments>http://damonparker.org/blog/2007/11/05/osx-scrollbars-top-and-bottom/#comments</comments>
		<pubDate>Mon, 05 Nov 2007 22:00:16 +0000</pubDate>
		<dc:creator>damonp</dc:creator>
				<category><![CDATA[Snippets]]></category>

		<guid isPermaLink="false">http://damonparker.org/blog/2007/11/05/osx-scrollbars-top-and-bottom/</guid>
		<description><![CDATA[In Terminal: defaults write &#34;Apple Global Domain&#34; AppleScrollBarVariant DoubleBoth]]></description>
			<content:encoded><![CDATA[<p></p><p>In Terminal:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">defaults write <span style="color: #ff0000;">&quot;Apple Global Domain&quot;</span> AppleScrollBarVariant DoubleBoth</div></div>
 <img src="http://damonparker.org/wp-content/plugins/feed-statistics.php?view=1&post_id=383" width="1" height="1" style="display: none;" /><img src="http://damonparker.org/?ak_action=api_record_view&id=383&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://damonparker.org/blog/2007/11/05/osx-scrollbars-top-and-bottom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quickly Copy MySQL Database to Remote Host</title>
		<link>http://damonparker.org/blog/2007/08/31/quickly-copy-mysql-database-to-remote-host/</link>
		<comments>http://damonparker.org/blog/2007/08/31/quickly-copy-mysql-database-to-remote-host/#comments</comments>
		<pubDate>Fri, 31 Aug 2007 16:29:50 +0000</pubDate>
		<dc:creator>damonp</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[Snippets]]></category>

		<guid isPermaLink="false">http://damonparker.org/blog/2007/08/31/quickly-copy-mysql-database-to-remote-host/</guid>
		<description><![CDATA[Copy an entire database: mysqldump LOCAL_DBNAME &#124; ssh USER@REMOTE_HOST mysql -p REMOTE_DBNAME Copy a single table: mysqldump LOCAL_DBNAME LOCAL_TABLE &#124; ssh USER@REMOTE_HOST -p REMOTE_DBNAME REMOTE_TABLE This shortcut only works if you can access the local DB without a password. If you have to login to both local and remote MySQL servers, the MySQL password prompts [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Copy an entire database:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">mysqldump LOCAL_DBNAME <span style="color: #66cc66;">|</span> ssh USER<span style="color: #66cc66;">@</span>REMOTE_HOST mysql -p REMOTE_DBNAME</div></div>
<p>Copy a single table:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">mysqldump LOCAL_DBNAME LOCAL_TABLE <span style="color: #66cc66;">|</span> ssh USER<span style="color: #66cc66;">@</span>REMOTE_HOST -p REMOTE_DBNAME REMOTE_TABLE</div></div>
<p>This shortcut only works if you can access the local DB without a password.  If you have to login to both local and remote MySQL servers, the MySQL password prompts get mashed together.  You could specify the password on the command line like</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">-pPASSWORD</div></div>
<p>but your shell may keep the password in its history so that anyone with access to your account could pick through your shell history and retrieve the password.  Using the MySQL password prompt doesn&#8217;t do this.</p>
 <img src="http://damonparker.org/wp-content/plugins/feed-statistics.php?view=1&post_id=377" width="1" height="1" style="display: none;" /><img src="http://damonparker.org/?ak_action=api_record_view&id=377&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://damonparker.org/blog/2007/08/31/quickly-copy-mysql-database-to-remote-host/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH-Keygen For Public Key Authentication</title>
		<link>http://damonparker.org/blog/2007/08/07/ssh-keygen-for-public-key-authentication/</link>
		<comments>http://damonparker.org/blog/2007/08/07/ssh-keygen-for-public-key-authentication/#comments</comments>
		<pubDate>Tue, 07 Aug 2007 15:16:09 +0000</pubDate>
		<dc:creator>damonp</dc:creator>
				<category><![CDATA[Snippets]]></category>
		<category><![CDATA[SysAdmin]]></category>

		<guid isPermaLink="false">http://damonparker.org/blog/2007/08/07/ssh-keygen-for-public-key-authentication/</guid>
		<description><![CDATA[ssh-keygen -t dsa -b 1024 &#91;root@titan .ssh&#93;# ssh-keygen -t dsa -b 1024 Generating public/private dsa key pair. Enter file in which to save the key &#40;/root/.ssh/id_dsa&#41;: Enter passphrase &#40;empty for no passphrase&#41;: Enter same passphrase again: Your identification has been saved in /root/.ssh/id_dsa. Your public key has been saved in /root/.ssh/id_dsa.pub. The key fingerprint is: [...]]]></description>
			<content:encoded><![CDATA[<p></p><div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ssh-keygen -t dsa -b <span style="color: #cc66cc;">1024</span></div></div>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">&#91;</span>root<span style="color: #66cc66;">@</span>titan .ssh<span style="color: #66cc66;">&#93;</span><span style="color: #808080; font-style: italic;"># ssh-keygen -t dsa -b 1024</span><br />
Generating public<span style="color: #66cc66;">/</span>private dsa key pair.<br />
Enter file <span style="color: #b1b100;">in</span> which to save the key <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">/</span>root<span style="color: #66cc66;">/</span>.ssh<span style="color: #66cc66;">/</span>id_dsa<span style="color: #66cc66;">&#41;</span>: <br />
Enter passphrase <span style="color: #66cc66;">&#40;</span>empty <span style="color: #b1b100;">for</span> no passphrase<span style="color: #66cc66;">&#41;</span>: <br />
Enter same passphrase again: <br />
Your identification has been saved <span style="color: #b1b100;">in</span> <span style="color: #66cc66;">/</span>root<span style="color: #66cc66;">/</span>.ssh<span style="color: #66cc66;">/</span>id_dsa.<br />
Your public key has been saved <span style="color: #b1b100;">in</span> <span style="color: #66cc66;">/</span>root<span style="color: #66cc66;">/</span>.ssh<span style="color: #66cc66;">/</span>id_dsa.pub.<br />
The key fingerprint is:<br />
d2:<span style="color: #cc66cc;">32</span>:02:4e:<span style="color: #cc66cc;">25</span>:<span style="color: #cc66cc;">27</span>:<span style="color: #cc66cc;">53</span>:8f:c1:ab:<span style="color: #cc66cc;">80</span>:02:0f:<span style="color: #cc66cc;">25</span>:da:af root<span style="color: #66cc66;">@</span>host.domain.com</div></div>
<p>Then copy in any public keys into ~/.ssh/authorized_keys</p>
 <img src="http://damonparker.org/wp-content/plugins/feed-statistics.php?view=1&post_id=375" width="1" height="1" style="display: none;" /><img src="http://damonparker.org/?ak_action=api_record_view&id=375&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://damonparker.org/blog/2007/08/07/ssh-keygen-for-public-key-authentication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exim Queue Snippets</title>
		<link>http://damonparker.org/blog/2007/06/28/exim-queue-snippets/</link>
		<comments>http://damonparker.org/blog/2007/06/28/exim-queue-snippets/#comments</comments>
		<pubDate>Thu, 28 Jun 2007 13:26:13 +0000</pubDate>
		<dc:creator>damonp</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[SysAdmin]]></category>

		<guid isPermaLink="false">http://damonparker.org/blog/2007/06/28/exim-queue-snippets/</guid>
		<description><![CDATA[These are all useful when trying to track down an open formmail script. List bounce messages exiqgrep -f '^&#60;&#62;$' Freeze bounce messages exiqgrep -i -f '^&#60;&#62;$' &#124; xargs exim -Mf Freeze messages from user@domain.com exiqgrep -i -f user@domain.com&#124; xargs exim -Mf Find out what user your webserver runs as. Use this as the email address [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>These are all useful when trying to track down an open formmail script.</p>
<p>List bounce messages</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">exiqgrep -f <span style="color: #ff0000;">'^&lt;&gt;$'</span></div></div>
<p>Freeze bounce messages</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">exiqgrep -i -f <span style="color: #ff0000;">'^&lt;&gt;$'</span> <span style="color: #66cc66;">|</span> xargs exim -Mf</div></div>
<p>Freeze messages from <em>user@domain.com</em></p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">exiqgrep -i -f user<span style="color: #66cc66;">@</span>domain.com<span style="color: #66cc66;">|</span> xargs exim -Mf</div></div>
<p>Find out what user your webserver runs as.  Use this as the email address to key on.  For example, my Apache runs as <em>nobody</em> so I want to freeze all messages sent from the user <em>nobody@domain.com</em> so I can look through them to see if I can deduce where the insecure formmail script is.</p>
<p>Delete frozen messages</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">exiqgrep -z -i <span style="color: #66cc66;">|</span> xargs exim -Mrm</div></div>
 <img src="http://damonparker.org/wp-content/plugins/feed-statistics.php?view=1&post_id=301" width="1" height="1" style="display: none;" /><img src="http://damonparker.org/?ak_action=api_record_view&id=301&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://damonparker.org/blog/2007/06/28/exim-queue-snippets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recursive Chmod Tricks</title>
		<link>http://damonparker.org/blog/2007/06/27/recursive-chmod-tricks/</link>
		<comments>http://damonparker.org/blog/2007/06/27/recursive-chmod-tricks/#comments</comments>
		<pubDate>Wed, 27 Jun 2007 13:03:22 +0000</pubDate>
		<dc:creator>damonp</dc:creator>
				<category><![CDATA[Snippets]]></category>
		<category><![CDATA[SysAdmin]]></category>

		<guid isPermaLink="false">http://damonparker.org/blog/2007/06/27/recursive-chmod-tricks/</guid>
		<description><![CDATA[Recursively chmod only directories find . -type d -exec chmod 755 &#123;&#125; \; Similarly, recursively set the execute bit on every directory chmod -R a+X * The +X flag sets the execute bit on directories only Recursively chmod only files find . -type f -exec chmod 644 &#123;&#125; \; Recursively chmod only PHP files (with [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Recursively chmod only directories</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">find . -<span style="color: #000066;">type</span> d -<span style="color: #000066;">exec</span> chmod <span style="color: #cc66cc;">755</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span> \;</div></div>
<p>Similarly, recursively set the execute bit on every directory</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">chmod -R a+X <span style="color: #66cc66;">*</span></div></div>
<p>The +X flag sets the execute bit on directories only</p>
<p>Recursively chmod only files</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">find . -<span style="color: #000066;">type</span> f -<span style="color: #000066;">exec</span> chmod <span style="color: #cc66cc;">644</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span> \;</div></div>
<p>Recursively chmod only PHP files (with extension .php)</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">find . -<span style="color: #000066;">type</span> f -name <span style="color: #ff0000;">'*.php'</span> -<span style="color: #000066;">exec</span> chmod <span style="color: #cc66cc;">644</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span> \;</div></div>
 <img src="http://damonparker.org/wp-content/plugins/feed-statistics.php?view=1&post_id=347" width="1" height="1" style="display: none;" /><img src="http://damonparker.org/?ak_action=api_record_view&id=347&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://damonparker.org/blog/2007/06/27/recursive-chmod-tricks/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using xcache
Page Caching using xcache
Database Caching 18/57 queries in 0.007 seconds using xcache
Content Delivery Network via cdn.damonparker.org/q9i5a4w8/cds

Served from: damonparker.org @ 2010-07-30 13:51:11 -->