<?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>id26.com</title>
	<atom:link href="http://www.id26.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.id26.com</link>
	<description>Personal experience with technology</description>
	<lastBuildDate>Wed, 21 Apr 2010 19:25:08 +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>Epson 4800 Maintenance Required 0002 Error Code &#8211; Reset Key Sequence</title>
		<link>http://www.id26.com/2010/04/21/epson-4800-maintenance-required-0002-error-code-reset-key-sequence/</link>
		<comments>http://www.id26.com/2010/04/21/epson-4800-maintenance-required-0002-error-code-reset-key-sequence/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 19:25:08 +0000</pubDate>
		<dc:creator>dmccoy</dc:creator>
				<category><![CDATA[Epson]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Printer]]></category>
		<category><![CDATA[Stylus Pro 4800]]></category>

		<guid isPermaLink="false">http://www.id26.com/?p=178</guid>
		<description><![CDATA[This afternoon, one of our Epson Stylus Pro 4800 printers developed a maintenance required 0002 error code. The code refers that the Carriage Return Motor or CR Motor has reached the end of its life and should be replaced. At the time this Epson 4800 had printed 16,195 prints and had transferred the print head [...]]]></description>
			<content:encoded><![CDATA[<p>This afternoon, one of our Epson Stylus Pro 4800 printers developed a maintenance required 0002 error code. The code refers that the Carriage Return Motor or CR Motor has reached the end of its life and should be replaced. At the time this Epson 4800 had printed 16,195 prints and had transferred the print head (carriage) back and forth 4,995,102 times.</p>
<p>To reset the CR Motor count, you have to enter &#8220;Service Mode 2&#8243;. To do this, follow the following steps.</p>
<p>1. Turn off your Epson 4800.<br />
2. Hold down the Pause, down and menu buttons.<br />
3. Restart the Epson 4800 while holding down the buttons mentioned above.<br />
4. Continue to hold the buttons down until you see &#8220;Service Mode 2&#8243;.<br />
5. Use the up and down arrows to navigate to clean counts.<br />
6. Locate the CR Motor count.<br />
7. You should see an &#8220;Exec&#8221; on the screen.<br />
8. Use the right arrow to select &#8220;Exec&#8221;.<br />
9. Press the menu right arrow one more time to execute the clear command.<br />
10. power off and then power back on your printers. The error should be cleared.</p>
<p>Note: Your print quality may degrade with time. Epson recommends that you replace the CR motor when this error appears.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.id26.com/2010/04/21/epson-4800-maintenance-required-0002-error-code-reset-key-sequence/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Forbidden Error with .htaccess files in Wordpress</title>
		<link>http://www.id26.com/2010/03/24/forbidden-error-with-htacess-files-in-wordpress/</link>
		<comments>http://www.id26.com/2010/03/24/forbidden-error-with-htacess-files-in-wordpress/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 01:46:03 +0000</pubDate>
		<dc:creator>dmccoy</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[FollowSymlinks]]></category>
		<category><![CDATA[Httpd]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[RewriteBase]]></category>
		<category><![CDATA[RewriteCond]]></category>
		<category><![CDATA[RewriteEngine]]></category>
		<category><![CDATA[RewriteRule]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.id26.com/?p=171</guid>
		<description><![CDATA[I&#8217;ve been using Wordpress for a number of years and decided to switch my permalink structure. It originally was set to the default setting of ?p=100. I wanted to increase my SEO so I changed it to the current format Year / Month / Day / Post-Name. When I switch over, wordpress automatically created a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using <a href="http://www.wordpress.org">Wordpress</a> for a number of years and decided to switch my permalink structure. It originally was set to the default setting of ?p=100. I wanted to increase my <a href="http://en.wikipedia.org/wiki/Search_engine_optimization">SEO</a> so I changed it to the current format Year / Month / Day / Post-Name. When I switch over, wordpress automatically created a <a href="http://httpd.apache.org/docs/2.0/howto/htaccess.html">.htaccess</a> file in my webroot folder and locked me out of my website with a Forbidden Error.</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">Forbidden
&nbsp;
You don't have permission to access / on this server.</pre></div></div>

<p>The .htaccess file that was created looked like this.</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">&lt; IfModule mod_rewrite.c &gt;
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
&lt; / IfModule &gt;</pre></div></div>

<p>After chatting with my web administrator, we came to the conclusion that <a href="http://httpd.apache.org/docs/2.0/mod/core.html">FollowSymlinks</a> in <a href="http://httpd.apache.org/">Apache</a> was off be default. I needed to manually turn it on. The new .htaccess file looks like this.</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">&lt; IfModule mod_rewrite.c &gt;
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
&lt; / IfModule &gt;</pre></div></div>

<p>Additional Links:</p>
<p><a href="http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html">Apache RewriteEngine</a><br />
<a href="http://codex.wordpress.org/Using_Permalinks">Wordpress Codex for Permalinks</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.id26.com/2010/03/24/forbidden-error-with-htacess-files-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Randomly Choose A Buddies&#8217; Status Message As Your Own &#8211; OS X &#8211; Applescript</title>
		<link>http://www.id26.com/2009/11/10/randomly-choose-a-buddies-status-message-as-your-own-os-x-applescript/</link>
		<comments>http://www.id26.com/2009/11/10/randomly-choose-a-buddies-status-message-as-your-own-os-x-applescript/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 01:59:42 +0000</pubDate>
		<dc:creator>dmccoy</dc:creator>
				<category><![CDATA[Applescript]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://www.id26.com/?p=167</guid>
		<description><![CDATA[
tell application "iChat"
    tell application "iChat" to set messagelist to get status message of every buddy
      where status is not offline
    set msglistcount to count messagelist
    set theMessageList to {}
    repeat with x from 1 to msglistcount
  [...]]]></description>
			<content:encoded><![CDATA[<pre lang="sh">
<p>tell application "iChat"<br />
    tell application "iChat" to set messagelist to get status message of every buddy<br />
      where status is not offline<br />
    set msglistcount to count messagelist<br />
    set theMessageList to {}<br />
    repeat with x from 1 to msglistcount<br />
        if item x of messagelist is not "" then<br />
            copy item x of messagelist to end of theMessageList<br />
        end if<br />
        msglistcount = msglistcount - 1<br />
    end repeat<br />
    set newStatus to some item of theMessageList<br />
    set status message to "i'm in your internets stealing your status messages : " &#038; newStatus<br />
end tell
</pre lang="sh">
]]></content:encoded>
			<wfw:commentRss>http://www.id26.com/2009/11/10/randomly-choose-a-buddies-status-message-as-your-own-os-x-applescript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Syncing Date and Time with a NTP Server &#8211; Ubuntu</title>
		<link>http://www.id26.com/2009/09/23/syncing-date-and-time-with-a-ntp-server-ubuntu/</link>
		<comments>http://www.id26.com/2009/09/23/syncing-date-and-time-with-a-ntp-server-ubuntu/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 16:14:43 +0000</pubDate>
		<dc:creator>dmccoy</dc:creator>
				<category><![CDATA[Command-Line]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.id26.com/?p=163</guid>
		<description><![CDATA[If you have several servers to manage, having them set with the same date and time is very important.
NTP stands for Network Time Protocol.
ntpdate &#8211; set the date and time via NTP

sudo ntpdate NTPServerAddress

or if you want to use ubuntu&#8217;s time server.

sudo ntpdate ntp.ubuntu.com

If you want to use multiple time servers, you can use a [...]]]></description>
			<content:encoded><![CDATA[<p>If you have several servers to manage, having them set with the same date and time is very important.</p>
<p>NTP stands for Network Time Protocol.</p>
<p>ntpdate &#8211; set the date and time via NTP</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">sudo ntpdate NTPServerAddress</pre></div></div>

<p>or if you want to use ubuntu&#8217;s time server.</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">sudo ntpdate ntp.ubuntu.com</pre></div></div>

<p>If you want to use multiple time servers, you can use a command like this. Where the new time server follows the address of your current server.</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">sudo ntpdate ntp.ubuntu.com time.apple.com</pre></div></div>

<p>Links:<br />
 <a href="http://www.pool.ntp.org/">NTP Pool Project</a><br />
<a href="https://help.ubuntu.com/7.04/server/C/NTP.html">Ubuntu Time Synchronization with NTP </a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.id26.com/2009/09/23/syncing-date-and-time-with-a-ntp-server-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Activating Mod_Userdir.c in Apache2 &#8211; Ubuntu</title>
		<link>http://www.id26.com/2009/09/16/activating-mod_userdir-c-in-apache2-ubuntu/</link>
		<comments>http://www.id26.com/2009/09/16/activating-mod_userdir-c-in-apache2-ubuntu/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 16:23:08 +0000</pubDate>
		<dc:creator>dmccoy</dc:creator>
				<category><![CDATA[Command-Line]]></category>
		<category><![CDATA[Guides]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.id26.com/?p=156</guid>
		<description><![CDATA[This morning, I was working on allowing users of my web server to create web pages with in their home directory. Normally this is indicated by a URL of http://server.com/~useraccount and is activated by default. But during the Apache install process the module for modifying the user directory wasn&#8217;t activated.
List of things you&#8217;ll need to [...]]]></description>
			<content:encoded><![CDATA[<p>This morning, I was working on allowing users of my web server to create web pages with in their home directory. Normally this is indicated by a URL of http://server.com/~useraccount and is activated by default. But during the Apache install process the module for modifying the user directory wasn&#8217;t activated.</p>
<p>List of things you&#8217;ll need to do.</p>
<p>1) Add the module to your virtual host.<br />
2) Enable the module in apache2<br />
3) Restart apache2<br />
4) Create a web directory folder in your home folder<br />
5) make sure your permissions are correct</p>
<p>Step 1, adding the module to your virtual host.</p>
<p>Normally in Ubuntu, your enabled virtual hosts (or virtual hosts that are current running) are located in /etc/apache2/sites-enabled/your_domain_naming_scheme. For this example, I&#8217;ll always name my virtual hosts after their qualified domain name (qdn).</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">sudo nano /etc/apache2/sites-enabled/server.com</pre></div></div>

<p>With in your < virtualhost > < / virtualhost > tags, you need to add and If Module statement. An If Module states, that if the module exists in the apache lib directory, to go ahead and load it into ram. The common use of the UserDir statement is command and then directory. So in this case <strong>UserDir public_html</strong>. public_html is the directory that will need to be created in each user&#8217;s home directory in order for apache to map the URL to file systems correctly. In this case the URL of http://server.com/~dmccoy will be mapped to the file directory path of /home/dmccoy/public_html/.</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">        &lt; IfModule mod_userdir.c &gt;
                UserDir html
        &lt; /IfModule &gt;</pre></div></div>

<p>a complete virtual host might look something like this.</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">NameVirtualHost *:80
&lt; VirtualHost server.com:80 &gt;
        ServerAdmin dmccoy@server.com
&nbsp;
        DocumentRoot /var/www/server.com
        ServerName server.com
        ServerAlias server
&nbsp;
        &lt; Directory /&gt;
                Options FollowSymLinks
                AllowOverride None
        &lt; /Directory&gt;
        &lt; Directory /var/www/server.com/ &gt;
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
                # This directive allows us to have apache2's default start page
               # in /apache2-default/, but still have / go to the right place
              #RedirectMatch ^/$ /apache2-default/
        &lt; /Directory &gt;
&nbsp;
        &lt; IfModule mod_userdir.c &gt;
                UserDir html
        &lt; /IfModule &gt;
&nbsp;
        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        &lt; Directory &quot;/usr/lib/cgi-bin&quot; &gt;
                AllowOverride None
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        &lt; /Directory &gt;
&nbsp;
        ErrorLog /var/log/apache2/server.com-error.log
# Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn
&nbsp;
        CustomLog /var/log/apache2/server.com-access.log combined
        ServerSignature On
&nbsp;
   Alias /doc/ &quot;/usr/share/doc/&quot;
    &lt; Directory &quot;/usr/share/doc/&quot; &gt;
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    &lt; /Directory &gt;
&lt; /VirtualHost &gt;</pre></div></div>

<p>Step 2, Once you&#8217;ve told the virtual host to load the UserDir module, you&#8217;ll need to make sure it is enabled in apache2. You can find this out by looking in the /etc/apache2/mods-enabled/ directory.</p>
<p>Both of these files will need to be in the mods-enabled directory.</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">userdir.conf
userdir.load</pre></div></div>

<p>If they are not, make sure they are in the mods-available directory located at /etc/apache2/mods-available/. If they are in the mods-available directory, all you need to do is symbolically link them into the mods-enabled directory.</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">sudo ln -s /etc/apache2/mods-available/userdir.conf /etc/apache2/mods-enabled/userdir.conf
sudo ln -s /etc/apache2/mods-available/userdir.load /etc/apache2/mods-enabled/userdir.load</pre></div></div>

<p>Step 3, You&#8217;ll need to restart apache2 in order to activate the userdir module.</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">sudo /etc/init.d/apache2 restart</pre></div></div>

<p>Step 4, Now that the userdir module is active you can now add the &#8220;public_html&#8221; directory to any user that wants a website.</p>
<p>Normal command line steps might look something like this.</p>
<p>For yourself</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">&nbsp;
cd ~
mkdir public_html
echo &quot;test&quot; &gt; public_html/index.html</pre></div></div>

<p>Or for another account</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">&nbsp;
sudo mkdir /home/USER/public_html
sudo echo &quot;test&quot; &gt; home/USER/public_html/index.html</pre></div></div>

<p>Step 5, You should now be able to type in your browser http://server.com/~dmccoy and see &#8220;test&#8221; if you get a Forbidden error, you&#8217;ll need to change the permissions on your home directory folder and your public_html folder.</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">&nbsp;
chmod 701 /home/dmccoy
chmod 705 /home/dmccoy/public_html</pre></div></div>

<p>Repeat steps 4 and 5 for every account that would like web access.</p>
<p><a href="http://httpd.apache.org/docs/2.0/mod/mod_userdir.html">Apache 2 Module mod_userdir</a><br />
<a href="http://httpd.apache.org/docs/1.3/mod/mod_userdir.html">Apache 1.3 Module mod_userdir</a><br />
<a href="http://httpd.apache.org/docs/2.2/howto/public_html.html">Per-user web directories</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.id26.com/2009/09/16/activating-mod_userdir-c-in-apache2-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reset root password in Ubuntu (or Debian)</title>
		<link>http://www.id26.com/2009/07/28/boot-into-single-user-mode-in-ubuntu-or-debian/</link>
		<comments>http://www.id26.com/2009/07/28/boot-into-single-user-mode-in-ubuntu-or-debian/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 17:06:11 +0000</pubDate>
		<dc:creator>jwinters</dc:creator>
				<category><![CDATA[Command-Line]]></category>
		<category><![CDATA[Guides]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.id26.com/?p=141</guid>
		<description><![CDATA[When you lose/misplace/forget your root password on a RedHat-based linux distro, resetting the root password isn&#8217;t too difficult. I&#8217;ve added those instructions at the bottom in case you are interested.
In Debian distros (which includes Ubuntu) you are required to have the root password in order to change the root password (even when you boot into [...]]]></description>
			<content:encoded><![CDATA[<p>When you lose/misplace/forget your root password on a RedHat-based linux distro, resetting the root password isn&#8217;t too difficult. I&#8217;ve added those instructions at the bottom in case you are interested.</p>
<p>In Debian distros (which includes Ubuntu) you are required to have the root password in order to change the root password (even when you boot into single user mode, as you would with Redhat versions). While this adds a level of security, it also adds a level of annoyance when you have lost your password and are in a pinch.</p>
<p>Not to worry though, there is a way around (albeit, not as easy).</p>
<p>The first steps are the same for either Redhat distros or Ubuntu. Reboot the server, and get into the boot menu by pressing ESC to enter the menu:</p>
<p><img src="http://www.id26.com/wp-content/uploads/2009/07/BootOptions.png" alt="ESC to enter the menu" title="ESC to enter the menu" width="690" height="250" class="aligncenter size-full wp-image-142" /></p>
<p>Next you&#8217;ll need to choose which kernel you&#8217;re going to edit (it doesn&#8217;t really matter, but I usually choose the first in the list that is *not* recovery mode):</p>
<p><img class="aligncenter size-full wp-image-143" title="Select kernel to edit" src="http://www.id26.com/wp-content/uploads/2009/07/BootOptions-1.png" alt="Select kernel to edit" width="690" height="250" /></p>
<p>Type &#8216;e&#8217; to edit that line, and it will take you to another menu, which brings you to the line you&#8217;ll edit:</p>
<p><img class="aligncenter size-full wp-image-144" title="Edit kernel line" src="http://www.id26.com/wp-content/uploads/2009/07/BootOptions-2.png" alt="Edit kernel line" width="690" height="250" /></p>
<p>Scroll down to the &#8216;kernel&#8217; like, and hit &#8216;e&#8217; again. This will insert the kernel line into the grub&gt; prompt, where you can add/edit the boot instructions. Yours will not be identical to the example below, but should have the same components:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;"> kernel /boot/vmlinuz-2.6.17-11-386 root=UUID=7d2d4dd5-f7fd-45ad-8bc9-51b1b284fcaa ro quiet splash</pre></div></div>

<p>You will want to edit that to :</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;"> grub&gt; kernel /boot/vmlinuz-2.6.17-11-386 root=UUID=7d2d4dd5-f7fd-45ad-8bc9-51b1b284fcaa init=/bin/bash</pre></div></div>

<p>When finished, hit enter to go back to the previous screen, and hit &#8216;b&#8217; to boot that newly edited line.</p>
<p>After it boots, you&#8217;ll be at a shell prompt, but it isn&#8217;t writable! So any changes you make (like changing the root password) won&#8217;t hold through the reboot. So you&#8217;ll need to mount your root directory (which is simply labeled: / ) by typing the following command:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">mount -o remount,rw /</pre></div></div>

<p><em>Be sure to note the spacing in that command</em></p>
<p>Next you&#8217;ll need to change the root password. Since you are in the root prompt, it will change the password for user &#8216;root&#8217; by default. I&#8217;ve added the root user below so you can see how to change other user passwords as well (simply replace &#8216;root&#8217; with another user):</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;"> passwd root</pre></div></div>

<p>Enter the new password (one that you&#8217;ll remember, but is sufficiently secure). </p>
<p>It should reboot as it is now, but if you want to be safe you can reset the drive to read only:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">mount -o remount,ro /</pre></div></div>

<p>Then type:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;"> shutdown -r now</pre></div></div>

<p>When your server reboots, you should now be able to log in as root with your newly set password. Granted, this will only work if you are using the cli (or have already set to allow root login through the settings in gnome/kde). </p>
<p>To perform this same task on a RedHat linux distro (RedHat, Fedora, CentOS, etc.) you follow the same instructions as above, except you add the word &#8217;single&#8217; instead of &#8216;init=/bin/bash&#8217; from above. Then continue to boot.</p>
<p>When you boot that kernel, it will drop you into a root prompt, at which point you can type passwd to change your password (with passwd, just like above). Next time you reboot your server, you will have root access with your newly formed password.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.id26.com/2009/07/28/boot-into-single-user-mode-in-ubuntu-or-debian/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Backing up and Restoring your MySQL database &#8211; Ubuntu</title>
		<link>http://www.id26.com/2009/07/23/backing-up-and-restoring-your-mysql-database-ubuntu/</link>
		<comments>http://www.id26.com/2009/07/23/backing-up-and-restoring-your-mysql-database-ubuntu/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 17:30:32 +0000</pubDate>
		<dc:creator>dmccoy</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Command-Line]]></category>
		<category><![CDATA[Guides]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.id26.com/?p=82</guid>
		<description><![CDATA[If you manage any type of databases, you know the importance of backing up your data. Whether you have file corruption from a failing hard drive, a run away script or from a hacking attempt; loosing your databases can and will break your business. If you&#8217;ve never backed up your database, now is a good [...]]]></description>
			<content:encoded><![CDATA[<p>If you manage any type of databases, you know the importance of backing up your data. Whether you have file corruption from a failing hard drive, a run away script or from a hacking attempt; loosing your databases can and will break your business. If you&#8217;ve never backed up your database, now is a good time to start.</p>
<p>The easiest way to backup your MySQL database is with &#8220;/usr/bin/mysqldump&#8221;. You&#8217;ll need to access this application via command. Whether it is from the a console or an SSH connection.</p>
<p>mysqldump &#8211; a database backup program<br />
mysqldump [options] [db_name [tbl_name ...]]</p>
<p>There are three general ways to invoke mysqldump:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">mysqldump [options] db_name [tables]
mysqldump [options] --databases db_name1 [db_name2 db_name3...]
mysqldump [options] --all-databases</pre></div></div>

<p>By default, the mysqldump command will dump the contents of your database directly into your terminal and not into a file. This output can be redirected anyway and to anywhere you like. But it is commonly used in this manner:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">mysqldump -u [username] -p [password] [databasename] &gt; [backup.sql]
mysqldump -u root -p PASSWORD DATABASE &gt; DATABASE-BACKUP-DATE.sql</pre></div></div>

<p> [username] &#8211; your database username<br />
 [password] &#8211; the password for your database<br />
 [databasename] &#8211; the name of your database<br />
 [backup.sql] &#8211; the file to which the database contents needs to be directed to</p>
<p>If you don&#8217;t want to use your password in the command line, you can always prompt for your password by excluding it from your command.</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">mysqldump -u root -p DATABASE &gt; DATABASE-BACKUP-DATE.sql
Enter password:</pre></div></div>

<p>If you forgot your password, you&#8217;ll get an error like this.</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">mysqldump: Got error: 1045: Access denied for user 'root'@'localhost' (using password: YES) when trying to connect</pre></div></div>

<p>Or if you didn&#8217;t enter a password when one is needed, you&#8217;ll get this error.</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">mysqldump: Got error: 1045: Access denied for user 'root'@'localhost' (using password: NO) when trying to connect</pre></div></div>

<p>If you&#8217;d like the convenience of having the database automatically delete the old database before re-writing the content you can use the &#8220;&#8211;add-drop-table&#8221; feature.</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;"> mysqldump --add-drop-table -u root -p PASSWORD DATABASE &gt; DATABASE-BACKUP-DATE.sql</pre></div></div>

<p>If you need to only backup specific tables of the database you can use this command.</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">mysqldump --add-drop-table -u root -p PASSWORD DATABASE TABLE&gt; DATABASE-TABLE-BACKUP-DATE.sql</pre></div></div>

<p>The syntax for the command is:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">mysqldump -u [username] -p [password] [databasename] [table1 table2 ....]</pre></div></div>

<p>[tables] &#8211; This is a list of tables to backup. Each table is separated by a space. </p>
<p>If you are a server administrator and need to backup multiple databases at the same time, you can use the next command. You just have to be sure that the &#8220;-u&#8221; user account has permission to read those databases.</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">mysqldump -u root -p PASSWORD --databases DATABASE1 DATABASE2 DATABASE3 &gt; DATABASE-1-2-3-BACKUP-DATE.sql</pre></div></div>

<p>Or if you just want to back up ALL the databases at one, use the &#8220;&#8211;all-databases&#8221; parameter to backup all the databases in the server in one easy step.</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">mysqldump --all-databases&gt; ALL-DATABASES-DATE.sql</pre></div></div>

<p><strong>How to back up only the data structure.</strong></p>
<p>While in development, most programmers only need to back up their database structure, not their test data. To do this, use the &#8220;&#8211;no-data&#8221; parameter.</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">mysqldump --no-data --databases DATABASE1 DATABASE2 DATABASE3 &gt; DATABASE-1-2-3-Structure-Bakcup-DATE.sql</pre></div></div>

<p>If you have large databases and not enough hard drive space to store them in the regular SQL, text format, you can compressing the backup file on the fly.</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">mysqldump --all-databases | bzip2 -c &gt;all-databases-backup-date.sql.bz2
&nbsp;
mysqldump --all-databases | gzip &gt;all-databases-backup-date.sql.gz</pre></div></div>

<p>If you are away from your servers, or have multiple servers that you manage, you can still backup your databases while you are away. Use the bash script below in conjunction with a cron-tab to automate your backups.</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">#!/bin/sh
date=`date -I`
mysqldump --all-databases | gzip &gt; /var/mysql_backup/mysql-backup-all-$date.sql.gz</pre></div></div>

<p><strong>How to restore your databases.</strong></p>
<p>If the unforeseen happens and you need to totally rebuild your databases, you can do so easily from the mysqldump SQL files.</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">mysql -u root -p PASSWORD DATABASE &lt; DATABASE-BACKUP-DATE.sql</pre></div></div>

<p>Mysql Synopsis:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">mysql -u [username] -p [password] [database_to_restore] &lt; [backup_file.sql]</pre></div></div>

<p>Restoring from the compressed files.</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">gunzip &lt; DATABASE-BACKUP.sql.gz | mysql -u root -p PASSWORD DATABASE</pre></div></div>

<p>Or do 2 at a time.</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">cat DATABASE-BACKUP-1.sql DATABASE-BACKUP-2.sql | mysql -u root -p PASSWORD</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.id26.com/2009/07/23/backing-up-and-restoring-your-mysql-database-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing and setting up Apache2 with Vhosts &#8211; Ubuntu</title>
		<link>http://www.id26.com/2009/07/22/installing-and-setting-up-apache2-with-vhosts-ubuntu/</link>
		<comments>http://www.id26.com/2009/07/22/installing-and-setting-up-apache2-with-vhosts-ubuntu/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 03:01:32 +0000</pubDate>
		<dc:creator>dmccoy</dc:creator>
				<category><![CDATA[Command-Line]]></category>
		<category><![CDATA[Guides]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.id26.com/?p=106</guid>
		<description><![CDATA[Apache is the most widely used website hosting applications. At the time of this article, Apache is reported to have about 70% of the market. While Microsoft IIS has dropped dramatically to 30%. I&#8217;ve personally been using Apache for the last 15 years had have never ever had any problems with the application. All the [...]]]></description>
			<content:encoded><![CDATA[<p>Apache is the most widely used website hosting applications. At the time of this article, Apache is reported to have about 70% of the market. While Microsoft IIS has dropped dramatically to 30%. I&#8217;ve personally been using Apache for the last 15 years had have never ever had any problems with the application. All the problems I&#8217;ve had were related to typos in my configuration files.</p>
<p>To get Apache up and running, you need to do 2 things.</p>
<p>1) install apache<br />
2) start apache</p>
<p>That is basically all you need to know, to get apache up and running. Fairly simple. But of course human nature creeps in and we want to start customizing and personalizing.</p>
<p>To Installing apache2 via apt-get:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">sudo apt-get install apache2</pre></div></div>

<p>Starting apache2 for the first time</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">sudo /etc/init.d/apache2 start</pre></div></div>

<p>If you get this error:</p>
<p><strong>apache2: Could not determine the server&#8217;s fully qualified domain name, using 127.0.0.1 for ServerName</strong></p>
<p>You need to add &#8220;ServerName localhost&#8221; to the &#8220;/etc/apache2/conf.d/fqdn&#8221; file. This can all be done in a single command:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">echo &quot;ServerName localhost&quot; | sudo tee /etc/apache2/conf.d/fqdn</pre></div></div>

<p>If you need to Start|Stop|Reload|etc Apache&#8217;s httpd daemon on Ubuntu, you&#8217;d want to use the &#8220;/etc/init.d/apache2&#8243; commands:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">Usage: /etc/init.d/apache2 {
start
stop
restart
reload
force-reload
start-htcacheclean
stop-htcacheclean
status
}</pre></div></div>

<p>If you are using any other operating system, you&#8217;d want to use the apachectl command:</p>
<p>apachectl &#8211; Apache HTTP Server Control Interface</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">/usr/sbin/apachectl</pre></div></div>

<p>apachectl commands</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">start : Loads the org.apache.httpd launchd job.
stop, graceful-stop : Unloads the org.apache.httpd launchd job.
restart, graceful : Unloads, then loads the org.apache.httpd launchd job.
fullstatus : Displays  a  full status report from mod_status. For this to work, 
you need to have mod_status enabled on your server and a text-based 
browser such as lynx available on your system. The URL used to access the 
status report can be set by editing the STATUSURL variable in the script.
&nbsp;
status : Displays a brief status report. Similar to the fullstatus option, except 
that the list of requests currently being served is omitted.
&nbsp;
configtest : Run a configuration file syntax test. It parses the configuration files 
and either reports Syntax Ok or detailed information about  the  particular 
syntax error. This is equivalent to apachectl -t.
&nbsp;
The following option was available in earlier versions but has been removed. 
(It is now built into the httpd daemon).
&nbsp;
startssl : To  start  httpd  with  SSL  support,  you should edit your configuration 
file to include the relevant directives and then use the normal apachectl start.</pre></div></div>

<p>The main files/directories you will be working with first are:<br />
apache2.conf : the configuration file<br />
sites-available : a directory to let Apache know what sites are available to be accessed by httpd<br />
sites-enables : a directory to let Apache know which websites need to be loading on start</p>
<p>A list of the default apache2 configuration file structure in &#8220;/etc/apache2/&#8221;:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">dmccoy@server:/etc/apache2# ls -l /etc/apache2/
total 48
-rw-r--r-- 1 root root 10104 2009-04-01 11:01 apache2.conf
drwxr-xr-x 2 root root  4096 2009-07-17 05:16 conf.d
-rw-r--r-- 1 root root   378 2009-04-01 11:01 envvars
-rw-r--r-- 1 root root     0 2009-07-13 10:57 httpd.conf
drwxr-xr-x 2 root root 12288 2009-07-17 05:16 mods-available
drwxr-xr-x 2 root root  4096 2009-07-13 10:57 mods-enabled
-rw-r--r-- 1 root root   513 2009-04-01 11:01 ports.conf
drwxr-xr-x 2 root root  4096 2009-07-22 00:54 sites-available
drwxr-xr-x 2 root root  4096 2009-07-13 10:57 sites-enabled</pre></div></div>

<p>The default web site is located at:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">/var/www/index.html</pre></div></div>

<p>if you launch the domain in a web browser &#8220;http://localhost&#8221; you should see a message &#8220;It Works!&#8221;. If you are using the server version with out a gui, you can use &#8220;lynx http://localhost&#8221;. If lynx isn&#8217;t installed, you can use apt-get to install it.</p>
<p>If you need to maintain more then (1) website, you can use a Virtual Host to manage its location and access. Below is the default Virtual Host sample, located in &#8220;/etc/apache2/sites-available/default/&#8221;</p>
<p>There are (4) lines that you need to change.<br />
1) You&#8217;ll need to change the ServerAdmin from webmaster@localhost to your_admin_account@domain.name email address.<br />
2) If you are changing your default location of DocumentRoot /var/www, you&#8217;ll need to edit the path here. An instance where you&#8217;d need to change this directory, is if it was located on a different hard drive or hard drive partition.<br />
3) If you change your DocumentRoot, then you&#8217;ll need to change the Directory  from /var/www/ to your new path.<br />
4) You&#8217;ll also need to change your log names to allow easier management of multiple domains.  ErrorLog /var/log/apache2/error.log and CustomLog /var/log/apache2/access.log combined could be changed to domain.name-error.log and domain.name-access.log.</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">&lt; VirtualHost *:80 &gt;
        ServerAdmin webmaster@localhost
&nbsp;
        DocumentRoot /var/www
        &lt; Directory /&gt;
                Options FollowSymLinks
                AllowOverride None
        &lt; /Directory &gt;
        &lt; Directory /var/www/ &gt;
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        &lt; /Directory &gt;
&nbsp;
        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        &lt; Directory &quot;/usr/lib/cgi-bin&quot; &gt;
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        &lt; /Directory &gt;
&nbsp;
        ErrorLog /var/log/apache2/error.log
&nbsp;
        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn
&nbsp;
        CustomLog /var/log/apache2/access.log combined
&nbsp;
    Alias /doc/ &quot;/usr/share/doc/&quot;
    &lt; Directory &quot;/usr/share/doc/&quot; &gt;
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    &lt; /Directory &gt;
&lt; /VirtualHost &gt;</pre></div></div>

<p>Below is a sample VirtualHost file for a domain.</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">&lt; VirtualHost *:80 &gt;
        ServerAdmin dmccoy @ server .com
        ServerName server.com
        ServerAlias server
        DocumentRoot /var/www
        &lt; Directory /&gt;
                Options FollowSymLinks
                AllowOverride None
        &lt; /Directory &gt;
        &lt; Directory /var/www/server.com &gt;
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        &lt; /Directory &gt;
&nbsp;
        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        &lt; Directory &quot;/usr/lib/cgi-bin&quot; &gt;
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        &lt; /Directory &gt;
&nbsp;
        ErrorLog /var/log/apache2/server.com-error.log
&nbsp;
        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn
&nbsp;
        CustomLog /var/log/apache2/server.com-access.log combined
&nbsp;
    Alias /doc/ &quot;/usr/share/doc/&quot;
    &lt; Directory &quot;/usr/share/doc/&quot; &gt;
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    &lt; /Directory &gt;
&lt; /VirtualHost &gt;</pre></div></div>

<p>You&#8217;ll Notice that I added (2) extra lines. I added &#8220;<a target="_blank" href="http://httpd.apache.org/docs/2.0/mod/core.html#servername">ServerName</a>&#8221; and &#8220;<a target="_blank" href="http://httpd.apache.org/docs/2.0/mod/core.html#serveralias">ServerAlias</a>&#8220;.</p>
<p>ServerName : Description : Hostname and port that the server uses to identify itself<br />
ServerName : Syntax : ServerName fully-qualified-domain-name[:port]<br />
ServerName : Usage : ServerName www.example.com:80 </p>
<p>ServerAlias : Description : Alternate names for a host used when matching requests to name-virtual hosts<br />
ServerAlias : Syntax : ServerAlias hostname [hostname] &#8230;<br />
ServerAlias : Usage : ServerAlias server server2.domain.com server2 </p>
<p>If by change you need manage another domain, you can copy the default virtualhost file and edit those same 4 lines to create another domain. And if you have another, you repeat the steps until all your domains are entered.</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/domain.name</pre></div></div>

<p>Now that you&#8217;ve made your sites available to httpd (Apache), you can now enable them to be used by httpd. The easiest way to do this, is to make a symbolic link from the sites-available directory to the sites-enabled directory. Below is how I would enable the default domain for this server.</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">sudo ln -s /etc/apache2/sites-available/default /etc/apache2/sites-enabled/default</pre></div></div>

<p>Once you have enabled all the domains you need, you can now restart Apache to make them active.</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">sudo /etc/init.d/apache2 restart
[sudo] password for dmccoy: 
 * Restarting web server apache2
 ... waiting    ...done.</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.id26.com/2009/07/22/installing-and-setting-up-apache2-with-vhosts-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to download files via command line &#8211; OS X, Ubuntu : Wget, cURL</title>
		<link>http://www.id26.com/2009/07/21/how-to-download-files-via-command-line-os-x-ubuntu-wget-curl/</link>
		<comments>http://www.id26.com/2009/07/21/how-to-download-files-via-command-line-os-x-ubuntu-wget-curl/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 20:13:42 +0000</pubDate>
		<dc:creator>dmccoy</dc:creator>
				<category><![CDATA[Command-Line]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.id26.com/?p=100</guid>
		<description><![CDATA[For most server administrators doing system updates or installing patches via a command shell is normal, but for the average user trying to patch his new system, this task might be a little difficult. Opening a terminal and downloading a file, just by typing in a few words, is not as simple as clicking a [...]]]></description>
			<content:encoded><![CDATA[<p>For most server administrators doing system updates or installing patches via a command shell is normal, but for the average user trying to patch his new system, this task might be a little difficult. Opening a terminal and downloading a file, just by typing in a few words, is not as simple as clicking a download icon on a website, tho, once you learn how to use Wget or cURL, it will be.</p>
<p>From my understanding, Wget is a stand-alone application, that is command-line only. And, cURL is a cross-platfrom API library called <a target="_blank" href="http://curl.haxx.se/">libcurl</a>. Personally, I like Wget better then cURL, but that&#8217;s just because I am bias.</p>
<p>If you want to know all the nitty-gritty differences, check out <a target="_blank" href="http://daniel.haxx.se/docs/curl-vs-wget.html">curl vs Wget</a>.</p>
<p>Wget &#8211; The non-interactive network downloader. (I refer to it as, WWW Get or Web Get).</p>
<p>    wget [option]&#8230; [URL]&#8230;</p>
<p>curl &#8211; transfer a URL</p>
<p>    curl [options] [URL...]</p>
<p>How to download a file with wget:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">wget http://domain.com/path/to/file.zip</pre></div></div>

<p>How to download a file with cURL:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">curl -O http://domain.com/path/to/file.zip
&nbsp;
or
&nbsp;
curl http://domain.com/path/to/file.zip &gt; file.zip</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.id26.com/2009/07/21/how-to-download-files-via-command-line-os-x-ubuntu-wget-curl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use Dstat to monitor your server &#8211; Ubuntu</title>
		<link>http://www.id26.com/2009/07/21/use-dstat-to-monitor-your-server-during-peak-times-ubuntu/</link>
		<comments>http://www.id26.com/2009/07/21/use-dstat-to-monitor-your-server-during-peak-times-ubuntu/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 16:48:34 +0000</pubDate>
		<dc:creator>dmccoy</dc:creator>
				<category><![CDATA[Command-Line]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.id26.com/?p=91</guid>
		<description><![CDATA[Dstat is one of the best tools you can use for monitoring your server during peak times. It is a combination of vmstat, iostat, netstat, nfsstat and ifstat. This program allows you to access and view key elements of your system&#8217;s resources instantly.
dstat &#8211; versatile tool for generating system resource statistics
dstat [-afv] [options..] [delay [count]]

Using [...]]]></description>
			<content:encoded><![CDATA[<p><a target="_blank" href="http://dag.wieers.com/home-made/dstat/">Dstat</a> is one of the best tools you can use for monitoring your server during peak times. It is a combination of vmstat, iostat, netstat, nfsstat and ifstat. This program allows you to access and view key elements of your system&#8217;s resources instantly.</p>
<p>dstat &#8211; versatile tool for generating system resource statistics</p>
<p>dstat [-afv] [options..] [delay [count]]</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">Using dstat to relate disk-throughput with network-usage (eth0), total CPU-usage and 
system counters:
&nbsp;
       dstat -dnyc -N eth0 -C total -f 5
       Checking dstat’s behaviour and the system’s impact on dstat:
&nbsp;
       dstat -taf --debug
       Using the time plugin together with cpu, net, disk, system, load, proc and 
       topcpu plugins:
&nbsp;
       dstat -tcndylp -M topcpu
       this is identical to
&nbsp;
       dstat -M time,cpu,net,disk,sys,load,proc,topcpu
       Using dstat to relate cpu stats with interrupts per device:
&nbsp;
       dstat -tcyif</pre></div></div>

<p>Installing Dstat</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">sudo apt-get install dstat
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  dstat
0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
Need to get 58.0kB of archives.
After this operation, 406kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com jaunty/universe dstat 0.6.8-1 [58.0kB]
Fetched 58.0kB in 1s (50.0kB/s)
Selecting previously deselected package dstat.
(Reading database ... 24720 files and directories currently installed.)
Unpacking dstat (from .../archives/dstat_0.6.8-1_all.deb) ...
Processing triggers for man-db ...
Setting up dstat (0.6.8-1) ...</pre></div></div>

<p>Dstat updates every second to display its information. Use &#8220;control C&#8221; to quit the application.</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">$ dstat
----total-cpu-usage---- -dsk/total- -net/total- ---paging-- ---system--
usr sys idl wai hiq siq| read  writ| recv  send|  in   out | int   csw 
  0   0 100   0   0   0|  13k   29k|   0     0 |   0     0 |   7    12 
  0   1  99   0   0   0|  32k    0 | 418B  404B|   0     0 |  11    14 
  0   0 100   0   0   0|   0     0 |1360B  420B|   0     0 |  17    14 
  0   0  99   1   0   0|   0   856k| 132B  420B|   0     0 |  22    22 
  0   0 100   0   0   0|   0     0 | 132B  420B|   0     0 |  10    14 
  0   0 100   0   0   0|   0     0 | 192B  420B|   0     0 |  12    16 ^C</pre></div></div>

<p>A screen shot of the unmodified output of dstat:</p>
<p><img src="http://www.id26.com/wp-content/uploads/2009/07/Picture-9.png" alt="Picture 9" title="Picture 9" width="522" height="115" class="aligncenter size-full wp-image-92" /></p>
<p>Family Commands for dstat:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">    Performance tools
       ifstat(1), iftop(8), iostat(1), mpstat(1), netstat(1), nfsstat(1), nstat, vmstat(1), xosview(1)
&nbsp;
   Debugging tools
       htop(1), lslk(1), lsof(8), top(1)
&nbsp;
   Process tracing
       ltrace(1), pmap(1), ps(1), pstack(1), strace(1)
&nbsp;
   Binary debugging
       ldd(1), file(1), nm(1), objdump(1), readelf(1)
&nbsp;
   Memory usage tools
       free(1), memusage, memusagestat, slabtop(1)
&nbsp;
   Accounting tools
       dump-acct, dump-utmp, sa(8)
&nbsp;
   Hardware debugging tools
       dmidecode, ifinfo(1), lsdev(1), lshal(1), lshw(1), lsmod(8), lspci(8), lsusb(8), smartctl(8), x86info(1)
&nbsp;
   Application debugging
       mailstats(8), qshape(1)
&nbsp;
   Xorg related tools
       xdpyinfo(1), xrestop(1)
&nbsp;
   Other useful info
       proc(5)</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.id26.com/2009/07/21/use-dstat-to-monitor-your-server-during-peak-times-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
