<?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>Solutions Log &#187; sysadmin</title>
	<atom:link href="http://solutions.unixsherpa.com/tag/sysadmin/feed/" rel="self" type="application/rss+xml" />
	<link>http://solutions.unixsherpa.com</link>
	<description>by Dan Reiland</description>
	<lastBuildDate>Fri, 16 Apr 2010 20:28:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Remote Mirroring Using nc and dd</title>
		<link>http://solutions.unixsherpa.com/2009/08/10/remote-mirroring-using-nc-and-dd/</link>
		<comments>http://solutions.unixsherpa.com/2009/08/10/remote-mirroring-using-nc-and-dd/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 16:58:06 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Apple OSX]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[netcat]]></category>

		<guid isPermaLink="false">http://solutions.unixsherpa.com/?p=160</guid>
		<description><![CDATA[You can use the dd and nc commands for exact disk mirroring from one server to another. The following commands send data from Server1 to Server2: 12Server2# nc -l 12345 &#124; dd of=/dev/sdb Server1# dd if=/dev/sda &#124; nc server2 12345 Make sure that you issue Server2's command first so that it's listening on port 12345 [...]]]></description>
			<content:encoded><![CDATA[<p>You can use the dd and nc commands for exact disk mirroring from one server to another. The following commands send data from Server1 to Server2:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Server2# nc -l 12345 | dd of=/dev/sdb<br />
Server1# dd if=/dev/sda | nc server2 12345</div></td></tr></tbody></table></div>
<p>Make sure that you issue Server2's command first so that it's listening on port 12345 when Server1 starts sending its data.</p>
<p>Unless you're sure that the disk is not being modified, it's better to boot Server1 from a RescueCD or LiveCD to do the copy. </p>
<p>Reference: <a href="http://www.linuxjournal.com/content/tech-tip-remote-mirroring-using-nc-and-dd">http://www.linuxjournal.com/content/tech-tip-remote-mirroring-using-nc-and-dd</a></p>
]]></content:encoded>
			<wfw:commentRss>http://solutions.unixsherpa.com/2009/08/10/remote-mirroring-using-nc-and-dd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add syslog forwarding host to syslog-ng</title>
		<link>http://solutions.unixsherpa.com/2009/05/06/add-syslog-forwarding-host-to-syslog-ng/</link>
		<comments>http://solutions.unixsherpa.com/2009/05/06/add-syslog-forwarding-host-to-syslog-ng/#comments</comments>
		<pubDate>Wed, 06 May 2009 20:45:05 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[syslog-ng]]></category>

		<guid isPermaLink="false">http://solutions.unixsherpa.com/?p=82</guid>
		<description><![CDATA[# $Header: /var/cvsroot/gentoo-x86/app-admin/syslog-ng/files/syslog-ng.conf.gentoo,v 1.7 2007/08/02 04:52:18 mr_bones_ Exp $ # # Syslog-ng default configuration file for Gentoo Linux # contributed by Michael Sterrett options { chain_hostnames(off); sync(0); # The default action of syslog-ng 1.6.0 is to log a STATS line # to the file every 10 minutes. That's pretty ugly after a while. # Change [...]]]></description>
			<content:encoded><![CDATA[<pre>
# $Header: /var/cvsroot/gentoo-x86/app-admin/syslog-ng/files/syslog-ng.conf.gentoo,v 1.7 2007/08/02 04:52:18 mr_bones_ Exp $
#
# Syslog-ng default configuration file for Gentoo Linux
# contributed by Michael Sterrett

options {
        chain_hostnames(off);
        sync(0);

        # The default action of syslog-ng 1.6.0 is to log a STATS line
        # to the file every 10 minutes.  That's pretty ugly after a while.
        # Change it to every 12 hours so you get a nice daily update of
        # how many messages syslog-ng missed (0).
        stats(43200);
};

source src {
    unix-stream("/dev/log" max-connections(256));
    internal();
    file("/proc/kmsg");
};

destination messages { file("/var/log/messages"); };
destination splunk { tcp("hostname-or-ip" port(9998)); };

# By default messages are logged to tty12...
destination console_all { file("/dev/tty12"); };
# ...if you intend to use /dev/console for programs like xconsole
# you can comment out the destination line above that references /dev/tty12
# and uncomment the line below.
#destination console_all { file("/dev/console"); };

log { source(src); destination(messages); };
log { source(src); destination(splunk); };
log { source(src); destination(console_all); };
</pre>
]]></content:encoded>
			<wfw:commentRss>http://solutions.unixsherpa.com/2009/05/06/add-syslog-forwarding-host-to-syslog-ng/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recursively delete .svn directories</title>
		<link>http://solutions.unixsherpa.com/2009/04/10/recursively-delete-svn-directories/</link>
		<comments>http://solutions.unixsherpa.com/2009/04/10/recursively-delete-svn-directories/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 20:17:02 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[SCM]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[vcs]]></category>

		<guid isPermaLink="false">http://solutions.unixsherpa.com/?p=56</guid>
		<description><![CDATA[Abstract This is a simple example of a unix command, which recursively deletes subversion .svn folders. Subversion is a well-spread open-source revision control application. Every copy of source code received from subversion repository has .svn folders, which store metadata. However, if you want to use or distribute source code for end-user consumption, these folders are [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Abstract</strong></p>
<p>This is a simple example of a unix command, which recursively deletes subversion .svn folders. Subversion is a well-spread open-source revision control application. Every copy of source code received from subversion repository has .svn folders, which store metadata. However, if you want to use or distribute source code for end-user consumption, these folders are not necessary. A simple svn export [repository] is suitable.</p>
<p><strong>Compatible </strong><span> </span></p>
<ul>
<li>Linux, FreeBSD, Mac OS X, Cygwin...</li>
<li>Nearly any unix-compatible system with rm and find</li>
</ul>
<p>We use find command to find all .svn folders beginning from current directory.</p>
<pre>
$ find . -type d -name .svn
</pre>
<pre>
./.svn
./sourceA/.svn
./sourceB/.svn
./sourceB/module/.svn
./sourceC/.svn
</pre>
<p>It is possible to pass these directories directly to rm command, using grave accent quotes (key to left of '1')</p>
<pre>
$ rm -rf `find . -type d -name .svn`
</pre>
<p>So, this will remove every .svn folder beginning from current directory.</p>
<p><strong>Source code: bash script</strong></p>
<pre>
#!/bin/sh

echo "recursively removing .svn folders from"
pwd
rm -rf `find . -type d -name .svn`
</pre>
<p>You may save this script to /usr/bin/csvn (or other binary folder included in path) and use later to get 'clean' project source without typing lengthy commands.</p>
<p>For example,</p>
<pre>
$ svn checkout svn://server.com/svn/project
A    project/index.php
A    project/sourceA/a.php
A    project/sourceA/a1.php
A    project/sourceA/a2.php
A    project/sourceB/b.php
A    project/sourceB/module/lib.php
A    project/sourceC/c.php
Checked out revision 15.

$ cd project
$ csvn
</pre>
<p><strong>Warning</strong><br />
<em>Always check you current working directory before calling 'csvn'.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://solutions.unixsherpa.com/2009/04/10/recursively-delete-svn-directories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up public key authentication over SSH</title>
		<link>http://solutions.unixsherpa.com/2009/01/28/setting-up-public-key-authentication-over-ssh/</link>
		<comments>http://solutions.unixsherpa.com/2009/01/28/setting-up-public-key-authentication-over-ssh/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 17:15:47 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Apple OSX]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://solutions.unixsherpa.com/?p=39</guid>
		<description><![CDATA[Generate key on local machine 1ssh-keygen -t rsa It will ask you for a password but you can leave it blank. Note you could also pick -t dsa if you prefer. Ensure that the remote server has a .ssh directory Make sure the server your connecting to has a .ssh directory in your home directory. [...]]]></description>
			<content:encoded><![CDATA[<p>Generate key on local machine</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ssh-keygen -t rsa</div></td></tr></tbody></table></div>
<p>It will ask you for a password but you can leave it blank.</p>
<p>Note you could also pick -t dsa if you prefer.<br />
Ensure that the remote server has a .ssh directory</p>
<p>Make sure the server your connecting to has a .ssh directory in your home directory. If it doesn't exist you can run the ssh-keygen command above, and it will create one with the correct permissions.<br />
Copy your local public key to the remote server</p>
<p>If your remote server doesn't have a file called ~/.ssh/authorized_keys2 then we can create it. If that file already exists, you need to append to it instead of overwriting it, which the command below would do:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">scp ~/.ssh/id_rsa.pub remote.server.com:.ssh/authorized_keys2</div></td></tr></tbody></table></div>
<p>Now ssh to the remote server</p>
<p>Now you can ssh to the remote server without entering your password.<br />
Security</p>
<p>If you are unable to login without being prompted for a password it is likely the result of improper permissions being set on .ssh/ and its children. SSH is picky about permissions; to fix the problem, ssh to the remote server and issue the following command:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">chmod -R 700 .ssh/</div></td></tr></tbody></table></div>
<p>Now keep in mind that all someone needs to login to the remote server, is the file on your local machine ~/.ssh/id_rsa, so make sure it is secure.</p>
<p>Reference: <a href="http://www.petefreitag.com/item/532.a">http://www.petefreitag.com/item/532.a</a></p>
]]></content:encoded>
			<wfw:commentRss>http://solutions.unixsherpa.com/2009/01/28/setting-up-public-key-authentication-over-ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove SSL key file pass-phrase</title>
		<link>http://solutions.unixsherpa.com/2009/01/11/remove-ssl-key-file-pass-phrase/</link>
		<comments>http://solutions.unixsherpa.com/2009/01/11/remove-ssl-key-file-pass-phrase/#comments</comments>
		<pubDate>Sun, 11 Jan 2009 18:55:31 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Apple OSX]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://solutions.unixsherpa.com/?p=36</guid>
		<description><![CDATA[Sometimes you may want to remove the pass-phrase from your SSL key file. A specific use case is with a webserver (Apache, Cherokee, etc) where you do not want to be prompted to enter the pass-phrase each time the server starts. Requirements like these can get in the way of automated system procedures. Removing the [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you may want to remove the pass-phrase from your SSL key file. A specific use case is with a webserver (Apache, Cherokee, etc) where you do not want to be prompted to enter the pass-phrase each time the server starts. Requirements like these can get in the way of automated system procedures.</p>
<p>Removing the password is simple:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">root# openssl rsa -in www.yourdomain.com.key -out www.yourdomain.com.key</div></td></tr></tbody></table></div>
<p>Reference: <a href="http://httpd.apache.org/docs/2.0/ssl/ssl_faq.html">http://httpd.apache.org/docs/2.0/ssl/ssl_faq.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://solutions.unixsherpa.com/2009/01/11/remove-ssl-key-file-pass-phrase/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)
Database Caching 3/20 queries in 0.173 seconds using disk
Object Caching 750/771 objects using disk

Served from: solutions.unixsherpa.com @ 2010-09-10 01:20:36 -->