<?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>Mission Data Blog &#187; linux</title>
	<atom:link href="http://www.missiondata.com/blog/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.missiondata.com/blog</link>
	<description>Louisville-based Web Development &#38; Software Engineering</description>
	<lastBuildDate>Tue, 24 Jan 2012 14:58:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Showing progress using dd</title>
		<link>http://www.missiondata.com/blog/system-administration/87/showing-progress-using-dd/</link>
		<comments>http://www.missiondata.com/blog/system-administration/87/showing-progress-using-dd/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 15:04:39 +0000</pubDate>
		<dc:creator>steveny</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.missiondata.com/blog/linux/87/showing-progress-using-dd/</guid>
		<description><![CDATA[One of the frustrating behaviors of dd is that it provides no feedback about what it is doing. It does however provide a signal (USR1) that you can send to the process that will dump the current progress. Open a new terminal (I use screen) and type: while true; do kill -USR1 `pidof dd`; sleep [...]]]></description>
			<content:encoded><![CDATA[<p>One of the frustrating behaviors of <a href="http://en.wikipedia.org/wiki/Dd_%28Unix%29">dd</a> is that it provides no feedback about what it is doing.  It does however provide a signal (USR1) that you can send to the process that will dump the current progress.  Open a new terminal (I use screen) and type:</p>
<pre><code>while true; do kill -USR1 `pidof dd`; sleep 2; done</code></pre>
<p>(NOTE: if `pidof dd` doesn&#8217;t work for you, just use the process id directly)</p>
<p>Switch back to the terminal where dd is running and you should see:</p>
<pre><code>9902751744 bytes (9.9 GB) copied, 732.883 s, 13.5 MB/s
9469+0 records in
9468+0 records out
9927917568 bytes (9.9 GB) copied, 734.914 s, 13.5 MB/s
9496+0 records in
9495+0 records out
9956229120 bytes (10 GB) copied, 736.941 s, 13.5 MB/s</code></pre>
<p>updating every couple of seconds.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.missiondata.com/blog/system-administration/87/showing-progress-using-dd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>S3 Streaming With PHP</title>
		<link>http://www.missiondata.com/blog/systems-integration/49/s3-streaming-with-php/</link>
		<comments>http://www.missiondata.com/blog/systems-integration/49/s3-streaming-with-php/#comments</comments>
		<pubDate>Sat, 25 Nov 2006 18:45:24 +0000</pubDate>
		<dc:creator>carsonm</dc:creator>
				<category><![CDATA[Systems Integration]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[s3]]></category>

		<guid isPermaLink="false">http://blogs.missiondata.com/linux/49/s3-streaming-with-php/</guid>
		<description><![CDATA[Steven pointed out that someone was looking for a way to stream to S3 using PHP and said I should figure out how to get it going. Since he made a patch to let you stream data with Ruby using S3 I figured I should do one for PHP. There may be better ways of [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blogs.missiondata.com/author/steveny/">Steven</a> pointed out that someone was looking for a way to <a href="http://developer.amazonwebservices.com/connect/thread.jspa?threadID=12829&#038;tstart=0">stream to S3 using PHP</a> and said I should figure out how to get it going. Since he made a patch to let you <a href="http://blogs.missiondata.com/ruby/29/streaming-data-to-s3-with-ruby/">stream data with Ruby using S3</a> I figured I should do one for PHP. There may be better ways of doing this but since I&#8217;ve already done it with C using curl I figured that would be the fastest way.<br />
<span id="more-49"></span></p>
<p>First you will want to get the <a href="http://developer.amazonwebservices.com/connect/servlet/JiveServlet/download/24-12470-46948-845/s3.php">S3 PHP library from Amazon</a>. Then you add the following to the file:</p>
<pre>
<code>/**
 * putObjectStream -- Streams data to a bucket.
 *
 * Takes ($bucket, $key, $streamFunction, $contentType, $contentLength [,$acl, $metadataArray, $md5])
 *
 *
 * - [str] $bucket: the bucket into which file will be written
 * - [str] $key: key of written file
 * - [str] $streamFunction: function to call for data to stream
 * - [str] $contentType: file content type
 * - [str] $contentLength: file content length
 * - [str] $acl: access control policy of file (OPTIONAL: defaults to 'private')
 * - [str] $metadataArray: associative array containing user-defined metadata (name=&gt;value) (OPTIONAL)
 * - [bool] $md5: the MD5 hash of the object (OPTIONAL)
*/
function putObjectStream($bucket, $key, $streamFunction, $contentType, $contentLength, $acl, $metadataArray, $md5){
        sort($metadataArray);
        $resource = "$bucket/$key";
        $resource = urlencode($resource);
        $httpDate = gmdate("D, d M Y G:i:s T");

        $curl_inst = curl_init();

        curl_setopt ($curl_inst, CURLOPT_CONNECTTIMEOUT, 30);
        curl_setopt ($curl_inst, CURLOPT_LOW_SPEED_LIMIT, 1);
        curl_setopt ($curl_inst, CURLOPT_LOW_SPEED_TIME, 180);
        curl_setopt ($curl_inst, CURLOPT_NOSIGNAL, 1);
        curl_setopt ($curl_inst, CURLOPT_READFUNCTION, $streamFunction);
        curl_setopt ($curl_inst, CURLOPT_URL, $this-&gt;serviceUrl . $resource);
        curl_setopt ($curl_inst, CURLOPT_UPLOAD, true);
        curl_setopt ($curl_inst, CURLINFO_CONTENT_LENGTH_UPLOAD, $contentLength);

        $header[] = "Date: $httpDate";
        $header[] = "Content-Type: $contentType";
        $header[] = "Content-Length: $contentLength";
        $header[] = "Expect: ";
        $header[] = "Transfer-Encoding: ";
        $header[] = "x-amz-acl: $acl";

        $MD5 = "";
        if($md5){
                $MD5 = $this-&gt;hex2b64(md5_file($filePath));
                $header[] = "Content-MD5: $MD5";
        }

        $stringToSign="PUT\n$MD5\n$contentType\n$httpDate\nx-amz-acl:$acl\n";
        foreach($metadataArray as $current){
                if($current!=""){
                        $stringToSign.="x-amz-meta-$current\n";
                        $header = substr($current,0,strpos($current,':'));
                        $meta = substr($current,strpos($current,':')+1,strlen($current));
                        $header[] = "x-amz-meta-$header: $meta";
                }
        }

        $stringToSign.="/$resource";

        $signature = $this-&gt;constructSig($stringToSign);

        $header[] = "Authorization: AWS $this-&gt;accessKeyId:$signature";

        curl_setopt($curl_inst, CURLOPT_HTTPHEADER, $header);
        curl_setopt($curl_inst, CURLOPT_RETURNTRANSFER, 1);

        $result = curl_exec ($curl_inst);

        $this-&gt;responseString = $result;
        $this-&gt;responseCode = curl_getinfo($curl_inst, CURLINFO_HTTP_CODE);

        curl_close($curl_inst);
}</code>
</pre>
<p>Now you have an updated s3.php you are ready to start streaming. Be aware that the content length value needs to be correct. If it is not the correct size your upload will be either truncated (too short) or it will hang (too long). If it hangs the S3 service will timeout after a small amount of time and give you an error.</p>
<p>Here are two examples of how to use it. First with a file:</p>
<pre>
<code>&lt;?php

include 's3.php';

class MyClass
{
  var $data;

  function stream_function($handle, $fd, $length)
  {
    return fread($this-&gt;data, $length);
  }
}

$my_class_inst = new MyClass();

$fsize = filesize("/tmp/largefile.tar.gz");

$my_class_inst-&gt;data = fopen("/tmp/largefile.tar.gz", "r");

$s3_inst = new s3("access key", "private key");
$s3_inst-&gt;putObjectStream("abucket", "largefile.tar.gz", array($my_class_inst, "stream_function"), "application/x-gzip", $fsize, "public-read", array(), null);

print "Response String: " . $s3_inst-&gt;responseString . "\n";
print "Response Code: " . $s3_inst-&gt;responseCode . "\n";
print "Parsed XML: " . $s3_inst-&gt;parsed_xml . "\n";

fclose($my_class_inst-&gt;data);

?&gt;</code>
</pre>
<p>Another example of streaming some random text:</p>
<pre>
<code>&lt;?php

include 's3.php';

class MyClass
{
  var $data;

  function stream_function($handle, $fd, $length)
  {
    return $this-&gt;data;
  }
}

$my_class_inst = new MyClass();

$my_class_inst-&gt;data = "A test string";
$size = strlen($my_class_inst-&gt;data);

$s3_inst = new s3("access key", "private key");
$s3_inst-&gt;putObjectStream("bucketname", "test.txt", array($my_class_inst, "stream_function"), "text/html", $size, "public-read", array(), null);

print "Response String: " . $s3_inst-&gt;responseString . "\n";
print "Response Code: " . $s3_inst-&gt;responseCode . "\n";
print "Parsed XML: " . $s3_inst-&gt;parsed_xml . "\n";

?&gt;</code>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.missiondata.com/blog/systems-integration/49/s3-streaming-with-php/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>How to build the PHP rrdtool extension by hand</title>
		<link>http://www.missiondata.com/blog/system-administration/54/how-to-build-the-php-rrdtool-extention-by-hand/</link>
		<comments>http://www.missiondata.com/blog/system-administration/54/how-to-build-the-php-rrdtool-extention-by-hand/#comments</comments>
		<pubDate>Tue, 09 May 2006 12:17:28 +0000</pubDate>
		<dc:creator>carsonm</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blogs.missiondata.com/?p=54</guid>
		<description><![CDATA[I think by now most sysadmin types know about rrdtool and the nice graphs it makes. I recently wanted to create some graphs by hand using PHP so I turned to the php-rrdtool extension. I found that it takes a little work to get it to compile but that could be because I&#8217;m not constantly [...]]]></description>
			<content:encoded><![CDATA[<p>I think by now most sysadmin types know about <a href="http://oss.oetiker.ch/rrdtool/">rrdtool</a> and the nice graphs it makes. I recently wanted to create some graphs by hand using PHP so I turned to the php-rrdtool extension. I found that it takes a little work to get it to compile but that could be because I&#8217;m not constantly recompiling PHP and just don&#8217;t know better. You can get this module as an rpm for fedora (php-rrdtool) but I like to compile php by hand so I couldn&#8217;t use it. I&#8217;m going to assume that you know how to compile PHP normally with whatever other items you want to include and that you have the rrdtool development libraries installed or have compiled and installed rrdtool from source.</p>
<h3>Step 1. Get the PHP rrdtool source</h3>
<p>Go to the contrib directory on the rrdtool distribution site:<br />
<a href="http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub/contrib/">http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub/contrib/</a></p>
<p>There are a number of files in this directory that mention rrd. You want the one named: <a href="http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub/contrib/php_rrdtool.tgz">php_rrdtool.tgz</a> <br/></p>
<p><span id="more-54"></span></p>
<h3>Step 2. Untar into the correct place</h3>
<p>Now that you have the source go into your php source directory and then into the ext directory. So you will be somewhere like this:</p>
<p>/usr/local/src/php-5.1.3/ext/</p>
<p>Now untar the source into this directory.</p>
<h3>Step 3. Recreate the php configuration file</h3>
<p>There is a warning that you will get if you do not have autoconf 2.13 installed on your system when you try to do this. It is easy enough to get this version if you have fedora so that is what I did. </p>
<p>One tricky part to this is that I had to remove the old configuration file first before the new one could be created.</p>
<ol>
<li>Change directory to your PHP source, if you are still in the ext directory just cd ..</li>
<li>Remove the existing configuration file</li>
<li>If you are using autoconf 2.13 run the following command: <br/> PHP_AUTOCONF=autoconf-2.13 ./buildconf &#8211;force<br/> If you are using whatever other autoconf you have installed just run: <br/> ./buildconf &#8211;force</li>
<li>You should now have a new configuration file that can be run with the &#8211;with-rrdtool option</li>
</ol>
<h3>Step 4. Test</h3>
<p>After compiling with rrdtool you should be able to use the phpinfo() function to list the installed extensions. If everything went right you should see rrdtool listed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.missiondata.com/blog/system-administration/54/how-to-build-the-php-rrdtool-extention-by-hand/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>managing disk space with logrotate</title>
		<link>http://www.missiondata.com/blog/system-administration/48/managing-disk-space-with-logrotate/</link>
		<comments>http://www.missiondata.com/blog/system-administration/48/managing-disk-space-with-logrotate/#comments</comments>
		<pubDate>Thu, 27 Apr 2006 02:28:13 +0000</pubDate>
		<dc:creator>darrend</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[logrotate]]></category>
		<category><![CDATA[Utilities]]></category>

		<guid isPermaLink="false">http://blogs.missiondata.com/?p=48</guid>
		<description><![CDATA[At a customer site, the test and production linux servers for some intranet applications were slowly running out of disk space. The apps themselves were running fine, it was the logfiles generated by the apps that were the issue; logging that came in useful just in case something went wrong, but quickly aged. In one [...]]]></description>
			<content:encoded><![CDATA[<p>At a customer site, the test and production linux servers for some intranet applications were slowly running out of disk space. The apps themselves were running fine, it was the logfiles generated by the apps that were the issue; logging that came in useful just in case something went wrong, but quickly aged. In one particular case, a catalina.out file was several years old and was 11 gigabytes; 90% of it wasn&#8217;t really relevant any longer.</p>
<p>The solution to the problem of wrangling logfiles is probably already installed on your server: it&#8217;s <a href="http://iain.cx/src/logrotate/">logrotate</a>. Chances are logrotate is already configured in your system crontab as a daily task, and chances are it is configured to obey any configuration files found in the <tt>/etc/logrotate.d</tt> directory. If you find that directory, you are probably good to go.</p>
<p><span id="more-48"></span><br />
In <tt>/etc/logrotate.d</tt> you&#8217;ll find several short configuration files. Each configuration deals with 1 or 2 related logfiles that should be checked and possibly administered on a regular basis. Logrotate can do alot of things with a logfile: clear the target log, create a copy of it, compress the copy, keep <em>N</em> backup copies, and it can be configured to rotate the target logfile on a daily, weekly, or monthly basis.</p>
<p>For example, here is how my client handles a logfile generated by a log4j-enabled java rmi server:</p>
<pre>
<code> /appdir/log/java_rmi_log.txt {
    daily
    rotate 10
    copytruncate
    compress
    notifempty
    missingok
 }</code>
</pre>
<p>This configuration means<br />
<blockquote>On a <em>daily</em> basis <em>rotate</em>, <em>compress</em>, and retain up to <em>10</em> days worth of logs using the <em>copytruncate</em> method. But <em>notifempty</em>; if the log is empty don&#8217;t do anything. Finally, <em>missingok</em>, so no need to log an error anywhere if the target logfile isn&#8217;t found.
</p></blockquote>
<p>This is nigh on a <a href="http://en.wikipedia.org/wiki/Domain_Specific_Language">domain specific language</a> for logfile rotation, and like most DSLs I&#8217;ve come across it&#8217;s much easier to read than it is to remember when writing. Don&#8217;t worry, the <a href="http://www.die.net/doc/linux/man/man8/logrotate.8.html">man page for logrotate</a> lists all the details.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.missiondata.com/blog/system-administration/48/managing-disk-space-with-logrotate/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Long arguments and getops</title>
		<link>http://www.missiondata.com/blog/system-administration/17/17/</link>
		<comments>http://www.missiondata.com/blog/system-administration/17/17/#comments</comments>
		<pubDate>Tue, 07 Mar 2006 18:28:33 +0000</pubDate>
		<dc:creator>steveny</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Utilities]]></category>

		<guid isPermaLink="false">http://blogs.missiondata.com/?p=17</guid>
		<description><![CDATA[I recently had a need to adapt a script that recrawls a site with nutch. One of my design goals was to use the same command line options as the Fetchtool (one of the steps I had to take to recrawl a site). It became apparent fairly quickly that bash&#8217;s built-in &#8216;getopts&#8217; didn&#8217;t support long [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had a need to adapt a script that <a href="http://today.java.net/pub/a/today/2006/02/16/introduction-to-nutch-2.html">recrawls</a> a site with <a href="http://wiki.apache.org/nutch/">nutch</a>.  One of my design goals was to use the same command line options as the <a href="http://wiki.apache.org/nutch/DissectingTheNutchCrawler#head-35f305b76ece4e69fd33a02838f985f3d2cac0af">Fetchtool</a> (one of the steps I had to take to recrawl a site).</p>
<p>It became apparent fairly quickly that bash&#8217;s built-in &#8216;getopts&#8217; didn&#8217;t support long command line arguments, so I had to fall back on <a href="http://www.devdaily.com/unix/man/man1/getopt.1.shtml">getopt</a>.</p>
<p>Here is the portion of the script that parses the command line arguments:</p>
<pre>
<code>set -- `getopt -n$0 -u -a --longoptions="depth: adddays: topN:" "h" "$@"` || usage
[ $# -eq 0 ] &amp;&amp; usage

while [ $# -gt 0 ]
do
    case "$1" in
       --depth)   depth=$2;shift;;
       --adddays) adddays=$2;shift;;
       --topN)    topN=$2;shift;;
       -h)        usage;;
       --)        shift;break;;
       -*)        usage;;
       *)         break;;            #better be the crawl directory
    esac
    shift
done</code>
</pre>
<p>Deconstructing this bit by bit:</p>
<p><span id="more-17"></span></p>
<pre>
  <code>set -- `getopt -n$0 -u -a --longoptions="depth: adddays: topN:" "h" "$@"` || usage
[ $# -eq 0 ] &amp;&amp; usage
  </code>
</pre>
<p>&#8216;set &#8211;&#8217; unsets the existing postional parameters and sets them to the result of getopt.<br />
The call to getopts works like this:</p>
<ul>
<li> -n$0, sets the nicename to the name of the script (so warnings come back nicely from getopts)
<li> -a, allows long arguments to start with a singe &#8216;-&#8217; (they ususally have two (&#8216;&#8211;&#8217;)
<li> &#8211;longoptions=&#8221;depth: adddays: topN:&#8221;, sets the format of the long options.  In this case I have 3 (depth, adddays, and topN).  The<br />
trailing colon indicates I am expecting an additional argument. </p>
<li>  &#8220;h&#8221;, the short options (-h)
<li> &#8220;$@&#8221;, the arguments passed into the script
  </ul>
<p>The &#8216;||&#8217; at the end and the second line will call my usage statement if  an error comes back from getopt (a non-0 return code).  The next line make sure we get at least one argument back.</p>
<p>To help understand what goes on next, lets run that command at the shell:</p>
<pre>
  <code class="console"> $ getopt -nrecrawl.sh -u -a --longoptions="depth: adddays: topN:" "h" -depth 5 -adddays 10 -topN 3 -h -x
recrawl.sh: unrecognized option `-x'
 --depth 5 --adddays 10 --topN 3 -h --
  </code>
</pre>
<p>A few items of note.  The first is the warning message we get because &#8216;x&#8217; is an unknown option (notice it is prefaced by what we supplied to the -n argument).  The second is the result of the getopt operation on my command line parameters.</p>
<p>Now to interpret the results:</p>
<pre>
  <code>while [ $# -gt 0 ]
do
    case "$1" in
       --depth)   depth=$2;shift;;
...
       -h)        usage;;
       --)        shift;break;;
       -*)        usage;;
       *)         break;;            #better be the crawl directory
    esac
    shift
done
  </code>
</pre>
<p>The while loop loops through each of the arguments return from getopt.  If an argument requires an additional value, I use $2 to snag that value and assign it to a variable.  When we are done with an argument, we shift passed it and move on to the next one.  A few special cases exist:</p>
<ul>
<li>-*) matches any unkown option and prints the usage statement
<li> *) matchs any other argument (in this case it is our required directory)
<li> &#8211;) is the end marker from getopt
  </ul>
<p>The script then goes on to verify the parameters (like the directory exists) and does the crawl&#8230;.but that is for another day.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.missiondata.com/blog/system-administration/17/17/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cvs history</title>
		<link>http://www.missiondata.com/blog/system-administration/16/cvs-history/</link>
		<comments>http://www.missiondata.com/blog/system-administration/16/cvs-history/#comments</comments>
		<pubDate>Wed, 22 Feb 2006 15:45:52 +0000</pubDate>
		<dc:creator>darrend</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Utilities]]></category>

		<guid isPermaLink="false">http://blogs.missiondata.com/?p=16</guid>
		<description><![CDATA[For alot of people, CVS is history; they&#8217;ve switched to SVN and are loving life. For those of us continuing the use this venerable tool, I present the following cobbled together bit of utility. It&#8217;s a bash function. and a nice way to keep an eye on what&#8217;s happening on a cvs repository. I work [...]]]></description>
			<content:encoded><![CDATA[<p>For alot of people, CVS <strong>is</strong> history; they&#8217;ve switched to SVN and are loving life. For those of us continuing the use this venerable tool, I present the following cobbled together bit of utility.</p>
<p>It&#8217;s a bash function. and a nice way to keep an eye on what&#8217;s happening on a cvs repository. I work with a team of around 7 guys, and I like to keep an eye on what&#8217;s changed and who changed it.</p>
<p>It works like this, summarizing what I consider to be the highlights from the <code>cvs history</code> command, and defaults to showing checkins for the current date:</p>
<pre><code class="console">$ cvshist
M 2006-02-22 10:34 EDT jsmith  1.3  InternalOperation.java         APRJ7A/src/com/ppc/oepica/model/internal
M 2006-02-22 10:53 EDT jsmith  1.37 FooBarCopier.java              APRJ7A/src/com/ppc/oepica/model/external
M 2006-02-22 11:26 EDT darrend 1.23 CommonJobBase.java             APRJ7A/src/com/ppc/oepica/model/common</code></pre>
<p>I use the <code>date</code> command, which gives me some flexibility when specifying a date</p>
<pre><code class="console">$ cvshist yesterday
$ cvshist 2 days ago
$ cvshist january 10
$ cvshist 2006-01-11</code></pre>
<p>Here&#8217;s the source. I&#8217;ve used this on linux and cygwin; you&#8217;ll need bash, gnu date, and cvs.</p>
<pre><code class="console">$ declare -f
cvshist ()
{
  export CVSROOT=:pserver:darrend@shlnxtest1:/home/cvs;
  TARGET_DATE=$(date -d "$*" +%Y-%m-%d);
  cvs history -a -z EDT -c -D $TARGET_DATE | sed "s/\s*==.*$//" | grep "$TARGET_DATE"
}</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.missiondata.com/blog/system-administration/16/cvs-history/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick and dirty cryptfs</title>
		<link>http://www.missiondata.com/blog/system-administration/12/quick-and-dirty-cryptfs/</link>
		<comments>http://www.missiondata.com/blog/system-administration/12/quick-and-dirty-cryptfs/#comments</comments>
		<pubDate>Wed, 15 Feb 2006 23:50:39 +0000</pubDate>
		<dc:creator>steveny</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://blogs.missiondata.com/?p=12</guid>
		<description><![CDATA[Here is a quick rundown on how to create a cryptfs partition that mounts during boot with Fedora Core 4. Configure the kernel (this may already be done for you): Device Drivers ---&#62; Multiple devices driver support (RAID and LVM) ---&#62; [*] Multiple devices driver support (RAID and LVM) &#60; &#62; RAID support &#60;*&#62; Device [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a quick rundown on how to create a cryptfs partition that mounts during boot with Fedora Core 4.</p>
<p>Configure the kernel (this may already be done for you):</p>
<pre>
<code>Device Drivers ---&gt;
  Multiple devices driver support (RAID and LVM) ---&gt;
    [*] Multiple devices driver support (RAID and LVM)
      &lt; &gt;   RAID support
      &lt;*&gt;   Device mapper support
      &lt;*&gt;     Crypt target support

Cryptographic options ---&gt;
  &lt;M&gt;   MD5 digest algorithm
  &lt;M&gt;   SHA1 digest algorithm
  &lt;M&gt;   AES cipher algorithms
   .... </code>
</pre>
<p>Install the userland tools:</p>
<pre>
<code>yum install cryptsetup</code>
</pre>
<p>Create the filesystem and format it:</p>
<pre>
<code>cryptsetup -c blowfish -s 64 create fs_name /dev/sda2
mkfs.ext3 /dev/mapper/fs_name</code>
</pre>
<p>Create /etc/init.d/crytptinit:</p>
<pre>
<code>if [ -b /dev/mapper/fs_name ]; then
  /sbin/cryptsetup remove fs_name
fi
/sbin/cryptsetup -c blowfish -s 64  create fs_name /dev/sda2</code>
</pre>
<p>Run it at the runlevels you want:</p>
<pre>
<code>cd /etc/rc3.d
ln -s ../init.d/cryptinit S08cryptinit</code>
</pre>
<p>Create the mount point:</p>
<pre>
<code>mkdir /mount_point</code>
</pre>
<p>Edit /etc/fstab:</p>
<pre>
<code>/dev/mapper/fs_name /mount_point               ext3   defaults 0 0</code>
</pre>
<p>Reboot.  You will be asked for your passphrase when the machine boots.</p>
<p>Information in this post was gleaned from several places.  <a href="http://deb.riseup.net/storage/encryption/dmcrypt/">Here is one</a><br />
that matches closely.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.missiondata.com/blog/system-administration/12/quick-and-dirty-cryptfs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

