<?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>cat brain.log &#124; less &#187; System Administration</title>
	<atom:link href="http://log.largevoid.com/cat/system-administration/feed/" rel="self" type="application/rss+xml" />
	<link>http://log.largevoid.com</link>
	<description>Getting it down on `paper`</description>
	<lastBuildDate>Tue, 24 Aug 2010 00:16:21 +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>Restore Close Button to Right in Ubuntu 10.04</title>
		<link>http://log.largevoid.com/2010/06/restore-close-button-to-right-in-ubuntu-10-04/</link>
		<comments>http://log.largevoid.com/2010/06/restore-close-button-to-right-in-ubuntu-10-04/#comments</comments>
		<pubDate>Sun, 13 Jun 2010 22:58:52 +0000</pubDate>
		<dc:creator>Chief</dc:creator>
				<category><![CDATA[Reference]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[button_layout]]></category>
		<category><![CDATA[close button]]></category>
		<category><![CDATA[gconftool]]></category>
		<category><![CDATA[metacity]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://log.largevoid.com/?p=370</guid>
		<description><![CDATA[gconftool-2 --set "/apps/metacity/general/button_layout" --type string "menu:minimize,maximize,close"
Ref: LaunchPad &#187; Ubuntu &#187; Questions &#187; Question #108951
]]></description>
			<content:encoded><![CDATA[<p><code>gconftool-2 --set "/apps/metacity/general/button_layout" --type string "menu:minimize,maximize,close"</code></p>
<p>Ref: <a href="https://answers.launchpad.net/ubuntu/+question/108951">LaunchPad &raquo; Ubuntu &raquo; Questions &raquo; Question #108951</a></p>
]]></content:encoded>
			<wfw:commentRss>http://log.largevoid.com/2010/06/restore-close-button-to-right-in-ubuntu-10-04/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Performance Problems on an MD1000 with PERC/6 Disk Array</title>
		<link>http://log.largevoid.com/2010/04/performance-problems-on-an-md1000-with-perc6-disk-array/</link>
		<comments>http://log.largevoid.com/2010/04/performance-problems-on-an-md1000-with-perc6-disk-array/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 20:43:43 +0000</pubDate>
		<dc:creator>Chief</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[bios]]></category>
		<category><![CDATA[dell]]></category>
		<category><![CDATA[disk]]></category>
		<category><![CDATA[hdparm]]></category>
		<category><![CDATA[latency]]></category>
		<category><![CDATA[logs]]></category>
		<category><![CDATA[md1000]]></category>
		<category><![CDATA[PERC]]></category>
		<category><![CDATA[raid]]></category>
		<category><![CDATA[RMA]]></category>

		<guid isPermaLink="false">http://log.largevoid.com/?p=324</guid>
		<description><![CDATA[One of the machines that I use at work was exhibiting severely slow disk I/O performance.  I noticed that any directory I traversed to for the first time took 30-50 seconds to `cd` into.  After that first time, however, the response was speedy.  I suspected hardware problems, since caching would explain the [...]]]></description>
			<content:encoded><![CDATA[<p>One of the machines that I use at work was exhibiting severely slow disk I/O performance.  I noticed that any directory I traversed to for the first time took 30-50 seconds to `cd` into.  After that first time, however, the response was speedy.  I suspected hardware problems, since caching would explain the quick re-traversal.  This is my story.</p>
<ol>
<li>Check the lights.  All <span style="color:green">green</span>, now what?</li>
<li>Check the load.  Normal.</li>
<li>Try <code>hdparm</code>.  <em>What?</em> <code>man hdparm</code><br/>
<pre><span style="color:green">// normal machine 1:</span>
$ sudo /sbin/hdparm -Tt /dev/md0:
 Timing cached reads:   15348 MB in  2.00 seconds = <strong>7688.21 MB</strong>/sec
 Timing buffered disk reads:  808 MB in  3.19 seconds = <strong>253.58 MB</strong>/sec

<span style="color:green">// normal machine 2:</span>
$ sudo /sbin/hdparm -Tt /dev/md0:
 Timing cached reads:   18448 MB in  1.99 seconds = <strong>9254.38 MB</strong>/sec
 Timing buffered disk reads:  1654 MB in  3.00 seconds = <strong>551.33 MB</strong>/sec

<span style="color:green">// problem machine:</span>
$ sudo /sbin/hdparm -Tt /dev/sdc:
 Timing cached reads:   27660 MB in  1.99 seconds = <strong>13883.97 MB</strong>/sec
 Timing buffered disk reads:    8 MB in 14.64 seconds = <strong>559.51 <em>kB</em></strong>/sec</pre>
<p>Yes, we definitively have a problem.  500 kB/sec is cable modem speed, and I know my hard drive can store data faster than that&#8230; ok, now what?
	</li>
<li>Check the logs.
<ol>
<li>Reboot into bios</li>
<li>Check the event history</li>
<li>Reboot into PERC bios</li>
<li>Check the event history.</li>
<li>Call Dell, the ones with all the answers and none of the obligation to share.  They know the track-record of the hardware they sell, so when you call them up, they just sent you replacement parts for whatever everyone else&#8217;s problem was.  This time, it worked.</li>
</ol>
</li>
<li>The phone call to Dell went through the obvious: Reboot? Logs? Firmware? blah blah&#8230; Dell says they saw errors with disk 9.  Ok, that&#8217;s something we didn&#8217;t see the first time around.  Anyway&#8230;</li>
<li>Dell decided to send a new PERC card, new PERC cable, and because of the disk error, a new disk.</li>
</ol>
<p>We decided to only replace the PERC card first, to see if that would solve the problem.  It worked!</p>
<pre><span style="color:green">// problem machine after new PERC card:</span>
$ sudo /sbin/hdparm -Tt /dev/sdc
 Timing cached reads:   25368 MB in  1.99 seconds = <strong>12727.72 MB</strong>/sec
 Timing buffered disk reads:  256 MB in  3.00 seconds =  <strong>85.33 <em>MB</em></strong>/sec</pre>
<p>That&#8217;s 2 orders of magnitude improvement, but it&#8217;s not good enough.  The other machines are doing better.  Let&#8217;s change the look-ahead cache size.</p>
<pre><span style="color:green">// Set lookahead to 8192 blocks:</span>
$ sudo /sbin/blockdev --setra 8192 /dev/sdc
$ sudo /sbin/hdparm -Tt /dev/sdc
/dev/sdc:
 Timing cached reads:   23988 MB in  1.99 seconds = <strong>12035.05 MB</strong>/sec
 Timing buffered disk reads:  1202 MB in  3.00 seconds = <strong>400.48 MB</strong>/sec</pre>
<p>Now that&#8217;s what I&#8217;m talkin&#8217; about!!  Yes, 400 MB/sec is what we&#8217;re expecting for local disks.  Call it a day, grab me a beer, celebrate &#8212; disaster thwarted.</p>
<p>When all was said and done, we double-checked the logs and didn&#8217;t find anything having to do with disk 9, so we figured it was all probably the card.  It&#8217;s better not to rebuild the array in this case because we don&#8217;t use striping or mirroring&#8230; we need the space, and the &#8220;data&#8221; is regenerable (it&#8217;s processed output, not source data).  I would have replaced the cable too, since there&#8217;s no penalty for doing so, but I wasn&#8217;t the tinkerer today.</p>
<p>So that&#8217;s it: bad PERC/6 card.  It&#8217;s not the first bad enterprise part we&#8217;ve received from Dell.  They need to work on that.</p>
]]></content:encoded>
			<wfw:commentRss>http://log.largevoid.com/2010/04/performance-problems-on-an-md1000-with-perc6-disk-array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Static IP with DHCP-Assigned DNS on Ubuntu 9.10</title>
		<link>http://log.largevoid.com/2009/12/static-ip-with-dhcp-assigned-dns-on-ubuntu-9-10/</link>
		<comments>http://log.largevoid.com/2009/12/static-ip-with-dhcp-assigned-dns-on-ubuntu-9-10/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 20:05:08 +0000</pubDate>
		<dc:creator>Chief</dc:creator>
				<category><![CDATA[Reference]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[dhclient]]></category>
		<category><![CDATA[dhcp]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[eth0]]></category>
		<category><![CDATA[fixed address]]></category>
		<category><![CDATA[static ip]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://log.largevoid.com/?p=246</guid>
		<description><![CDATA[There is a ton of bug reports regarding the Network-Manager&#8217;s nm-applet not properly configuring static ips.  There are, and always have been, bugs in the nm-applet, in each of its versions.  In short, getting a static ip with dhcp assigned DNS parameters requires editing the /etc/dhcp3/dhclient.conf file.  Here we go.

sudo vi /etc/dhcp3/dhclient.conf
&#62;&#62;
alias [...]]]></description>
			<content:encoded><![CDATA[<p>There is a ton of bug reports regarding the Network-Manager&#8217;s nm-applet not properly configuring static ips.  There are, and always have been, bugs in the nm-applet, in each of its versions.  In short, getting a static ip with dhcp assigned DNS parameters requires editing the <em>/etc/dhcp3/dhclient.conf</em> file.  Here we go.</p>
<ol>
<li><code>sudo vi /etc/dhcp3/dhclient.conf</code>
<pre>&gt;&gt;
alias {
  interface "eth0";
  fixed-address 192.168.1.101;
  option subnet-mask 255.255.255.255;
}
&lt;&lt;</pre>
</li>
<li><code>sudo dhclient -r</code></li>
<li><code>sudo dhclient</code></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://log.largevoid.com/2009/12/static-ip-with-dhcp-assigned-dns-on-ubuntu-9-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing GDAL via FWTools</title>
		<link>http://log.largevoid.com/2009/12/installing-gdal-via-fwtools/</link>
		<comments>http://log.largevoid.com/2009/12/installing-gdal-via-fwtools/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 03:01:57 +0000</pubDate>
		<dc:creator>Chief</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[crs]]></category>
		<category><![CDATA[cs2cs]]></category>
		<category><![CDATA[fwtools]]></category>
		<category><![CDATA[gdal]]></category>
		<category><![CDATA[gdalwarp]]></category>
		<category><![CDATA[geo]]></category>
		<category><![CDATA[spatial]]></category>

		<guid isPermaLink="false">http://log.largevoid.com/?p=225</guid>
		<description><![CDATA[
wget http://home.gdal.org/fwtools/FWTools-linux-2.0.6.tar.gz
sudo tar xzf FWTools-linux-2.0.6.tar.gz -C /usr/local
sudo /usr/local/FWTools-2.0.6/install.sh
sudo vi /etc/profile


# Add /usr/local/FWTools-2.0.6/bin_safe to the global $PATH 
pathmunge /usr/local/FWTools-2.0.6/bin_safe
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC


sudo cp /usr/local/FWTools-2.0.6/man/man1/* /usr/local/man/man1/
sudo cp /usr/local/FWTools-2.0.6/man/man3/* /usr/local/man/man3/
sudo cp /usr/local/FWTools-2.0.6/share/man/man1/* /usr/local/share/man/man1/
sudo cp /usr/local/FWTools-2.0.6/share/man/man3/* /usr/local/share/man/man3/
logout

Warning: You may break PHP!
The fwtools_env.* files could be copied to /etc/profile.d/, but if you&#8217;re running PHP, you&#8217;ll break [...]]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>home.gdal.org<span style="color: #000000; font-weight: bold;">/</span>fwtools<span style="color: #000000; font-weight: bold;">/</span>FWTools-linux-2.0.6.tar.gz
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">tar</span> xzf FWTools-linux-2.0.6.tar.gz <span style="color: #660033;">-C</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>FWTools-2.0.6<span style="color: #000000; font-weight: bold;">/</span>install.sh
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>profile</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="vim" style="font-family:monospace;"># Add <span style="color: #000000;">/</span>usr<span style="color: #000000;">/</span>local<span style="color: #000000;">/</span>FWTools<span style="color: #000000;">-</span>2<span style="color: #000000;">.</span>0<span style="color: #000000;">.</span>6<span style="color: #000000;">/</span>bin_safe to the global <span style="color: #000000;">$</span>PATH 
pathmunge <span style="color: #000000;">/</span>usr<span style="color: #000000;">/</span>local<span style="color: #000000;">/</span>FWTools<span style="color: #000000;">-</span>2<span style="color: #000000;">.</span>0<span style="color: #000000;">.</span>6<span style="color: #000000;">/</span>bin_safe
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>FWTools-2.0.6<span style="color: #000000; font-weight: bold;">/</span>man<span style="color: #000000; font-weight: bold;">/</span>man1<span style="color: #000000; font-weight: bold;">/*</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>man<span style="color: #000000; font-weight: bold;">/</span>man1<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>FWTools-2.0.6<span style="color: #000000; font-weight: bold;">/</span>man<span style="color: #000000; font-weight: bold;">/</span>man3<span style="color: #000000; font-weight: bold;">/*</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>man<span style="color: #000000; font-weight: bold;">/</span>man3<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>FWTools-2.0.6<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>man<span style="color: #000000; font-weight: bold;">/</span>man1<span style="color: #000000; font-weight: bold;">/*</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>man<span style="color: #000000; font-weight: bold;">/</span>man1<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>FWTools-2.0.6<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>man<span style="color: #000000; font-weight: bold;">/</span>man3<span style="color: #000000; font-weight: bold;">/*</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>man<span style="color: #000000; font-weight: bold;">/</span>man3<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #7a0874; font-weight: bold;">logout</span></pre></div></div>

<p><strong>Warning</strong>: You may break PHP!</p>
<p>The fwtools_env.* files could be copied to /etc/profile.d/, but if you&#8217;re running PHP, you&#8217;ll break the mechanism that loads php extensions.  I don&#8217;t know why.</p>
<h4>Reference:</h4>
<p><a href="http://fwtools.maptools.org/">FWTools: Open Source GIS Binary Kit for Windows and Linux</a></p>
]]></content:encoded>
			<wfw:commentRss>http://log.largevoid.com/2009/12/installing-gdal-via-fwtools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring MySQL</title>
		<link>http://log.largevoid.com/2009/11/configuring-mysql/</link>
		<comments>http://log.largevoid.com/2009/11/configuring-mysql/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 00:11:20 +0000</pubDate>
		<dc:creator>Chief</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[chkconfig]]></category>
		<category><![CDATA[configure]]></category>
		<category><![CDATA[init.d]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysqld]]></category>

		<guid isPermaLink="false">http://log.largevoid.com/?p=108</guid>
		<description><![CDATA[The following is how I set up MySQL on wharf.

First, ensure mysql is installed: ls /etc/init.d/my*
Now, make mysql start on boot: sudo /sbin/chkconfig --level 35 mysqld on
Start the mysql server: sudo /etc/init.d/mysqld start
Make MySQL more secure: sudo /usr/bin/mysql_secure_installation
Log into mysql as root: mysql -u root -p [to be entered by prompt]
Add another mysql user: mysql&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>The following is how I set up MySQL on wharf.</p>
<ol>
<li>First, ensure mysql is installed: <code>ls /etc/init.d/my*</code></li>
<li>Now, make mysql start on boot: <code>sudo /sbin/chkconfig --level 35 mysqld on</code></li>
<li>Start the mysql server: <code>sudo /etc/init.d/mysqld start</code></li>
<li>Make MySQL more secure: <code>sudo /usr/bin/mysql_secure_installation</code></li>
<li>Log into mysql as root: <code>mysql -u root -p [to be entered by prompt]</code></li>
<li>Add another mysql user: <br/><code>mysql&gt; CREATE USER 'newuser'@'%' IDENTIFIED BY 'newuserpass';<br/>mysql&gt; GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER ON *.* TO 'newuser'@'%';<br/>mysql&gt; FLUSH PRIVILEGES;</code></li>
<p></code></li>
<li>Exit mysql: <code>mysql&gt; exit</code></li>
<li>Test: <code>mysql -u &lt;newuser&gt; -p &lt;newuserpass&gt;</code></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://log.largevoid.com/2009/11/configuring-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git &#8211; Install and Configure</title>
		<link>http://log.largevoid.com/2009/11/git-install-and-configure/</link>
		<comments>http://log.largevoid.com/2009/11/git-install-and-configure/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 23:19:50 +0000</pubDate>
		<dc:creator>Chief</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[configure]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[repository]]></category>
		<category><![CDATA[revision]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://log.largevoid.com/?p=61</guid>
		<description><![CDATA[Git is a code revision system not much unlike subversion and CVS.  One of the best features of git is that it is a distributed revision system, so you can check-in, check-out, commit, revert, etc without ever needing direct access to the central repository.  You can work with your repository as if it were a [...]]]></description>
			<content:encoded><![CDATA[<p>Git is a code revision system not much unlike subversion and CVS.  One of the best features of git is that it is a distributed revision system, so you can check-in, check-out, commit, revert, etc without ever needing direct access to the central repository.  You can work with your repository as if it were a centralized system if need be found.<span id="more-61"></span></p>
<h3>Installation (from source)</h3>
<p>Go to <a href="http://www.kernel.org/pub/software/scm/git/">http://www.kernel.org/pub/software/scm/git/</a> and pick the latest version (1.6.5.2), then from the command line, issue:</p>
<p><code># Make a temporary directory from which we'll work<br />
mkdir ~/gittmp<br />
cd ~/gittmp</code><br />
<code># Get the source, compile and intsall<br />
wget http://www.kernel.org/pub/software/scm/git/git-1.6.5.2.tar.gz<br />
tar xzf git-1.6.5.2.tar.gz<br />
cd ~/gittmp/git-1.6.5.2<br />
./configure<br />
make<br />
sudo make install<br />
cd  ~/gittmp</code><br />
<code># Get and install the man pages<br />
wget http://www.kernel.org/pub/software/scm/git/git-manpages-1.6.5.2.tar.gz<br />
sudo tar xzf git-manpages-1.6.5.2.tar.gz -C /usr/local/share/man/<br />
cd ~<br />
rm -r ~/gittmp/</code></p>
<h3>Testing</h3>
<p>Now that we&#8217;ve got everything set up, go ahead and check that everything&#8217;s visible to your path.  Note: You may need to log back in for the settings to be read.<br />
<code>$ which git<br />
/usr/local/bin/git<br />
$ git config --help<br />
--- man page retrieved ---</code></p>
<h3>Configuration</h3>
<p>Now we need to set some globals.  These are used to identify you when pushing changes.<br />
<code>$ git config --global user.name "Scott Chacon"<br />
$ git config --global user.email "schacon@gmail.com"</code></p>
<p>In a <strong>distributed environment</strong>, your workflow might go something like: A writes some code and commits. B pulls code, makes updates, commits.  A updates local copy with B&#8217;s committed changes, continues development.  The flow goes: get updates from peer, make changes, commit.  Here&#8217;s an example:<br />
<code>alice: $ cd ~/project<br />
alice: $ git init<br />
alice: $ git add lib src README CHANGELOG<br />
alice: $ git commit -m "Initialization"<br />
bob: $ git clone /home/alice/project myrepo<br />
bob: $ echo 'I made a change' &gt;&gt; CHANGELOG<br />
bob: $ git commit -a -m "Appended changelog info"<br />
alice: $ cd ~/project<br />
alice: $ git pull /home/bob/myrepo master<br />
alice: $ echo "Confirmed, changes were merged" &gt;&gt; CHANGELOG<br />
alice: $ git commit -a -m "Merged bob's changes with some new additions"</code></p>
<p>Another setup might be to have a <strong>public repository</strong> for centralized access.  It&#8217;s not really a central repository, but it&#8217;s the place where you push all your changes to from any machine you work on.  In this way, anyone can go to exactly one place to get changes you&#8217;ve made, and you can work from any machine with git, using your own public repository as a starting point.<br />
<code>$ git clone --bare ~/proj proj.git<br />
$ touch proj.git/git-daemon-export-ok<br />
$ scp -r /proj.git user@host.com:/path/to/proj.git</code><br />
Want to have access to the repo via <strong>http</strong>?  Try this:<br />
<code>$ mv proj.git /var/www/html/repos/proj.git<br />
$ cd /var/www/html/repos/proj.git<br />
$ git --bare update-server-info<br />
$ chmod a+x hooks/post-update</code><br />
Now anyone can access your repository like so: <code>$ git clone http://example.com/repos/proj.git</code></p>
<p>Prefer a <strong>private repository</strong>?  It&#8217;s easier than the public setup.<br />
You: <code>$ git clone --bare /home/user/myrepo/.git /tmp/myrepo.git<br />
$ scp -r /tmp/myrepo.git myserver.com:/opt/git/myrepo.git</code><br />
Peer: <code>$ git clone myserver.com:/opt/git/myrepo.git</code></p>
<p>So how do these shared repositories work?</p>
<ol>
<li> clone to initialize local git revision management</li>
<li> modify/commit/revert/etc locally (1 or more times)</li>
<li> push up to the shared repository</li>
</ol>
<p>Peer: &#8230; makes changes to source &#8230;<br />
Peer: <code>$ git commit -a -m "I made a few changes"</code><br />
Peer: &#8230; continue editing until ready for consumption &#8230;<br />
Peer: <code>$ git commit -a -m "I made a few more changes"</code><br />
Peer: <code>$ git push ssh://yourserver.com/~you/proj.git master[:master]</code><br />
You: <code>$ git clone myserver.com:/opt/git/myrepo.git</code><br />
You: &#8230; editing/conflict management/etc. &#8230;<br />
You: <code>$ git commit -a -m "Pretty up peer's changes (minor edits)"</code><br />
You: <code>$ git push ssh://yourserver.com/~you/proj.git master[:master]</code></p>
<h3>Using Git on Windows</h3>
<p>If you plan on using Git on Windows (Sure, why not? masochists pssht) you could install <a href="http://sourceforge.net/projects/gitextensions/">Git Extensions (Windows)</a> from <a href="http://git-scm.com/tools">http://git-scm.com/tools</a>.  At least, that&#8217;s what I did.  It was confusing as all hell, until I went through all possible alternatives that appeared easier than understanding what a <a href="http://www.kernel.org/pub/software/scm/git/docs/git-remote.html">remote</a> is.  The key to getting it all to work is setting up ssh keys so that you can auto-logon to whatever server has your git repositories with the ssh protocol.  If you&#8217;re using the git protocol, I don&#8217;t think that applies.  I could be wrong on this.</p>
<p>Once you&#8217;ve installed <strong>Git Extensions</strong>, load it up, do some general configuration (user.name, user.email, etc.), then select from the menu bar <em>Remotes</em>-&gt;<em>PuTTy</em>-&gt;<em>Generate or import key</em>.  This assumes that you&#8217;ll be using <strong>PuTTY</strong> for all your ssh needs (if applicable).  Anyway, generate a key and save the public key somewhere handy, save the private key somewhere safe.  Now, using that pubkey, follow the advice for <a href="http://log.largevoid.com/2009-09/setting-up-ssh-keys/">Setting up SSH Keys</a>.  You&#8217;re going to want to add that pub key to your authorized_keys on the git repo server.  After that, make sure the PuTTY authentication agent is running (<em>Remotes</em>-&gt;<em>PuTTy</em>-&gt;<em>Start authentication agent</em>).  A new icon should appear in your system tray.  Right click on the new icon to &#8220;<em>Add Key</em>.&#8221;  This key will be your private key.  The agent handles the hand-shaking.</p>
<p>After doing all this the hard way, maybe you should just use the git protocol, but then again, I haven&#8217;t tried it myself.</p>
<h3>Resources</h3>
<p>Finally, it&#8217;s probably best to read Git&#8217;s HOWTOs and Tutorials.</p>
<ul>
<li><a href="http://git.or.cz/gitwiki/Installation">Git Installation</a></li>
<li><a href="http://book.git-scm.com/book.pdf">Git Community Book</a> (pgs. 40-44, 75-77)</li>
<li><a href="http://kernel.org/pub/software/scm/git/docs/howto/">Git HOWTOs</a></li>
<li><a href="http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html">Git Tutorial (1of2)</a></li>
<li><a href="http://www.kernel.org/pub/software/scm/git/docs/gittutorial-2.html">Git Tutorial (2of2)</a></li>
<li>man git</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://log.largevoid.com/2009/11/git-install-and-configure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing JDK on RHEL5</title>
		<link>http://log.largevoid.com/2009/10/installing-jdk-on-rhel5/</link>
		<comments>http://log.largevoid.com/2009/10/installing-jdk-on-rhel5/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 07:21:09 +0000</pubDate>
		<dc:creator>Chief</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[ANT]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[JDK]]></category>
		<category><![CDATA[RHEL5]]></category>

		<guid isPermaLink="false">http://log.largevoid.com/?p=28</guid>
		<description><![CDATA[I needed to install the JDK as a prerequisite for GeoServer.
Steps

Download latest JDK (jdk-6u16-linux-i586-rpm.bin) from Sun.
     Note: navigating Sun&#8217;s website and using their download accelerator is a PAIN.
chmod a+x jdk-6u16-linux-i586-rpm.bin
sudo ./jdk-6u16-linux-i586-rpm.bin
ls -l /usr/java
Create file /etc/profile.d/java-jdk.sh

sudo vi /etc/profile.d/java-jdk.sh
cat /etc/profile.d/java-jdk.sh
	#!/bin/bash
	export JAVA_HOME=/usr/java/latest
	export JRE_HOME=/usr/java/latest/jre
	export PATH=$JAVA_HOME/bin:$ANT_HOME/bin:$PATH



]]></description>
			<content:encoded><![CDATA[<p>I needed to install the JDK as a prerequisite for GeoServer.</p>
<h3>Steps</h3>
<ol>
<li>Download latest JDK (jdk-6u16-linux-i586-rpm.bin) from Sun.<br />
     Note: navigating Sun&#8217;s website and using their download accelerator is a PAIN.</li>
<li>chmod a+x jdk-6u16-linux-i586-rpm.bin</li>
<li>sudo ./jdk-6u16-linux-i586-rpm.bin</li>
<li>ls -l /usr/java</li>
<li>Create file /etc/profile.d/java-jdk.sh
<ol>
<li>sudo vi /etc/profile.d/java-jdk.sh</li>
<li>cat /etc/profile.d/java-jdk.sh<code><br />
	#!/bin/bash<br />
	export JAVA_HOME=/usr/java/latest<br />
	export JRE_HOME=/usr/java/latest/jre<br />
	export PATH=$JAVA_HOME/bin:$ANT_HOME/bin:$PATH<br />
</code></li>
</ol>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://log.largevoid.com/2009/10/installing-jdk-on-rhel5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting Up SSH Keys</title>
		<link>http://log.largevoid.com/2009/09/setting-up-ssh-keys/</link>
		<comments>http://log.largevoid.com/2009/09/setting-up-ssh-keys/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 08:29:02 +0000</pubDate>
		<dc:creator>Chief</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[authorized_keys]]></category>
		<category><![CDATA[automated]]></category>
		<category><![CDATA[rsa]]></category>
		<category><![CDATA[scp]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://log.largevoid.com/?p=34</guid>
		<description><![CDATA[Question How do I configure my machine to be able to ssh into another machine without having to enter a password every time?
Answer:
Let&#8217;s first define a few things.

localhost &#8211; Your regular, every-day machine.  This machine will be making outbound calls to other machines, and is the originator of the ssh/scp requests.
server  &#8211; The [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Question</strong> How do I configure my machine to be able to ssh into another machine without having to enter a password every time?</p>
<p><em>Answer:</em><br />
Let&#8217;s first define a few things.</p>
<ul>
<li><em>localhost</em> &#8211; Your regular, every-day machine.  This machine will be making outbound calls to other machines, and is the originator of the ssh/scp requests.</li>
<li><em>server</em>  &#8211; The machine to which one would want to log into via ssh, or scp files to.</li>
</ul>
<p>First, generate the localhost&#8217;s key:<code><br />
 localhost$ ssh-keygen -b 4096 -t rsa<br />
 localhost$ scp ~/.ssh/id_rsa.pub server:~/.ssh/localhost.pub<br />
</code></p>
<p>We&#8217;ll go the fail-safe way, ensuring that an authorized_keys file exists, then we&#8217;ll cat the old with the new and replace the existing authorized_keys file:<code><br />
  server$ touch ~/.ssh/authorized_keys<br />
  server$ chmod 600 ~/.ssh/authorized_keys<br />
  server$ cp ~/.ssh/authorized_keys ~/.ssh/authorized_keys.bak<br />
  server$ cat ~/.ssh/authorized_keys.bak ~/.ssh/localhost.pub > ~/.ssh/authorized_keys<br />
</code></p>
<p>That&#8217;s all there is to it.</p>
<p><strong>Question</strong> Why would you want to do that?</p>
<p><em>Answer:</em><br />
Say you have a bash script that needs to copy files to another machine every time they are generated.  The best way to do that is to scp them.  Scp requires ssh authorization.  By setting up these keys, you can allow your script to scp files securely without locking at the password prompt.</p>
]]></content:encoded>
			<wfw:commentRss>http://log.largevoid.com/2009/09/setting-up-ssh-keys/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Server Patches and Time Zones</title>
		<link>http://log.largevoid.com/2009/07/server-patches-and-time-zones/</link>
		<comments>http://log.largevoid.com/2009/07/server-patches-and-time-zones/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 02:00:05 +0000</pubDate>
		<dc:creator>Chief</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[hwclock]]></category>
		<category><![CDATA[sbin]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[sysconfig]]></category>
		<category><![CDATA[timezone]]></category>

		<guid isPermaLink="false">http://log.largevoid.com/?p=7</guid>
		<description><![CDATA[Sometimes, after a server patch, the timezone is reset to Pacific time.  Why?  I don’t know, but when you patch a machine, be sure to double-check that the time zone after the patch is the same as before the patch.  If not, set it.

Logged in, then su, check which timezone your machine is currently using [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes, after a server patch, the timezone is reset to Pacific time.  Why?  I don’t know, but when you patch a machine, be sure to double-check that the time zone after the patch is the same as before the patch.  If not, set it.</p>
<ol>
<li>Logged in, then <code>su</code>, check which timezone your machine is currently using by executing `<strong>date</strong>`. You’ll see something like <code>Mon 17 Jan 2005 12:15:08 PM PST</code>, PST in this case is the current timezone.</li>
<li>Change to the directory <code>/usr/share/zoneinfo</code> here you will find a list of time zone regions. Choose the most appropriate region, if you live in Canada or the US this directory is the “America” directory.</li>
<li>If you wish, backup the previous timezone configuration by copying it to a different location. Such as<br />
<code>mv /etc/localtime  /etc/localtime-old</code></li>
<li>Create a symbolic link from the appropriate timezone to /etc/localtime. Example:<br />
<code>ln -sf /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime</code></li>
<li>If you have the utility rdate, update the current system time by executing<br />
<code>/usr/bin/rdate -s time-a.nist.gov</code></li>
<li>Set the ZONE entry in the file <code>/etc/sysconfig/clock</code> file (e.g. “America/Los_Angeles”)</li>
<li>Set the hardware clock by executing:<br />
<code>/sbin/hwclock --systohc</code></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://log.largevoid.com/2009/07/server-patches-and-time-zones/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moving Dokuwiki Name Spaces</title>
		<link>http://log.largevoid.com/2009/06/moving-dokuwiki-name-spaces/</link>
		<comments>http://log.largevoid.com/2009/06/moving-dokuwiki-name-spaces/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 12:14:46 +0000</pubDate>
		<dc:creator>Chief</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[dokuwiki]]></category>
		<category><![CDATA[merge]]></category>
		<category><![CDATA[namespace]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://log.largevoid.com/?p=37</guid>
		<description><![CDATA[The dokuwiki name space may become polluted with legacy junk if entire name spaces are moved or removed.  There will be empty name spaces that you&#8217;d prefer to rid yourself of.  I realize that moving name spaces is bad practice, but it happens.  Follow along to see how to resolve dangling name [...]]]></description>
			<content:encoded><![CDATA[<p>The dokuwiki name space may become polluted with legacy junk if entire name spaces are moved or removed.  There will be empty name spaces that you&#8217;d prefer to rid yourself of.  I realize that moving name spaces is bad practice, but it happens.  Follow along to see how to resolve dangling name spaces.</p>
<h3>The Process</h3>
<p>Below is the order in which one would rename an entire name space.  For demonstration, we&#8217;ll use a real example: Renaming :configuration: to :notes:, the very notes that you&#8217;re reading right now.</p>
<ol>
<li>ssh into your wiki server</li>
<li><code>cd /var/www/default/wiki/</code></li>
<li><code>tar czf data-<date>.tgz data</code></li>
<li><code>cd data</code> (pwd is /var/www/default/wiki/data)</li>
<li><code>mv attic/configuration attic/notes</code> (assuming notes doesn&#8217;t exist!!)</li>
<li><code>mv meta/configuration meta/notes</code> (again assuming notes doesn&#8217;t exist.)</li>
<li><code>mv pages/configuration pages/notes</code> (&#8230; again&#8230;)</li>
<li><code>grep -r configuration pages/notes/*</code> (to find anything that might be broken)</li>
<li>foreach broken link: fix it.  There&#8217;s a sed trick, but I don&#8217;t know it.</li>
<li>cross your fingers</li>
<li>visit your wiki website and enjoy.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://log.largevoid.com/2009/06/moving-dokuwiki-name-spaces/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compiling Datascope.so for PHP</title>
		<link>http://log.largevoid.com/2008/10/compiling-datascope-so-for-php/</link>
		<comments>http://log.largevoid.com/2008/10/compiling-datascope-so-for-php/#comments</comments>
		<pubDate>Fri, 10 Oct 2008 10:46:56 +0000</pubDate>
		<dc:creator>Chief</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[antelope]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[datascope]]></category>
		<category><![CDATA[dl]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://log.largevoid.com/?p=21</guid>
		<description><![CDATA[Does the following sentence make sense?
In order to be able to simply dl(&#8220;Datascope.so&#8221;) in your PHP code, you first need to make sure Datascope.so is compiled and copied to the extension_dir, as specified in php.ini (ex: /usr/lib/php4).
Answer:
  No: Stop right now.  You&#8217;re not qualified to read this article.
  Yes: Keep reading.
Notes
You&#8217;re not [...]]]></description>
			<content:encoded><![CDATA[<p>Does the following sentence make sense?</p>
<p>In order to be able to simply dl(&#8220;Datascope.so&#8221;) in your PHP code, you first need to make sure Datascope.so is compiled and copied to the <strong>extension_dir</strong>, as specified in <em>php.ini</em> (ex: <em>/usr/lib/php4</em>).</p>
<p><strong>Answer:</strong><br />
  No: Stop right now.  You&#8217;re not qualified to read this article.<br />
  Yes: Keep reading.</p>
<h3>Notes</h3>
<p>You&#8217;re not compiling the PHP source code for actual use, so <strong>please</strong> don&#8217;t install it.  If you do, you run the risk of clobbering any pre-existing php installations, and overwriting previously compiled-in modules.  The only reason why you &#8221;make&#8221; PHP is so that the Zend libraries are properly initialized.  </p>
<p>The PHP &#8221;make&#8221; step may be avoidable, but given that the compile doesn&#8217;t affect system performance, I didn&#8217;t bother.  </p>
<p>Paths should be changed to reflect your setup.  If you don&#8217;t have the src/contrib/data/php/datascope code, you can get it from the <a href="http://www.indiana.edu/~aug/source_downloads/download.html">contrib source</a> at <a href="http://www.brtt.com/">BRTT</a>&#8217;s web site.</p>
<p>Contrib appears to be maintained by <a href="http://www.indiana.edu/~aug/">Indiana University</a>.</p>
<h3>Paths</h3>
<ul>
<li><strong>Antelope Bash Script</strong> &#8221;/opt/antelope/4.9/setup.sh&#8221;</li>
<li><strong>Datascope Source</strong> &#8221;/opt/antelope/4.9/src/contrib/data/php/datascope&#8221;</li>
<li><strong>PHP Source Code URL</strong> &#8221;http://downloads.php.net/ilia/php-5.1.4.tar.bz2&#8221;</li>
<li><strong>PHP Modules Directory</strong> &#8221;/usr/lib/php/modules/&#8221;</li>
</ul>
<h3>Compile and Install Steps</h3>
<ol>
<li>wget <em>&lt;PHP Source Code&gt;</em></li>
<li>bunzip2 php-5.1.4.tar.bz2</li>
<li>tar xf php-5.1.4.tar</li>
<li>cd php-5.1.4</li>
<li>PHP_INC=`pwd`</li>
<li>export PHP_INC</li>
<li>./configure</li>
<li>make</li>
<li>cd <em>&lt;Datascope Source&gt;</em></li>
<li>source <em>&lt;Antelope Bash Script&gt;</em></li>
<li>sudo make install</li>
<li>sudo cp Datascope.so <em>&lt;PHP Modules Directory&gt;</em></li>
</ol>
<h3>PHP Script Example</h3>
<p>Proper usage of the &#8221;Datascope.so&#8221; module follows:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">putenv</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;PFPATH=/opt/antelope/4.9/data/pf&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">putenv</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;ANTELOPE=/opt/antelope/4.9&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">set_include_path</span><span style="color: #009900;">&#40;</span>
  <span style="color: #990000;">get_include_path</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>PATH_SEPARATOR<span style="color: #339933;">.</span><span style="color: #990000;">getenv</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ANTELOPE'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;/data/php&quot;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #990000;">extension_loaded</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;Datascope.so&quot;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #990000;">dl</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;Datascope.so&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #990000;">exit</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;Failed to load datascope.so&quot;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://log.largevoid.com/2008/10/compiling-datascope-so-for-php/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/


Served from: log.largevoid.com @ 2010-09-10 19:48:40 -->