<?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>Notes of a SysAdmin</title>
	<atom:link href="http://www.notesofasysadmin.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.notesofasysadmin.com</link>
	<description>This blog is about me, Drew Decker, and my experiences as a Senior Linux/Unix Systems Administrator.</description>
	<lastBuildDate>Tue, 01 May 2012 04:54:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Installing Nagios Core on Arch Linux</title>
		<link>http://www.notesofasysadmin.com/linux/installing-nagios-core-on-arch-linux/</link>
		<comments>http://www.notesofasysadmin.com/linux/installing-nagios-core-on-arch-linux/#comments</comments>
		<pubDate>Fri, 11 Nov 2011 23:06:36 +0000</pubDate>
		<dc:creator>Drew</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Nagios]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[System Monitoring]]></category>

		<guid isPermaLink="false">http://www.notesofasysadmin.com/?p=523</guid>
		<description><![CDATA[Nagios, which is also known as Nagios Core (this is the community version) allows you to monitor virtually any system, application, service, and/or business processes and alert you (or your team) when the are not are functioning properly. I know, from experience, that standing up a Nagios instance is very helpful in aiding with troubleshooting [...]]]></description>
			<content:encoded><![CDATA[<p>Nagios, which is also known as Nagios Core (this is the community version) allows you to monitor virtually any system, application, service, and/or business processes and alert you (or your team) when the are not are functioning properly. I know, from experience, that standing up a Nagios instance is very helpful in aiding with troubleshooting and is useful even if you just want a top-down look at how your infrastructure is doing. <span id="more-523"></span>  </p>
<p>I decided to write an article on installing it onto an Arch Linux distribution, as that&#8217;s what I run as a server instance at home.  You can install Nagios on a physical system or virtual machine; there&#8217;s no limitations there.  The reason I wanted to focus on the Arch Linux distribution was due to the fact that there is no much information on installing Nagios on Arch Linux; the main Arch Linux Wiki has an <a href="https://wiki.archlinux.org/index.php/Nagios" title="Arch Linux - Nagios">article on it</a>, though.</p>
<h3>Getting Started</h3>
<p>So, the first thing to do, is make sure you have all the dependencies.  You can tell Arch Linux to install a series of packages and it is smart enough to know what&#8217;s already installed and needs updating, so the following is just to outline the main requirements for Nagios.  Technically, the only requirement is a C compiler, but it&#8217;s not entirely useful, unless you just want a command line version of Nagios (which is completely legit, but having a web interface, for me, is always a plus).<br />
Dependencies:</p>
<ul>
<li>Apache</li>
<li>PHP</li>
<li>GCC compiler</li>
<li>GD development libraries</li>
</ul>
<h3>Installing Dependencies</h3>
<p>Like I stated before, Arch Linux makes it simple to install packages, so, all you have to do is run a single command and you will be able to install all the required dependencies:</p>

<div class="wp_codebox"><table><tr id="p52319"><td class="code" id="p523code19"><pre class="bash" style="font-family:monospace;">pacman <span style="color: #660033;">-S</span> apache php-apache <span style="color: #c20cb9; font-weight: bold;">gcc</span> php-gd</pre></td></tr></table></div>

<p>This will download the required dependencies for Nagios, but also will have several dependencies of their own, and Arch Linux will handle all of this for you.</p>
<h3>Installing Nagios Core</h3>
<p>Nagios Core is one of the easiest configure, compile, and install application I&#8217;ve ever dealt with, so this step-by-step documentation should get you set up pretty quick.</p>
<h4>Setting Up Users/Groups</h4>
<p>Let&#8217;s add the nagio user and give it a password.</p>

<div class="wp_codebox"><table><tr id="p52320"><td class="code" id="p523code20"><pre class="bash" style="font-family:monospace;">useradd <span style="color: #660033;">-m</span> nagios
<span style="color: #c20cb9; font-weight: bold;">passwd</span> nagios
Enter new UNIX password: 
Retype new UNIX password: 
<span style="color: #c20cb9; font-weight: bold;">passwd</span>: password updated successfully</pre></td></tr></table></div>

<p>Now, we need to add the Nagios command group:</p>

<div class="wp_codebox"><table><tr id="p52321"><td class="code" id="p523code21"><pre class="bash" style="font-family:monospace;">groupadd nagcmd</pre></td></tr></table></div>

<p>Finally, we just add the <code>nagcmd</code> and <code>http</code> (Apache user) groups to the <code>nagios</code> user.</p>

<div class="wp_codebox"><table><tr id="p52322"><td class="code" id="p523code22"><pre class="bash" style="font-family:monospace;">usermod <span style="color: #660033;">-a</span> <span style="color: #660033;">-G</span> nagcmd nagios
usermod <span style="color: #660033;">-a</span> <span style="color: #660033;">-G</span> nagcmd http</pre></td></tr></table></div>

<h4>Download and Extract Nagios</h4>
<p>At the time of this writing, go <a href="http://www.nagios.org/download" title="Nagios Download Page">here</a> and download both the Nagios Core (3.3.1) and Nagios Plugins (1.4.15) compressed files.  At this time, the direct downloads are:</p>
<ul>
<li><a href="http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.3.1.tar.gz" title="Nagios Core">Nagios Core</a></li>
<li><a href="http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.15.tar.gz" title="Nagios Plugins">Nagios Plugins</a></li>
</ul>
<p>You could easily use wget to download the files, as I did.</p>

<div class="wp_codebox"><table><tr id="p52323"><td class="code" id="p523code23"><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>prdownloads.sourceforge.net<span style="color: #000000; font-weight: bold;">/</span>sourceforge<span style="color: #000000; font-weight: bold;">/</span>nagios<span style="color: #000000; font-weight: bold;">/</span>nagios-3.3.1.tar.gz
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>prdownloads.sourceforge.net<span style="color: #000000; font-weight: bold;">/</span>sourceforge<span style="color: #000000; font-weight: bold;">/</span>nagiosplug<span style="color: #000000; font-weight: bold;">/</span>nagios-plugins-1.4.15.tar.gz</pre></td></tr></table></div>

<p>Okay, we are now ready to extract both; we only need Nagios Core right now, but let&#8217;s extract both so that we don&#8217;t have to mess with doing that later.  I&#8217;ll assume that the files are in <code>/root/Downloads</code>.</p>

<div class="wp_codebox"><table><tr id="p52324"><td class="code" id="p523code24"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>Downloads
<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xzvf</span> .<span style="color: #000000; font-weight: bold;">/</span>nagios-3.3.1.tar.gz
<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xzvf</span> .<span style="color: #000000; font-weight: bold;">/</span>nagios-plugins-1.4.15.tar.gz</pre></td></tr></table></div>

<p>You should have two directories (something similar to the following): <strong><code>nagios-3.3.1</code></strong> and <strong><code>nagios-plugins-1.4.15</code></strong>.</p>
<h3>Run Nagios <code>configure</code> Script</h3>
<p>Now it&#8217;s time to get down to the actual configure/compile/install part.  Before, we can install, or even compiling Nagios, we have to run the <code>configure</code> script with some very important flags set. <em>Note: Nagios&#8217; default prefix is <code>/usr/local/nagios</code>; if this is an issue, you need to also set the prefix by <code>--prefix=/your/desired/prefix</code></em></p>

<div class="wp_codebox"><table><tr id="p52325"><td class="code" id="p523code25"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>Downloads<span style="color: #000000; font-weight: bold;">/</span>nagios-3.3.1<span style="color: #000000; font-weight: bold;">/</span>
.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--with-command-group</span>=nagcmd <span style="color: #660033;">--with-httpd-conf</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>httpd<span style="color: #000000; font-weight: bold;">/</span>conf<span style="color: #000000; font-weight: bold;">/</span>extra</pre></td></tr></table></div>

<p>Once this completes and everything looks good, go ahead and compile the source</p>

<div class="wp_codebox"><table><tr id="p52326"><td class="code" id="p523code26"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">make</span> all</pre></td></tr></table></div>

<p>The moment you&#8217;ve been waiting for, now let&#8217;s actually install Nagios.</p>

<div class="wp_codebox"><table><tr id="p52327"><td class="code" id="p523code27"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span>
<span style="color: #c20cb9; font-weight: bold;">make</span> install-init
<span style="color: #c20cb9; font-weight: bold;">make</span> install-config
<span style="color: #c20cb9; font-weight: bold;">make</span> install-commandmode
<span style="color: #c20cb9; font-weight: bold;">make</span> install-webconf</pre></td></tr></table></div>

<p>Let&#8217;s discuss what each one does:</p>
<ul>
<li><code>install</code> installs the Nagios Core base</li>
<li><code>install-init</code> installs the init script (<code>/etc/rc.d/</code>)</li>
<li><code>install-config</code> installs some sample configuration files so you can start with something</li>
<li><code>install-commandmode</code> installs/configures the correct permissions on the directory holding the external command file</li>
<li><code>install-webconf</code> installs the Apache configuration files in the directory you provided the configure script, in this case, <code>/etc/httpd/conf/extra/</code></li>
</ul>
<h3>Create <code>nagiosadmin</code> User</h3>
<p>Now we need to create a user that has permissions to manage the Nagios system.  As a whole, Nagios is open, there is no authentication in Nagios Core, so the way to &#8220;protect&#8221; Nagios, is to just set up a user/password via htaccess.  I&#8217;m using <code>nagiosadmin</code> since that&#8217;s been the adopted user for as long as I&#8217;ve used Nagios.</p>

<div class="wp_codebox"><table><tr id="p52328"><td class="code" id="p523code28"><pre class="bash" style="font-family:monospace;">htpasswd <span style="color: #660033;">-c</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>nagios<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>htpasswd.users nagiosadmin
New password: 
Re-type new password: 
Adding password <span style="color: #000000; font-weight: bold;">for</span> user nagiosadmin</pre></td></tr></table></div>

<h3>Configure Apache</h3>
<p>We have to configure Apache to use the configuration file placed in <code>/etc/httpd/conf/extras/</code>, which is how Arch Linux sets up its base <code>httpd.conf</code> file.  Towards the bottom of the <code>/etc/httpd/conf/httpd.conf</code> file, you will see a few <code>Include</code> sections.  After the last <code>Include</code> sections add the following:</p>

<div class="wp_codebox"><table><tr id="p52329"><td class="code" id="p523code29"><pre class="apache" style="font-family:monospace;"><span style="color: #adadad; font-style: italic;"># Nagios</span>
<span style="color: #00007f;">Include</span> conf/extra/nagios.conf</pre></td></tr></table></div>

<h3>Configure PHP</h3>
<p>Next we have to make a few modifications to PHP in order to get things to work, in the long run.  Based off this installation of Nagios, the Nagios web files are in <code>/usr/local/nagios/share/</code>.  The problem is, by default, PHP is configured to use the <code>open_basedir</code>, which is a security mechanism.  You can either disable it (comment it out) or you can just add <code>/usr/local/nagios/share/</code> to <code>open_basedir</code>, which is what I recommend.  Your <code>open_basedir</code> should look something similar to:</p>

<div class="wp_codebox"><table><tr id="p52330"><td class="code" id="p523code30"><pre class="bash" style="font-family:monospace;">open_basedir = <span style="color: #000000; font-weight: bold;">/</span>srv<span style="color: #000000; font-weight: bold;">/</span>http<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>nagios<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>:<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>:<span style="color: #000000; font-weight: bold;">/</span>tmp<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>share<span style="color: #000000; font-weight: bold;">/</span>pear<span style="color: #000000; font-weight: bold;">/</span></pre></td></tr></table></div>

<p>The last thing you have to do with PHP is enable the GD extension that you installed as a pre-requisite, earlier (it is more towards the bottom):</p>

<div class="wp_codebox"><table><tr id="p52331"><td class="code" id="p523code31"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">extension</span>=gd.so</pre></td></tr></table></div>

<h3>Restart Apache</h3>
<p>Easy, peasy &#8211; just restart Apache so that your Apache and PHP configuration are reflected.</p>

<div class="wp_codebox"><table><tr id="p52332"><td class="code" id="p523code32"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rc.d<span style="color: #000000; font-weight: bold;">/</span>httpd restart</pre></td></tr></table></div>

<h3>Install Nagios Plugins</h3>
<p>Now, let&#8217;s install the Nagios Plugins.  You&#8217;ll need to go into the directory you extracted, when you extracted that archive for the Nagios Plugins.  From there, you just need to run the configure script with the appropriate flags.</p>

<div class="wp_codebox"><table><tr id="p52333"><td class="code" id="p523code33"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>Downloads<span style="color: #000000; font-weight: bold;">/</span>nagios-plugins-1.4.15<span style="color: #000000; font-weight: bold;">/</span>
.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--with-nagios-user</span>=nagios <span style="color: #660033;">--with-nagios-group</span>=nagios</pre></td></tr></table></div>

<p>Next compile the source code for Nagios Plugins:</p>

<div class="wp_codebox"><table><tr id="p52334"><td class="code" id="p523code34"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">make</span></pre></td></tr></table></div>

<p>Finally, install Nagios Plugins:</p>

<div class="wp_codebox"><table><tr id="p52335"><td class="code" id="p523code35"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></td></tr></table></div>

<h3>Update <code>/etc/rc.conf</code> (bootup items)</h3>
<p>To finish up, you will need to make sure that Nagios starts up upon a reboot, so you will need to add <code>nagios</code> to the <code>DAEMONS</code> section of <code>/etc/rc/conf</code>.</p>
<h3>Start Nagios</h3>
<p>Now you can go ahead and start up Nagios.  All the configuration files are in <code>/usr/local/nagios/etc</code> and the templates and host-based configuration files are in <code>/usr/local/nagios/etc/objects/</code>.  From here you can start configuring all that.  Just remember, after you update a configuration item, you&#8217;ll need to restart Nagios.</p>

<div class="wp_codebox"><table><tr id="p52336"><td class="code" id="p523code36"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rc.d<span style="color: #000000; font-weight: bold;">/</span>nagios</pre></td></tr></table></div>

<p><a href="http://www.notesofasysadmin.com/static/2011/11/nagios_installed.png" rel="lightbox[523]" title="Nagios Installed"><img src="http://www.notesofasysadmin.com/static/2011/11/nagios_installed-300x148.png" alt="Nagios Installed" title="Nagios Installed" width="300" height="148" class="aligncenter size-medium wp-image-541" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.notesofasysadmin.com/linux/installing-nagios-core-on-arch-linux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mac: Dock Taking Up 100% CPU After 10.6.8 Update</title>
		<link>http://www.notesofasysadmin.com/mac/mac-dock-taking-up-100-cpu-after-10-6-8-update/</link>
		<comments>http://www.notesofasysadmin.com/mac/mac-dock-taking-up-100-cpu-after-10-6-8-update/#comments</comments>
		<pubDate>Tue, 19 Jul 2011 20:37:26 +0000</pubDate>
		<dc:creator>Drew</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Annoying]]></category>
		<category><![CDATA[Bug]]></category>
		<category><![CDATA[Virtualization]]></category>

		<guid isPermaLink="false">http://www.notesofasysadmin.com/?p=460</guid>
		<description><![CDATA[Are you one of the lucky ones that upgraded your OSX software from 10.6.x to 10.6.8 and noticed a decrease in battery life, only to realize that your Dock application is eating up 100% of your CPU? If you have Parallels Desktop installed, then I&#8217;ve been able to resolve the issue by researching the issue [...]]]></description>
			<content:encoded><![CDATA[<p>Are you one of the lucky ones that upgraded your OSX software from 10.6.x to 10.6.8 and noticed a decrease in battery life, only to realize that your Dock application is eating up 100% of your CPU?  If you have Parallels Desktop installed, then I&#8217;ve been able to resolve the issue by researching the issue online and process of elimination.  The issue is actually with Parallels Desktop, and the issue seems to have crept up after the 10.6.8 update from Apple.<span id="more-460"></span></p>
<h3>Reproducing The Issue</h3>
<p>To reproduce the issue, all you need to do is open <strong>Activity Monitor</strong> and make note of your Dock application.  Is it spiking around the 100% mark?  You should see something like the following:</p>
<p><a href="http://www.notesofasysadmin.com/static/2011/07/dock_running_at_100_percent_cpu.gif" rel="lightbox[460]" title="OSX Dock Running at 100% CPU"><img src="http://www.notesofasysadmin.com/static/2011/07/dock_running_at_100_percent_cpu-300x51.gif" alt="OSX Dock Running at 100% CPU" title="OSX Dock Running at 100% CPU" width="300" height="51" class="alignnone size-medium wp-image-461" /></a></p>
<h3>Steps To Resolve The Issue</h3>
<p>To resolve this issue, the following steps will have to be taken:</p>
<ul>
<li>Remove the <strong>Windows Applications</strong> folder from the Dock application</li>
<li>Kill the Dock application</li>
<li>Verify the Dock application is functioning normally</li>
</ul>
<p>Very simple set of steps that takes longer to document and explain than to actually fix!</p>
<h4>Dock: Windows Application Folder</h4>
<p><a href="http://www.notesofasysadmin.com/static/2011/07/windows_applications_menu_on_dock.gif" rel="lightbox[460]" title="Windows Applications Menu"><img src="http://www.notesofasysadmin.com/static/2011/07/windows_applications_menu_on_dock-300x224.gif" alt="Windows Applications Menu" title="Windows Applications Menu" width="300" height="224" class="alignnone size-medium wp-image-474" /></a></p>
<h4>Dock: Remove Windows Application Folder From The Dock</h4>
<p><a href="http://www.notesofasysadmin.com/static/2011/07/remove_windows_application_menu_from_dock.gif" rel="lightbox[460]" title="Remove Windows Application Menu From The Dock"><img src="http://www.notesofasysadmin.com/static/2011/07/remove_windows_application_menu_from_dock-300x139.gif" alt="Remove Windows Application Menu From The Dock" title="Remove Windows Application Menu From The Dock" width="300" height="139" class="alignnone size-medium wp-image-476" /></a></p>
<h4>Dock: Windows Application Folder Removed From The Dock</h4>
<p><a href="http://www.notesofasysadmin.com/static/2011/07/windows_applications_menu_now_removed.gif" rel="lightbox[460]" title="Windows Applications Menu Removed"><img src="http://www.notesofasysadmin.com/static/2011/07/windows_applications_menu_now_removed.gif" alt="Windows Applications Menu Removed" title="Windows Applications Menu Removed" width="156" height="187" class="alignnone size-full wp-image-477" /></a></p>
<h4>Kill The Current Dock Application</h4>
<p><a href="http://www.notesofasysadmin.com/static/2011/07/quit_process.gif" rel="lightbox[460]" title="Kill Dock Process"><img src="http://www.notesofasysadmin.com/static/2011/07/quit_process.gif" alt="Kill Dock Process" title="Kill Dock Process" width="234" height="178" class="alignnone size-full wp-image-479" /></a></p>
<h4>Confirm Quit (Kill) of Dock Application</h4>
<p><a href="http://www.notesofasysadmin.com/static/2011/07/confirm_quit.gif" rel="lightbox[460]" title="Confirm Quit (Kill) of Dock"><img src="http://www.notesofasysadmin.com/static/2011/07/confirm_quit-300x83.gif" alt="Confirm Quit (Kill) of Dock" title="Confirm Quit (Kill) of Dock" width="300" height="83" class="alignnone size-medium wp-image-480" /></a></p>
<h4>Confirm CPU Usage Has Subsided<br />
<h4>
<a href="http://www.notesofasysadmin.com/static/2011/07/dock_process_behaving_normally.gif" rel="lightbox[460]" title="Dock Process Now Behaving Normally"><img src="http://www.notesofasysadmin.com/static/2011/07/dock_process_behaving_normally-300x24.gif" alt="Dock Process Now Behaving Normally" title="Dock Process Now Behaving Normally" width="300" height="24" class="alignnone size-medium wp-image-481" /></a></p>
<h3>Proof.</h3>
<p>So, just to prove how much of an impact this was, my battery life went from about <strong>2:24</strong> battery (remaining) to <strong>8:33</strong> battery (remaining).</p>
<h4>Before</h4>
<p><a href="http://www.notesofasysadmin.com/static/2011/07/battery_status_before.gif" rel="lightbox[460]" title="Battery Status: Before"><img src="http://www.notesofasysadmin.com/static/2011/07/battery_status_before.gif" alt="Battery Status: Before" title="Battery Status: Before" width="195" height="21" class="alignnone size-full wp-image-483" /></a></p>
<h4>After</h4>
<p><a href="http://www.notesofasysadmin.com/static/2011/07/battery_status_after.gif" rel="lightbox[460]" title="Battery Status: After"><img src="http://www.notesofasysadmin.com/static/2011/07/battery_status_after.gif" alt="Battery Status: After" title="Battery Status: After" width="191" height="20" class="alignnone size-full wp-image-484" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.notesofasysadmin.com/mac/mac-dock-taking-up-100-cpu-after-10-6-8-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL: Placing the Whole MySQL System into read-only Mode</title>
		<link>http://www.notesofasysadmin.com/databases/mysql-placing-the-whole-mysql-system-into-read-only-mode/</link>
		<comments>http://www.notesofasysadmin.com/databases/mysql-placing-the-whole-mysql-system-into-read-only-mode/#comments</comments>
		<pubDate>Tue, 21 Jun 2011 23:52:44 +0000</pubDate>
		<dc:creator>Drew</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Configuration]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.notesofasysadmin.com/?p=450</guid>
		<description><![CDATA[The other day I had to push some updates to a production instance from our staging instance, but this was during the busy time of the day. This change was critical, as it was resolving an issue that was needing to be resolved as soon as possible, so doing it during the middle of the [...]]]></description>
			<content:encoded><![CDATA[<p>The other day I had to push some updates to a production instance from our staging instance, but this was during the busy time of the day.  This change was critical, as it was resolving an issue that was needing to be resolved as soon as possible, so doing it during the middle of the day was a must.  I knew people were using the system, so I needed to make sure nothing was going to be writing to the database while I pushed the update, so I had to place the MySQL system into a read-only state.</p>
<p>Placing the MySQL system into read-only mode is very quick and easy:</p>
<h3>Login:</h3>

<div class="wp_codebox"><table><tr id="p45040"><td class="code" id="p450code40"><pre class="mysql" style="font-family:monospace;">mysql <span style="color: #CC0099;">-</span>u root <span style="color: #CC0099;">-</span>p</pre></td></tr></table></div>

<p><em>Note: This requires the <strong><a href="http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#sysvar_read_only">SUPER</a></strong> MySQL privilege.</em></p>
<h3>Enable Read-Only Mode:</h3>

<div class="wp_codebox"><table><tr id="p45041"><td class="code" id="p450code41"><pre class="mysql" style="font-family:monospace;">mysql<span style="color: #CC0099;">&gt;</span> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=SET"><span style="color: #990099; font-weight: bold;">set</span></a> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=GLOBAL"><span style="color: #990099; font-weight: bold;">GLOBAL</span></a> read_only <span style="color: #CC0099;">=</span> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=TRUE"><span style="color: #9900FF; font-weight: bold;">true</span></a><span style="color: #000033;">;</span></pre></td></tr></table></div>

<p>That&#8217;s it!  I&#8217;m sure you&#8217;ll need to know how to disable read-only mode and let users write back to the database, so in order to do that, do the following:</p>
<h3>Re-enable Read/Write Mode:</h3>

<div class="wp_codebox"><table><tr id="p45042"><td class="code" id="p450code42"><pre class="mysql" style="font-family:monospace;">mysql<span style="color: #CC0099;">&gt;</span> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=SET"><span style="color: #990099; font-weight: bold;">set</span></a> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=GLOBAL"><span style="color: #990099; font-weight: bold;">GLOBAL</span></a> read_only <span style="color: #CC0099;">=</span> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=FALSE"><span style="color: #9900FF; font-weight: bold;">false</span></a><span style="color: #000033;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.notesofasysadmin.com/databases/mysql-placing-the-whole-mysql-system-into-read-only-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu: PHP Not Rendering When Using user_dir (public_html)</title>
		<link>http://www.notesofasysadmin.com/linux/ubuntu-php-not-rendering-when-using-user_dir-public_html/</link>
		<comments>http://www.notesofasysadmin.com/linux/ubuntu-php-not-rendering-when-using-user_dir-public_html/#comments</comments>
		<pubDate>Tue, 21 Jun 2011 23:35:54 +0000</pubDate>
		<dc:creator>Drew</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Configuration]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.notesofasysadmin.com/?p=440</guid>
		<description><![CDATA[The other day I wanted to set up my Ubuntu Desktop to use the mod_userdir module so that I (and other users) could use our home directories as a personal development system for testing code, etc. This way, no one had to deal with permissions or transferring files to and from the default, DirectoryRoot. This [...]]]></description>
			<content:encoded><![CDATA[<p>The other day I wanted to set up my Ubuntu Desktop to use the <code>mod_userdir</code> module so that I (and other users) could use our home directories as a personal development system for testing code, etc.  This way, no one had to deal with permissions or transferring files to and from the default, <code>DirectoryRoot</code>.  This allows me to be able to clone my git repository, make changes, and commit/push changes to the repository with ease.</p>
<p>I ran into an Ubuntu-specific issue where the configuration default was set to not run the PHP engine for the user directories (<code>/home/*/public_html</code>).  When I say <strong>Ubuntu-specific</strong>, that doesn&#8217;t mean that this only happens with Ubuntu, however, Ubuntu tends to add defaults into the system when packages are installed so that the end-user just has to <strong>enable</strong> these modules.  The setting in general was the <code>php_admin_value engine</code> option. This was, by default, set to <strong>Off</strong>.  All I did to fix this was remove it entirely from the configuration file. </p>
<h3>Before:</h3>

<div class="wp_codebox"><table><tr id="p44046"><td class="code" id="p440code46"><pre class="apache" style="font-family:monospace;">&lt;<span style="color: #000000; font-weight:bold;">IfModule</span> mod_userdir.c&gt;
    &lt;<span style="color: #000000; font-weight:bold;">Directory</span> /home/*/public_html&gt;
        <span style="color: #00007f;">php_admin_value</span> engine <span style="color: #0000ff;">Off</span>
    &lt;/<span style="color: #000000; font-weight:bold;">Directory</span>&gt;
&lt;/<span style="color: #000000; font-weight:bold;">IfModule</span>&gt;</pre></td></tr></table></div>

<h3>After:</h3>

<div class="wp_codebox"><table><tr id="p44047"><td class="code" id="p440code47"><pre class="apache" style="font-family:monospace;">&lt;<span style="color: #000000; font-weight:bold;">IfModule</span> mod_userdir.c&gt;
    &lt;<span style="color: #000000; font-weight:bold;">Directory</span> /home/*/public_html&gt;
&nbsp;
    &lt;/<span style="color: #000000; font-weight:bold;">Directory</span>&gt;
&lt;/<span style="color: #000000; font-weight:bold;">IfModule</span>&gt;</pre></td></tr></table></div>

<p>You will need to restart Apache in order for these changes to take effect:</p>

<div class="wp_codebox"><table><tr id="p44048"><td class="code" id="p440code48"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>apache2 restart</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.notesofasysadmin.com/linux/ubuntu-php-not-rendering-when-using-user_dir-public_html/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Compression: Using the zip Command in Linux</title>
		<link>http://www.notesofasysadmin.com/linux/compression-using-the-zip-command-in-linux/</link>
		<comments>http://www.notesofasysadmin.com/linux/compression-using-the-zip-command-in-linux/#comments</comments>
		<pubDate>Thu, 19 May 2011 23:27:27 +0000</pubDate>
		<dc:creator>Drew</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[.zip]]></category>
		<category><![CDATA[command-line]]></category>
		<category><![CDATA[Compression]]></category>

		<guid isPermaLink="false">http://www.notesofasysadmin.com/?p=426</guid>
		<description><![CDATA[So, the other day I needed to compress some files on a Linux system to make available to a customer. Most end users don&#8217;t know how to uncompress .tar, .gz, .bz2, etc formats on a Windows system. Even more so, Windows systems, since Windows XP has had the built in utility to uncompress .zip files, [...]]]></description>
			<content:encoded><![CDATA[<p>So, the other day I needed to compress some files on a Linux system to make available to a customer.  Most end users don&#8217;t know how to uncompress .tar, .gz, .bz2, etc formats on a Windows system.  Even more so, Windows systems, since Windows XP has had the built in utility to uncompress .zip files, so sometimes you&#8217;ll need to know the simple, sometimes useful, <code>zip</code> command in Linux.<span id="more-426"></span></p>
<p>The syntax of the command goes <code>zip [switches] zipped-up-filename.zip [files or directory]</code>.  The command is very simple, although, it took me a second to figure out to correct syntax to getting the command to zip up a folder recursively.</p>
<h3>Zipping Up a File</h3>

<div class="wp_codebox"><table><tr id="p42653"><td class="code" id="p426code53"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>server<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># zip zipped-up-filename.zip file1.txt</span></pre></td></tr></table></div>

<h3>Zipping Up More Than One File</h3>

<div class="wp_codebox"><table><tr id="p42654"><td class="code" id="p426code54"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>server<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># zip zipped-up-filename.zip file1.txt file2.txt file3.log file4.inc</span></pre></td></tr></table></div>

<h3>Zipping Up A Subdirectory (and its subdirectories)</h3>

<div class="wp_codebox"><table><tr id="p42655"><td class="code" id="p426code55"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>server<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># zip -r zipped-up-filename.zip folder-to-be-zipped/</span></pre></td></tr></table></div>

<h3>Zipping Up the Current Directory (and its subdirectories)</h3>
<p>This one&#8217;s similar, but a bit different, from the previous command:</p>

<div class="wp_codebox"><table><tr id="p42656"><td class="code" id="p426code56"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>server<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># zip -r zipped-up-filename.zip .</span></pre></td></tr></table></div>

<p>Hope this helps with getting used to (hopefully you don&#8217;t get used to this command to much) the <code>zip</code> command; comes in very useful when you least expect it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.notesofasysadmin.com/linux/compression-using-the-zip-command-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Terminal Entry Overlapping Resolved</title>
		<link>http://www.notesofasysadmin.com/unixlinux/terminal-entry-overlapping-resolved/</link>
		<comments>http://www.notesofasysadmin.com/unixlinux/terminal-entry-overlapping-resolved/#comments</comments>
		<pubDate>Fri, 11 Mar 2011 00:33:58 +0000</pubDate>
		<dc:creator>Drew</dc:creator>
				<category><![CDATA[Unix/Linux]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://www.notesofasysadmin.com/?p=120</guid>
		<description><![CDATA[Have you ever typed into the terminal, through an SSH session and the text overlaps the same line and causes you to lose track of what you were typing? This is so frustrating and has everything to do with how the terminal is interpreting the number of columns the kernel states that you have. The [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever typed into the terminal, through an SSH session and the text overlaps the same line and causes you to lose track of what you were typing?  This is so frustrating and has everything to do with how the terminal is interpreting the number of columns the kernel states that you have.  The fix is pretty simple; all you have to do is resize your terminal using <code>stty</code>.</p>
<p>First, let&#8217;s see if the terminal can fix itself.  Check to see how many columns your terminal is set to:</p>

<div class="wp_codebox"><table><tr id="p12060"><td class="code" id="p120code60"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>server:~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># stty -a |  awk '/columns/ { print $6 }' </span>
<span style="color: #000000;">127</span></pre></td></tr></table></div>

<p>Now, resize your window on your SSH session.  Then re-run the command:</p>

<div class="wp_codebox"><table><tr id="p12061"><td class="code" id="p120code61"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>server:~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># stty -a |  awk '/columns/ { print $6 }'</span>
<span style="color: #000000;">207</span></pre></td></tr></table></div>

<p>If the value changed, you should be good, however, if it did not change you will have to manually change it to something bigger.  This value is up to you.  To change the value, issue the following command:</p>

<div class="wp_codebox"><table><tr id="p12062"><td class="code" id="p120code62"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>server:~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># stty cols 207     # Where 207 is the number of columns set</span>
<span style="color: #666666; font-style: italic;"># nothing should be returned</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Now verify the setting took affect</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>server:~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># stty -a |  awk '/columns/ { print $6 }'</span>
<span style="color: #000000;">207</span>    <span style="color: #666666; font-style: italic;"># Sample output</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.notesofasysadmin.com/unixlinux/terminal-entry-overlapping-resolved/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Forcing PHP to Display Errors for Debugging</title>
		<link>http://www.notesofasysadmin.com/web-development/forcing-php-to-display-errors-for-debugging/</link>
		<comments>http://www.notesofasysadmin.com/web-development/forcing-php-to-display-errors-for-debugging/#comments</comments>
		<pubDate>Thu, 10 Mar 2011 23:49:18 +0000</pubDate>
		<dc:creator>Drew</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Degugging]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.notesofasysadmin.com/?p=113</guid>
		<description><![CDATA[Sometimes when doing some development from a subdirectory of a domain (that does not affect the main application), it would be useful to have errors displayed to the screen, but not enabling on a global-wide basis. There&#8217;s a way to do this within your application by just added a bit of configuration information at the [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes when doing some development from a subdirectory of a domain (that does not affect the main application), it would be useful to have errors displayed to the screen, but not enabling on a global-wide basis.  There&#8217;s a way to do this within your application by just added a bit of configuration information at the top of your PHP file.  Normally, you will want to include it in a file that is included on every page, dynamically, so that you don&#8217;t have to include this configuration information on multiple files.  Just place the following PHP code at the top of your file (such as the <code>functions.php</code> file):</p>

<div class="wp_codebox"><table><tr id="p11364"><td class="code" id="p113code64"><pre class="php" style="font-family:monospace;"><a href="http://www.php.net/error_reporting"><span style="color: #990000;">error_reporting</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">E_ALL</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<a href="http://www.php.net/ini_set"><span style="color: #990000;">ini_set</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;display_errors&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Easy as that, and now you have PHP errors now displaying for this application, but nothing else (such as production code) will display errors.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.notesofasysadmin.com/web-development/forcing-php-to-display-errors-for-debugging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generating Checksums on Solaris 9/10</title>
		<link>http://www.notesofasysadmin.com/unix/generating-checksums-on-solaris-910/</link>
		<comments>http://www.notesofasysadmin.com/unix/generating-checksums-on-solaris-910/#comments</comments>
		<pubDate>Wed, 26 Jan 2011 18:51:39 +0000</pubDate>
		<dc:creator>Drew</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[Checksum]]></category>
		<category><![CDATA[File Comparison]]></category>
		<category><![CDATA[MD5]]></category>
		<category><![CDATA[SHA]]></category>
		<category><![CDATA[Solaris 10]]></category>
		<category><![CDATA[Solaris 9]]></category>

		<guid isPermaLink="false">http://www.notesofasysadmin.com/?p=96</guid>
		<description><![CDATA[Just the other day, I was needing to generate checksums of files and compare them through a shell script; useful when you want to know when a file has been changed without comparing what has been changed. On Linux, it&#8217;s pretty simple (md5sum), however, on Solaris, it&#8217;s a totally different set of commands &#8211; and [...]]]></description>
			<content:encoded><![CDATA[<p>Just the other day, I was needing to generate checksums of files and compare them through a shell script; useful when you want to know when a file has been changed without comparing what has been changed.</p>
<p>On Linux, it&#8217;s pretty simple (md5sum), however, on Solaris, it&#8217;s a totally different set of commands &#8211; and on top of that &#8211; Solaris 9 and 10 are totally different.  First thing though, my disclaimer is, I&#8217;m using stock Solaris 9 and 10 machines and I am well aware that I could install <code>md5sum</code> and/or the Solaris 10 equivalent onto the Solaris 9 machine, however I assume that you cannot just install software without proper change management schedules.</p>
<h4>Solaris 9</h4>

<div class="wp_codebox"><table><tr id="p9668"><td class="code" id="p96code68"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">## Full Format</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>server:~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># cksum /dev/null</span>
<span style="color: #000000;">4294967295</span>      <span style="color: #000000;">0</span>       <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null
&nbsp;
<span style="color: #666666; font-style: italic;">## Only display the checksum</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>server:~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># cksum /dev/null | cut -f1</span>
<span style="color: #000000;">4294967295</span></pre></td></tr></table></div>

<h4>Solaris 10</h4>
<p><strong><code>cksum</code></strong></p>

<div class="wp_codebox"><table><tr id="p9669"><td class="code" id="p96code69"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">## Full Format</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>server:~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># cksum /dev/null</span>
<span style="color: #000000;">4294967295</span>      <span style="color: #000000;">0</span>       <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null
&nbsp;
<span style="color: #666666; font-style: italic;">## Only display the checksum</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>server:~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># cksum /dev/null | cut -f1</span>
<span style="color: #000000;">4294967295</span></pre></td></tr></table></div>

<p><strong><code>digest</code></strong></p>

<div class="wp_codebox"><table><tr id="p9670"><td class="code" id="p96code70"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">## Full Format - MD5</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>server:~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># digest -v -a md5 /dev/null </span>
md5 <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null<span style="color: #7a0874; font-weight: bold;">&#41;</span> = d41d8cd98f00b204e9800998ecf8427e
&nbsp;
<span style="color: #666666; font-style: italic;">## Full Format - SHA1</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>server:~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># digest -v -a sha1 /dev/null     </span>
sha1 <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null<span style="color: #7a0874; font-weight: bold;">&#41;</span> = da39a3ee5e6b4b0d3255bfef95601890afd80709
&nbsp;
<span style="color: #666666; font-style: italic;">## Full Format - SHA256</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>server:~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># digest -v -a sha256 /dev/null   </span>
sha256 <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null<span style="color: #7a0874; font-weight: bold;">&#41;</span> = e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
&nbsp;
<span style="color: #666666; font-style: italic;">## Full Format - SHA512</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>server:~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># digest -v -a sha512 /dev/null </span>
sha512 <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null<span style="color: #7a0874; font-weight: bold;">&#41;</span> = cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e
&nbsp;
<span style="color: #666666; font-style: italic;">## Only display the checksum - MD5</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>server:~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># digest -a md5 /dev/null          </span>
d41d8cd98f00b204e9800998ecf8427e
&nbsp;
<span style="color: #666666; font-style: italic;">## Only display the checksum - SHA1</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>server:~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># digest -a sha1 /dev/null    </span>
da39a3ee5e6b4b0d3255bfef95601890afd80709
&nbsp;
<span style="color: #666666; font-style: italic;">## Only display the checksum - SHA256</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>server:~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># digest -a sha256 /dev/null  </span>
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
&nbsp;
<span style="color: #666666; font-style: italic;">## Only display the checksum - SHA512</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>server:~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># digest -a sha512 /dev/null    </span>
cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e</pre></td></tr></table></div>

<p>For comparing files, I usually just use mksum or MD5 algorithm.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.notesofasysadmin.com/unix/generating-checksums-on-solaris-910/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to install a local gem (Ruby) on Linux</title>
		<link>http://www.notesofasysadmin.com/linux/how-to-install-a-local-gem-ruby-on-linux/</link>
		<comments>http://www.notesofasysadmin.com/linux/how-to-install-a-local-gem-ruby-on-linux/#comments</comments>
		<pubDate>Mon, 24 Jan 2011 21:15:10 +0000</pubDate>
		<dc:creator>Drew</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Gem]]></category>
		<category><![CDATA[Installation]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.notesofasysadmin.com/?p=88</guid>
		<description><![CDATA[Installing a gem in Linux is pretty easy. All you have to do is issue the following: gem install localgem.gem It&#8217;s as easy as that. I needed to install a gem locally due to a bug causing my remote gem install to fail.]]></description>
			<content:encoded><![CDATA[<p>Installing a gem in Linux is pretty easy.  All you have to do is issue the following:</p>

<div class="wp_codebox"><table><tr id="p8872"><td class="code" id="p88code72"><pre class="bash" style="font-family:monospace;">gem <span style="color: #c20cb9; font-weight: bold;">install</span> localgem.gem</pre></td></tr></table></div>

<p>It&#8217;s as easy as that.  I needed to install a gem locally due to a bug causing my remote gem install to fail.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.notesofasysadmin.com/linux/how-to-install-a-local-gem-ruby-on-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reverse DNS Lookup from Remote netstat Connections</title>
		<link>http://www.notesofasysadmin.com/linux/reverse-dns-lookup-from-remote-netstat-connections/</link>
		<comments>http://www.notesofasysadmin.com/linux/reverse-dns-lookup-from-remote-netstat-connections/#comments</comments>
		<pubDate>Fri, 26 Nov 2010 23:59:26 +0000</pubDate>
		<dc:creator>Drew</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[One-Liners]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Shell Scripts]]></category>

		<guid isPermaLink="false">http://www.notesofasysadmin.com/?p=76</guid>
		<description><![CDATA[The other day, I needed to find out what connection were connecting to one of my Linux boxes. I&#8217;ve written a shell script one-liner that will pull all the uniq IP addresses, perform a reverse lookup, and return the results by way of IP ADDRESS ---> REVERSE LOOKUP. Later, I plan on adding to this [...]]]></description>
			<content:encoded><![CDATA[<p>The other day, I needed to find out what connection were connecting to one of my Linux boxes.  I&#8217;ve written a shell script one-liner that will pull all the uniq IP addresses, perform a reverse lookup, and return the results by way of <code>IP ADDRESS ---> REVERSE LOOKUP</code>.  Later, I plan on adding to this will the amount of connections per IP, but for now, it just grabs the reverse address and displays it will the originating IP address.</p>

<div class="wp_codebox"><table><tr id="p7674"><td class="code" id="p76code74"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">netstat</span> <span style="color: #660033;">-napl</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ print $5 }'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-vP</span> <span style="color: #ff0000;">'(STREAM|DGRAM|]|State|and|Address|\(servers)|0.0.0.0'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/^[ \t]*//;s/[ \t]*$//'</span>  <span style="color: #000000; font-weight: bold;">|</span>  <span style="color: #c20cb9; font-weight: bold;">sort</span> <span style="color: #660033;">-rn</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-d</span><span style="color: #ff0000;">&quot;:&quot;</span> <span style="color: #660033;">-f1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">uniq</span><span style="color: #000000; font-weight: bold;">`</span>; <span style="color: #000000; font-weight: bold;">do</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-en</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$i</span> --&gt; &quot;</span><span style="color: #000000; font-weight: bold;">`</span>dig <span style="color: #660033;">-x</span> <span style="color: #007800;">$i</span> +short<span style="color: #000000; font-weight: bold;">`</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>; <span style="color: #000000; font-weight: bold;">done</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.notesofasysadmin.com/linux/reverse-dns-lookup-from-remote-netstat-connections/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

