<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Fiz-ix</title>
	
	<link>http://www.fiz-ix.com</link>
	<description>(Physics)</description>
	<lastBuildDate>Sun, 07 Apr 2013 18:24:56 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/fiz-ix/Axjj" /><feedburner:info uri="fiz-ix/axjj" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:browserFriendly></feedburner:browserFriendly><item>
		<title>Simple Electret Microphone and Band-Pass Amplifier Circuit</title>
		<link>http://www.fiz-ix.com/2013/04/simple-electret-microphone-and-band-pass-amplifier-circuit/</link>
		<comments>http://www.fiz-ix.com/2013/04/simple-electret-microphone-and-band-pass-amplifier-circuit/#comments</comments>
		<pubDate>Sun, 07 Apr 2013 18:24:56 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Basics]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Guides]]></category>

		<guid isPermaLink="false">http://www.fiz-ix.com/?p=1464</guid>
		<description><![CDATA[If you are working on a project that responds to sounds, your circuit will require some type of microphone to transduce the sound into a modulated voltage and, most likely, some type of amplification of this modulated voltage. I like to use electret microphones to transduce sound because they require relatively simple circuits. For example, [...]]]></description>
			<content:encoded><![CDATA[<p>If you are working on a project that responds to sounds, your circuit will require some type of microphone to transduce the sound into a modulated voltage and, most likely, some type of amplification of this modulated voltage. I like to use electret microphones to transduce sound because they require relatively simple circuits. For example, the circuit below passes the output of an electret microphone (hooked up according to its datasheet) through a band-pass amplifier based on an LM358 operational amplifier. This circuit is suitable for a 5-V system. The op-amp circuit has both a high-pass portion (R1 and C1) and a low-pass portion (R2 and C2). Thus, the circuit attenuates frequencies below f = 1/(2&#960;R1C1) = 5.9 Hz and frequencies above f = 1/(2&#960;R2C2) = 15915 Hz. The op-amp acts like an inverting amplifier with a gain of -R2/R1=37. The voltage divider (R4 and R5) is used to give the output about a 1.6 V DC offset. This allows both the positive and negative portions of the input to be amplified and present in the output. After building this circuit, I discovered a very similar circuit is implemented by <a href="https://www.sparkfun.com/products/9964" title="electret breakout board" target="_blank">SparkFun&#8217;s electret microphone breakout board</a> but different resistor and capacitor values are used yielding a different gain and different band-pass characteristics, a different op amp is used, and a capacitor is placed in parallel with R4 presumably to stabilize the voltage to the non-inverting input of the op-amp. This additional capacitor may be a good idea, but I actually think my circuit is superior in that the voltage divider introduces a smaller DC offset that more closely matches the midpoint of the op-amp&#8217;s dynamic range when powered by 5 volts. Just my opinion.</p>
<p><a href="http://www.fiz-ix.com/wp-content/uploads/2013/04/MicAndAmp.png"><img src="http://www.fiz-ix.com/wp-content/uploads/2013/04/MicAndAmp.png" alt="" title="MicAndAmp" width="500" height="269" class="aligncenter size-full wp-image-1465" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.fiz-ix.com/2013/04/simple-electret-microphone-and-band-pass-amplifier-circuit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IR Photodiode Circuit Schematic</title>
		<link>http://www.fiz-ix.com/2013/04/ir-photodiode-circuit-schematic/</link>
		<comments>http://www.fiz-ix.com/2013/04/ir-photodiode-circuit-schematic/#comments</comments>
		<pubDate>Thu, 04 Apr 2013 17:40:08 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Basics]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Guides]]></category>

		<guid isPermaLink="false">http://www.fiz-ix.com/?p=1458</guid>
		<description><![CDATA[The following schematic demonstrates a simple infrared (IR) photodiode circuit using a analog-to-digital converter (ADC) to monitor the photodiode. An analog pin on an Arduino used with the analogRead() function will do the job. Photodiodes are two-pin analog devices. This makes them relatively easy to use and makes their output graded. Some of my students [...]]]></description>
			<content:encoded><![CDATA[<p>The following schematic demonstrates a simple infrared (IR) photodiode circuit using a analog-to-digital converter (ADC) to monitor the photodiode. An analog pin on an Arduino used with the analogRead() function will do the job. Photodiodes are two-pin analog devices. This makes them relatively easy to use and makes their output graded. Some of my students are using one in a project along with an IR LED as an IR absorption meter. On the other hand, their output is relatively weak so they can&#8217;t detect extremely small or distant IR signals. Notice that the photodiode is reverse biased. Thus, when no light is present, no current flows through the diode and the 1 megaohm pull-up resistor ensures that the ADC monitoring the photodiode reads 5 V. When light, in this case IR light, strikes the photodiode, electron-hole pairs are created in the semiconductor which creates a small current causing the voltage at the ADC pin to drop. So the lower the voltage read by the ADC, the more IR light is being received. </p>
<p><a href="http://www.fiz-ix.com/wp-content/uploads/2013/04/IRPhotodiode.png"><img src="http://www.fiz-ix.com/wp-content/uploads/2013/04/IRPhotodiode.png" alt="" title="IRPhotodiode" width="390" height="319" class="aligncenter size-full wp-image-1459" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.fiz-ix.com/2013/04/ir-photodiode-circuit-schematic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Direct Control of Arduino Uno Digital Input/Output Pins Using Port Registers</title>
		<link>http://www.fiz-ix.com/2013/02/direct-control-of-arduino-uno-digital-inputoutput-pins-using-port-registers/</link>
		<comments>http://www.fiz-ix.com/2013/02/direct-control-of-arduino-uno-digital-inputoutput-pins-using-port-registers/#comments</comments>
		<pubDate>Thu, 14 Feb 2013 19:33:25 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Guides]]></category>

		<guid isPermaLink="false">http://www.fiz-ix.com/?p=1433</guid>
		<description><![CDATA[The ATmega328 has a total of three input/output ports, port B, port C, and port D. Two of these ports, namely port B and port D, are associated with the 14 digital input/output pins on the Arduino Uno. Port C is associated with the analog input pins which can also be used as digital input/output [...]]]></description>
			<content:encoded><![CDATA[<p>The ATmega328 has a total of three input/output ports, port B, port C, and port D. Two of these ports, namely port B and port D, are associated with the 14 digital input/output pins on the Arduino Uno. Port C is associated with the analog input pins which can also be used as digital input/output pins if needed. The following table summarizes the mapping between the Arduino Uno digital pins and the ATmega328 port pins.</p>
<p><center></p>
<table border="1" bordercolor="#000000" style="background-color:#FFFFFF" width="200" cellpadding="2" cellspacing="0">
<tr>
<td>Arduino Digital Pin</td>
<td>Port Pin</td>
</tr>
<tr>
<td>0</td>
<td>PD0</td>
</tr>
<tr>
<td>1</td>
<td>PD1</td>
</tr>
<tr>
<td>2</td>
<td>PD2</td>
</tr>
<tr>
<td>3</td>
<td>PD3</td>
</tr>
<tr>
<td>4</td>
<td>PD4</td>
</tr>
<tr>
<td>5</td>
<td>PD5</td>
</tr>
<tr>
<td>6</td>
<td>PD6</td>
</tr>
<tr>
<td>7</td>
<td>PD7</td>
</tr>
<tr>
<td>8</td>
<td>PB0</td>
</tr>
<tr>
<td>9</td>
<td>PB1</td>
</tr>
<tr>
<td>10</td>
<td>PB2</td>
</tr>
<tr>
<td>11</td>
<td>PB3</td>
</tr>
<tr>
<td>12</td>
<td>PB4</td>
</tr>
<tr>
<td>13</td>
<td>PB5</td>
</tr>
</table>
<p></center><br />
&nbsp;</p>
<p>To turn on or off a Arduino digital pin, its mode is first set using <code>pinMode()</code> and then its state is set using <code>digitalWrite()</code>. For example, to turn on digital pin 5 for one second then turn if off for one second repeatedly, the following code could be used.</p>
<pre><code>
int myPin = 5;
void setup() {
   pinMode(myPin,OUTPUT);
}
void loop() {
   digitalWrite(myPin,HIGH);
   delay(1000);
   digitalWrite(myPin,LOW);
   delay(1000);
}</code></pre>
<p>It is also possible to control the digital pins by accessing the port registers directly. For example, the following achieves the same result as the above code. It is explained below.</p>
<pre><code>
void setup() {
   DDRD = DDRD | B00100000; 
}
void loop() {
   PORTD = PORTD | B00100000;
   delay(1000);
   PORTD = PORTD &#038; B11011111;
   delay(1000);
}</code></pre>
<p>Each port has a one byte register defining the direction of the associated pins. This register is called DDRD for port D and DDRB for port B. From zero to seven, each bit in this register corresponds to the comparably numbered pin of that port. For example, the fifth bit of DDRD controls port pin D5 or Arduino digital pin 5. If this bit is set to zero, the pin is an input. If this bit is set to one, the pin is an output pin. Thus, the line of code in the setup function above sets Arduino digital pin 5 to an output pin using a bitwise or operator. Each port also has a one byte register defining the state of the associated pins. This register is called PORTD for port D and PORTB for port B. Just like the DDRx registers, each bit in these registers from zero to seven corresponds to the comparably numbered pin of that port. For example, the fifth bit of PORTD controls the state of pin D5 or Arduino digital pin 5. If this bit is set to zero, the pin is set to 0 V. If this bit is set to one, the pin is set to 5 V (on the Arduino Uno). Thus the lines of code in the loop function above first turns on Arduino digital pin 5 using a bitwise or and then turns this pin off using a bitwise and.</p>
<p>Controlling digital i/o pins at the register level is incredibly powerful. For example, you could turn all 8 pins of port D using a single line of code if you wanted to. However, with great power comes great responsibility. Manipulating registers can be tricky and may yield unexpected results. For example, buried in the ATmega328 data sheet is a warning that one can not change a pin from the high impedance input off state to the output on state in one step. You must first go to an intermediate state of output low or input high before going to output high. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.fiz-ix.com/2013/02/direct-control-of-arduino-uno-digital-inputoutput-pins-using-port-registers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introduction to Arduino Serial Communication</title>
		<link>http://www.fiz-ix.com/2013/02/introduction-to-arduino-serial-communication/</link>
		<comments>http://www.fiz-ix.com/2013/02/introduction-to-arduino-serial-communication/#comments</comments>
		<pubDate>Wed, 13 Feb 2013 00:36:47 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Guides]]></category>

		<guid isPermaLink="false">http://www.fiz-ix.com/?p=1427</guid>
		<description><![CDATA[Serial communication is a method for two computers or microcontrollers (or one computer and a microcontroller) to talk to one another. Arduino uses the transistor-transistor logic (TTL) serial protocol. This protocol sends bits using voltages of zero (for a zero bit) and five (for a one bit). Another popular serial protocol is RS-232 which uses [...]]]></description>
			<content:encoded><![CDATA[<p>Serial communication is a method for two computers or microcontrollers (or one computer and a microcontroller) to talk to one another. Arduino uses the transistor-transistor logic (TTL) serial protocol. This protocol sends bits using voltages of zero (for a zero bit) and five (for a one bit). Another popular serial protocol is RS-232 which uses +13 V to represent zeros and -13 V to represent ones. In both cases, serial communication involves sending bytes one bit at a time starting with the least significant bit (LSB). Each bit is preceded by a start bit (0 V for TTL serial communication) and immediately followed by a stop bit (0 V for TTL serial communication). Therefore, the figure below shows the signals that would be generated if the bytes 11011001 (top) and 00010010 (bottom) where sent via a serial channel. </p>
<p><a href="http://www.fiz-ix.com/wp-content/uploads/2013/02/SerialCommunication.png"><img src="http://www.fiz-ix.com/wp-content/uploads/2013/02/SerialCommunication-300x164.png" alt="" title="SerialCommunication" width="300" height="164" class="aligncenter size-medium wp-image-1428" /></a></p>
<p>In order for two devices to communicate via a serial signal, both must be configured with the same baud rate or bits per second (bps) rate. This tells both machines the interval of time between individual bits so they can synchronize. The most common baud rate for Arduino is 9600. In fact, this is the default baud rate when a new serial monitor is opened from the Arduino IDE. Other baud rates are sometimes necessary. For example, communication with GPS modules often uses a baud rate of 4800.</p>
<p>The following sketch demonstrates serial communication between an Arduino Uno and a the serial monitor on a computer. When a character is sent to the Arduino from the serial monitor on a computer, the Arduino reads this byte and immediately will send it back. The <code>Serial.begin()</code>, <code>Serial.available()</code>, <code>Serial.read()</code>, <code>Serial.print()</code>, and <code>Serial.write()</code> commands are used to start serial communication, test to see if any bytes are available in the serial buffer, read in the next byte in the serial buffer, print a decimal number to the serial monitor, and print the ASCII character corresponding to this decimal number, respectively. The comments in the code should help you figure out what each component does.</p>
<pre><code>// Program Name: Serial Echo

// note: serial bytes are read as ASCII 
// (American Standard Code for Information Interchange) 
// characters

byte myByte; // a variable to store a byte read from the serial 
// buffer

void setup() {
  Serial.begin(9600); // begin serial communications at 9600 bps
}

void loop() {
 if (Serial.available()&gt;0) {
  while(Serial.available()&gt;0){ // while bytes remain in the serial 
  // buffer
  myByte = Serial.read(); // read in the current byte
  // = is ASCII character 61
  // 0-9 are ASCII characters 48 to 57
  // - is ASCII character 45
  // + is ASCII character 43
  }
  Serial.print("ASCII Character Value of Byte Read: \n");
  Serial.write(myByte);
  Serial.print('\n');
  Serial.print("ASCII Decimal Value of Byte Read: \n");
  Serial.print(myByte); // prints ASCII character corresponding 
  // to myByte
  Serial.print('\n');
 }
}</code></pre>
<p>One important concept to understand is that serial information is sent out of and read into the Arduino one byte at a time. Moreover, each byte that is read into memory corresponds to the decimal ASCII encoding for the ASCII character being received. So, if the character <code>A</code> is sent, the value stored in <code>myByte</code> would be <code>65</code> since this is the decimal code for the ASCII character <code>A</code>. For more on ASCII characters and serial communications see <a href="http://www.fiz-ix.com/2012/11/arduino-serial-communication-bytes-bases-and-ascii-characters/" target="_blank">this post</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fiz-ix.com/2013/02/introduction-to-arduino-serial-communication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Controlling Common-Cathode RGB LEDs with Arduino</title>
		<link>http://www.fiz-ix.com/2013/02/controlling-common-cathode-rgb-leds-with-arduino/</link>
		<comments>http://www.fiz-ix.com/2013/02/controlling-common-cathode-rgb-leds-with-arduino/#comments</comments>
		<pubDate>Fri, 08 Feb 2013 15:02:51 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Guides]]></category>

		<guid isPermaLink="false">http://www.fiz-ix.com/?p=1416</guid>
		<description><![CDATA[A common-cathode RGB LED has a total of four pins. One of the pins is the cathode which must be connected to ground and the others each control a color. The pinout shown below is for a typical RGB LED. Notice that each of the pins is a slightly different length; the cathode is the [...]]]></description>
			<content:encoded><![CDATA[<p>A common-cathode RGB LED has a total of four pins. One of the pins is the cathode which must be connected to ground and the others each control a color. The pinout shown below is for a typical RGB LED. Notice that each of the pins is a slightly different length; the cathode is the longest. </p>
<p><a href="http://www.fiz-ix.com/wp-content/uploads/2013/02/Screen-shot-2013-02-08-at-9.53.07-AM.png"><img src="http://www.fiz-ix.com/wp-content/uploads/2013/02/Screen-shot-2013-02-08-at-9.53.07-AM-300x252.png" alt="" title="RGBLED" width="300" height="252" class="aligncenter size-medium wp-image-1417" /></a></p>
<p>Since there are three colors, controlling a common-cathode RGB LED with an Arduino requires three digital output pins (and three <a href="http://www.fiz-ix.com/2012/05/the-voltage-divider-circuit-and-led-current-limiting/" target="_blank">current limiting resistors</a>). You could turn these pins off and on one at a time using <code>digitalWrite()</code> commands. You could also use a byte (of which one bit controls each of the colors so five bits would be unused) and a bit-mask. See <a href="http://www.fiz-ix.com/2013/02/using-bytes-and-bitmasks-to-control-multiple-arduino-digital-outputs/" target="_blank">this post</a> for more details. This would result in more compact code. </p>
<p>When lights of different colors are combined, new colors result. But unlike pigment mixing, which is subtractive color mixing, light mixing results in additive color mixing. Red and green makes yellow, red and blue makes magenta, and green and blue makes cyan. If red, green, and blue are simultaneously turned on, white light is produced. In order to obtain more fine grained control over the color produced by an RGB LED, you can use PWM and <code>analogWrite()</code> (see <a href="http://www.fiz-ix.com/2012/11/using-pulse-width-modification-to-simulate-analog-outputs-with-digital-signals/" target="_blank">this post</a> for more details).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fiz-ix.com/2013/02/controlling-common-cathode-rgb-leds-with-arduino/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using A Mechanical Relay to Switch Large AC or DC Currents with a Small DC Current</title>
		<link>http://www.fiz-ix.com/2013/02/using-a-mechanical-relay-to-switch-large-ac-or-dc-currents-with-a-small-dc-current/</link>
		<comments>http://www.fiz-ix.com/2013/02/using-a-mechanical-relay-to-switch-large-ac-or-dc-currents-with-a-small-dc-current/#comments</comments>
		<pubDate>Thu, 07 Feb 2013 18:57:06 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Basics]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Guides]]></category>

		<guid isPermaLink="false">http://www.fiz-ix.com/?p=1406</guid>
		<description><![CDATA[Let&#8217;s say you are working on a project that requires you to turn on an appliance plugged into a household main (115-ish V AC) using an Arduino (3.3-5 V DC). What would you use as a switch. For some applications you can use a bipolar junction transistor as a switch (see this post). However, such [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s say you are working on a project that requires you to turn on an appliance plugged into a household main (115-ish V AC) using an Arduino (3.3-5 V DC). What would you use as a switch. For some applications you can use a bipolar junction transistor as a switch (see <a href="http://www.fiz-ix.com/2012/11/how-to-use-an-npn-transistor-as-a-switch/" title="NPNSwitch" target="_blank">this post</a>). However, such applications require that both the circuit controlling the switch and the circuit being switch have the same common ground. When the circuit doing the switching and the circuit being switched are at vastly different voltages and will carry vastly different currents a better solution is a mechanical relay. Relays have a small electromagnet that when supplied with a small DC current closes a switch through which a much larger DC or AC current can flow. The switch closing is accompanied by a satisfying clicking noise. The picture below is a typical relay. This one is manufactured by OMRON and has 5 pins. The pinout is also shown. </p>
<p><a href="http://www.fiz-ix.com/wp-content/uploads/2013/02/Screen-shot-2013-02-07-at-1.45.32-PM.png"><img src="http://www.fiz-ix.com/wp-content/uploads/2013/02/Screen-shot-2013-02-07-at-1.45.32-PM-300x224.png" alt="" title="Screen shot 2013-02-07 at 1.45.32 PM" width="300" height="224" class="aligncenter size-medium wp-image-1408" /></a></p>
<p><a href="http://www.fiz-ix.com/wp-content/uploads/2013/02/Screen-shot-2013-02-07-at-1.45.46-PM.png"><img src="http://www.fiz-ix.com/wp-content/uploads/2013/02/Screen-shot-2013-02-07-at-1.45.46-PM-296x300.png" alt="" title="Screen shot 2013-02-07 at 1.45.46 PM" width="296" height="300" class="aligncenter size-medium wp-image-1409" /></a></p>
<p>This particular relay is a single pole, double throw (SPDT) switch. If you were controlling a switch like this with an Arduino you would hook an Arduino digital pin up to pin 2 (or pin 5) then hook pin 5 (or pin 2) up to ground. Then setting the Arduino digital pin high will throw the switch. The device being switched should be hooked up across pins 1 and 3. Notice that a SPDT switch connects pins 1 and 4 when no current is supplied across pins 2 and 5. A single pole, single throw (SPST) switch like the one shown below (also made by OMRON) lacks this alternative path. An SPST switch will be specified to be normally open (NO) or normally closed (NC). This particular relay is normally open. </p>
<p><a href="http://www.fiz-ix.com/wp-content/uploads/2013/02/Screen-shot-2013-02-07-at-1.45.56-PM.png"><img src="http://www.fiz-ix.com/wp-content/uploads/2013/02/Screen-shot-2013-02-07-at-1.45.56-PM-284x300.png" alt="" title="Screen shot 2013-02-07 at 1.45.56 PM" width="284" height="300" class="aligncenter size-medium wp-image-1410" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.fiz-ix.com/2013/02/using-a-mechanical-relay-to-switch-large-ac-or-dc-currents-with-a-small-dc-current/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Bytes and Bitmasks to Control Multiple Arduino Digital Outputs</title>
		<link>http://www.fiz-ix.com/2013/02/using-bytes-and-bitmasks-to-control-multiple-arduino-digital-outputs/</link>
		<comments>http://www.fiz-ix.com/2013/02/using-bytes-and-bitmasks-to-control-multiple-arduino-digital-outputs/#comments</comments>
		<pubDate>Tue, 05 Feb 2013 01:28:13 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Guides]]></category>
		<category><![CDATA[Ardunio]]></category>

		<guid isPermaLink="false">http://www.fiz-ix.com/?p=1394</guid>
		<description><![CDATA[A fine way to compactly control multiple Arduino digital output pins is to use a byte in conjunction with a bitmap. The byte provides the structure (eight bits) to compactly specify which digital pins are turned on and which are turned off. Let&#8217;s consider an example. Suppose you have eight digital output pins to control, [...]]]></description>
			<content:encoded><![CDATA[<p>A fine way to compactly control multiple Arduino digital output pins is to use a byte in conjunction with a bitmap. The byte provides the structure (eight bits) to compactly specify which digital pins are turned on and which are turned off. Let&#8217;s consider an example. Suppose you have eight digital output pins to control, Arduiono pins 2, 3, 4, 5, 6, 7, 8, and 9 for example. More specifically, let&#8217;s say you want pins 2, 3, 5, and 8 to be turned on (high) and pins 4, 6, 7, and 9 to be turned off (low). The following code will accomplish this.</p>
<pre><code>int myPins[] = {2, 3, 4, 5, 6, 7, 8, 9};
int onPins = B11010010; 

void setup() {
   for (int ii = 0; ii <= 7; ii++) {
      pinMode(myPins[ii],OUTPUT);
      digitalWrite(myPins[ii],LOW);
   }
}

void loop() {
   for (int ii = 0; ii <= 7; ii++) {
      if (onPins &#038; (B10000000 >> ii)) {
         digitalWrite(myPins[ii],HIGH);
      }
      else {
         digitalWrite(myPins[ii],LOW);
      }
   }
}</code></pre>
<p>The <code>B10000000 >> ii</code> portion of the code uses a right bit shift operator to shift each bit in <code>B10000000</code> exactly <code>ii</code> places to the right. For each rightward shift, the least significant bit falls off and the most significant bit is replaced by a zero. For example <code>B10000000 >> 4</code> would yield <code>B00001000</code>.</p>
<p>The conditional part of the <code>if</code> statement uses the bitwise <code>AND</code> compare. Each bit of the byte contained by <code>onPins</code> is compared to the corresponding bit of the byte resulting after the bit shift operator (what is often referred to as the bitmask). If any of the bitwise compares evaluates true then the entire <code>if</code> statement evaluates true and the <code>if</code> statement code is executed. If none of the bitwise compares evaluate true then the <code>if</code> statement evaluates false and the code in the <code>else</code> statement is executed. </p>
<p>Note that the result of the bitmask is to turn on all of the pins corresponding to the <code>1</code>s in <code>onPins</code> and turn off all the other pins.</p>
<p>I hope you found this quick tutorial helpful. Happy programming. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.fiz-ix.com/2013/02/using-bytes-and-bitmasks-to-control-multiple-arduino-digital-outputs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mapping Arduino Analog-to-Digital Converter (ADC) Output to Voltage</title>
		<link>http://www.fiz-ix.com/2013/01/mapping-arduino-analog-to-digital-converter-adc-output-to-voltage/</link>
		<comments>http://www.fiz-ix.com/2013/01/mapping-arduino-analog-to-digital-converter-adc-output-to-voltage/#comments</comments>
		<pubDate>Thu, 17 Jan 2013 02:38:01 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Guides]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.fiz-ix.com/?p=1388</guid>
		<description><![CDATA[The Arduino Uno is a digital device, but it has an analog-to-digital converter (ADC) to allow us to probe the analog signals that permeating our analog world. The ADC is a 10-bit device that can map an analog signal consisting of a voltage ranging from 0 to 5 volts to a decimal value between 0 [...]]]></description>
			<content:encoded><![CDATA[<p>The Arduino Uno is a digital device, but it has an analog-to-digital converter (ADC) to allow us to probe the analog signals that permeating our analog world. The ADC is a 10-bit device that can map an analog signal consisting of a voltage ranging from 0 to 5 volts to a decimal value between 0 and 1023 (2<sup>10</sup>-1). The sketch below prototypes how to take the decimal value supplied by the ADC and map it back to voltage. Conceptually, the idea of mapping a number from one range to another involves selecting the number on the destination range that has the same location relative to the end points as the original number had to the end points on the original range. If that sentence makes no sense to you, let me give a simple example. If I gave you the number 7 on the range 0 to 10 and told you to map the 7 to a number on the range 0 to 1000, you should pick 700 because 700 has the same position relative to 1000 as 7 has relative to 10. In other words, 7 is to 10 as 700 is to 1000. With a little thought, you can convince yourself that if both the original and destination ranges start at zero, then the mapping is accomplished as follows.</p>
<pre><code>newNumber = orignialNumber*maxValueOnNewRange/maxValueOnOriginalRange</code></pre>
<p>The following is the prototype Arduino sketch promised above. </p>
<pre><code>int analogValue; // a place to hold the decimal value produced by 
// the ADC
float analogVolts; // a place to hold the analogValue mapped back 
// to voltage
byte analogPin = 5; // the analog pin connected to the analog 
// signal we wish to read (pin A5)

void setup() {
// nothing
}

void loop() {
analogValue = analogRead(analogPin);
analogVolts = (float)analogValue*5/1023; // must convert int to float 
// to perform floating point math
}</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.fiz-ix.com/2013/01/mapping-arduino-analog-to-digital-converter-adc-output-to-voltage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Finding Standard Error of Slope and Y-Intercept using LINEST in Excel (Linear Regression in Physics Lab)</title>
		<link>http://www.fiz-ix.com/2013/01/finding-standard-error-of-slope-and-y-intercept-using-linest-in-excel-linear-regression-in-physics-lab/</link>
		<comments>http://www.fiz-ix.com/2013/01/finding-standard-error-of-slope-and-y-intercept-using-linest-in-excel-linear-regression-in-physics-lab/#comments</comments>
		<pubDate>Fri, 04 Jan 2013 18:06:51 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Labs]]></category>
		<category><![CDATA[Physics Labs]]></category>
		<category><![CDATA[Physics]]></category>

		<guid isPermaLink="false">http://www.fiz-ix.com/?p=1366</guid>
		<description><![CDATA[In Excel, you can apply a line-of-best fit to any scatterplot. The equation for the fit can be displayed but the standard error of the slope and y-intercept are not give. To find these statistics, use the LINEST function instead. The LINEST function performs linear regression calculations and is an array function, which means that [...]]]></description>
			<content:encoded><![CDATA[<p>In Excel, you can apply a line-of-best fit to any scatterplot. The equation for the fit can be displayed but the standard error of the slope and y-intercept are not give. To find these statistics, use the LINEST function instead. The LINEST function performs linear regression calculations and is an array function, which means that it returns more than one value. Let&#8217;s do an example to see how it works.</p>
<p>Let&#8217;s say you did an experiment to measure the spring constant of a spring. You systematically varied the force exerted on the spring (F) and measured the amount the spring stretched (s). Hooke&#8217;s law states the F=-ks (let&#8217;s ignore the negative sign since it only tells us that the direction of F is opposite the direction of s). Because linear regression aims to minimize the total squared error in the vertical direction, it assumes that all of the error is in the y-variable. Let&#8217;s assume that since you control the force used, there is no error in this quantity. That makes F the independent value and it should be plotted on the x-axis. Therefore, s is the dependent variable and should be plotted on the y-axis. Notice that the slope of the fit will be equal to 1/k and we expect the y-intercept to be zero. (As an aside, in physics we would rarely force the y-intercept to be zero in the fit even if we expect it to be zero because if the y-intercept is not zero, it may reveal a systematic error in our experiment.)</p>
<p>The images below and the following text summarize the mechanics of using LINEST in Excel. Since it is an array function, select 6 cells (2 columns, 3 rows). You can select up to 5 rows (10 cells) and get even more statistics, but we usually only need the first six. Hit the equal sign key to tell Excel you are about to enter a function. Type <code>LINEST(</code>, use the mouse to select your y-data, type a comma, use the mouse to select your x-data, type another comma, then type <code>true</code> twice separated by a comma and close the parentheses. <strong>DON&#8217;T HIT ENTER</strong>. Instead, <strong>hold down shift and control and then press enter</strong>. This is the way to execute an array function. The second image below shows the results of the function. From left to right, the first row displays the slope and y-intercept, the second row displays the standard error of the slope and y-intercept. The first element in the third row displays the correlation coefficient. I actually don&#8217;t know what the second element is. Look it up if you are interested. By the way, you might wonder what the <code>true</code> arguments do. The first <code>true</code> tells LINEST not to force the y-intercept to be zero and the second <code>true</code> tells LINEST to return additional regression stats besides just the slope and y-intercept.</p>
<p><a href="http://www.fiz-ix.com/wp-content/uploads/2013/01/LINEST1.png"><img src="http://www.fiz-ix.com/wp-content/uploads/2013/01/LINEST1.png" alt="" title="LINEST1" width="392" height="175" class="aligncenter size-full wp-image-1368" /></a></p>
<p><a href="http://www.fiz-ix.com/wp-content/uploads/2013/01/LINEST2.png"><img src="http://www.fiz-ix.com/wp-content/uploads/2013/01/LINEST2.png" alt="" title="LINEST2" width="355" height="156" class="aligncenter size-full wp-image-1369" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.fiz-ix.com/2013/01/finding-standard-error-of-slope-and-y-intercept-using-linest-in-excel-linear-regression-in-physics-lab/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Making a Movie in MATLAB</title>
		<link>http://www.fiz-ix.com/2013/01/making-a-movie-in-matlab/</link>
		<comments>http://www.fiz-ix.com/2013/01/making-a-movie-in-matlab/#comments</comments>
		<pubDate>Fri, 04 Jan 2013 02:10:54 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[MATLAB]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.fiz-ix.com/?p=1362</guid>
		<description><![CDATA[Although it creates bulky AVI files, MATLAB can relatively easily make movies of animated figures. The code below prototypes how this is done. % define the number of frames in your movie numberOfFrames = 1200; % use a loop to generate frames of the movie for ii = 1:numberOfFrames % insert code to update data [...]]]></description>
			<content:encoded><![CDATA[<p>Although it creates bulky AVI files, MATLAB can relatively easily make movies of animated figures. The code below prototypes how this is done.</p>
<pre><code>% define the number of frames in your movie
numberOfFrames = 1200;
% use a loop to generate frames of the movie
for ii = 1:numberOfFrames
    % insert code to update data to be plotted
    % plot data
    figure(1); clf;
    plot(x,y);
    % insert code to format plot any way you want
    drawnow; % force the plot to be displayed
    M(ii) = getframe(1); % save figure 1 as an element of
    % a movie object called M
end

% use the movie2avi function to save the movie
% there are several parameters you can specify
% the only one usually worth messing with is 
% frames per second (fps)
% 20 fps will make this 1200 frame movie 60 s long
movie2avi(M, 'filename', 'fps', 20);</code></pre>
<p>I hope this helps. The AVI will probably be over a GB in size. Use handbrake or ffmpeg to convert the movie made by MATLAB to a more compressed format like MP4.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fiz-ix.com/2013/01/making-a-movie-in-matlab/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Explanation of Insulation R-Value</title>
		<link>http://www.fiz-ix.com/2012/12/explanation-of-insulation-r-value/</link>
		<comments>http://www.fiz-ix.com/2012/12/explanation-of-insulation-r-value/#comments</comments>
		<pubDate>Sat, 29 Dec 2012 03:05:44 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Energy]]></category>
		<category><![CDATA[Notebooks]]></category>

		<guid isPermaLink="false">http://www.fiz-ix.com/?p=1351</guid>
		<description><![CDATA[The second laws of thermodynamics states that heat spontaneously flows from bodies at higher temperature to bodies at lower temperature. Thus, it is an inevitable outcome of all systems left to their own devices to eventually reach thermal equilibrium. The purpose of insulation is to reduce the speed at which equilibrium is reached. Insulation reduces [...]]]></description>
			<content:encoded><![CDATA[<p>The second laws of thermodynamics states that heat spontaneously flows from bodies at higher temperature to bodies at lower temperature. Thus, it is an inevitable outcome of all systems left to their own devices to eventually reach thermal equilibrium. The purpose of insulation is to reduce the speed at which equilibrium is reached. Insulation reduces the rate at which heat is conducted between two bodies. The &#8220;quality&#8221; of insulation is often rated using a ratio called R-value which is defined as the ratio of the temperature difference between the bodies between which the insulation is placed over the rate of heat flow across the insulation per unit area. More compactly,</p>
<pre><code>R = &#916;T/[(dQ/dt)/A]</code></pre>
<p>where <code>T</code> is temperature, <code>Q</code> is heat, <code>t</code> is time, and <code>A</code> is surface area. The SI units for <code>R</code> are <code>K m<sup>2</sup> s/J</code> or <code>K m<sup>2</sup>/W</code> however, most insulations sold in the US use the convoluted units of <code><sup>o</sup>F ft<sup>2</sup> h/BTU</code>. </p>
<p>The larger an insulations R-value, the better it is at slowing the flow of heat. </p>
<p>More insight into the meaning of R-value can be had by considering a different but equivalent definition. R-value is also the ratio of an insulations thickness over the thermal conductivity of the material from which it is made. More compactly,</p>
<pre><code>R = L/k</code></pre>
<p>where <code>L</code> is thickness and the thermal conductivity <code>k</code> has SI units of <code>W/(K m)</code> and Imperial units of  <code>BTU/(hr ft <sup>o</sup>F)</code>.</p>
<p>In this form, it can be seen that the thicker the insulation, the higher its R-value and the better it is at slowing the flow of heat. Two different insulations may have different R-values even if they are made out of the same material if they have different thicknesses. For this reason, R-value, like weight, is an extrinsic property of insulation. On the other hand, insulation&#8217;s thermal conductivity is an intrinsic property of the material from which it is made. </p>
<p>Since R-value depends only on thickness and thermal conductivity, it is additive if two or more pieces of insulation are combined. For example, if one were to sandwich two pieces of foam insulation with R-values of 5 and 8, respectively, the combination would have an R-value of 13.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fiz-ix.com/2012/12/explanation-of-insulation-r-value/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Explanation of Heat Pump HSPF Rating</title>
		<link>http://www.fiz-ix.com/2012/12/explanation-of-heat-pump-hspf-rating/</link>
		<comments>http://www.fiz-ix.com/2012/12/explanation-of-heat-pump-hspf-rating/#comments</comments>
		<pubDate>Thu, 27 Dec 2012 22:39:20 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Energy]]></category>
		<category><![CDATA[Notebooks]]></category>

		<guid isPermaLink="false">http://www.fiz-ix.com/?p=1338</guid>
		<description><![CDATA[HSPF stands for Heating Seasonal Performance Factor. It is a measure defined by the Air Conditioning, Heating, and Refrigeration Institute to rate the heating efficiency of air conditioner or heat pump. Let me emphasis that again, the HSFP rating only reflects the heating efficiency of a heat pump, not its cooling efficiency. Cooling efficiency is [...]]]></description>
			<content:encoded><![CDATA[<p>HSPF stands for Heating Seasonal Performance Factor. It is a measure defined by the Air Conditioning, Heating, and Refrigeration Institute to rate the heating efficiency of air conditioner or heat pump. Let me emphasis that again, the HSFP rating only reflects the heating efficiency of a heat pump, not its cooling efficiency. Cooling efficiency is rated using a different metric called SEER. <a href="http://www.fiz-ix.com/2012/12/explanation-of-heat-pump-seer-rating/" target="_blank">See this post for more information about SEER</a>. </p>
<p>The efficiency of a heat pump is highest when the difference between the indoor and outdoor temperature is the least. For this reason, air-source heat pumps are much more efficient in the spring and fall then in the winter and summer. The HSPF rating attempts to take seasonal variations in heat pump efficiency into account. For this reason, it can be thought of as an average heating efficiency over the course of a year. </p>
<p>HSPF is defined as the ratio of the thermal energy transferred into your home per heating season in British thermal units (BTU) divided by the electrical energy consumed by the heat pump in watt-hours (Wh) per heating season. More compactly,</p>
<pre><code>HSPF = (thermal energy transfered, BTU)/(electrical energy used, Wh)</code></pre>
<p>As a physicist, it doesn&#8217;t make much sense to mix two units of energy (BTU and Wh) in the same formula. It makes understanding the formula more complicated. If one notes that <code>1 Wh = 3.412 BTU</code>, then</p>
<pre><code>HSPF = 3.412 (thermal energy transfered)/(electrical energy used)</code></pre>
<p>where the energies can be in any units so long as they are the same units. In this form, you can see that a 100% efficient electric resistive heater has a HSPF rating of 3.412. Thus a heat pump with a HSPF rating of 6.8 would pump about twice as much thermal energy into your home as it consumes in electricity. </p>
<p>Although the HSPF rating you will actual achieve depends on your climate (hotter climates will achieve higher real-life HSPF ratings than cooler climates) replacing a 6 HSPF heat pump with a 9 HSPF heat pump will decrease the amount of electricity needed to heat your home by about 33.3%. In general, you can calculate the percent reduction in electricity used by a new heat pump to heat your home using the following formula.</p>
<pre><code>Percent Energy Savings = 1 - (Old System HSPF)/(New System HSPF)</pre>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.fiz-ix.com/2012/12/explanation-of-heat-pump-hspf-rating/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Explanation of Heat Pump SEER Rating</title>
		<link>http://www.fiz-ix.com/2012/12/explanation-of-heat-pump-seer-rating/</link>
		<comments>http://www.fiz-ix.com/2012/12/explanation-of-heat-pump-seer-rating/#comments</comments>
		<pubDate>Thu, 27 Dec 2012 21:44:03 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Energy]]></category>
		<category><![CDATA[Notebooks]]></category>

		<guid isPermaLink="false">http://www.fiz-ix.com/?p=1328</guid>
		<description><![CDATA[SEER stands for Seasonal Energy Efficiency Ratio. It is a measure defined by the Air Conditioning, Heating, and Refrigeration Institute to rate the cooling efficiency of air conditioner or heat pump. Let me emphasis that again, the SEER rating only reflects the cooling efficiency of a heat pump, not its heating efficiency. Heating efficiency is [...]]]></description>
			<content:encoded><![CDATA[<p>SEER stands for Seasonal Energy Efficiency Ratio. It is a measure defined by the Air Conditioning, Heating, and Refrigeration Institute to rate the cooling efficiency of air conditioner or heat pump. Let me emphasis that again, the SEER rating only reflects the cooling efficiency of a heat pump, not its heating efficiency. Heating efficiency is rated using a different metric called HSPF. <a href="http://www.fiz-ix.com/2012/12/explanation-of-heat-pump-hspf-rating/" target="_blank">See this post for more information about HSPF</a>.</p>
<p>The efficiency of a heat pump is highest when the difference between the indoor and outdoor temperature is the least. For this reason, air-source heat pumps are much more efficient in the spring and fall then in the winter and summer. The SEER rating attempts to take seasonal variations in heat pump efficiency into account. For this reason, it can be thought of as an average efficiency over the course of a year. </p>
<p>SEER is defined as the ratio of the thermal energy transfered out of your home per cooling season in British thermal units (BTU) divided by the electrical energy consumed by the heat pump in watt-hours (Wh) per cooling season. More compactly,</p>
<pre><code>SEER = (thermal energy transfered, BTU)/(electrical energy used, Wh)</code></pre>
<p>As a physicist, it doesn&#8217;t make much sense to mix two units of energy (BTU and Wh) in the same formula. It makes understanding the formula more complicated. If one notes that <code>1 Wh = 3.412 BTU</code>, then</p>
<pre><code>SEER = 3.412 (thermal energy transfered)/(electrical energy used)</code></pre>
<p>where the energies can be in any units so long as they are the same units. In this form, you can see that a 100% efficient air conditioner has a SEER rating of 3.412. Thus a heat pump with a SEER rating of 6.8 would remove about twice as much thermal energy from your home as it consumes in electricity. </p>
<p>Although the SEER rating you will actual achieve depends on your climate (hotter climates will achieve lower real-life SEER ratings than cooler climates) replacing a 10 SEER heat pump with a 16 SEER heat pump will decrease the amount of electricity needed to cool your home by about 37.5%. Replacing a 10 SEER heat pump with a 22 SEER model will reduce the electricity used by your heat pump by about 54.5%. So there is diminishing returns to energy savings with increasing SEER rating. In general, you can calculate the percent reduction in electricity used by a new heat pump to cool your home using the following formula.</p>
<pre><code>Percent Energy Savings = 1 - (Old System SEER)/(New System SEER)</pre>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.fiz-ix.com/2012/12/explanation-of-heat-pump-seer-rating/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu DNS BIND Master Server Setup</title>
		<link>http://www.fiz-ix.com/2012/12/ubuntu-dns-server-guide-bind-master-server-setup/</link>
		<comments>http://www.fiz-ix.com/2012/12/ubuntu-dns-server-guide-bind-master-server-setup/#comments</comments>
		<pubDate>Thu, 27 Dec 2012 18:57:57 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.fiz-ix.com/?p=1245</guid>
		<description><![CDATA[In a previous post I walked you through the installation of BIND9 (Berkley Internet Name Daemon Version 9) on Ubuntu and configuring the installation to function as a caching name server on your local area network (LAN). Caching DNS records on a local server will hopefully boost your network&#8217;s performance. That is great, but you [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.fiz-ix.com/wp-content/uploads/2012/11/ubuntuLogo.png"><img src="http://www.fiz-ix.com/wp-content/uploads/2012/11/ubuntuLogo-300x135.png" alt="" title="ubuntuLogo" width="300" height="135" class="alignleft size-medium wp-image-723" /></a>In a <a href="http://www.fiz-ix.com/2012/12/set-up-an-ubuntu-bind-dns-caching-name-server/" target="_blank">previous post</a> I walked you through the installation of BIND9 (Berkley Internet Name Daemon Version 9) on Ubuntu and configuring the installation to function as a caching name server on your local area network (LAN). Caching DNS records on a local server will hopefully boost your network&#8217;s performance. That is great, but you probably want your private DNS server to actually help manage the machines on your LAN by maintaining host records and serving those records. Here I show you how to setup a BIND master server to do just that. </p>
<h3>Makeup of A Fictional Domain</h3>
<p>Here we will consider the set up of a fictional domain named <code>mydomain.lan</code> on a restricted network (i.e., a LAN located behind a firewall) and the <code>192.168.1.0</code> subnet. The domain will have have 4 hosts with the following addresses, names, and roles.</p>
<pre><code>IP Address  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hostname &nbsp;&nbsp;&nbsp; role &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; alias
192.168.1.99 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; john &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DNS/mail server
192.168.1.50 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; paul &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; web server &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; www
192.168.1.51 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; george  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; workstation
192.168.1.52 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ringo &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; workstation</code></pre>
<p>Note that the web server is configured with the alias (canonical name) <code>www</code> so that one can navigate to it using <code>www.mydomain.lan</code> in addition to <code>paul</code> and <code>paul.mydomain.lan</code>. Of course your domain will vary in makeup and function to the one considered here, but you should be able to modify the following code to suit your needs.</p>
<h3>Configure Zones on BIND</h3>
<p>Ubuntu installs BIND with a configuration file <code>/etc/bind/named.conf</code> that suits most home office and small business needs and does not need to be modified. Instead you will create your local DNS &#8220;zone&#8221; by editing <code>/etc/bind/named.conf.local</code>, which is sourced by <code>named.conf</code>. Open this file with a text editor of your choice (I use <code>vi</code> here).</p>
<pre><code>sudo vi /etc/bind/named.conf.local</code></pre>
<p>Ignore the commented areas and add a zone definition for your domain to this file.</p>
<pre><code>zone "mydomain.lan" IN {
&nbsp;&nbsp;&nbsp; type master;
&nbsp;&nbsp;&nbsp; file "/etc/bind/zones/mydomain.lan.db";
};</code></pre>
<p>Add a reverse DNS zone definition as well. This will allow the server to map IP addresses to domain names.</p>
<pre><code>zone "1.168.192.in-addr.arpa" {
&nbsp;&nbsp;&nbsp; type master;
&nbsp;&nbsp;&nbsp; file "/etc/bind/zones/rev.1.168.192.in-addr.arpa";
};</code></pre>
<h3>Create DNS Records</h3>
<p>The zone definitions in the previous section refer to files that will contain details about our network mapping. The <code>mydomain.lan.db</code> file will contain records of the hostname-to-IP address mappings of your domain. The <code>rev.1.168.192.in-addr.arpa</code> file will contain &#8220;reverse&#8221; IP address-to-hostname records. Make a directory to hold these files and open <code>mydomain.lan.db</code>.</p>
<pre><code>sudo mkdir /etc/bind/zones
sudo vi /etc/bind/zones/mydomain.lan.db</code></pre>
<p>For the fictitious domain considered here <code>mydomain.lan.db</code> is edited to look like the following.</p>
<pre><code>; Use semicolons to add comments.
; Host-to-IP Address DNS Pointers for mydomain.lan
; Note: The extra "." at the end of addresses are important.
; The following parameters set when DNS records will expire, etc.
; Importantly, the serial number must always be iterated upward to prevent
; undesirable consequences. A good format to use is YYYYMMDDI where
; the I index is in case you make more that one change in the same day.
mydomain.lan. IN SOA john.mydomain.lan. hostmaster.mydomain.lan. (
&nbsp;&nbsp;&nbsp; 200709131 ; serial
&nbsp;&nbsp;&nbsp; 8H ; refresh
&nbsp;&nbsp;&nbsp; 4H ; retry
&nbsp;&nbsp;&nbsp; 4W ; expire
&nbsp;&nbsp;&nbsp; 1D ; minimum
)
; NS indicates that john is the name server on mydomain.lan
; MX indicates that john is (also) the mail server on mydomain.lan
mydomain.lan.    IN NS  john.mydomain.lan.
mydomain.lan. IN MX 10 john.mydomain.lan.
; Set an alias (canonical name) for paul
www   IN  CNAME  paul.mydomain.lan.
; Set the address for localhost.mydomain.lan
localhost &nbsp;&nbsp; IN A 127.0.0.1
; Set the hostnames in alphabetical order
george &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IN A 192.168.1.51
john &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IN A 192.168.1.99
paul &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IN A 192.168.1.50
ringo &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IN A 192.168.1.52</code></pre>
<p>After creating the reverse DNS record file</p>
<pre><code>sudo vi /etc/bind/zones/rev.1.168.192.in-addr.arpa</code></pre>
<p>it is edited to look like the following.</p>
<pre><code>; IP Address-to-Host DNS Pointers for 192.168.1.0 subnet
@ IN SOA  john.mydomain.lan. hostmaster.mydomain.lan. (
&nbsp;&nbsp;&nbsp; 200709131 ; serial
&nbsp;&nbsp;&nbsp; 8H ; refresh
&nbsp;&nbsp;&nbsp; 4H ; retry
&nbsp;&nbsp;&nbsp; 4W ; expire
&nbsp;&nbsp;&nbsp; 1D ; minimum
)
; define the authoritative name server
IN  NS   john.mydomain.lan.
; our hosts, in numeric order
99 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IN PTR john.mydomain.lan.
50 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IN PTR paul.mydomain.lan.
51 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IN PTR george.mydomain.lan.
52 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IN PTR ringo.mydomain.lan.</code></pre>
<p>Of course, your DNS records will look different then those above but hopefully by using these configurations as templates you can customize the files to your domain. To initiate your authoritative DNS server restart BIND.</p>
<pre><code>sudo /etc/init.d/bind9 restart</code></pre>
<p>Test your DNS server by typing <code>dig mydomain.lan</code> at the command prompt. All of the hosts on your local network should appear under <code>AUTHORITY SECTION</code> in the output of this command. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.fiz-ix.com/2012/12/ubuntu-dns-server-guide-bind-master-server-setup/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Set Up an Ubuntu BIND DNS Caching Name Server</title>
		<link>http://www.fiz-ix.com/2012/12/set-up-an-ubuntu-bind-dns-caching-name-server/</link>
		<comments>http://www.fiz-ix.com/2012/12/set-up-an-ubuntu-bind-dns-caching-name-server/#comments</comments>
		<pubDate>Thu, 27 Dec 2012 18:50:53 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.fiz-ix.com/?p=1243</guid>
		<description><![CDATA[In previous posts, I shared instructions for setting up a Ubuntu LAMP (Linux, Apache, mySQL, PHP) server and configuring Apache and mySQL to host new sites complete with phpmyadmin and cgi-bin access. I thought it would be useful to write a follow-up guide on setting up of an Ubuntu DNS (Domain Name Service) server on [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.fiz-ix.com/wp-content/uploads/2012/11/ubuntuLogo.png"><img src="http://www.fiz-ix.com/wp-content/uploads/2012/11/ubuntuLogo-300x135.png" alt="" title="ubuntuLogo" width="300" height="135" class="alignleft size-medium wp-image-723" /></a>In previous posts, I shared instructions for <a href="http://www.fiz-ix.com/2012/11/how-to-setup-an-ubuntu-lamp-server-with-a-desktop-gui/" target="_blank">setting up a Ubuntu LAMP (Linux, Apache, mySQL, PHP) server</a> and <a href="http://www.fiz-ix.com/2012/12/configure-apache-mysql-and-cgi-bin-on-an-ubuntu-lamp-server/" target="_blank">configuring Apache and mySQL</a> to host new sites complete with phpmyadmin and cgi-bin access. I thought it would be useful to write a follow-up guide on setting up of an Ubuntu DNS (Domain Name Service) server on your LAN (local area network). For newcomers, DNS is a service that maps IP addresses to domain names (e.g., a public DNS server is responsible for mapping <code>www.google.com</code> to <code>173.194.75.104</code> and vise versa). There are several reasons why you may want to set up a private DNS server on you LAN. If your LAN includes more than a few machines, a private DNS server may be a more convenient way to map client host names to IP addresses then having to maintain a hosts configuration files on each client. A private DNS server can also help increase network performance by caching IP addresses of commonly visited websites instead of retrieving them from the public DNS servers maintained by ISPs at each request. This post describes how to set up a caching DNS server using BIND9 (Berkley Internet Naming Daemon Version 9), the most widely used DNS program and the DNS server that ships with Ubuntu. In a <a href="http://www.fiz-ix.com/2012/12/ubuntu-dns-server-guide-bind-master-server-setup/" target="_blank">follow-up post</a> I describe how to set up a master DNS server to serve DNS records for an imaginary domain (i.e., your LAN).</p>
<h3>Step 1: Install BIND DNS server on Ubuntu</h3>
<p>There are two ways to install BIND on Ubuntu. If you are performing a fresh installation of Ubuntu Server Edition as per <a href="http://www.fiz-ix.com/2012/11/how-to-setup-an-ubuntu-lamp-server-with-a-desktop-gui/" target="_blank">this post</a>, at some point the install shell will ask if you wish to install a DNS and/or LAMP server. Select DNS (and LAMP if you so desire using the arrow keys and spacebar) and continue (using tab and enter). On the other hand, if you have already completed the installation of your LAMP server then use Ubuntu&#8217;s built in package management program <code>apt-get</code> to install BIND. Open a terminal and type</p>
<pre><code>sudo apt-get update
sudo apt-get install bind9</code></pre>
<p>You may need to insert the Ubuntu install CD to perform this installation.</p>
<h3>Step 2: Configure BIND Caching DNS server</h3>
<p>By default, BIND installs on Ubuntu configured to act as a caching DNS server. However, you need to edit the configuration options file <code>/etc/bind/named.conf.options</code> to specify a public DNS server operating on the wide area network (WAN) to which un-cached domain names should be forwarded. Open this file with the text editor of your choice (I use <code>vi</code> here).</p>
<pre><code>sudo vi /etc/bind/named.conf.options</code></pre>
<p>Uncomment and edit the <code>forwarders</code> section of this file to point to your internet service provider&#8217;s DNS server. You may enter multiple DNS server addresses (separated by semicolons) if you desire. When finished, the <code>forwarders</code> section should look like the following with the <code>xxx.xxx.xxx.xxx</code> replaced with the appropriate IP address(es).</p>
<pre><code>forwarders {
xxx.xxx.xxx.xxx;
xxx.xxx.xxx.xxx;
};</code></pre>
<p>You must also edit the <code>/etc/resolv.conf</code> configuration file of all machines on your LAN (including the DNS server itself) to point to your new DNS server. Open this file</p>
<pre><code>vi /etc/resolv.conf</code></pre>
<p>and add</p>
<pre><code>nameserver xxx.xxx.xxx.xxx</code></pre>
<p>to the top of the file where <code>xxx.xxx.xxx.xxx</code> is the IP address of your new DNS server. When configuring the DNS server itself, change the <code>nameserver</code> address to <code>127.0.0.1</code>, which points to <code>localhost</code>. You may delete any additional <code>nameserver</code> lines appearing in the <code>resolv.conf</code> file although it may be prudent to leave lines in place that point to your ISP&#8217;s DNS server so that client machines continue to function in the event of your server going offline (just make sure your DNS server is listed first). To implement the changes to your DNS server, restart BIND.</p>
<pre><code>sudo /etc/init.d/bind9 restart</code></pre>
<p>Finally, test your server by typing the following command in a terminal on any machine on your LAN configured to use your new DNS server.</p>
<pre><code>dig www.fiz-ix.com</code></pre>
<p>Near the end of the output of this command there should be a line that reads <code>Query time: 24 ms</code> (of course the actual time may be different). Execute the <code>dig www.fiz-ix.com</code> command again and you should notice that the query time significantly decreased indicating that your DNS server is caching DNS information for <code>www.fiz-ix.com</code>. Note that BIND caches DNS information to RAM and not disk. In most cases this will not be a problem since most machines have plenty of memory and old records are purged from memory after a period of time. However, if you expect your server to get a lot of traffic you may want to periodically flush the cache using</p>
<pre><code>sudo rndc -s localhost flush</code></pre>
<p>or set the maximum amount of memory to use (in essence forcing overflow data to be deleted before it expires) by setting the <code>max-cache-size</code> option in the configuration file.</p>
<p><strong>Congratulations!</strong> you are finished setting up your Ubuntu caching name server.  See my next <a href="http://www.fiz-ix.com/2012/12/ubuntu-dns-server-guide-bind-master-server-setup/" target="_blank">post</a> where I discuss configuring a master DNS server to serve hostnames to machines on your LAN.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fiz-ix.com/2012/12/set-up-an-ubuntu-bind-dns-caching-name-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Free Discounted Cash Flow (DCF) Stock Valuation Google Spreadsheet (Version 2.0)</title>
		<link>http://www.fiz-ix.com/2012/12/new-and-improved-discounted-cash-flow-dcf-stock-valuation-google-spreadsheet/</link>
		<comments>http://www.fiz-ix.com/2012/12/new-and-improved-discounted-cash-flow-dcf-stock-valuation-google-spreadsheet/#comments</comments>
		<pubDate>Sun, 23 Dec 2012 18:15:24 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Notebooks]]></category>
		<category><![CDATA[Stock Valuation]]></category>
		<category><![CDATA[Stock Valuations]]></category>

		<guid isPermaLink="false">http://www.fiz-ix.com/?p=1309</guid>
		<description><![CDATA[I&#8217;ve just finished updating my stock valuation spreadsheet. Here are some highlights of version 2.0. Value is calculated using the twenty-year discounted cash flow method. It uses ten years of financial statements instead of five. Free cash flow is estimated using Warren Buffet&#8217;s &#8220;owner earnings&#8221; instead of the free cash flow reported on the company&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just finished updating my stock valuation spreadsheet. Here are some highlights of version 2.0. Value is calculated using the twenty-year discounted cash flow method. It uses ten years of financial statements instead of five. Free cash flow is estimated using Warren Buffet&#8217;s &#8220;owner earnings&#8221; instead of the free cash flow reported on the company&#8217;s cash flow statement. The company&#8217;s growth rate is estimated using 75% of the company&#8217;s average cash return on invested capital (CROIC) over the past ten years. </p>
<p>Because this is a google spreadsheet, it can be run on any computer with an internet browser and does not require expensive software like Microsoft Excel. To use the spreadsheet, simply enter the ticker symbol for the company you want to investigate on the &#8216;Summary&#8217; sheet and press enter. The code automatically downloads ten years of financial data and calculates a per share value for the company. This spreadsheet does in 5 seconds what used to take me about an hour. There are several preferences you can modify to change how conservative you wish to be in your analysis. <a href="https://docs.google.com/spreadsheet/ccc?key=0AsDhxDwhwS7adHdZVVV6eTBTT2t1RVktR09WSndyZVE&#038;usp=sharing" target="_blank">Click here to download the spreadsheet</a>. The images below are examples of the output generated by the spreadsheet.</p>
<p><a href="http://www.fiz-ix.com/wp-content/uploads/2012/12/mrvl_dcf.jpg"><img src="http://www.fiz-ix.com/wp-content/uploads/2012/12/mrvl_dcf.jpg" alt="" title="mrvl_dcf" width="400" height="651" class="aligncenter size-full wp-image-1305" /></a></p>
<p><a href="http://www.fiz-ix.com/wp-content/uploads/2012/12/mrvl_chart.jpg"><img src="http://www.fiz-ix.com/wp-content/uploads/2012/12/mrvl_chart.jpg" alt="" title="mrvl_chart" width="400" height="256" class="aligncenter size-full wp-image-1306" /></a></p>
<p>My spreadsheet is free while other valuation spreadsheets on the internet cost money (see for example <a href="www.oldschoolvalue.com" target=_blank>Old School Value</a>) because of its simple design and limited functionality, and I am offering it without a guarantee that it will work for all companies. I tested it and it works for most of the DJIA companies so long as they had (mostly) positive owner earnings during the last ten years. You probably don&#8217;t want to invest is companies that have had negative owner earnings recently anyways. It is meant for academic purposes only and any investing decisions should be based on a thorough analysis of the prospective company&#8217;s financial statements and fillings. That said, if you have any problems with the spreadsheet, leave a comment on one of my stock valuation posts and I will try to help you out.</p>
<p><a href="https://docs.google.com/spreadsheet/ccc?key=0AsDhxDwhwS7adHdZVVV6eTBTT2t1RVktR09WSndyZVE&#038;usp=sharing" target="_blank">CLICK HERE TO DOWNLOAD</a></p>
<p>You must have a Google account to view and copy the spreadsheet. The spreadsheet is initially read only. Open the spreadsheet and select <code>File > Make a copy...</code> and save it to your Google Drive with whatever name you wish. Now you can change the ticker symbol and default parameters to begin valuing companies.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fiz-ix.com/2012/12/new-and-improved-discounted-cash-flow-dcf-stock-valuation-google-spreadsheet/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Configure Apache, mySQL, and cgi-bin on an Ubuntu LAMP Server</title>
		<link>http://www.fiz-ix.com/2012/12/configure-apache-mysql-and-cgi-bin-on-an-ubuntu-lamp-server/</link>
		<comments>http://www.fiz-ix.com/2012/12/configure-apache-mysql-and-cgi-bin-on-an-ubuntu-lamp-server/#comments</comments>
		<pubDate>Thu, 20 Dec 2012 20:41:33 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.fiz-ix.com/?p=1241</guid>
		<description><![CDATA[In a previous post, I shared step-by-step instructions for setting up a Ubuntu LAMP (Linux, Apache, mySQL, PHP) server on your local area network (LAN). I also showed how you could customize the server installation to include all of the niceties of Ubuntu&#8217;s Desktop GUI. If this installation was successful, you should be able to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.fiz-ix.com/wp-content/uploads/2012/11/ubuntuLogo.png"><img src="http://www.fiz-ix.com/wp-content/uploads/2012/11/ubuntuLogo-300x135.png" alt="" title="ubuntuLogo" width="300" height="135" class="alignleft size-medium wp-image-723" /></a></p>
<p>In a <a href="http://www.fiz-ix.com/2012/11/how-to-setup-an-ubuntu-lamp-server-with-a-desktop-gui//" target="_blank">previous post</a>, I shared step-by-step instructions for setting up a Ubuntu LAMP (Linux, Apache, mySQL, PHP) server on your local area network (LAN). I also showed how you could customize the server installation to include all of the niceties of Ubuntu&#8217;s Desktop GUI. If this installation was successful, you should be able to view the default site served by Apache (actually an index of the default site) using any machine on your LAN. Type the server&#8217;s IP address (or alias if you added the server to your <code>/etc/hosts</code> file) in your browser&#8217;s address bar or, if you are browsing on the server itself, type <code>127.0.0.1</code> or <code>localhost</code>. If an error occurs, then you will have to edit the <code>apache2.conf</code> file to ensure that Apache can fully resolve the server&#8217;s name. Out of good measure you should do this anyway, even if everything seems to be working. Use your favorite text editing program (I use vi here) and open the file.</p>
<pre><code>sudo vi /etc/apache2/apache2.conf</code></pre>
<p>Add the following line somewhere:</p>
<pre><code>ServerName localhost</code></pre>
<p>and restart Apache.</p>
<pre><code>sudo /etc/init.d/apache2 restart</code></pre>
<p>If the default site loads then you are ready to configure Apache to serve your own sites. This configuration process may not be familiar to you if someone else hosts your websites. Here I walk you through the necessary steps. Additionally, I show you how to install phpMyAdmin to administer mySQL databases and how to configure a <code>cgi-bin</code> directory to run CGI programs.</p>
<h3>Step 1: Create a new Apache site</h3>
<p>To create a new site, first create a directory where you want to keep files associated with this site. I like to keep sites in my home directory so (using my user name of jeff) I create a <code>/home/jeff/public_html</code> directory. The configuration files for all sites available to Apache are stored in the <code>/etc/apache2/sites-available/</code> directory. Create a configuration file for your new site (here called fiz-ix) by copying the configuration file for the default site.</p>
<pre><code>sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/fiz-ix</code></pre>
<p>Open the new configuration file.</p>
<pre><code>sudo vi /etc/apache2/sites-available/fiz-ix</code></pre>
<p>You will notice that there is a lot of stuff between <code>&lt;VirtualHost&gt;</code> tags. You have to edit some of this. Change the <code>DocumentRoot</code> path to point to the newly created site directory.</p>
<pre><code>DocumentRoot /home/jeff/public_html</code></pre>
<p>In a similar fashion, change one of the <code>Directory</code> directives (it looks something like this)</p>
<pre><code>&lt;Directory /var/www/&gt;</code></pre>
<p>to be consistent with your site path.</p>
<pre><code>&lt;Directory /home/jeff/public_html/&gt;</code></pre>
<p>After making these changes, disable the default site using the Apache disable site script.</p>
<pre><code>sudo a2dissite default </code></pre>
<p>Next, use the Apache enable site script to activate the new site.</p>
<pre><code>sudo a2ensite fiz-ix</code></pre>
<p>Finally, restart Apache.</p>
<pre><code>sudo /etc/init.d/apache2 restart</code></pre>
<p>Create a simple <code>index.html</code> file and save it in /home/jeff/public_html/ to test your new site. Something simple like</p>
<pre><code>&lt;html&gt;
&lt;strong&gt;Fiz-ix is Fun&lt;/strong&gt;</code></pre>
<p>Browse (preferable on another machine) to your new site to test the configuration.</p>
<h3>Step 2: Install phpmyadmin and create root mySQL user</h3>
<p>In order to make mySQL database administration easy, many hosts provide phpMyAdmin. You can easily install this tool on your Ubuntu LAMP server too using the built in package management software. At the command prompt type</p>
<pre><code>sudo apt-get update
sudo apt-get install phpmyadmin</code></pre>
<p>You may have to insert the Ubuntu install CD to complete this installation. During the installation the script will ask which version of Apache to automatically configure. If you installed apache as per this <a href="http://www.fiz-ix.com/2012/11/how-to-setup-an-ubuntu-lamp-server-with-a-desktop-gui/" target="_blank">previous post</a> then select <code>apache2</code> (with space bar) and continue. After the install completes, the phpMyAdmin script should be in the <code>/usr/share/</code>directory and (after restarting Apache; see above) it should resolve in your browser when you type <code>localhost/phpmyadmin</code> (or <code>xxx.xxx.xxx.xxx/phpmyadmin</code>). If it doesn&#8217;t, you must add the following alias and include to the bottom of the apache configuration file <code>apache2.conf</code> in <code>/etc/apache2/</code>.</p>
<pre><code>Include /etc/phpmyadmin/apache.conf
Alias /phpmyadmin /usr/share/phpmyadmin</code></pre>
<p>You can log in by using root as your username and the root password configured during the mySQL installation (if you decided not to enter a mySQL password or were not prompted for a password then the password field is blank by default). Once logged on to phpMyAdmin, you can set a new root password by navigating to the privileges page, clicking the icon that looks like a pencil next to each root account (there may be more than one), and entering a password in the appropriate field of the page that loads.</p>
<h3>Step 3: Configure a cgi-bin directory</h3>
<p>Configuring Apache to allow CGI program execution is pretty easy. Create a directory to be used for CGI programs (here I create <code>/home/jeff/public_html/cgi-bin</code>) and add the following to the site configuration file (again between the <code>&lt;VirtualHost&gt;</code> tags).</p>
<pre><code>ScriptAlias /cgi-bin/ /home/jeff/public_html/cgi-bin/
&lt;Directory /home/jeff/public_html/cgi-bin/&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Options ExecCGI
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddHandler cgi-script cgi pl
&lt;/Directory&gt;</code></pre>
<p>The first line creates an alias that points to the directory in which CGI scripts are stored. The final line tells Apache that only files that end with the *.cgi and *.pl extensions should be considered CGI programs and executed.</p>
<p><strong>Congratulations!</strong> Your new site is configured. It is worth mentioning that if you are going to be granting computers on the wide area network access to your new Ubuntu LAMP server, you should take some time to learn how to properly secure Apache. Check out these other sites for more information on configuring Apache under Ubuntu. <a href="https://help.ubuntu.com/community/ApacheMySQLPHP">Ubuntu Community</a>, <a href="http://httpd.apache.org/docs/2.2/">Apache2.2 Documentation</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.fiz-ix.com/2012/12/configure-apache-mysql-and-cgi-bin-on-an-ubuntu-lamp-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft (MSFT) – Discounted Cash Flow Valuation is a Strong Argument to Buy</title>
		<link>http://www.fiz-ix.com/2012/12/microsoft-msft-discounted-cash-flow-valuation-is-a-strong-argument-to-buy/</link>
		<comments>http://www.fiz-ix.com/2012/12/microsoft-msft-discounted-cash-flow-valuation-is-a-strong-argument-to-buy/#comments</comments>
		<pubDate>Thu, 20 Dec 2012 20:28:05 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Notebooks]]></category>
		<category><![CDATA[Stock Valuation]]></category>
		<category><![CDATA[Stock Valuations]]></category>

		<guid isPermaLink="false">http://www.fiz-ix.com/?p=1292</guid>
		<description><![CDATA[An analysis using my Free Twenty-Year Discounted Cash Flow Valuation Spreadsheet says that Microsoft (MSFT) is a strong buy. Microsoft, like Oracle and Dell and Intel, is a member of the old guard of the technology sector. The company is king of a maturing market, namely personal computers, and has little presence in the mobile [...]]]></description>
			<content:encoded><![CDATA[<p>An analysis using my <a href="http://www.fiz-ix.com/store/" target="_blank">Free Twenty-Year Discounted Cash Flow Valuation Spreadsheet</a> says that Microsoft (MSFT) is a strong buy. Microsoft, like Oracle and Dell and Intel, is a member of the old guard of the technology sector. The company is king of a maturing market, namely personal computers, and has little presence in the mobile market yet. Nevertheless, Microsoft has a moat if there ever was one. Most of the world&#8217;s computers use Windows and, as anyone who has tried to use an iPad to do real work can tell you, the PC is going to be around for a long time. Besides, Microsoft is a cash cow and has grown free-cash flow in a uniform manner few companies can match (see the graph below). My analysis assuming a huge 50% margin of safety yields a per share value of $32.83, which is above today&#8217;s (12/20/12) opening prices. See the results of my analysis below. <a href="http://www.fiz-ix.com/store/" target="_blank">Click here to downloads my free spreadsheet</a>.</p>
<p><a href="http://www.fiz-ix.com/wp-content/uploads/2012/12/msft_dcf.jpg"><img src="http://www.fiz-ix.com/wp-content/uploads/2012/12/msft_dcf.jpg" alt="" title="msft_dcf" width="400" height="627" class="aligncenter size-full wp-image-1293" /></a><br />
<a href="http://www.fiz-ix.com/wp-content/uploads/2012/12/msft_dcf_chart.jpg"><img src="http://www.fiz-ix.com/wp-content/uploads/2012/12/msft_dcf_chart.jpg" alt="" title="msft_dcf_chart" width="400" height="293" class="aligncenter size-full wp-image-1294" /></a></p>
<p>Disclosure: I am long MSFT</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fiz-ix.com/2012/12/microsoft-msft-discounted-cash-flow-valuation-is-a-strong-argument-to-buy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Free Discounted Cash Flow Stock Valuation Spreadsheet</title>
		<link>http://www.fiz-ix.com/2012/12/discounted-cash-flow-stock-valuation-spreadsheet/</link>
		<comments>http://www.fiz-ix.com/2012/12/discounted-cash-flow-stock-valuation-spreadsheet/#comments</comments>
		<pubDate>Thu, 20 Dec 2012 18:49:05 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Notebooks]]></category>
		<category><![CDATA[Stock Valuation]]></category>
		<category><![CDATA[Stock Valuations]]></category>

		<guid isPermaLink="false">http://www.fiz-ix.com/?p=1288</guid>
		<description><![CDATA[Price: Free Use this automated google spreadsheet to quickly value companies you are thinking of investing in. The spreadsheet using a twenty-year discounted cash flow method like the method Warren Buffet uses. To use the spreadsheet, simply enter the ticker symbol for the company you want to investigate on the &#8216;Summary&#8217; page and your preferences [...]]]></description>
			<content:encoded><![CDATA[<h1>Price: Free</h1>
<p>Use this automated google spreadsheet to quickly value companies you are thinking of investing in. The spreadsheet using a twenty-year discounted cash flow method like the method Warren Buffet uses. To use the spreadsheet, simply enter the ticker symbol for the company you want to investigate on the &#8216;Summary&#8217; page and your preferences and the code automatically downloads five years of financial data and calculates a per share value for the company. This spreadsheet does in 5 seconds what used to take me about an hour. </p>
<p><a href="http://www.fiz-ix.com/wp-content/uploads/2012/12/dcfss_small.jpg"><img src="http://www.fiz-ix.com/wp-content/uploads/2012/12/dcfss_small.jpg" alt="" title="dcfss_small" width="400" class="aligncenter size-medium wp-image-1264" /></a></p>
<p><a href="http://www.fiz-ix.com/wp-content/uploads/2012/12/dcfchart_small.png"><img src="http://www.fiz-ix.com/wp-content/uploads/2012/12/dcfchart_small.png" alt="" title="dcfchart_small" width="400" height="293" class="aligncenter size-full wp-image-1267" /></a></p>
<p>Click on the link below to get the spreadsheet. You must have a Google account to view and copy the spreadsheet. It is initially read only. Open the spreadsheet and select <code>File > Make a copy...</code> and save it to your Google Drive with whatever name you wish. Now you can change the ticker symbol and default parameters to begin valuing companies.</p>
<p><a href="https://docs.google.com/spreadsheet/ccc?key=0AsDhxDwhwS7adHdZVVV6eTBTT2t1RVktR09WSndyZVE&#038;usp=sharing" target="_blank">LINK TO SPREADSHEET</a> </p>
<p>I can not guarantee that the spreadsheet will work for all companies. I tested it and it works for all of the DJIA companies so long as they have positive cash-flow for the last five years. You don&#8217;t want to invest is companies that have had negative cash flow recently anyways. It is meant for academic purposes only and any investing decisions should be based on a thorough analysis of the prospective company&#8217;s financial statements and fillings. That said, if you have any problems with the spreadsheet, leave a comment below and I will try to help you out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fiz-ix.com/2012/12/discounted-cash-flow-stock-valuation-spreadsheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Intel (INTC) – Discounted Cash Flow Valuation Analysis</title>
		<link>http://www.fiz-ix.com/2012/12/intel-intc-discounted-cash-flow-valuation-analysis/</link>
		<comments>http://www.fiz-ix.com/2012/12/intel-intc-discounted-cash-flow-valuation-analysis/#comments</comments>
		<pubDate>Thu, 20 Dec 2012 16:42:57 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Notebooks]]></category>
		<category><![CDATA[Stock Valuation]]></category>
		<category><![CDATA[Stock Valuations]]></category>

		<guid isPermaLink="false">http://www.fiz-ix.com/?p=1276</guid>
		<description><![CDATA[An analysis using my Free Twenty-Year Discounted Cash Flow Valuation Spreadsheet says that Intel is a strong buy. Intel has lately faced some headwinds cracking into the mobile market. To take this into account I assumed a gigantic 50% margin of safety, a huge amount for such a strong company with a dividend yield of [...]]]></description>
			<content:encoded><![CDATA[<p>An analysis using my <a href="http://www.fiz-ix.com/store/" target="_blank">Free Twenty-Year Discounted Cash Flow Valuation Spreadsheet</a> says that Intel is a strong buy. Intel has lately faced some headwinds cracking into the mobile market. To take this into account I assumed a gigantic 50% margin of safety, a huge amount for such a strong company with a dividend yield of over 4%. My analysis yields a per share value of $44.52 that with my margin of safety yields a recommended purchase price $22.26, above today&#8217;s (12/20/12) opening prices. See the results of my analysis below. <a href="http://www.fiz-ix.com/store/" target="_blank">Click here to download my free spreadsheet</a>.</p>
<p><a href="http://www.fiz-ix.com/wp-content/uploads/2012/12/dcfss_small.jpg"><img src="http://www.fiz-ix.com/wp-content/uploads/2012/12/dcfss_small.jpg" alt="" title="dcfss_small" width="400" height="630" class="aligncenter size-full wp-image-1264" /></a><br />
<a href="http://www.fiz-ix.com/wp-content/uploads/2012/12/dcfchart_small.png"><img src="http://www.fiz-ix.com/wp-content/uploads/2012/12/dcfchart_small.png" alt="" title="dcfchart_small" width="400" height="293" class="aligncenter size-full wp-image-1267" /></a></p>
<p>Disclosure: I am long INTC</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fiz-ix.com/2012/12/intel-intc-discounted-cash-flow-valuation-analysis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss><!-- Dynamic page generated in 1.519 seconds. --><!-- Cached page generated by WP-Super-Cache on 2013-05-18 08:22:50 -->
