<?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>Dee Double Dub &#187; Linux</title>
	<atom:link href="http://www.deedoubledub.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.deedoubledub.com</link>
	<description>random points of interest</description>
	<lastBuildDate>Fri, 17 Jul 2009 00:30:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>CUDA 2.1 Setup on Ubuntu 8.04</title>
		<link>http://www.deedoubledub.com/2009/04/cuda-21-setup-on-ubuntu-804/</link>
		<comments>http://www.deedoubledub.com/2009/04/cuda-21-setup-on-ubuntu-804/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 01:37:30 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[CUDA]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://deedoubledub.phpnet.us/?p=74</guid>
		<description><![CDATA[The Compute Unified Device Architecture is nVidia&#8217;s architecture and API for using graphics processors as powerful parallel supercomputers on the cheap.  Setting up the environment for developing with CUDA requires the installation of the CUDA driver, the CUDA toolkit, and the CUDA SDK.  The following is the process for setting up this environment in Ubuntu [...]]]></description>
			<content:encoded><![CDATA[<p>The Compute Unified Device Architecture is nVidia&#8217;s architecture and API for using graphics processors as powerful parallel supercomputers on the cheap.  Setting up the environment for developing with CUDA requires the installation of the CUDA driver, the CUDA toolkit, and the CUDA SDK.  The following is the process for setting up this environment in Ubuntu 8.04.</p>
<p><span id="more-74"></span></p>
<ol>
<li>Install the necessary build tools</li>
<p>You may find that you need some additional development libraries depending on what is already installed on your system.<br />
<code>sudo apt-get install build-essential libglut3-dev libxi-dev libxmu-dev</code></p>
<li>Download the CUDA driver, Toolkit, and SDK from <a href="http://developer.nvidia.com">developer.nvidia.com</a></li>
<li>Install the CUDA driver</li>
<p>The nVidia driver cannot be installed while X is running, so you will need to stop gdm and install the driver in a virtual console by pressing ctrl+alt+F1.  If you have already installed the Ubuntu restricted driver for your nVidia graphics card like I did, you will probably run into some trouble installing the CUDA driver.  I solved my problems by following the nVidia driver manual installation guide <a href="https://help.ubuntu.com/community/NvidiaManual">here</a>.  The normal process if there are no conflicting drivers already installed are as follows.<br />
<code>chmod +x NVIDIA-Linux-x86-xxx-pkg1.run<br />
sudo /etc/init.d/gdm stop<br />
sudo ./NVIDIA-Linux-x86-xxx-pkg1.run<br />
sudo /etc/init.d/gdm start</code></p>
<li>Install the CUDA toolkit</li>
<p><code>chmod +x NVIDIA_CUDA_Toolkit_2.1_ubuntu8.04_x86.run<br />
sudo ./NVIDIA_CUDA_Toolkit_2.1_ubuntu8.06_x86.run</code></p>
<li>Modify Environment Variables</li>
<p>The simplest way to do this is to edit your ~/.bashrc file.  Changes take effect when you start a new terminal session.<br />
<code>PATH=$PATH:/usr/local/cuda/bin<br />
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib<br />
export PATH<br />
export LD_LIBRARY_PATH</code></p>
<li>Install the CUDA SDK</li>
<p><code>chmod +x ./NVIDIA_CUDA_SDK_xxx_linux.run<br />
./NVIDIA_CUDA_SDK_xxx_linux.run</code></p>
<li>Compile and Run the example programs</li>
<p><code>cd ~/NVIDIA_CUDA_SDK<br />
make</code></p>
<p>Now execute any of the example programs in ~/NVIDIA_CUDA_SDK/bin/linux/release/</ol>
<p>Check out <a href="http://lifeofaprogrammergeek.blogspot.com/2008/05/cuda-development-in-ubuntu.html">http://lifeofaprogrammergeek.blogspot.com/2008/05/cuda-development-in-ubuntu.html</a> for similar details and how to copy the template project and start coding your own CUDA program.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deedoubledub.com/2009/04/cuda-21-setup-on-ubuntu-804/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Free Linux Journal Subscription</title>
		<link>http://www.deedoubledub.com/2009/03/free-linux-journal-subscription/</link>
		<comments>http://www.deedoubledub.com/2009/03/free-linux-journal-subscription/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 14:25:51 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Deals]]></category>
		<category><![CDATA[LinuxJournal]]></category>

		<guid isPermaLink="false">http://deedoubledub.phpnet.us/?p=65</guid>
		<description><![CDATA[
This week Linux Journal magazine has been running a contest and the prize is a one year free subscription to the digital edition of their magazine.
All you have to do to enter is head over to Linux Journal and watch this week&#8217;s series of Tech Tip Videos (the ones marked &#8220;This is Tech Tip Video [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="aligncenter size-full wp-image-66" title="lj-logo" src="http://www.deedoubledub.com/wp-content/uploads/2009/03/lj-logo.gif" alt="lj-logo" /></p>
<p>This week <a href="http://www.linuxjorunal.com">Linux Journal</a> magazine has been running a contest and the prize is a one year free subscription to the digital edition of their magazine.</p>
<p>All you have to do to enter is head over to Linux Journal and watch this week&#8217;s series of <a href="http://www.linuxjournal.com/video">Tech Tip Videos</a> (the ones marked &#8220;This is Tech Tip Video Contest Week (March 9 &#8211; 13) at LinuxJournal.com!&#8221;).  Throughout those videos they sprinkled secret letters.  You just have to find the secret letters over the course of the week and unscramble them to produce a linux related phrase.  Once you have unscrambled the letters, head over to the <a href="http://www.linuxjournal.com/content/contest">contest submission</a> form and submit it to win a free subscription.</p>
<p>Hurry!  The contest ends at 11:59:59PM EDT, Friday, March 13 2009.  That&#8217;s tonight!</p>
<p>Here&#8217;s the official <a href="http://www.linuxjournal.com/content/linux-journal-announces-contest-prizes-begin-march-9">contest announcement</a> from Monday.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deedoubledub.com/2009/03/free-linux-journal-subscription/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nagios NRPE setup on Ubuntu 8.04</title>
		<link>http://www.deedoubledub.com/2009/03/nagios-nrpe-setup-on-ubuntu-804/</link>
		<comments>http://www.deedoubledub.com/2009/03/nagios-nrpe-setup-on-ubuntu-804/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 23:37:12 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Nagios]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://deedoubledub.phpnet.us/?p=31</guid>
		<description><![CDATA[Here is a step by step walkthrough that I developed recently for setting up the Nagios NRPE plugin to monitor remote hosts. This setup was performed on a host running Ubuntu Server 8.04.1. This walkthrough is based on the official nagios documentation and will result in a NRPE plugin installed from source since the latest version of nagios and its plugins are not available in the Ubuntu 8.04 repositories.]]></description>
			<content:encoded><![CDATA[<p>Here is a step by step walkthrough that I developed recently for setting up the <a href="http://www.nagios.org">Nagios</a> NRPE plugin to monitor remote hosts.  This setup was performed on a host running Ubuntu Server 8.04.1.  This walkthrough is based on the official nagios documentation and will result in a NRPE plugin installed from source since the latest version of nagios and its plugins are not available in the Ubuntu 8.04 repositories.</p>
<p><span id="more-31"></span></p>
<h3>On the remote host (machine to be monitored)</h3>
<p>1. Become root.  This just makes it easier so you don&#8217;t have to keep typing sudo.<br />
<code># sudo -s</code></p>
<p>2. Create nagios user and set password<br />
<code>$ /usr/sbin/useradd nagios<br />
$ passwd nagios</code></p>
<p>3. Install the OpenSSL development libraries required to compile the NRPE plugin<br />
<code>$ apt-get install libssl-dev openssl</code></p>
<p>4. Download source tarball of Nagios plugins (<a href="http://www.nagios.org/download">http://www.nagios.org/download</a>)<br />
<code>$ wget &lt;nagios-plugins, latest stable version&gt;</code></p>
<p>5. Extract the tarball<br />
<code>$ tar xzf &lt;nagios-plugins...&gt;.tar.gz<br />
$ cd &lt;nagios-plugins...&gt;</code></p>
<p>5a. (optional) Install additional libraries required for any plugins that you will need.  See the REQUIREMENTS document included with nagios plugins source code for any dependencies necessary for specific plugins.</p>
<p>6. Compile and install the plugins<br />
<code>$ ./configure<br />
$ make<br />
$ make install</code></p>
<p>7. Fix the permissions on the plugin directory and the plugins<br />
<code>$ chown nagios:nagios /usr/local/nagios<br />
$ chown -R nagios:nagios /usr/local/nagios/libexec</code></p>
<p>8. Install xinetd<br />
<code>$ apt-get install xinetd</code></p>
<p>9. Install the NRPE daemon, download the source tarball for NRPE from <a href="http://www.nagios.org/download">http://www.nagios.org/download</a><br />
<code>$ wget &lt;nrpe, latest stable version&gt;<br />
$ tar xzf &lt;nrpe...&gt;.tar.gz<br />
$ cd &lt;nrpe...&gt;<br />
$ ./configure<br />
$ make all<br />
<br />
$ make install-plugin<br />
$ make install-daemon<br />
$ make install-daemon-config<br />
$ make install-xinetd</code></p>
<p>10. Edit /etc/xinetd.d/nrpe and add the IP address of the monitoring server to the only_from directive.  This directive can contain multiple IP addresses provided in a space separated list.  This example will allow access from the Nagios monitoring server as well as the localhost.<br />
<code>$ vi /etc/xinetd.d/nrpe<br />
<br />
. . .<br />
<br />
only_from    =xxx.xxx.xxx.xxx 127.0.0.1</code></p>
<p>11. Edit /etc/services to add the NRPE port definition<br />
<code>$ vi /etc/services<br />
<br />. . .<br />
<br />
nrpe    5666/tcp    # NRPE</code></p>
<p>12. Restart xinetd<br />
<code>$ /etc/init.d/xinetd restart</code></p>
<p>13. Test the NRPE daemon locally</p>
<p>First, use netstat to make sure that it is running under xinetd<br />
<code>$ netstat -at | grep nrpe</code><br />
should produce this output:<br />
<code>tcp 0 0 *:nrpe *:* LISTEN</code></p>
<p>Now give it a test using the Nagios check_nrpe plugin:<br />
<code>$ /usr/local/nagios/libexec/check_nrpe -H localhost</code><br />
You should see this output (with the appropriate version number of course)<br />
<code>NRPE v2.12</code></p>
<p>14. At this point you should be able to access the Nagios NRPE daemon on this host from the monitoring server to execute plugins locally.  Make sure to modify your firewall rules to allow access on port 5666 to the NRPE daemon.  The commands that are to be executed by the NRPE plugin can be customized in /usr/local/nagios/etc/nrpe.cfg.</p>
<h3>On the monitoring host (machine running nagios)</h3>
<p>1. Become root<br />
<code>$ sudo -s</code></p>
<p>2. Download and install the check_nrpe plugin (<a href="http://www.nagios.org/download">http://www.nagios.org/download</a>)<br />
<code>$ wget &lt;nrpe, latest stable version&gt;<br />
$ tar xzf &lt;nrpe...&gt;.tar.gz<br />
$ cd &lt;nrpe...&gt;<br />
$ ./configure<br />
$ make all<br />
$ make install-plugin</code></p>
<p>3. Test communication with remote NRPE daemon<br />
<code>$ /usr/local/nagios/libexec/check_nrpe -H &lt;hostname&gt;</code><br />
Your output should look like this if everything is successful (with the proper version number again).<br />
<code>NRPE v2.12</code></p>
<p>4. Create the NRPE command definition wherever in your configuration files you have commands defined.<br />
<code>$ vi /usr/local/nagios/etc/objects/commands.cfg<br />
<br />
. . .<br />
<br />
define command{<br />
&nbsp;&nbsp;&nbsp;&nbsp;command_name check_nrpe<br />
&nbsp;&nbsp;&nbsp;&nbsp;command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$<br />
}</code></p>
<p>5. Now you can create host and service definitions for the remote host and begin monitoring local services through the NRPE plugin and daemon.<br />
SAMPLE:<br />
<code>define service{<br />
&nbsp;&nbsp;&nbsp;&nbsp;use generic-service<br />
&nbsp;&nbsp;&nbsp;&nbsp;host_name remotehost<br />
&nbsp;&nbsp;&nbsp;&nbsp;service_description Current Users<br />
&nbsp;&nbsp;&nbsp;&nbsp;check_command check_nrpe!check_users<br />
}<br />
; check_nrpe tells the remote nrpe daemon to execute<br />
; the check_users command as defined in nrpe.cfg</code></p>
<p>6. Verify your configuration and restart the Nagios daemon to begin monitoring the remote host.<br />
Verify your nagios configuration:<br />
<code>$ /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg</code><br />
If everything checks out, restart the Nagios daemon:<br />
<code>$ /etc/init.d/nagios restart</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.deedoubledub.com/2009/03/nagios-nrpe-setup-on-ubuntu-804/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Redirect HTTP traffic to HTTPS with Apache</title>
		<link>http://www.deedoubledub.com/2009/03/redirect-http-traffic-to-https-with-apache/</link>
		<comments>http://www.deedoubledub.com/2009/03/redirect-http-traffic-to-https-with-apache/#comments</comments>
		<pubDate>Thu, 05 Mar 2009 23:49:16 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://deedoubledub.phpnet.us/?p=12</guid>
		<description><![CDATA[Occasionally when I am setting up a web server I want all interaction to occur in a secure channel encrypted with SSL.  I like to leave standard HTTP access available so that the standard http:// url still brings you to the proper site, so I redirect HTTP traffic on port 80 to an HTTPS [...]]]></description>
			<content:encoded><![CDATA[<p>Occasionally when I am setting up a web server I want all interaction to occur in a secure channel encrypted with SSL.  I like to leave standard HTTP access available so that the standard http:// url still brings you to the proper site, so I redirect HTTP traffic on port 80 to an HTTPS session on port 443.  Since I only do this once in a while, I always have to go searching for the proper method to do it, so I&#8217;m posting it here for a quick reference and to share it around.</p>
<p>The way to direct HTTP traffic to HTTPS is with the mod_rewrite URL Rewriting Engine module in Apache.  Here is the process that I used earlier today on an Ubuntu 8.04 Server with Apache2.<span id="more-12"></span></p>
<p>First enable the rewrite module using the a2enmod utility:</p>
<p><code>$ sudo a2enmod rewrite</code></p>
<p>Next edit <em>/etc/apache2/sites-available/default</em> to redirect the port 80 virtual host to the port 443 virtual host.<br />
<code><br />
$ sudo vi /etc/apache2/sites-available/default</code></p>
<p><code>&lt;VirtualHost *:80&gt;<br />
RewriteEngine on<br />
RewriteCond  %{SERVER_PORT} ^80$<br />
RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [R,L]<br />
. . .<br />
&lt;/VirtualHost&gt;</code></p>
<p><em>RewriteEngine on</em> enables mod_rewrite on this virtual host.  <em>RewriteCond  %{SERVER_PORT} ^80$</em> matches all requests on port 80, then <em>RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [R,L]</em> rewrites the request making it an https:// request.  Now all requests coming in on port 80 (HTTPS) will be redirected to port 443 (HTTPS).</p>
<p>Now save em&gt;/etc/apache2/sites-available/default and reload the Apache configuration to make the rewrite active.</p>
<p><code>$ sudo /etc/init.d/apache2 reload</code></p>
<p>For more information regarding Apache mod_rewrite or more details related to the rewrite rules structure and regular expressions see the <a href="http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html">documentation</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deedoubledub.com/2009/03/redirect-http-traffic-to-https-with-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
