<?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>fritzmahnke.com: The Machines Work For Us</title>
	<atom:link href="http://www.fritzmahnke.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fritzmahnke.com</link>
	<description>How to do everything with your computers</description>
	<lastBuildDate>Sat, 14 Apr 2012 01:46:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.3</generator>
		<item>
		<title>Assembly Language Megaprimer: Hello World</title>
		<link>http://www.fritzmahnke.com/2012/04/13/assembly-language-megaprimer-hello-world/</link>
		<comments>http://www.fritzmahnke.com/2012/04/13/assembly-language-megaprimer-hello-world/#comments</comments>
		<pubDate>Sat, 14 Apr 2012 01:46:58 +0000</pubDate>
		<dc:creator>Fritz</dc:creator>
				<category><![CDATA[asm]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[nasm]]></category>

		<guid isPermaLink="false">http://www.fritzmahnke.com/?p=227</guid>
		<description><![CDATA[I&#8217;ve recently taken an interest in assembly language programming, mainly as a means of advancing my C++ debugging skills. I stumbled on the Assembly Language Megaprimer for Linux, a great series of video tutorials on this subject. The learning curve is just  right for a C/C++ programmer ready to learn assembly language. Vivek, the presenter [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently taken an interest in assembly language programming, mainly as a means of advancing my C++ debugging skills. I stumbled on the<a href="http://www.securitytube.net/groups?operation=view&amp;groupId=5"> Assembly Language Megaprimer for Linux</a>, a great series of video tutorials on this subject. The learning curve is just  right for a C/C++ programmer ready to learn assembly language. Vivek, the presenter of the series and founder of <a href="http://www.securitytube.net">SecurityTube</a>, presents the material in a very clear and interesting way.</p>
<p>The only problem was all the example code was in AT&amp;T syntax for <a href="http://www.google.com/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;ved=0CDAQFjAA&amp;url=http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FGNU_Assembler&amp;ei=0tSIT-KSBYbctgeFouzbCQ&amp;usg=AFQjCNEPhO55OWWu0QI1bvLls3Gu3Leo3A&amp;sig2=Q1-myRwpCaWBFjC7Wq0i7w">GNU Assembler (gas)</a>, and I had already begun learning Intel syntax and <a href="http://www.google.com/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=6&amp;ved=0CGAQFjAF&amp;url=http%3A%2F%2Fwww.nasm.us%2F&amp;ei=79SIT76jLMXXtgfluKmXCQ&amp;usg=AFQjCNFqkq2O2JGGAyokXTPMRbbCpEZcFw&amp;sig2=uai83NI9nfvHhh7U5ZeRJQ">The Netwide Assembler</a>.</p>
<p>I decided to follow the tutorial series and convert the code to the Intel/NASM syntax. Here is the equivalent NASM source code for <a href="http://www.securitytube.net/video/222">Part 4: Hello World</a>. Be sure to install NASM on your Linux system before attempting to use the code.</p>
<p>The video first presents the world&#8217;s simplest assembly program, which does nothing but start and exit.</p>
<pre class="brush: plain; title: ;">
; JustExit.asm

section .text

global _start

_start:
	; http://linux.die.net/man/2/exit
	; void _exit(int status);

	; System call number for exit.
	mov eax, 1

	; Exit code
	mov ebx, 0

	; Call exit
	int 0x80

	; Program has ended
</pre>
<p>Either <a href="http://www.fritzmahnke.com/files/JustExit.asm">download JustExit.asm</a> or type the above code into a new file. Then assemble, link, and run it in the Linux shell:</p>
<pre class="brush: plain; title: ;">
nasm -f elf -g -F dwarf JustExit.asm # assemble
ld JustExit.o -o JustExit            # link
./JustExit                           # run
</pre>
<p>This program will seem to do nothing, since its only function is to start and stop immediately.</p>
<p>The second half of the video gets a little more interesting, explaining how to write an assembly language program that prints &#8220;Hello World&#8221; on the screen.</p>
<pre class="brush: plain; title: ;">
; HelloWorld.asm

section .data
	HelloWorldString db `Hello World\n`

section .text 

global _start 

_start:
	; http://linux.die.net/man/2/write
	; ssize_t write(int fd, const void *buf, size_t count);

	; System call number for write
	mov eax, 4

	; File descriptor stdout
	mov ebx, 1

	; Address of string constant
	mov ecx, HelloWorldString

	; Buffer size (11 characters plus newline)
	mov edx, 12

	; Call write
	int 0x80

	; Exit the program
	mov eax, 1
	mov ebx, 0
	int 0x80
</pre>
<p><a href="http://www.fritzmahnke.com/files/HelloWorld.asm"> Download HelloWorld.asm</a> or type the code into a new file. Then assemble, link, and run as before:</p>
<pre class="brush: plain; title: ;">
nasm -f elf -g -F dwarf HelloWorld.asm # assemble
ld HelloWorld.o -o HelloWorld          # link
./HelloWorld                           # run
</pre>
<p>If you were successful, you should see &#8220;Hello World&#8221; printed on your screen.</p>
<h2>Further Reading</h2>
<p><a href="http://asm.sourceforge.net/articles/linasm.html#Syntax">Intel and AT&amp;T Syntax</a><br />
<a href="http://en.wikipedia.org/wiki/X86_assembly_language#Syntax">x86 Assembly Language Syntax</a><br />
<a href="http://www.ibm.com/developerworks/linux/library/l-gas-nasm/index.html">Linux assemblers: A comparison of GAS and NASM</a></p>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2012%2F04%2F13%2Fassembly-language-megaprimer-hello-world%2F&amp;linkname=Assembly%20Language%20Megaprimer%3A%20Hello%20World" title="Digg" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a> <a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2012%2F04%2F13%2Fassembly-language-megaprimer-hello-world%2F&amp;linkname=Assembly%20Language%20Megaprimer%3A%20Hello%20World" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2012%2F04%2F13%2Fassembly-language-megaprimer-hello-world%2F&amp;linkname=Assembly%20Language%20Megaprimer%3A%20Hello%20World" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2012%2F04%2F13%2Fassembly-language-megaprimer-hello-world%2F&amp;linkname=Assembly%20Language%20Megaprimer%3A%20Hello%20World" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2012%2F04%2F13%2Fassembly-language-megaprimer-hello-world%2F&amp;linkname=Assembly%20Language%20Megaprimer%3A%20Hello%20World" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a> <a class="a2a_button_google_reader" href="http://www.addtoany.com/add_to/google_reader?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2012%2F04%2F13%2Fassembly-language-megaprimer-hello-world%2F&amp;linkname=Assembly%20Language%20Megaprimer%3A%20Hello%20World" title="Google Reader" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/reader.png" width="16" height="16" alt="Google Reader"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.fritzmahnke.com/2012/04/13/assembly-language-megaprimer-hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Make Eclipse Clean and Rebuild an Android .apk When any Project File is Changed</title>
		<link>http://www.fritzmahnke.com/2011/11/23/make-eclipse-clean-and-rebuild-an-android-apk-when-any-project-file-is-changed/</link>
		<comments>http://www.fritzmahnke.com/2011/11/23/make-eclipse-clean-and-rebuild-an-android-apk-when-any-project-file-is-changed/#comments</comments>
		<pubDate>Wed, 23 Nov 2011 23:14:29 +0000</pubDate>
		<dc:creator>Fritz</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[ndk]]></category>

		<guid isPermaLink="false">http://www.fritzmahnke.com/?p=217</guid>
		<description><![CDATA[Eclipse&#8217;s default behavior for an Android project seems to ignore changes to project files that aren&#8217;t handled by a Builder. For example, an Eclipse project might have a text file with configuration data referenced in Project Explorer. By default, Eclipse will NOT rebuild and upload the .apk file upon modifying that file and Running or [...]]]></description>
			<content:encoded><![CDATA[<p>Eclipse&#8217;s default behavior for an Android project seems to ignore changes to project files that aren&#8217;t handled by a Builder.</p>
<p>For example, an Eclipse project might have a text file with configuration data referenced in Project Explorer. By default, Eclipse will NOT rebuild and upload the .apk file upon modifying that file and Running or Debugging the project. Instead, the console shows:</p>
<pre class="brush: plain; title: ;">[2011-11-21 21:51:25 - MyProject] Application already deployed. No need to reinstall.</pre>
<p>This is also the default behavior of Eclipse with the Android Native Development Kit (NDK). Although running ndk-build creates new native C or C++ libraries, Eclipse does not rebuild and upload the .apk file upon using Run and Debug functions. Instead, it launches the old .apk file that already exists on the Android device.</p>
<p>The simplest solution is to enable the following option: Window | Preferences | General | Workspace | Refresh automatically. This causes Eclipse to automatically detect a change to a file referenced in Eclipse Project Explorer and Cleans, rebuilds and uploads the .apk file appropriately. I found I need to wait just a few seconds after saving the file before pressing F11 to launch Eclipse&#8217;s debugger.</p>
<p>This is saving me a lot of time in the build cycle.</p>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2011%2F11%2F23%2Fmake-eclipse-clean-and-rebuild-an-android-apk-when-any-project-file-is-changed%2F&amp;linkname=Make%20Eclipse%20Clean%20and%20Rebuild%20an%20Android%20.apk%20When%20any%20Project%20File%20is%20Changed" title="Digg" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a> <a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2011%2F11%2F23%2Fmake-eclipse-clean-and-rebuild-an-android-apk-when-any-project-file-is-changed%2F&amp;linkname=Make%20Eclipse%20Clean%20and%20Rebuild%20an%20Android%20.apk%20When%20any%20Project%20File%20is%20Changed" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2011%2F11%2F23%2Fmake-eclipse-clean-and-rebuild-an-android-apk-when-any-project-file-is-changed%2F&amp;linkname=Make%20Eclipse%20Clean%20and%20Rebuild%20an%20Android%20.apk%20When%20any%20Project%20File%20is%20Changed" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2011%2F11%2F23%2Fmake-eclipse-clean-and-rebuild-an-android-apk-when-any-project-file-is-changed%2F&amp;linkname=Make%20Eclipse%20Clean%20and%20Rebuild%20an%20Android%20.apk%20When%20any%20Project%20File%20is%20Changed" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2011%2F11%2F23%2Fmake-eclipse-clean-and-rebuild-an-android-apk-when-any-project-file-is-changed%2F&amp;linkname=Make%20Eclipse%20Clean%20and%20Rebuild%20an%20Android%20.apk%20When%20any%20Project%20File%20is%20Changed" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a> <a class="a2a_button_google_reader" href="http://www.addtoany.com/add_to/google_reader?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2011%2F11%2F23%2Fmake-eclipse-clean-and-rebuild-an-android-apk-when-any-project-file-is-changed%2F&amp;linkname=Make%20Eclipse%20Clean%20and%20Rebuild%20an%20Android%20.apk%20When%20any%20Project%20File%20is%20Changed" title="Google Reader" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/reader.png" width="16" height="16" alt="Google Reader"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.fritzmahnke.com/2011/11/23/make-eclipse-clean-and-rebuild-an-android-apk-when-any-project-file-is-changed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Foolproof Guide to Troubleshooting Anything</title>
		<link>http://www.fritzmahnke.com/2011/10/06/the-foolproof-guide-to-troubleshooting-anything/</link>
		<comments>http://www.fritzmahnke.com/2011/10/06/the-foolproof-guide-to-troubleshooting-anything/#comments</comments>
		<pubDate>Thu, 06 Oct 2011 17:17:43 +0000</pubDate>
		<dc:creator>Fritz</dc:creator>
				<category><![CDATA[Training]]></category>

		<guid isPermaLink="false">http://www.fritzmahnke.com/?p=184</guid>
		<description><![CDATA[My work is fast paced. I show up at your business with two or three days to help you improve your situation as promised. If we encounter a technical roadblock, it&#8217;s imperative for you and me to resolve it before I leave for my next assignment. Good troubleshooting skills are vastly useful. No matter whose fault [...]]]></description>
			<content:encoded><![CDATA[<p>My work is fast paced. I show up at your business with two or three days to help you improve your situation as promised. If we encounter a technical roadblock, it&#8217;s imperative for you and me to resolve it before I leave for my next assignment.</p>
<p>Good troubleshooting skills are vastly useful. No matter whose fault a problem is, if it&#8217;s in the way of doing what you&#8217;re paid to do, you might not be paid.</p>
<p>I work in the computer software industry and that is where my expertise lies. However, the <em>principles</em> of troubleshooting are abstract and universal.</p>
<h2>“One bite at<em> </em>a time&#8230;one bite at a time”</h2>
<p>A few times now, I&#8217;ve been asked, “How the hell do you know all this stuff?” To me, this question sounds ridiculous. Trust that I&#8217;m hating myself appropriately for using a cliché so early in this post, but I promise it will be the only one: How the hell do you eat an elephant? One bite at a time, of course.</p>
<p>You have probably witnessed an expert or &#8220;master&#8221; working on a problem. The master is <em>on</em>, and is so all the time. The master seems to know exactly how to approach every troublesome situation relating to his or her craft. The master either knows the solution to the trouble or knows where to look next to find it (which ultimately leads him to the solution or to another expert who can help). These skills, along with experience, are what separate mere competence from mastery.</p>
<p>Although they are likely smart people, there&#8217;s not <em>necessarily</em> anything intellectually spectacular about masters. Additionally, an individual that is a master on one subject is generally a novice on countless others. The point is, mastery of a skill comes from consistently exercising <a href="http://xkcd.com/627/">an efficient, honed application of logic</a>.</p>
<p>When something isn&#8217;t working the way you think it should, the best way out of this situation is to break the system into manageable pieces. <a href="http://www.cprogramming.com/how_to_learn_anything.html">Don&#8217;t stare</a> gloomily at the problem in hopes of intimidating a solution to present itself. Go to work. The process should be like a montage from a Rocky movie, except in real time and less exciting to the average onlooker.</p>
<p>Two immediate effects result from applying this technique:</p>
<ol>
<li>In breaking the system into smaller parts, your problem will take on an appearance of solve-ability rather than instill hopelessness.  Keeps your moral up, in other words!</li>
<li>Once you&#8217;ve identified multiple pieces of the system, you can analyze each of them in turn. Then, it&#8217;s much more likely you&#8217;ll isolate a single non-working part of the system. Fix it and you&#8217;ve succeeded.</li>
</ol>
<p>Some people do this more quickly and mentally than others. Speed and precision come with experience. The basic procedure is always the same, though.</p>
<h2>Dissection of the system</h2>
<h3>Step 1: Determine the requirements that yield the desired result</h3>
<p>Every troubleshooting scenario is the same in at least two ways:</p>
<ol>
<li>There are one or more <strong>general requirements</strong> that must be fulfilled to yield a <strong>desired result</strong>.</li>
<li>There are one or more <strong>issues</strong> that stand in the way of the requirements working to cause the desired result, instead causing an undesirable <strong>actual result</strong>.</li>
</ol>
<p>The <strong>desired result</strong> is usually pretty easy to identify. It&#8217;s the point at which you consider the trouble to be over. You don&#8217;t have to consult with anyone else about the desired result; the fact that it&#8217;s not happening is the reason you&#8217;re troubleshooting in the first place.</p>
<p>The <strong>actual result</strong> is also easy to identify. It&#8217;s simply what happens instead of the desired result. Note, <em>and this is very important</em>, that the actual result is not the direct opposite of the desired result. It is what specifically happens instead of the desired result. It&#8217;s very important to distinguish between the two, because the latter likely contains information about the issues, where the former does not.</p>
<p>The <strong>general requirements </strong>may or may not be immediately obvious, depending on your experience. An internet search is a decent place to get started. Google isn&#8217;t omnipotent, however; you&#8217;ll get better results asking someone instead. Just pay attention to what that person says; you&#8217;ll need to know it again and again.</p>
<p>Also, if there&#8217;s a manual or documentation, familiarize yourself with it.</p>
<p><strong>Dissection, Step 1, Example 1: Car</strong></p>
<ul>
<li><strong>Desired result</strong>: Your car starts when you turn the key in the ignition.</li>
<li><strong>Actual result</strong>: Your car is completely silent when you turn the key in the ignition (<em>not</em> &#8220;your car doesn&#8217;t start&#8221;).</li>
<li>How to find general requirements? Search internet for &#8220;how does a car start&#8221; or ask anyone who&#8217;s worked on a car.</li>
<li><strong>General requirements</strong>: Spark plug generates a spark. Spark must ignite fuel in engine. Engine must compress fuel.</li>
</ul>
<p><strong>Dissection, Step 1, Example 2: Computer</strong></p>
<ul>
<li><strong>Desired result</strong>: Your computer connects to the World Wide Web.</li>
<li><strong>Actual result</strong>: Your computer displays an error message when you launch your web browser (<em>not</em> &#8220;your computer doesn&#8217;t connect to the World Wide Web&#8221;).</li>
<li>How to find general requirements? Search internet for &#8220;how does a computer connect to cable internet&#8221; or call anyone who works on computers.</li>
<li><strong>General requirements</strong>: Web browser communicates with network adapter, network adapter connects to home router, home router connects to cable modem, cable modem connects to ISP.</li>
</ul>
<h3>Step 2: Find and diagnose unfulfilled requirements</h3>
<p>At this point, you have a basic idea of what it takes to make The Thing you&#8217;re using do What You Want. If all the general requirements are met, the desired result will happen. Now you have to analyze each of the general requirements and determine which one or ones are not being met.</p>
<p>Depending on your level of expertise and the complexity of the system, this might be a mental exercise, a written one, or both. I like to make big headers on paper for general requirements and then scrawl detailed notes between them.</p>
<h3>Find and diagnose, Step 2, Example 1: Car</h3>
<p>&#8220;Okay, I&#8217;ve determined the <strong>general requirements</strong> are spark, fuel, and compression. I also found info on testing each of these requirements. Where should I begin?</p>
<p>Hmm, I don&#8217;t have a compression test kit, so let&#8217;s skip that requirement for now. Fuel&#8230;I filled the car with gas yesterday, so there&#8217;s fuel in the tank. Is it getting to the engine? I discovered through my research that a working fuel pump should make a whirring noise when I turn the key. But my <strong>actual result </strong>confirms there&#8217;s no noise. Maybe there&#8217;s a problem with fuel delivery. Spark&#8230;I discovered I can do a spark test quickly with only a screwdriver, so let&#8217;s try it. Yep, there&#8217;s a spark.</p>
<p>Spark: check. Fuel: in question. Compression: probably fine, but I&#8217;ll get my neighbor to pick up a compression test kit on the way home. Now to start investigating at the fuel pump.&#8221;</p>
<h3>Find and diagnose, Step 2, Example 2: Computer</h3>
<p>&#8220;Okay, I&#8217;ve determined the <strong>general requirements</strong> are connectivity between my computer, the router, the cable modem, and the ISP. Where should I begin?</p>
<p>I skimmed the manual for the cable modem, and it said a solid, non-blinking light means the modem is connected to the ISP. That&#8217;s the case, so I think the cable modem and ISP are okay. The router status lights are okay, and Steve&#8217;s computer is connected to the router and his internet is working fine. Therefore, I conclude the requirement not being fulfilled is connectivity between my computer and the router.</p>
<p>Cable modem and ISP: check. Wireless router: check. Computer&#8217;s connection to router: in question. I&#8217;ll investigate that. The <strong>actual result</strong> is the web browser is giving me an error message, so I&#8217;ll do a Google search for that message from Steve&#8217;s computer.&#8221;</p>
<p>You should understand from the examples why it&#8217;s important to identify the <strong>actual result</strong> correctly. It may contain key information about which requirement(s) aren&#8217;t being met.</p>
<h3>Step 3: Repeat steps 1-2 on the unfulfilled requirements</h3>
<p>So far, we&#8217;ve demonstrated with two examples how to identify the desired result, actual result, and general requirements of a troubleshooting scenario. We&#8217;ve also demonstrated how to isolate unfulfilled requirements that are preventing the desired result.</p>
<p>Notice, however, that neither of the example problems have actually been solved. So far, these are crappy examples of troubleshooting, you might think. In fact, though, these are excellent examples of how real-world troubleshooting actually works.</p>
<p>Troubleshooting is an <strong>iterative</strong> process. What that means is you must now apply the same steps to a different set of information drawn from the results of your last attempt.</p>
<p>In the example with the car, we ended being pretty confident there was a fuel pump delivery problem. Therefore, our next <strong>iteration</strong> involves determining the general requirements to yield the desired result (fuel delivery) and then finding and diagnosing any unfulfilled requirements.</p>
<p>In the example with the computer, we ended with confidence that the problem was with the computer itself rather than the wireless router, cable modem or ISP. Therefore, our next <strong>iteration</strong> involves determining the general requirements to properly connect the computer to the wireless router (desired result).</p>
<p>The number of iterations required depends on the complexity of the problem, of course. Some sources of trouble are just more elusive and rare than others. At this point, however, you should have a clear idea of how you can use the procedure above to &#8220;close in&#8221; and eliminate unfulfilled requirements and yield your desired result.</p>
<h2>Now Go to Work</h2>
<p>Yes, that&#8217;s all there is to it. With the information above, you are poised to learn how to fix anything.</p>
<p>The most valuable and rewarding thing about experience with a system is the reusability of the knowledge gained from working with that system. Reusability of knowledge is the reason you see masters working faster than others. Additionally, mastery of the <em>principles</em> of troubleshooting makes learning new things easier and easier. Yes, the more things you learn to do, the easier it is to learn to do additional things.</p>
<p>The masters are the ones who remember and connect all the conclusions they draw from careful application of the troubleshooting process.</p>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2011%2F10%2F06%2Fthe-foolproof-guide-to-troubleshooting-anything%2F&amp;linkname=The%20Foolproof%20Guide%20to%20Troubleshooting%20Anything" title="Digg" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a> <a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2011%2F10%2F06%2Fthe-foolproof-guide-to-troubleshooting-anything%2F&amp;linkname=The%20Foolproof%20Guide%20to%20Troubleshooting%20Anything" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2011%2F10%2F06%2Fthe-foolproof-guide-to-troubleshooting-anything%2F&amp;linkname=The%20Foolproof%20Guide%20to%20Troubleshooting%20Anything" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2011%2F10%2F06%2Fthe-foolproof-guide-to-troubleshooting-anything%2F&amp;linkname=The%20Foolproof%20Guide%20to%20Troubleshooting%20Anything" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2011%2F10%2F06%2Fthe-foolproof-guide-to-troubleshooting-anything%2F&amp;linkname=The%20Foolproof%20Guide%20to%20Troubleshooting%20Anything" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a> <a class="a2a_button_google_reader" href="http://www.addtoany.com/add_to/google_reader?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2011%2F10%2F06%2Fthe-foolproof-guide-to-troubleshooting-anything%2F&amp;linkname=The%20Foolproof%20Guide%20to%20Troubleshooting%20Anything" title="Google Reader" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/reader.png" width="16" height="16" alt="Google Reader"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.fritzmahnke.com/2011/10/06/the-foolproof-guide-to-troubleshooting-anything/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use Postfix to send email through Microsoft Exchange server</title>
		<link>http://www.fritzmahnke.com/2010/12/25/use-postfix-to-send-email-through-microsoft-exchange-server/</link>
		<comments>http://www.fritzmahnke.com/2010/12/25/use-postfix-to-send-email-through-microsoft-exchange-server/#comments</comments>
		<pubDate>Sat, 25 Dec 2010 17:04:59 +0000</pubDate>
		<dc:creator>Fritz</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[rt]]></category>
		<category><![CDATA[sendmail]]></category>

		<guid isPermaLink="false">http://www.fritzmahnke.com/?p=123</guid>
		<description><![CDATA[Last week, we installed the excellent Request Tracker (RT) 3.8.8 software on a Debian 5 Linux system for evaluation. RT is a powerful open source issue tracking system. When tickets are updated, RT must send email messages to the relevant people. Since our organization&#8217;s email is handled by a hosted Microsoft Exchange server, we needed [...]]]></description>
			<content:encoded><![CDATA[<p>Last week, we installed the excellent <a href="http://bestpractical.com/rt/">Request Tracker (RT)</a> 3.8.8 software on a Debian 5 Linux system for evaluation. RT is a powerful open source issue tracking system.</p>
<p>When tickets are updated, RT must send email messages to the relevant people. Since our organization&#8217;s email is handled by a hosted Microsoft Exchange server, we needed our Linux machine to automatically log in and send outgoing emails through our MS Exchange server.</p>
<p>There are many applications for this technique. For example, a system administrator might use maintenance scripts to send logs to interested parties.</p>
<p>The procedure below is a &#8220;cheat sheet&#8221; for this configuration. It is meant to show the steps as briefly as possible, with a minimal but complete explanation. It also notes any troubleshooting steps we followed.</p>
<p>Throughout this tutorial, personal information is obfuscated using xX and yY. Output is in bold text.</p>
<h2>Install Postfix</h2>
<p>The first step toward handling email on a Linux machine is to select a <a href="http://en.wikipedia.org/wiki/Message_transfer_agent">Mail Transfer Agent (MTA)</a> or &#8220;mailer&#8221;. We use <a href="http://www.postfix.org">Postfix</a> for our implementation.</p>
<p>First, install Postfix, which automatically removes Debian&#8217;s default MTA, exim4. Also install the modules necessary for SASL authentication:</p>
<p><code>debian:~# apt-get install postfix libsasl2-modules</code></p>
<p>After installation is complete, Postfix will prompt for some information.</p>
<p>General type of mail configuration: <strong>Internet site</strong><br />
System mail name: <strong>mydomain.com</strong></p>
<p>System mail name is the default domain name from which email will originate (the &#8220;from&#8221; address, without a user prefix).</p>
<h2>Optional: Send email manually via SMTP/telnet to make sure this works</h2>
<p>Now that Postfix is installed, make sure we can use our Exchange server. Manually test <a href="http://en.wikipedia.org/wiki/Extended_SMTP">ESMTP</a> on our server over telnet. ESMTP is the protocol used by our Exchange server.</p>
<p><code>debian:~# telnet mail.mydomain.com 25</code></p>
<p>where mail.mydomain.com is the Exchange server&#8217;s fully qualified domain name or IP address, followed by its SMTP port.</p>
<p><code><strong>Trying xXx.xXx.xXx.xx...<br />
Connected to mail.mydomain.com.<br />
Escape character is '^]'.<br />
220 incoming-imf1.mydomain.com Microsoft ESMTP MAIL Service, Version: 6.0.3790.3959 ready at  Thu, 23 Dec 2010 18:08:28 -0500<br />
</strong></code></p>
<p>Say ehllo to the Exchange server from our email domain:</p>
<p><code>EHLO mydomain.com<br />
<strong>250-incoming-imf1.mydomain.com Hello [xX.xXx.xX.xX]<br />
250-TURN<br />
250-SIZE 104857600<br />
250-ETRN<br />
250-PIPELINING<br />
250-DSN<br />
250-ENHANCEDSTATUSCODES<br />
250-8bitmime<br />
250-BINARYMIME<br />
250-CHUNKING<br />
250-VRFY<br />
250-X-EXPS GSSAPI NTLM LOGIN<br />
250-X-EXPS=LOGIN<br />
250-AUTH GSSAPI NTLM LOGIN<br />
250-AUTH=LOGIN<br />
250-X-LINK2STATE<br />
250-XEXCH50<br />
250 OK</strong><br />
</code></p>
<p>Our Postfix configuration will use the AUTH LOGIN mechanism, so send that command here:</p>
<p><code>AUTH LOGIN</code></p>
<p>The following <a href="http://en.wikipedia.org/wiki/Base64">Base64</a> output decodes to &#8220;Username:&#8221;. Enter our username encoded in Base64 (do that <a href="http://www.webpan.com/Customers/Email/base64_conversion.htm">here</a>):</p>
<p><code><strong>334 VXNlcm5hbWU6</strong><br />
xXxXxXxXxX</code></p>
<p>The server returns &#8220;Password:&#8221;. Enter our Base64-encoded password:</p>
<p><code><strong>334 UGFzc3dvcmQ6</strong><br />
yYyYyYyYyY<br />
<strong>235 2.7.0 Authentication successful.</strong></code></p>
<p>We see this message and don&#8217;t hear any dolphins crying, so we&#8217;re clear to proceed as planned. Use MAIL FROM and RCPT TO commands to specify the &#8220;from&#8221; and &#8220;to&#8221; email addresses, respectively:</p>
<p><code>MAIL FROM:fritz@mydomain.com<br />
<strong>250 2.1.0 fritz@mydomain.com....Sender OK</strong><br />
RCPT TO:fmahnke@yYyY.com<br />
<strong>250 2.1.5 fmahnke@yYyY.com</strong></code></p>
<p>Notice the &#8220;to&#8221; email address for the test is on a different domain. This is important, since mail servers may have different authentication requirements for same-domain and cross-domain email. Carefully compose a test message:</p>
<p><code>DATA<br />
<strong>354 Start mail input; end with &lt;CRLF&gt;.&lt;CRLF&gt;</strong><br />
It was quite the dark and stormy afternoon.<br />
omgwtfbbq<br />
.</p>
<p><strong>250 2.6.0 <MAIL9bxu8YHqLPke3fz0001d09c@incoming-imf1.mydomain.com> Queued mail for delivery<br />
.</strong> QUIT<br />
<strong>221 2.0.0 incoming-imf1.mydomain.com Service closing transmission channel<br />
Connection closed by foreign host.</strong><br />
</code></p>
<p>By all accounts, this was successful, so open a beer and check the fmahnke@yYyY.com email account for a new message. If it&#8217;s there, we know we can control our mail server from this machine.</p>
<h2>Postfix configuration</h2>
<p>Postfix needs credentials to login to the server and send email. Add the mail server domain name and username:password (NOT encoded in Base64) of our user to /etc/postfix/sasl_passwd:</p>
<p><code>mail.mydomain.com          fritz@mydomain.com:secretpassword</code></p>
<p>Secure the password file from the peons:</p>
<p><code>debian:~# chown root:root /etc/postfix/sasl_passwd<br />
debian:~# chmod 600 /etc/postfix/sasl_passwd</code></p>
<p>Postfix does not work with plain text files. Update the password database (must be done whenever /etc/postfix/sasl_passwd is modified):</p>
<p><code>debian:~# postmap hash:/etc/postfix/sasl_passwd</code></p>
<p>Under no circumstances should root@mydomain.com be the reply to address for an email originating from our machine (this account does not exist on our hosted Exchange server), so we map (masquerade) it to an interested party. Add this and any other desired mappings to /etc/postfix/generic:</p>
<p><code>root@mydomain.com fritz@mydomain.com</code></p>
<p>Update the address maps database (must be done whenever /etc/postfix/generic is modified):</p>
<p><code>debian:~# postmap /etc/postfix/generic</code></p>
<p>Modify the main Postfix configuration file, aptly named /etc/postfix/<a href="http://www.postfix.org/postconf.5.html">main.cf</a>:</p>
<p><code># enable SASL for authentication<br />
smtp_sasl_auth_enable = yes<br />
# force AUTH LOGIN mechanism. Else Postfix might try something else<br />
smtp_sasl_mechanism_filter = login<br />
# Override Postfix default disallowing of plaintext AUTH LOGIN<br />
smtp_sasl_security_options =<br />
# use our password database for authentication<br />
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd<br />
# map machine email addresses to internet addresses<br />
smtp_generic_maps = hash:/etc/postfix/generic<br />
# send mail <a href="http://www.postfix.org/BASIC_CONFIGURATION_README.html#relay_to">through our Exchange ESMTP server</a><br />
relayhost = mail.mydomain.com<br />
</code></p>
<p>We must restart Postfix when we make changes.</p>
<p><code>debian:~# postfix reload</code></p>
<p>It should now work perfectly. Let&#8217;s test.</p>
<p><code>debian:~# sendmail fmahnke@yYyY.com<br />
Employees must wash hands before returning to work.<br />
.</code></p>
<p>Postfix writes its output to syslog. Check the status of our message:</p>
<p><code>debian:~# tail /var/log/syslog</p>
<p><strong>Dec 24 05:21:37 debian postfix/qmgr[4748]: EBE246625F: from=<root@mydomain.com>, size=307, nrcpt=1 (queue active)<br />
Dec 24 05:21:38 debian postfix/smtp[4816]: EBE246625F: to=<fmahnke@yYyY.com>, relay=mail.mydomain.com[144.202.247.20]:25, delay=3.9, delays=2.1/0.03/1.2/0.55, dsn=2.6.0, status=sent (250 2.6.0  <20101224112136.EBE246625F@debian.localdomain> Queued mail for delivery)</strong><br />
</code></p>
<p>Check fmahnke@yYyY.com for the new message. Is it there? Sweet. Postfix is configured successfully.</p>
<p>Further reading:</p>
<p><a href="http://support.microsoft.com/kb/153119">XFOR: Telnet to Port 25 to Test SMTP Communication</a><br />
<a href="http://www.webpan.com/Customers/Email/SMTP_Authentication_Telnet_Test.htm">Troubleshooting SMTP Authentication using Telnet</a><br />
<a href="http://www.computerperformance.co.uk/exchange2003/exchange2003_SMTP_Auth_Login.htm">Introduction to Microsoft Exchange Server 2003 &#8211; SMTP Auth Login</a></p>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2010%2F12%2F25%2Fuse-postfix-to-send-email-through-microsoft-exchange-server%2F&amp;linkname=Use%20Postfix%20to%20send%20email%20through%20Microsoft%20Exchange%20server" title="Digg" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a> <a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2010%2F12%2F25%2Fuse-postfix-to-send-email-through-microsoft-exchange-server%2F&amp;linkname=Use%20Postfix%20to%20send%20email%20through%20Microsoft%20Exchange%20server" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2010%2F12%2F25%2Fuse-postfix-to-send-email-through-microsoft-exchange-server%2F&amp;linkname=Use%20Postfix%20to%20send%20email%20through%20Microsoft%20Exchange%20server" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2010%2F12%2F25%2Fuse-postfix-to-send-email-through-microsoft-exchange-server%2F&amp;linkname=Use%20Postfix%20to%20send%20email%20through%20Microsoft%20Exchange%20server" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2010%2F12%2F25%2Fuse-postfix-to-send-email-through-microsoft-exchange-server%2F&amp;linkname=Use%20Postfix%20to%20send%20email%20through%20Microsoft%20Exchange%20server" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a> <a class="a2a_button_google_reader" href="http://www.addtoany.com/add_to/google_reader?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2010%2F12%2F25%2Fuse-postfix-to-send-email-through-microsoft-exchange-server%2F&amp;linkname=Use%20Postfix%20to%20send%20email%20through%20Microsoft%20Exchange%20server" title="Google Reader" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/reader.png" width="16" height="16" alt="Google Reader"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.fritzmahnke.com/2010/12/25/use-postfix-to-send-email-through-microsoft-exchange-server/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Colored BASH shell prompt to easily identify SSH sessions</title>
		<link>http://www.fritzmahnke.com/2010/12/24/colored-bash-shell-prompt-to-easily-identify-ssh-sessions/</link>
		<comments>http://www.fritzmahnke.com/2010/12/24/colored-bash-shell-prompt-to-easily-identify-ssh-sessions/#comments</comments>
		<pubDate>Fri, 24 Dec 2010 22:30:55 +0000</pubDate>
		<dc:creator>Fritz</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.fritzmahnke.com/?p=148</guid>
		<description><![CDATA[My administrative machine is a laptop running Ubuntu. I use SSH to access my headless servers and test machines, so I wanted a way to make it more obvious whether any given terminal window is on the local machine or connected to a remote one. I found this post, which explains how to change the [...]]]></description>
			<content:encoded><![CDATA[<p>My administrative machine is a laptop running Ubuntu. I use SSH to access my headless servers and test machines, so I wanted a way to make it more obvious whether any given terminal window is on the local machine or connected to a remote one.</p>
<p>I found <a href="http://www.cyberciti.biz/faq/bash-shell-change-the-color-of-my-shell-prompt-under-linux-or-unix/">this post</a>, which explains how to change the color of the BASH shell prompt.</p>
<p>To change the color of the shell prompt permanently, modify the SSH user&#8217;s /home/.bashrc:</p>
<p><code>#export PS1='\h:\w\$ '<br />
export PS1="\e[0;31m[\u@\h \W]\$ \e[m "<br />
</code></p>
<p>where 0;31 is the desired <a href="http://www.cyberciti.biz/faq/bash-shell-change-the-color-of-my-shell-prompt-under-linux-or-unix/">color code</a>. Making the change in a user&#8217;s .bashrc causes the colored prompt to be applied upon every login.</p>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2010%2F12%2F24%2Fcolored-bash-shell-prompt-to-easily-identify-ssh-sessions%2F&amp;linkname=Colored%20BASH%20shell%20prompt%20to%20easily%20identify%20SSH%20sessions" title="Digg" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a> <a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2010%2F12%2F24%2Fcolored-bash-shell-prompt-to-easily-identify-ssh-sessions%2F&amp;linkname=Colored%20BASH%20shell%20prompt%20to%20easily%20identify%20SSH%20sessions" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2010%2F12%2F24%2Fcolored-bash-shell-prompt-to-easily-identify-ssh-sessions%2F&amp;linkname=Colored%20BASH%20shell%20prompt%20to%20easily%20identify%20SSH%20sessions" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2010%2F12%2F24%2Fcolored-bash-shell-prompt-to-easily-identify-ssh-sessions%2F&amp;linkname=Colored%20BASH%20shell%20prompt%20to%20easily%20identify%20SSH%20sessions" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2010%2F12%2F24%2Fcolored-bash-shell-prompt-to-easily-identify-ssh-sessions%2F&amp;linkname=Colored%20BASH%20shell%20prompt%20to%20easily%20identify%20SSH%20sessions" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a> <a class="a2a_button_google_reader" href="http://www.addtoany.com/add_to/google_reader?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2010%2F12%2F24%2Fcolored-bash-shell-prompt-to-easily-identify-ssh-sessions%2F&amp;linkname=Colored%20BASH%20shell%20prompt%20to%20easily%20identify%20SSH%20sessions" title="Google Reader" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/reader.png" width="16" height="16" alt="Google Reader"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.fritzmahnke.com/2010/12/24/colored-bash-shell-prompt-to-easily-identify-ssh-sessions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Customizing Firefox&#8217;s search bar to ban useless web sites from Google</title>
		<link>http://www.fritzmahnke.com/2010/03/10/customizing-firefoxs-search-bar-to-ban-useless-web-sites-from-google/</link>
		<comments>http://www.fritzmahnke.com/2010/03/10/customizing-firefoxs-search-bar-to-ban-useless-web-sites-from-google/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 05:11:27 +0000</pubDate>
		<dc:creator>Fritz</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://www.fritzmahnke.com/?p=94</guid>
		<description><![CDATA[I love Firefox&#8217;s tabbed browsing and search bar for collecting research and solving problems. It&#8217;s so fast: press CTRL+T to open a new tab, press CTRL+K to switch focus to the search bar, type the search keywords, and press ENTER. What I don&#8217;t like is when I eagerly click a promising search result and am [...]]]></description>
			<content:encoded><![CDATA[<p>I love Firefox&#8217;s tabbed browsing and search bar for collecting research and solving problems. It&#8217;s so fast: press CTRL+T to open a new tab, press CTRL+K to switch focus to the search bar, type the search keywords, and press ENTER.</p>
<p>What I don&#8217;t like is when I eagerly click a promising search result and am greeted by something similar to the following:</p>
<div id="attachment_93" class="wp-caption alignnone" style="width: 160px"><a href="http://www.fritzmahnke.com/wp-content/uploads/2010/03/2010-03-09_2333.png"><img class="size-thumbnail wp-image-93" title="experts-exchange" src="http://www.fritzmahnke.com/wp-content/uploads/2010/03/2010-03-09_2333-150x150.png" alt="experts-exchange.com preview page" width="150" height="150" /></a><p class="wp-caption-text">experts-exchange.com preview page</p></div>
<p>experts-exchange.com has caused me quite a bit of browsing letdown over the past couple years of technical research. They may have the most relevant result to all my queries as promised, but I am not going to sign up for the experts-exchange.com service to find out. I can remove these annoying search results by adding the following operator to my Google search queries: <strong>-site:experts-exchange.com</strong>. In fact, any web site can be excluded from Google&#8217;s search results by adding this operator in the form <strong>-site:</strong><em>badwebsite.com</em>.</p>
<p>The <strong>-site</strong> operator is effective, but it is impractical to add this operator to every Google search we perform. Luckily, we can customize Firefox&#8217;s search bar plugin to automate this procedure and banish experts-exchange.com from all Google searches through eternity. Here&#8217;s the procedure.</p>
<p>Create a copy of %systemdrive%\Program Files\Mozilla Firefox\searchplugins\google.xml in the same folder and save it under a different name (e.g. google_ban_experts_exchange.xml). Open the new .xml file with your favorite text editor.</p>
<p>Modify the content of the <strong>ShortName</strong> element. This value determines how Firefox will name the new search plugin:</p>
<p><code>&lt;ShortName&gt;Google (no EE)&lt;/ShortName&gt;</code></p>
<p>Secondly, find the following line:</p>
<p><code>&lt;Param name="q" value="{searchTerms}"/&gt;</code></p>
<p>The <strong>value</strong> attribute specifies what is sent to the search engine URL when the search plugin is used. {searchTerms} is a variable that expands to the text entered in the Firefox search bar. Modify this line as follows:</p>
<p><code>&lt;Param name="q" value="{searchTerms}+-site%3Aexperts-exchange.com"/&gt;</p>
<p>Note that, for Google, a space character between keywords or operators must be changed to a plus sign (+) when used inside the <strong>Param</strong> element. Also, the colon character must be <a href="http://en.wikipedia.org/wiki/Percent-encoding">percent-encoded</a>, so it is changed to <em>%3A</em>.</p>
<p>Save the changes to the .xml file and restart Firefox, if necessary. Click the dropdown button to the left of the Firefox search bar; <strong>Google (no EE)</strong> is now available from the list. After performing a search using this new plugin, the results screen should show Firefox automatically adds <strong>-site:experts-exchange.com</strong> before performing the search.</p>
<p>I picked on experts-exchange.com in this post (and rightly so, since they've dashed my hopes for at-my-fingertips content so many times), but this trick can be used to customize searches using other operators as well. For example, one could build a search plugin that constrains results to a range of dates or that searches only for files of a certain type.</p>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2010%2F03%2F10%2Fcustomizing-firefoxs-search-bar-to-ban-useless-web-sites-from-google%2F&amp;linkname=Customizing%20Firefox%26%238217%3Bs%20search%20bar%20to%20ban%20useless%20web%20sites%20from%20Google" title="Digg" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a> <a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2010%2F03%2F10%2Fcustomizing-firefoxs-search-bar-to-ban-useless-web-sites-from-google%2F&amp;linkname=Customizing%20Firefox%26%238217%3Bs%20search%20bar%20to%20ban%20useless%20web%20sites%20from%20Google" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2010%2F03%2F10%2Fcustomizing-firefoxs-search-bar-to-ban-useless-web-sites-from-google%2F&amp;linkname=Customizing%20Firefox%26%238217%3Bs%20search%20bar%20to%20ban%20useless%20web%20sites%20from%20Google" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2010%2F03%2F10%2Fcustomizing-firefoxs-search-bar-to-ban-useless-web-sites-from-google%2F&amp;linkname=Customizing%20Firefox%26%238217%3Bs%20search%20bar%20to%20ban%20useless%20web%20sites%20from%20Google" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2010%2F03%2F10%2Fcustomizing-firefoxs-search-bar-to-ban-useless-web-sites-from-google%2F&amp;linkname=Customizing%20Firefox%26%238217%3Bs%20search%20bar%20to%20ban%20useless%20web%20sites%20from%20Google" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a> <a class="a2a_button_google_reader" href="http://www.addtoany.com/add_to/google_reader?linkurl=http%3A%2F%2Fwww.fritzmahnke.com%2F2010%2F03%2F10%2Fcustomizing-firefoxs-search-bar-to-ban-useless-web-sites-from-google%2F&amp;linkname=Customizing%20Firefox%26%238217%3Bs%20search%20bar%20to%20ban%20useless%20web%20sites%20from%20Google" title="Google Reader" rel="nofollow" target="_blank"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/icons/reader.png" width="16" height="16" alt="Google Reader"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.fritzmahnke.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.fritzmahnke.com/2010/03/10/customizing-firefoxs-search-bar-to-ban-useless-web-sites-from-google/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

