<?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>Tanner&#039;s Website &#187; Tutorials</title>
	<atom:link href="http://www.tannr.com/category/tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tannr.com</link>
	<description>My tube of the web.</description>
	<lastBuildDate>Mon, 06 Feb 2012 15:36:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Ubuntu and PCMCIA card</title>
		<link>http://www.tannr.com/2011/11/24/ubuntu-and-pcmcia-card/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ubuntu-and-pcmcia-card</link>
		<comments>http://www.tannr.com/2011/11/24/ubuntu-and-pcmcia-card/#comments</comments>
		<pubDate>Thu, 24 Nov 2011 19:34:04 +0000</pubDate>
		<dc:creator>Tanner</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.tannr.com/?p=328</guid>
		<description><![CDATA[<p>After installing Ubuntu Server 10.04 LTS on an old laptop (don&#8217;t ask why) I found that it wouldn&#8217;t detect its PCMCIA wired Ethernet card (PCM100).</p> <p>Solution:</p> Copy over the packages pcmciautils and libsysfs2 (I had to download them and transfer via USB flash drive: <a href="http://packages.ubuntu.com/lucid/pcmciautils">pcmciautils</a>, <a href="http://packages.ubuntu.com/lucid/libsysfs2">libsysfs2</a>) Install the packages: sudo dpkg -i [name].deb [...]]]></description>
			<content:encoded><![CDATA[<p>After installing Ubuntu Server 10.04 LTS on an old laptop (don&#8217;t ask why) I found that it wouldn&#8217;t detect its PCMCIA wired Ethernet card (PCM100).</p>
<p>Solution:</p>
<ol>
<li>Copy over the packages <strong>pcmciautils</strong> and <strong>libsysfs2</strong> (I had to download them and transfer via USB flash drive: <a href="http://packages.ubuntu.com/lucid/pcmciautils">pcmciautils</a>, <a href="http://packages.ubuntu.com/lucid/libsysfs2">libsysfs2</a>)</li>
<li>Install the packages: sudo dpkg -i [name].deb</li>
<li>Reboot</li>
</ol>
<p>Voilà!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tannr.com/2011/11/24/ubuntu-and-pcmcia-card/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cloning a drive the &#8216;dd&#8217; way</title>
		<link>http://www.tannr.com/2011/05/27/cloning-a-drive-the-dd-way/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=cloning-a-drive-the-dd-way</link>
		<comments>http://www.tannr.com/2011/05/27/cloning-a-drive-the-dd-way/#comments</comments>
		<pubDate>Sat, 28 May 2011 01:26:16 +0000</pubDate>
		<dc:creator>Tanner</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.tannr.com/?p=248</guid>
		<description><![CDATA[<p>Here&#8217;s how I cloned a drive with bad sectors using &#8216;<a href="http://en.wikipedia.org/wiki/Dd_%28Unix%29">dd</a>&#8216;.</p> <p>Since I did this on a Mac, I saved the output image file as a &#8216;.img&#8217; file. This would give me the ability to mount the image after I created it if I needed to get individual files.</p> <p>Clone the failing drive to [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s how I cloned a drive with bad sectors using &#8216;<a href="http://en.wikipedia.org/wiki/Dd_%28Unix%29">dd</a>&#8216;.</p>
<p>Since I did this on a Mac, I saved the output image file as a &#8216;.img&#8217; file. This would give me the ability to mount the image after I created it if I needed to get individual files.</p>
<p><strong>Clone the failing drive to an image file, skip bad sector errors with &#8216;noerror&#8217;:</strong></p>
<ol>
<li> Connect the drive to a Unix / Linux machine &#8211; do not mount the disk</li>
<li>Find the drive name in /dev (for me it was /dev/disk1)</li>
<li>Verify the host system has enough local storage to create the image, and in a terminal type:
<pre><strong>sudo dd conv=noerror,sync if=/dev/disk1 of=disk.img</strong></pre>
</li>
<li>Give it time to create the image. You may see errors when it hits bad sectors, but it&#8217;ll keep running thanks to &#8216;noerror&#8217;.</li>
</ol>
<p><strong>Copying from the image file to the new drive:</strong></p>
<ol>
<li>Connect the new drive and make sure it isn&#8217;t mounted (if it&#8217;s really new it shouldn&#8217;t have any file system or partitions at all)</li>
<li>Find the drive name in /dev (for me it was /dev/disk1)</li>
<li>Type in a terminal:
<pre><strong>sudo dd conv=noerror,sync if=disk.img of=/dev/disk1</strong></pre>
</li>
<li>Give it time to copy from the image to the new disk.</li>
</ol>
<p>The nice thing is that it copies <strong>everything</strong>. For me, the MBR was still there along with all partitions. If you wanted to just copy a single partition you could just be more specific (/dev/disk1s1 or however your system represents them). If the new drive was larger than the original drive, you&#8217;ll notice that there will be unallocated space. You can either create a separate partition, or use a utility to grow an existing one. Recent versions of Windows and OS X have this capability built in.</p>
<p>On boot, the machine I was repairing recognized the filesystem was dirty (it was a Windows XP machine / NTFS), and immediately ran a SCANDISK. I also manually ran it again once I booted into the system, and also ran &#8216;sfc /scannow&#8217; to verify the system files were intact.</p>
<p>That&#8217;s all you have to do. No expensive cloning software needed, just the power of Unix / Linux.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tannr.com/2011/05/27/cloning-a-drive-the-dd-way/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nagios alerts using sSMTP</title>
		<link>http://www.tannr.com/2011/04/25/nagios-alerts-using-ssmtp/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=nagios-alerts-using-ssmtp</link>
		<comments>http://www.tannr.com/2011/04/25/nagios-alerts-using-ssmtp/#comments</comments>
		<pubDate>Tue, 26 Apr 2011 02:22:51 +0000</pubDate>
		<dc:creator>Tanner</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.tannr.com/?p=219</guid>
		<description><![CDATA[<p>I&#8217;ve been running Nagios on my systems at home (yes, I&#8217;m that big of a nerd) for a week or so, but didn&#8217;t get around to setting up e-mail alerts until now. There are a few ways to go about doing this, but I&#8217;ll describe the way I got it going. Since I&#8217;m not running [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been running Nagios on my systems at home (yes, I&#8217;m that big of a nerd) for a week or so, but didn&#8217;t get around to setting up e-mail alerts until now. There are a few ways to go about doing this, but I&#8217;ll describe the way I got it going. Since I&#8217;m not running a mail server on any of my machines I use Google Apps to handle e-mail for my domains. I rather have &#8216;the Google&#8217; deal with all of that for me (and they do a great job).</p>
<p>For this particular instance I was running Ubuntu Server 8.04.4 LTS, but these steps should work fine on other versions and distros.</p>
<p>1. Install sSMTP and mailx</p>
<pre style="padding-left: 30px;">sudo apt-get install ssmtp mailx</pre>
<p></p>
<p>2. Configure sSMTP by editing /etc/ssmtp/ssmtp.conf</p>
<pre style="padding-left: 30px;">
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids &lt; 1000
# Make this empty to disable rewriting.
root=[your user account]@[yourdomain.com]

# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=smtp.gmail.com:587

# Where will the mail seem to come from?
rewriteDomain=

# The full hostname
hostname=[some hostname here]
UseTLS=YES
UseSTARTTLS=YES
AuthMethod=LOGIN
AuthUser=[your user account]@[your domain]
AuthPass=[your password]

# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
# This is optional if you're going to use revaliases - I didn't
FromLineOverride=YES</pre>
<p></p>
<p>3. Lock down /etc/ssmtp/ssmtp.conf to help protect your plaintext password</p>
<pre style="padding-left: 30px;">sudo chown root:nagcmd /etc/ssmtp/ssmtp.conf
sudo chmod 640 /etc/ssmtp/ssmtp.conf</pre>
<p></p>
<p>4. Alter your Nagios commands.cfg file for the correct mail path (for Ubuntu at least)</p>
<pre style="padding-left: 30px;">sudo vim /usr/local/nagios/etc/objects/commands.cfg</pre>
<p>
And change all instances of /bin/mail to /usr/bin/mail. Be sure to reload your Nagios configuration after making these changes.</p>
<p>That should be it! If you&#8217;re having trouble, break things down to troubleshoot. First test out sSMTP by doing the following:</p>
<pre style="padding-left: 30px;">sudo -vvv ssmtp somebody@somedomain.com</pre>
<p>
Write a message, press enter, then hit CTRL+D. If that works successfully but Nagios still isn&#8217;t sending alerts, be sure to check the Event Log in the Nagios interface to see if there are any errors.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tannr.com/2011/04/25/nagios-alerts-using-ssmtp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Going back to the black Twitter app icon</title>
		<link>http://www.tannr.com/2011/01/12/twitters-new-dock-icon/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=twitters-new-dock-icon</link>
		<comments>http://www.tannr.com/2011/01/12/twitters-new-dock-icon/#comments</comments>
		<pubDate>Wed, 12 Jan 2011 09:19:27 +0000</pubDate>
		<dc:creator>Tanner</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.tannr.com/?p=181</guid>
		<description><![CDATA[<p>It appears that with the latest update, Twitter has replaced their dock icon from the original sleek black color to a brighter blue. I really liked the original black, so this is how I went back to it.</p> <p><a href="http://www.tannr.com/wp-content/uploads/2011/01/BlueBlack.png"></a></p> <p>1. Download the <a href="http://www.tannr.com/files/1-12-11/Icon.icns">original icon here</a><br /> 2. Open up Applications and find the [...]]]></description>
			<content:encoded><![CDATA[<p>It appears that with the latest update, Twitter has replaced their dock icon from the original sleek black color to a brighter blue. I really liked the original black, so this is how I went back to it.</p>
<p><a href="http://www.tannr.com/wp-content/uploads/2011/01/BlueBlack.png"><img class="aligncenter size-medium wp-image-198" title="Blue to Black" src="http://www.tannr.com/wp-content/uploads/2011/01/BlueBlack-300x132.png" alt="" width="300" height="132" /></a></p>
<p>1. Download the <a href="http://www.tannr.com/files/1-12-11/Icon.icns">original icon here</a><br />
2. Open up Applications and find the Twitter app<br />
3. Right-click the app and select &#8216;Show Package Contents&#8217;<br />
4. Go to Contents, then Resources<br />
5. Locate &#8216;Icon.icns&#8217; then copy and paste itself in the same folder (this is optional, but we&#8217;re creating a backup)<br />
6. Put in your password if prompted<br />
7. Take the file you downloaded in step 1 and paste it into the same folder<br />
8. Click &#8216;Replace&#8217; when prompted<br />
9. Put in your password if prompted<br />
10. Move the Twitter app out of the dock, then load it up</p>
<p>You&#8217;re done! You should now have the original black Twitter app icon.</p>
<p>Keep in mind that with any future updates, you&#8217;ll probably have to repeat this process.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tannr.com/2011/01/12/twitters-new-dock-icon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Preventing a volume from automatically mounting in OS X</title>
		<link>http://www.tannr.com/2009/09/01/preventing-a-volume-from-automatically-mounting-in-os-x/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=preventing-a-volume-from-automatically-mounting-in-os-x</link>
		<comments>http://www.tannr.com/2009/09/01/preventing-a-volume-from-automatically-mounting-in-os-x/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 21:22:18 +0000</pubDate>
		<dc:creator>Tanner</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.tannr.com/?p=68</guid>
		<description><![CDATA[<p>In a <a href="http://www.tannr.com/?p=27">previous post</a> I mentioned that I was going to install Snow Leopard on a smaller, separate partition. After doing this, I realized that both partitions were going to be mounted when I booted into either operating system &#8211; Leopard or Snow Leopard. I wanted to prevent Spotlight from trying to index the [...]]]></description>
			<content:encoded><![CDATA[<p>In a <a href="http://www.tannr.com/?p=27">previous post</a> I mentioned that I was going to install Snow Leopard on a smaller, separate partition. After doing this, I realized that both partitions were going to be mounted when I booted into either operating system &#8211; Leopard or Snow Leopard. I wanted to prevent Spotlight from trying to index the files on both as I&#8217;d have duplicate entries for files and applications. I tried to disable indexing the Snow Leopard partition from the Leopard in Spolight&#8217;s preferences, but for some reason this configuration was stored universally meaning Snow Leopard would also exclude its own partition and only include Leopard&#8217;s. The best thing to do at this point was to keep the partitions from being mounted at the same time, and as separate as possible.</p>
<p>Before we start I must say I don&#8217;t recommend anyone who may be slightly scared of the Terminal, &#8220;vi&#8221;, and or possibly really screwing something up to do this. If you have access to a nerd who knows what they&#8217;re doing, I suggest you grab them. I&#8217;m not responsible for any hosed systems.</p>
<p>To keep any partition from automatically mounting in OS X do the following:</p>
<p><strong>1. In Terminal, run &#8220;sudo vifs&#8221;</strong></p>
<p>Why we run this:</p>
<p>The command &#8220;sudo&#8221; just means run the command after it (in this case &#8220;vifs&#8221;) as another user, namely <strong>root</strong> &#8211; so that we can make changes to files regular users normally wouldn&#8217;t have access to.</p>
<p>The command &#8220;vifs&#8221; is a utility to safely edit the &#8220;/etc/fstab&#8221; file &#8211; the configuration file we&#8217;re going to tell to not mount our partition. The &#8220;vi&#8221; part is actually from the fact that we&#8217;re using the text editor &#8220;vi&#8221; to change our file.</p>
<p><strong>2. Add the entry of the partition you want to keep from mounting<br />
</strong></p>
<p>If the file &#8220;fstab&#8221; in /etc/ didn&#8217;t already exist, vifs will generate it for you. If it did already exist and there were entries, you&#8217;ll see them listed. Most users will just see this:</p>
<pre>
#
# Warning - this file should only be modified with vifs(8)
#
# Failure to do so is unsupported and may be destructive.
#</pre>
<p>What we want to do now is add our entry. This can be tricky for people who aren&#8217;t familiar with the wonderful world of the vi text editor. Move the cursor down to the last line (with the down arrow key or by pressing shift+G) and then go to the end of that line (by pressing the right arrow or &#8216;)&#8217;). Press &#8216;i&#8217; and hit the right arrow over one, then press enter to create a new line. At this point you should be able to type text on a new line.</p>
<p>Here&#8217;s an example entry of what we&#8217;ll put on that line:</p>
<pre>
UUID=12A4B6C8-1A3B-1C3D-6E8F-123456789876 none hfs rw,noauto</pre>
<p>There are four parts to each entry we need to supply: partition, mount point, file system type, and options. All of the things you can do in fstab are way beyond the scope of this article. Running &#8220;man fstab&#8221; will give you plenty of information if you need to do something different.</p>
<p>In OS X one way to get the UUID for the partition is to go to Disk Utility, right-click on the partition you want to prevent from being automatically mounted, and select &#8220;Information&#8221;. From there you will be able to copy the &#8220;Universal Unique Identifier&#8221; line. Pasting it into our Terminal window is as simple as right-clicking and selecting &#8220;Paste&#8221;.</p>
<p>&#8220;none&#8221; simply means we&#8217;re not giving it a location to mount &#8211; this will be handled automatically by OS X.</p>
<p>&#8220;hfs&#8221; is the type of file system we&#8217;re dealing with. Since my partition was a Mac OS Extended (Journaled) type, this is what I used. If the partition is another type, this must match what type it is. This information is also explained in &#8220;man fstab&#8221; and many places on the web.</p>
<p>&#8220;rw,noauto&#8221; is our options. &#8220;noauto&#8221; tells OS X not to automatically mount the partition.</p>
<p>After you&#8217;ve added your line, your Terminal should look close to this:</p>
<pre>#
# Warning - this file should only be modified with vifs(8)
#
# Failure to do so is unsupported and may be destructive.
#

UUID=12A4B6C8-1A3B-1C3D-6E8F-123456789876 none hfs rw,noauto
</pre>
<p>To save our file and quit hit &#8220;esc&#8221;, then type &#8220;:wq&#8221; and press Enter. If something went wrong and you want to exit vi without making any changes, type &#8220;:q!&#8221; instead.</p>
<p>Reboot to test this out and you should be good to go. If you want to, check out your system logs in Console to make sure there weren&#8217;t any fstab errors.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tannr.com/2009/09/01/preventing-a-volume-from-automatically-mounting-in-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

