<?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>FettesPS &#187; Linux</title>
	<atom:link href="http://www.fettesps.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fettesps.com</link>
	<description>Fettes Programming Solutions</description>
	<lastBuildDate>Sun, 22 Jan 2012 18:21:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Download Every File of a Certain Extension on a Site</title>
		<link>http://www.fettesps.com/download-every-file-of-a-certain-extension-on-a-site/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=download-every-file-of-a-certain-extension-on-a-site</link>
		<comments>http://www.fettesps.com/download-every-file-of-a-certain-extension-on-a-site/#comments</comments>
		<pubDate>Sun, 22 Jan 2012 18:21:51 +0000</pubDate>
		<dc:creator>FettesPS</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[stock music]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[wget]]></category>

		<guid isPermaLink="false">http://www.fettesps.com/?p=1754</guid>
		<description><![CDATA[Today I was editing some video for Youtube and was looking for some free stock music. I ended up at a site I&#8217;ve seen many times before, DanoSongs.com, but haven&#8217;t really ended up using since finding a song involves going through a long list and playing them in an embedded player and then downloading the [...]]]></description>
			<content:encoded><![CDATA[<p>Today I was editing some video for Youtube and was looking for some free stock music. I ended up at a site I&#8217;ve seen many times before, <a href="http://www.danosongs.com">DanoSongs.com</a>, but haven&#8217;t really ended up using since finding a song involves going through a long list and playing them in an embedded player and then downloading the one you want.  What I wanted to do was download every MP3 and put them in a folder that I have full of stock music and then when inside my video editing software I can preview it along with the rest.  So here&#8217;s the command I used:</p>
<pre class="brush: plain; title: ; notranslate">wget -r -l1 -H -t1 -nd -N -np -A.mp3 -erobots=off http://www.danosongs.com/</pre>
<p>This is of course done with wget, a powerful command line utility for Linux. To tweak the command all you need to do is replace the URL with the page you&#8217;d like to scrape and then replace &#8220;mp3&#8243; with whatever file you&#8217;d like to grab. So you could easily scrape a page for all .png files or .docx files if you wanted. </p>
<p>Enjoy</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fettesps.com/download-every-file-of-a-certain-extension-on-a-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to find the Path of an Installed Program in Ubuntu</title>
		<link>http://www.fettesps.com/how-to-find-the-path-of-an-installed-program-in-ubuntu/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-find-the-path-of-an-installed-program-in-ubuntu</link>
		<comments>http://www.fettesps.com/how-to-find-the-path-of-an-installed-program-in-ubuntu/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 23:34:47 +0000</pubDate>
		<dc:creator>FettesPS</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.fettesps.com/?p=1736</guid>
		<description><![CDATA[Back in my FreeBSD days I relied heavily on the locate command to find out where things were installed. Since switching to Debian based Linux I&#8217;ve found that command to be far less reliable. The reason for this is it relies on a database that is almost always out of date. Now this is also [...]]]></description>
			<content:encoded><![CDATA[<p>Back in my FreeBSD days I relied heavily on the <i>locate</i> command to find out where things were installed.  Since switching to Debian based Linux I&#8217;ve found that command to be far less reliable.  The reason for this is it relies on a database that is almost always out of date.  Now this is also true for FreeBSD however I never had any issues locating files with it, which makes me wonder if they automatically called it after installing apps through ports or if it ran periodically via a cron job.  So you may ask yourself, why am I not recommending this approach?  The first is that it&#8217;s slow, it takes time to update this database so running updatedb before each locate command will eat up a good 30 seconds or more (you could schedule it with cron though). The second is that it is a security risk which exposes file locations to any non root user. Well then, what do I recommend instead?</p>
<pre class="brush: bash; title: ; notranslate">dpkg -L program</pre>
<p>This will work with any program installed with apt-get, synaptic or dpkg.  It is almost much faster and secure &#8212; it will only expose installed programs and not personal files.  So let&#8217;s see an example of it&#8217;s output:</p>
<pre class="brush: bash; title: ; notranslate">fettesps@athlon3200 ~ $ dpkg -L eggdrop
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/eggdrop
/usr/share/doc/eggdrop/NEWS.gz
/usr/share/doc/eggdrop/README.Debian
/usr/share/doc/eggdrop/copyright
/usr/share/doc/eggdrop/README.gz
/usr/share/doc/eggdrop/changelog.Debian.gz
/usr/bin
/usr/bin/eggdrop
/usr/lib
/usr/lib/eggdrop
/usr/lib/eggdrop/modules
/usr/lib/eggdrop/modules/assoc.so
/usr/lib/eggdrop/modules/blowfish.so
/usr/lib/eggdrop/modules/channels.so
/usr/lib/eggdrop/modules/compress.so
/usr/lib/eggdrop/modules/console.so
/usr/lib/eggdrop/modules/ctcp.so
/usr/lib/eggdrop/modules/dns.so
/usr/lib/eggdrop/modules/filesys.so
/usr/lib/eggdrop/modules/irc.so
/usr/lib/eggdrop/modules/notes.so
/usr/lib/eggdrop/modules/seen.so
/usr/lib/eggdrop/modules/server.so
/usr/lib/eggdrop/modules/share.so
/usr/lib/eggdrop/modules/transfer.so
/usr/lib/eggdrop/modules/uptime.so
/usr/lib/eggdrop/modules/wire.so
/usr/share/doc/eggdrop/upstream</pre>
<p>Just by skimming over this I can see that the program has documentation in /usr/share/doc/eggdrop and the binary is in /usr/bin/eggdrop and lastly there are libraries in /usr/lib/eggdrop. Of course parsing this mentally requires some knowledge of the Linux file structure, but even without you should still be able to find what you need by looking in those folders.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fettesps.com/how-to-find-the-path-of-an-installed-program-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Error: DBus error org.freedesktop.DBus.Error.NoReply: Message did not receive a reply (timeout by message bus) Please select another viewer and try again</title>
		<link>http://www.fettesps.com/error-dbus-error-org-freedesktop-dbus-error-noreply-message-did-not-receive-a-reply-timeout-by-message-bus-please-select-another-viewer-and-try-again/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=error-dbus-error-org-freedesktop-dbus-error-noreply-message-did-not-receive-a-reply-timeout-by-message-bus-please-select-another-viewer-and-try-again</link>
		<comments>http://www.fettesps.com/error-dbus-error-org-freedesktop-dbus-error-noreply-message-did-not-receive-a-reply-timeout-by-message-bus-please-select-another-viewer-and-try-again/#comments</comments>
		<pubDate>Tue, 19 Apr 2011 23:00:57 +0000</pubDate>
		<dc:creator>FettesPS</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linuxmint]]></category>
		<category><![CDATA[samba]]></category>

		<guid isPermaLink="false">http://www.fettesps.com/?p=1430</guid>
		<description><![CDATA[Ever since I upgraded to the newest version of LinuxMint I&#8217;ve been getting this annoying message every time I try to navigate to my shared drives: My first instinct was to reinstall Samba, and that didn&#8217;t fix the issue. I played around with the config file a bit and then gave up and forgot about [...]]]></description>
			<content:encoded><![CDATA[<p>Ever since I upgraded to the newest version of LinuxMint I&#8217;ve been getting this annoying message every time I try to navigate to my shared drives:</p>
<pre class="brush: bash; title: ; notranslate">Error: DBus error org.freedesktop.DBus.Error.NoReply: Message did not receive a reply (timeout by message bus) Please select another viewer and try again</pre>
<p>My first instinct was to reinstall Samba, and that didn&#8217;t fix the issue.  I played around with the config file a bit and then gave up and forgot about it for some time.  Today I ran into the same issue again and decided a more aggressive approach was necessary.  Simply uninstalling it leaves behind many config files and in order to completely start over you need to purge your existing install.  To do so run these commands:</p>
<pre class="brush: bash; title: ; notranslate">sudo apt-get purge samba
sudo apt-get install samba
sudo dpkg-reconfigure nautilus</pre>
<p>After purging my installation and starting over I was then able to browse to my network shares again.  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.fettesps.com/error-dbus-error-org-freedesktop-dbus-error-noreply-message-did-not-receive-a-reply-timeout-by-message-bus-please-select-another-viewer-and-try-again/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Installing Archey on Ubuntu</title>
		<link>http://www.fettesps.com/installing-archey-on-ubuntu/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=installing-archey-on-ubuntu</link>
		<comments>http://www.fettesps.com/installing-archey-on-ubuntu/#comments</comments>
		<pubDate>Wed, 02 Feb 2011 12:58:43 +0000</pubDate>
		<dc:creator>FettesPS</dc:creator>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[archey]]></category>
		<category><![CDATA[linux mint]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.fettesps.com/?p=1022</guid>
		<description><![CDATA[Ever since the first time I saw Arch Linux in action I&#8217;ve been in love with Archey.  For those of you who don&#8217;t know, Archey is just a little script that gets your current system information and displays it in the terminal with some ascii art. My initial search for Archey on the Debian platform [...]]]></description>
			<content:encoded><![CDATA[<p>Ever since the first time I saw Arch Linux in action I&#8217;ve been in love with Archey.  For those of you who don&#8217;t know, Archey is just a little script that gets your current system information and displays it in the terminal with some ascii art.  My initial search for Archey on the Debian platform</p>
<pre class="brush: plain; title: ; notranslate">
sudo apt-get install lsb-release scrot
wget http://github.com/downloads/djmelik/archey/archey-0.2.8.deb
sudo dpkg -i archey-0.2.8.deb
</pre>
<p>If you&#8217;re running Crunchbang, which at the time of writing this article is using Ubuntu 9.04 as it&#8217;s base, you&#8217;ll need to get a more up-to-date version of coreutils or else Archey will give you the following error:</p>
<pre class="brush: plain; title: ; notranslate">
user@crunchbang:/usr/bin$ archey
df: unrecognised option '--total'
Try `df --help' for more information.
Traceback (most recent call last):
  File &quot;/usr/bin/archey&quot;, line 304, in &lt;module&gt;
    func()
  File &quot;/usr/bin/archey&quot;, line 285, in disk_display
    total = p1.splitlines()[-1]
IndexError: list index out of range
</pre>
<p>Naturally, I&#8217;d assume that anyone running a version of Ubuntu that&#8217;s 9.04 or older will encounter the same issue.  I did not run into it on my Linux Mint 8 box or my Ubuntu 10.10 box.  By typing <i>df &#8211;version</i> you&#8217;ll see that it only has 6.10 included. You&#8217;ll want at least version 7 or else your <i>df</i> command will not support the <i>&#8211;total</i> flag.  So go ahead and download the package and install it:</p>
<pre class="brush: plain; title: ; notranslate">
wget http://ftp.us.debian.org/debian/pool/main/c/coreutils/coreutils_8.5-1_i386.deb
sudo dpkg -i coreutils_8.5-1_i386.deb
</pre>
<p>Now when you run Archey it should run as expected, without any errors.  Your next step is then to add it to your .bashrc so that it executes each time you open a terminal.  Open it up with your favourite text editor and add <b>archey</b> to the end of it an dhten save it.  Now every time you open a terminal or SSH into your box you should be presented with something like this:</p>
<pre class="brush: bash; title: ; notranslate">
                          .oyhhs:   User: fettesps
                 ..--.., shhhhhh-   Hostname: fettesps-crunchbang
               -+++++++++`:yyhhyo`  OS: Ubuntu 9.04 i686
          .--  -++++++++/-.-::-`    Kernel: 2.6.28-13-generic
        .::::-   :-----:/+++/++/.   Uptime: 2 days, 4:44
       -:::::-.          .:++++++:  Window Manager: Openbox
  ,,, .:::::-`             .++++++- Shell: Bash
./+++/-`-::-                ./////: Terminal: Xterm
+++++++ .::-                        Packages: 1036
./+++/-`-::-                :yyyyyo CPU: Pentium(R) Dual-Core CPU E6300 @ 2.80GHz
  ``` `-::::-`             :yhhhhh: RAM: 266 MB / 497 MB
       -:::::-.         `-ohhhhhh+  Disk: 2.2G / 49G
        .::::-` -o+///+oyhhyyyhy:
         `.--  /yhhhhhhhy+,....
               /hhhhhhhhh-.-:::;
               `.:://::- -:::::;
                         `.-:-'
</pre>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fettesps.com/installing-archey-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Time Keeping with the Arduino and DS1302</title>
		<link>http://www.fettesps.com/time-keeping-with-the-arduino-and-ds1302/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=time-keeping-with-the-arduino-and-ds1302</link>
		<comments>http://www.fettesps.com/time-keeping-with-the-arduino-and-ds1302/#comments</comments>
		<pubDate>Thu, 16 Dec 2010 12:45:06 +0000</pubDate>
		<dc:creator>FettesPS</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[chronobox]]></category>
		<category><![CDATA[ds1302]]></category>
		<category><![CDATA[lockbox]]></category>
		<category><![CDATA[maxim ic]]></category>

		<guid isPermaLink="false">http://www.fettesps.com/?p=1120</guid>
		<description><![CDATA[The Chronobox (Part 3) After ordering a few more supplies on the weekend my shipment arrived on Wednesday, the main thing I was waiting on was a time keeping chip and I had selected the DS1302 from Maxim IC to do that job. Aside from that I got a crystal for the clock, a few [...]]]></description>
			<content:encoded><![CDATA[<h3>The Chronobox (Part 3)</h3>
<p>After ordering a few more supplies on the weekend my shipment arrived on Wednesday, the main thing I was waiting on was a time keeping chip and I had selected the DS1302 from Maxim IC to do that job.  Aside from that I got a crystal for the clock, a few mini servos, some stackable headers (to make my proto shield and motor shield stackable), push buttons, a piezo speaker and some other various headers and connectors.<br />
<a href="http://www.fettesps.com/wp-content/uploads/2010/12/ds1302_bb-e1292204405976.png"><img src="http://www.fettesps.com/wp-content/uploads/2010/12/ds1302_bb-e1292204405976.png" alt="Arduino + ds1302 Circuit (Fritzing)" title="Arduino + ds1302 Circuit (Fritzing)" width="289" height="228" class="alignright size-full wp-image-1109" style="margin: 25px 0px 0px 10px;" /></a><a href="http://www.fettesps.com/wp-content/uploads/2010/12/IMG_0607.jpg"><img src="http://www.fettesps.com/wp-content/uploads/2010/12/IMG_0607-300x225.jpg" alt="DS1302 on Protoshield" title="DS1302 on Protoshield" width="300" height="225" class="alignright size-medium wp-image-1104"  style="margin: 25px 0px 0px 10px;" /></a><br />
I was very eager to try out the clock chip and rushes straight home and went to work.  I pulled a 3V battery out of an old motherboard and popped it into a 3V battery holder I had bought a while back (note: the 3V battery and holder is represented by a piezo speaker in this diagram as there was no part for a 3V battery).  I popped that into one side of the mini breadboard on the Protoshield and installed the DS1302 on the other side.  Wiring the circuit was a breeze and I didn&#8217;t even have to pull up the data sheet.  The chip came attached to a business card sized information sheet that had the pin outs on the back.  Thank you <a href="http://www.hvwtech.com/">HVW Technologies</a>!  I&#8217;ll be using the pin labels from that card and providing the alternative marker from the Fritzing diagrams in brackets.</p>
<p>The DS1302 has two pins for power input and which ever is capable of providing more power will take over and power the clock and crystal.  <a href="http://www.fettesps.com/wp-content/uploads/2010/12/ds1302_schematic-e1292205962573.png"><img src="http://www.fettesps.com/wp-content/uploads/2010/12/ds1302_schematic-e1292205962573-150x150.png" alt="DS1302 Schematic (Fritzing)" title="DS1302 Schematic (Fritzing)" width="150" height="150" class="alignleft size-thumbnail wp-image-1129" style="margin: 5px 10px 5px 0px;" /></a> So I hooked the Vcc1 (V+) to the 3.3v pin and the Vcc2 (Vbat) to the 3v battery. The idea being that if I unplug the device (USB or power adapter) the 3.3v pin will stop providing power to circuit and the battery will seamlessly take over so no time is lost.  When the circuit regains power the DS1302 has a built in trickle charge circuit that will charge up the 3v battery for you.  The X1 and X2 pins are bridge with a crystal, the ground to the ground rail of course and the remaining three pins are SCLK, I/O and RST (CE) are run to pins 7, 6 and 5, respectively.  </p>
<p>The code was very simple and was all build on the <a href="http://quadpoint.org/projects/arduino-ds1302">RTC Library</a> which I found on the Arduino site.  The code is very rough at this point and just prints the time every second over serial, during the range of 9pm to midnight it will print Unlocked and all other hours will print Locked.  Eventually the code will be altered to query the locked/unlocked status on button press and if it falls within the time range the servo will unlock the box.</p>
<pre class="brush: plain; title: ; notranslate">//  @author: Brad Fettes &lt;http://www.fettesps.com&gt;
//  @thanks: Matt Sparks &lt;http://quadpoint.org/projects/arduino-ds1302&gt;
//  @date: December 9, 2010
//  @purpose: Check the ds1302 to see if the chronobox should be locked or unlocked

#include &lt;stdio.h&gt;
#include &lt;string.h&gt;
#include &lt;DS1302.h&gt;

// Set the appropriate digital I/O pin connections
uint8_t CE_PIN   = 5;	// RST
uint8_t IO_PIN   = 6;
uint8_t SCLK_PIN = 7;

// Create a DS1302 object
DS1302 rtc(CE_PIN, IO_PIN, SCLK_PIN);

// Create buffers
char buf[50];
char day[10];

// Thanks to the Arduino library...
void check_alarms() {
  // Get the current time and date from the chip
  Time t = rtc.time();

  // Name the day of the week
  memset(day, 0, sizeof(day));  // clear day buffer 

  // Check the hour
  snprintf(
             buf, sizeof(buf), &quot;%02d:%02d:%02d&quot;,
             t.hr, t.min, t.sec
          );
  Serial.print(buf);
  Serial.print(&quot; - &quot;);
  switch (t.hr) {
    case 21: // After 9 pm
      Serial.println(&quot;UNLOCKED&quot;);
      break;

    case 22: // After 10 pm
      Serial.println(&quot;UNLOCKED&quot;);
      break;

    case 23: // After 11 pm
      Serial.println(&quot;UNLOCKED&quot;);
      break;

    default:
      Serial.println(&quot;LOCKED&quot;);
  }
  Serial.println();
}

void set_time() {
  /*
     Initialize a new chip by turning off write protection and clearing the
     clock halt flag. These methods needn't always be called. See the DS1302
     datasheet for details.
  */
  rtc.write_protect(false);
  rtc.halt(false);

  // Make a new time object to set the date and time
  Time t(2010, 12, 9, 11, 11, 0, 4);  // e.g. Thursday, Dec 9, 2010 at 11:11:00

  // Set the time and date on the chip
  rtc.time(t);
}

void setup() {
  // Ensure that we have a few seconds to upload code
  delay(2500);

  // then start serial communication
  Serial.begin(9600); 

  // Uncomment to set the time to the one defined above
  // make sure to upload it again uncommented or it will reset
  // the date each time gets powered up
  //set_time();
}

/* Loop and print the time every second */
void loop() {
  check_alarms(); // Lock or Unlock
  delay(1000); // wait one sec
}
</pre>
<p>The next step here is to combine this sketch with the one from <a href="controlling-a-lock-with-an-arduino-and-a-servo">Part 2</a> where I controlled a locking mechanism with a servo.  I will also need a way to provide feedback to the user by a piezo or LCD panel.  Stay tuned for Part 4 which will be posted just after the new year.  Happy holidays!</p>
<p><b>Download the Project Files:</b><br />
<a href="http://www.fettesps.com/files/lockbox-ds1302.fz">Frizing Project</a><br />
<a href="http://www.fettesps.com/files/lockbox-ds1302.pde">Arduino Code</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.fettesps.com/time-keeping-with-the-arduino-and-ds1302/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Controlling a Lock with an Arduino and a Servo</title>
		<link>http://www.fettesps.com/controlling-a-lock-with-an-arduino-and-a-servo/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=controlling-a-lock-with-an-arduino-and-a-servo</link>
		<comments>http://www.fettesps.com/controlling-a-lock-with-an-arduino-and-a-servo/#comments</comments>
		<pubDate>Wed, 15 Dec 2010 12:48:23 +0000</pubDate>
		<dc:creator>FettesPS</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[fritzing]]></category>
		<category><![CDATA[lockbox]]></category>

		<guid isPermaLink="false">http://www.fettesps.com/?p=1101</guid>
		<description><![CDATA[The Chronobox &#8211; Part 2 The other day I wrote about a project I was building that was a time based lockbox which I have now dubbed the &#8220;Chronobox.&#8221; Much like the Reverse Geocache this lockbox can only be opened from the inside and that will only happen if a certain set of parameters are [...]]]></description>
			<content:encoded><![CDATA[<h3>The Chronobox &#8211; Part 2</h3>
<p>The other day <a href="http://www.fettesps.com/arduino-prototyping-with-fritzing/">I wrote about a project</a> I was building that was a time based lockbox which I have now dubbed the &#8220;Chronobox.&#8221;  Much like the Reverse Geocache this lockbox can only be opened from the inside and that will only happen if a certain set of parameters are met.  In this case, that parameter is time.</p>
<p>Today, rather than focusing on Fritzing, I&#8217;ll be starting to cover some builds I&#8217;ve done on the protoshield to get familiar with each of the components needed for this project as well as to try out a few different locking mechanisms I&#8217;ve had on my mind.  <a href="http://www.fettesps.com/wp-content/uploads/2010/12/IMG_0592.jpg"><img class="alignleft size-medium wp-image-1105" title="Arduino Pushbutton Servo" src="http://www.fettesps.com/wp-content/uploads/2010/12/IMG_0592-300x225.jpg" alt="" width="300" height="225" style="margin: 5px 10px 0px 0px;" /></a>The first will be a simple circuit used to control a servo which will open a latch. My setup is just a standard blue Arduino Duemilanove and a <a href="http://www.adafruit.com/index.php?main_page=product_info&amp;cPath=17_21&amp;products_id=51">Proto Shield</a> from Adafruit with a mini breadboard fastened on top.  I also have a <a href="http://www.adafruit.com/index.php?main_page=product_info&amp;cPath=17_21&amp;products_id=81">motor shield</a> from Adafruit as well but I need to remove the current headers and replace them with stackable headers before its of any use to me, why all shields font come with these by default is beyond me.  My final configuration will likely be built out on a Hardcopy (which is apparently now known as the <a href="http://www.spikenzielabs.com/SpikenzieLabs/Prototino.html">Protino</a>).</p>
<p>Wiring the circuit was quite simple, I took 3 break away header pins and slit the center divider down to the middle and pushed it into the header from the servo which then allowed me to plug the header into the bottom right of the mini breadboard.<a href="http://www.fettesps.com/wp-content/uploads/2010/12/Servo-Pushbutton-Schematic-e1292210097776.png"><img class="alignright size-thumbnail wp-image-1153" style="background: white; padding: 5px 5px 5px 5px; margin-left: 15px; margin-top: 5px;" title="Arduino Servo/Pushbutton - Schematic" src="http://www.fettesps.com/wp-content/uploads/2010/12/Servo-Pushbutton-Schematic-e1292210097776-150x150.png" alt="Arduino Servo/Pushbutton - Schematic" width="150" height="150" /></a>The black wire was ran to the ground rail and the red wire run to the 5v rail (if you&#8217;re not using a proto shield you can just run them directly to the ground and 5v pins on the arduino).  The yellow control wire was run to on of the Digital PWM pins (Pin 9 in my case).  The switch was wired by running a ground wire with a 1k Ohm resistor bridging the gap and a wire run to the 5v rail.  Another line is then run from Digital pin 10 to a position between the 1k Ohm resistor and the push button.  When the button is idle the current will run from the ground, through the resistor into the input pin giving you a reading of low and when you press the button 5v is sent through the circuit into a the digital pin which will cause it to read high.  The resistor is there to stop the 5v current from running directly to the ground instead of the digital pin.</p>
<p><a href="http://www.fettesps.com/wp-content/uploads/2010/12/Servo-Pushbutton021.png"><img class="aligncenter size-medium wp-image-1152" style="background: white; padding: 5px;" title="Servo-Pushbutton 02 (Fritzing)" src="http://www.fettesps.com/wp-content/uploads/2010/12/Servo-Pushbutton021-e1292209747403-300x157.png" alt="Servo-Pushbutton 02 (Fritzing)" width="300" height="157" /></a></p>
<p>The code is pretty straight forward and is a combination of the Sweep and Button examples that came with the platform.  The pushbutton will be set to pin 10 for input and the LED pin will be pin 9 set for output and the servo will be attached to pin 5.  If you aren&#8217;t using the Protoshield you can skip the LED or just use the built in LED and 1k Ohm resistor on pin 13 instead.  When the button is pressed the LED pin will be set high and using the servo library I&#8217;ll be rotating between two positions which through experimentation I&#8217;ve determine to be just the right arc to lock or unlock the box.</p>
<pre class="brush: plain; title: ; notranslate">// @author : Brad Fettes &lt;http://www.fettesps.com&gt;
// @date   : Dec 04, 2010
// @thanks : Sweep by BARRAGAN &lt;http://barraganstudio.com&gt;
//		   : Button by Tom Igoe &lt;http://www.arduino.cc/en/Tutorial/Button&gt;

#include &lt;Servo.h&gt;

int inputPin = 10;      // Push button input pin
int btnVal = 0;         // Current value of pushbutton

int ledPin = 5;			// Pin for Green LED built into proto shield

int outputPin = 9;      // Servo pin
int servo_pos = 0;      // Current servo position
int servo_pos_a = 20;   // Position destination a
int servo_pos_b = 65;   // Position destination b
int servo_state = 0;    // 0 = position a, 1 = position b

Servo mrservo;  // create servo object to control the servo

void setup() {
  pinMode(inputPin, INPUT); // Push Button
  pinMode(ledPin, OUTPUT); // LED

  mrservo.attach(outputPin);  // attaches the servo on pin 9 to the servo object

  // Debug messages via serial monitor
  Serial.begin(9600);
  Serial.println(&quot;Starting...&quot;);
}

void loop() {
  // Check to see if button is LOW or HIGH (5v)
  btnVal = digitalRead(inputPin);

  if(btnVal == LOW) {
    Serial.println(&quot;Button: LOW&quot;);
    digitalWrite(ledPin, LOW);

    if(servo_state) {
      Serial.println(&quot;Position: a&quot;);
    } else {
      Serial.println(&quot;Position: b&quot;);
    }
  }

  if(btnVal == HIGH) {
    Serial.println(&quot;Button: HIGH&quot;);
    digitalWrite(ledPin, HIGH);

    if(servo_state) {
      Serial.println(&quot;Position: a&quot;);
    } else {
      Serial.println(&quot;Position: b&quot;);
    }

    // Move from position a to position b
    if(servo_state == 0) {
      // I don't know how to concatenate
      Serial.print(servo_pos_a); Serial.print(&quot; to &quot;); Serial.println(servo_pos_b);

      for(servo_pos = servo_pos_a; servo_pos &lt; servo_pos_b; servo_pos += 1) {
        mrservo.write(servo_pos);
        delay(15);                       // waits 15ms for the servo to reach the position
      }
      servo_state = 1;

    } else {  // Move from position b to position a

      Serial.print(servo_pos_b); Serial.print(&quot; to &quot;); Serial.println(servo_pos_a);

      for(servo_pos = servo_pos_b; servo_pos &gt;= servo_pos_a ; servo_pos -= 1) {
        mrservo.write(servo_pos);
        delay(15);
      }
      servo_state = 0;
    }
  }

  // Separate each cycle's output
  Serial.println(); Serial.println();
  delay(250);
}
</pre>
<p>Here&#8217;s a video out the servo with a meccano arm attached rotating between positions A and B:</p>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/7ze09GUIRpM?fs=1&amp;hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/7ze09GUIRpM?fs=1&amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
<p><a href="http://www.fettesps.com/wp-content/uploads/2010/12/IMG_0598.jpg"><img class="alignright size-medium wp-image-1107" style="margin: 15px 0px 5px 10px;" title="Arduino Lockbox Prototype" src="http://www.fettesps.com/wp-content/uploads/2010/12/IMG_0598-300x225.jpg" alt="" width="300" height="225" /></a><a href="http://www.fettesps.com/wp-content/uploads/2010/12/IMG_0595.jpg">I sculpted a prototype out of a small box</a> I had lying around.  It isn&#8217;t perfectly to scale as it&#8217;s not nearly as tall as my lockbox but the base dimensions are about the same.  After building a few latches out of cardboard and tacks I found a design I liked and made a more permanent latch with some mecanno like materials I had. I affixed it to the front of the box and hot glued a servo in place and wrote some code to try out the lock and see how it works.</p>
<p>I ran into a bit of an issue where when it&#8217;s in its reseting state the weight of the latch pulls down on the pivot point causing the longer shaft to lift up over the center line of the pivot point so when it pushes forward again the latch spins the wrong way.  In order to prevent this from happen I took another random piece of meccano and glued it under the latch so it had a resting post.  After a few tests runs I was satisfied with this solution.</p>
<p>I&#8217;m still not sure I&#8217;m happy with this latching method, so I think I&#8217;ll be testing out some other builds before I choose which method I&#8217;ll use in my final build.  One idea that was suggested to me, which made me chuckle because it was so simple I couldn&#8217;t believe I hadn&#8217;t thought of it, is to just attach the latch itself to a servo and mount it higher up, that way you don&#8217;t have joints which could fault on you and leave you with a lockbox jammed shut.  I&#8217;ve been considering this idea as well as doubling up and having two servos locking and unlocking the box, as I don&#8217;t want someone to be able to pull it open with brute force.  On top of that I&#8217;m resisting the urge to take the Dremel to the back casing on the key lock which is built into the cash box so I can see what&#8217;s going on in there, and possibly control it with a servo instead of a key.  The built in lock is very solid and you&#8217;d never be able to pull it open with brute force.</p>
<p><strong>Download the Project Files:</strong></p>
<p><a href="http://www.fettesps.com/files/lockbox-btn+servo.fz">Frizing Project</a><br />
<a href="http://www.fettesps.com/files/lockbox-btn+servo.pde">Arduino Code</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.fettesps.com/controlling-a-lock-with-an-arduino-and-a-servo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino Prototyping with Fritzing</title>
		<link>http://www.fettesps.com/arduino-prototyping-with-fritzing/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=arduino-prototyping-with-fritzing</link>
		<comments>http://www.fettesps.com/arduino-prototyping-with-fritzing/#comments</comments>
		<pubDate>Mon, 13 Dec 2010 12:36:04 +0000</pubDate>
		<dc:creator>FettesPS</dc:creator>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[ATMega328]]></category>
		<category><![CDATA[fritzing]]></category>
		<category><![CDATA[picaxe]]></category>

		<guid isPermaLink="false">http://www.fettesps.com/?p=1090</guid>
		<description><![CDATA[It&#8217;s been a while since I&#8217;ve written about Arduinos so I thought I&#8217;d share a project that I&#8217;m working on right now. It&#8217;s somewhat similar to the Reverse Geocache box that everyone was going nuts over a while back but yet very different. I must point out that I had already started developing it before [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since I&#8217;ve written about Arduinos so I thought I&#8217;d share a project that I&#8217;m working on right now.  It&#8217;s somewhat similar to the Reverse Geocache box that everyone was going nuts over a while back but yet very different. I must point out that I had already started developing it before I found the Reverse Geocache box, I&#8217;m not sure how I missed it when everyone was going nuts about it but I was glad to find it because I got some good ideas from it and some of the copy cat builds out there.  </p>
<p>This project is also a lockbox, but it does not have a GPS for it to unlock at certain locations, rather it unlocks at certain time periods. The project will be housed in an old cash box I&#8217;ve had since I was a kid, and will make use of a DS1302 clock chip to track the time, a servo to unlock the box, a button to query the system to unlock, and a simple piezo buzzer for audio feedback.  At this point I am undecided on adding an LCD panel, but I do have an old Nokia screen that I pulled out of my first cell phone.  I also need to set up some sort of charging port or just drill a hole for the power adapter to plug into the side of the Arduino, but I&#8217;ll worry about that later.</p>
<p>Even though the Protoshield makes things quick and easy I still wanted to draw it out first as up until now the most I&#8217;d ever done was create simple circuits with one component at a time.  I decided to try out <a href="http://www.fritzing.org">Fritzing</a> as it was free and worked in Linux, though I didn&#8217;t expect much with it being in Alpha.  Turns out it&#8217;s a really solid program that makes designing circuits a breeze.  </p>
<p>Here&#8217;s a sketch I made of the Arudino + Protoshield, a buzzer, servo, DS1302 clock chip and a crystal.  I was quite surprised it had all of the components I needed, with the exception of the clock battery and holder which were strangely absent and the crystal was of a different design than what I had to work with.</p>
<p><a href="http://www.fettesps.com/wp-content/uploads/2010/12/fritzing04.png"><img src="http://www.fettesps.com/wp-content/uploads/2010/12/fritzing04-300x120.png" alt="" title="fritzing 04" width="300" height="120" class="aligncenter size-medium wp-image-1094" /></a></p>
<p>I had been playing with it for a couple of nights before I even started playing with the Schematic and PCB screens but couldn&#8217;t stop playing with them once I noticed the Autoroute button.  The designs aren&#8217;t always 100% aesthetically pleasing but it does an impressive job and I love how you watch it figure it out step by step.  The Schematic screen will be especially handy later on down the road when I finalize the design and build a bare bones Arduino with just the necessary components.</p>
<p><a href="http://www.fettesps.com/wp-content/uploads/2010/12/fritzing05.png"><img src="http://www.fettesps.com/wp-content/uploads/2010/12/fritzing05-300x120.png" alt="" title="fritzing 05" width="300" height="120" class="aligncenter size-medium wp-image-1095" /></a></p>
<p>In the past I&#8217;ve tried a few other programs such as Eagle and found myself lost.  I&#8217;m overwhelmed with options and for someone who&#8217;s new to the electrical engineering side of things it&#8217;s quite scary.  <a href="http://www.fritzing.org">Fritzing</a> manages to keep it simple while giving you the power to do what you need to do without all that other crap interfering.  <a href="http://www.fritzing.org">Fritzing</a> is an absolute must have if you are doing any sort of work with either the Arduino or Picaxe platform.</p>
<p><object width="640" height="390"><param name="movie" value="http://www.youtube.com/v/Hxhd4HKrWpg&#038;hl=en_US&#038;feature=player_embedded&#038;version=3"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.youtube.com/v/Hxhd4HKrWpg&#038;hl=en_US&#038;feature=player_embedded&#038;version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="390"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.fettesps.com/arduino-prototyping-with-fritzing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Configuring Alpine 2.0 to Access Gmail on Ubuntu x64</title>
		<link>http://www.fettesps.com/configuring-alpine-2-0-to-access-gmail-on-ubuntu-x64/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=configuring-alpine-2-0-to-access-gmail-on-ubuntu-x64</link>
		<comments>http://www.fettesps.com/configuring-alpine-2-0-to-access-gmail-on-ubuntu-x64/#comments</comments>
		<pubDate>Mon, 06 Dec 2010 03:08:09 +0000</pubDate>
		<dc:creator>FettesPS</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[alpine 2.0]]></category>
		<category><![CDATA[apt-get]]></category>
		<category><![CDATA[pico]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.fettesps.com/?p=1085</guid>
		<description><![CDATA[Continuation of from the last post Installing Alpine 2.0 in Ubuntu Linux is a fairly simple process but can be rather confusing and elusive as there is no GUI to help you out. I ran into a few hitches along the way so I thought I&#8217;d help out future command line enthusiasts who might run [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>Continuation of <a href="http://www.fettesps.com/solving-ubuntus-the-following-packages-cannot-be-authenticated%E2%80%9D-error/">from the last post</a> </p></blockquote>
<p>Installing Alpine 2.0 in Ubuntu Linux is a fairly simple process but can be rather confusing and elusive as there is no GUI to help you out.  I ran into a few hitches along the way so I thought I&#8217;d help out future command line enthusiasts who might run into the same issue.</p>
<p>Installing Alpine is as simple as:</p>
<pre class="brush: plain; title: ; notranslate">sudo apt-get install alpine</pre>
<p>A few seconds later you&#8217;ll have Alpine up and running.  Type &#8220;alpine&#8221; into your terminal and then follow the prompts.  To configure it to use Gmail you&#8217;ll go into the Setup menu by pressing &#8220;S&#8221; and from there you&#8217;ll go into Config by hitting &#8220;C&#8221;.</p>
<p>This is how I configured mine for Gmail:</p>
<pre class="brush: plain; title: ; notranslate">
Personal Name                     = &lt;No Value Set: using &quot;Your Friendly Name&quot;&gt;
User Domain                       = gmail.com
SMTP Server (for sending)         = smtp.googlemail.com:587/tls/user=username@gmail.com
NNTP Server (for news)            = &lt;No Value Set&gt;
Inbox Path                        = {imap.gmail.com:993/user=username@gmail.com/ssl/novalidate-cert}Inbox
Incoming Archive Folders          = &lt;No Value Set&gt;
Pruned Folders                    = &lt;No Value Set&gt;
Default Fcc (File carbon copy)    = &lt;No Value Set: using &quot;sent-mail&quot;&gt;
Default Saved Message Folder      = &lt;No Value Set: using &quot;saved-messages&quot;&gt;
Postponed Folder                  = &lt;No Value Set: using &quot;postponed-msgs&quot;&gt;
Read Message Folder               = &lt;No Value Set&gt;
Form Letter Folder                = &lt;No Value Set&gt;
Trash Folder                      = &lt;No Value Set: using &quot;Trash&quot;&gt;
Literal Signature                 = &lt;No Value Set&gt;
Signature File                    = &lt;No Value Set: using &quot;.signature&quot;&gt; </pre>
<p>One thing worth noting there is the Inbox Path I set.  Every other guide I read said to use <br /><strong>{pop.gmail.com:993/pop3/ssl/novalidate-cert/user=user@gmail.com}</strong><br /> which simply did not work for me.  I struggled with this one for a good 20 min or so until I <a href="http://inferno.freedom-uplink.net/blog/2008/07/05/using-gmails-imap-through-alpine/">found this post</a> which did it slightly different than most.  Not sure why, but my computer needed that a bit different and if anything I&#8217;d guess it&#8217;s because I&#8217;m using the x64 build.</p>
<p>While you&#8217;re in the config menu you&#8217;ll also want to fix a few other things which were suggested on the <a href="http://ubuntuforums.org/showthread.php?t=1073916">Ubuntu Forums</a>. </p>
<pre class="brush: plain; title: ; notranslate">[Advanced User Preferences]
[x] &quot;Save Will Not Delete&quot;

[Pruning Rule]
[x] &quot;Don’t rename, don’t delete&quot; </pre>
<p>At this point you want to save your settings and exit Alpine.  So hit <strong>E</strong> and then <strong>Y</strong to save it.  At that point you should hit <strong>Q</strong> to exit and once again <strong>Y</strong> to confirm.</p>
<p>Now before you start Alpine again I suggest setting it to save your password.  Doing this is <a href="http://allforlinux.com/2010/07/read-your-e-mail-via-terminal/">a bit convoluted</a> but basically what you&#8217;re going to do is create an empty file in your home directory which will store your encrypted password.  </p>
<pre class="brush: plain; title: ; notranslate">cd ~
touch .pine-passfile
alpine</pre>
<p>When Alpine starts back up enter your Gmail password and it will then ask if you want to save it locally, hit <strong>Y</strong>.  You will have to do this once more the next time you send an outgoing mail but after that you will not be prompted again for your Gmail password.  </p>
<p>Now Alpine is all installed and you can be elite and say you read your email in the command line.  You can of course take it one step further and add it to your screen profile and then attach it every time you SSH in.  I&#8217;ve always got screen windows running for things like IRSSI and Hellanzb and Emacs, and now Alpine.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fettesps.com/configuring-alpine-2-0-to-access-gmail-on-ubuntu-x64/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Solving Ubuntu&#8217;s &#8220;The following packages cannot be authenticated” Error</title>
		<link>http://www.fettesps.com/solving-ubuntus-the-following-packages-cannot-be-authenticated%e2%80%9d-error/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=solving-ubuntus-the-following-packages-cannot-be-authenticated%25e2%2580%259d-error</link>
		<comments>http://www.fettesps.com/solving-ubuntus-the-following-packages-cannot-be-authenticated%e2%80%9d-error/#comments</comments>
		<pubDate>Mon, 06 Dec 2010 02:18:26 +0000</pubDate>
		<dc:creator>FettesPS</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[apt-get]]></category>
		<category><![CDATA[aptitude]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.fettesps.com/?p=1083</guid>
		<description><![CDATA[I was just trying to install Pine on one of my Ubuntu based boxes and had an issue getting it installed. It seems there&#8217;s no 64 bit binary available so I figured I&#8217;d try Alpine instead since it was in the apt-get repository. So I did a quick sudo apt-get install alpine and was prompted [...]]]></description>
			<content:encoded><![CDATA[<p>I was just trying to install Pine on one of my Ubuntu based boxes and had an issue getting it installed.  It seems there&#8217;s no 64 bit binary available so I figured I&#8217;d try Alpine instead since it was in the apt-get repository.  So I did a quick <em>sudo apt-get install alpine</em> and was prompted with this pesky message:</p>
<pre class="brush: plain; title: ; notranslate">WARNING: The following packages cannot be authenticated!
  foo bar baz
Install these packages without verification [y/N]?</pre>
<p>I hit <em>y</em> but the install still failed.  I did a quick Google and <a href="http://changelog.complete.org/archives/496-how-to-solve-the-following-packages-cannot-be-authenticated">found this solution</a> to the problem.</p>
<pre class="brush: plain; title: ; notranslate">sudo apt-get install debian-archive-keyring
sudo apt-get update</pre>
<p>After running those commands I got the same error, and once again I said yes.  This time it installed successfully.  So I went back and ran the <em>sudo apt-get install alpine</em> command again, and was prompted with the same question.  Thinking it didn&#8217;t work I hit yes and to my chigrin it installed perfectly this time.  Now, to figure out how to use Alpine to read my Gmail&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fettesps.com/solving-ubuntus-the-following-packages-cannot-be-authenticated%e2%80%9d-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Best Ubuntu Calculator</title>
		<link>http://www.fettesps.com/the-best-ubuntu-calculator/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-best-ubuntu-calculator</link>
		<comments>http://www.fettesps.com/the-best-ubuntu-calculator/#comments</comments>
		<pubDate>Thu, 02 Dec 2010 05:21:22 +0000</pubDate>
		<dc:creator>FettesPS</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[best linux calculator]]></category>
		<category><![CDATA[linux calc]]></category>
		<category><![CDATA[ubuntu calc]]></category>

		<guid isPermaLink="false">http://www.fettesps.com/?p=1074</guid>
		<description><![CDATA[Any modern operating system will come with at least some sort of calculator program. For years I&#8217;ve relied on Window&#8217;s calculator which I can bring up in just a couple of keystrokes. In Linux I&#8217;ve always just used whatever the default was for that distro, though I was never impressed with them as much as [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.fettesps.com/wp-content/uploads/2010/12/qualculate01.png"><img src="http://www.fettesps.com/wp-content/uploads/2010/12/qualculate01-300x296.png" alt="" title="qualculate01" width="300" height="296" class="alignright size-medium wp-image-1075" /></a>Any modern operating system will come with at least some sort of calculator program.  For years I&#8217;ve relied on Window&#8217;s calculator which I can bring up in just a couple of keystrokes.  In Linux I&#8217;ve always just used whatever the default was for that distro, though I was never impressed with them as much as the one packaged with Windows 7.  However recently I&#8217;ve been using OpenBox as my window manager and as a result I haven&#8217;t had my usual Gnome calculator at a finger&#8217;s reach.  So I figured since most of the time I&#8217;m doing something in the terminal and don&#8217;t need to load up a whole GUI to crunch a couple of numbers that I&#8217;d look into some terminal based ones.   After a bit of digging around I found <a href="http://qalculate.sourceforge.net/">Qalculate</a> which installs both a GUI based calculator as well as a terminal app.  How do you get it?</p>
<pre class="brush: bash; title: ; notranslate">sudo apt-get install qalculate</pre>
<p>After confirming your request you&#8217;ll be up and running in a few seconds.  Once installed you can launch the GUI based calculator by typing <em>qalculate</em> into your terminal, or if you&#8217;re using Gnome or KDE you can just launch the application via your menu.  </p>
<pre class="brush: bash; title: ; notranslate">fettesps@ubuntu ~ $ qalc 9*365/4+15*27-1
((9 * 365) / 4) + (15 * 27) - 1 = 1225.25</pre>
<p>Or if you need to do a series of calculations you can just type qalc and it will keep solving equations until you tell it to quit.</p>
<pre class="brush: bash; title: ; notranslate">
fettesps@ubuntu ~ $ qalc
&gt; 3.33333/1.21^3

  3.33333 / (1.21^3) = approx. 1.8815779

&gt; 9^3

  9^3 = 729

&gt; 2&lt;&lt;2

  shift(2, 2) = 8

&gt; 2&lt;&lt;9

  shift(2, 9) = 1024

&gt; quit
</pre>
<p>As you can see it even did some bitwise shifting for me.  Considering I didn&#8217;t even know what syntax it expected I was pretty happy with the results.  To be honest I&#8217;ve bit sitting here throwing random equations at it for half the night and I haven&#8217;t been able to stump it yet.  It can even calculate currencies for you!</p>
<pre class="brush: bash; title: ; notranslate">fettesps@ubuntu ~ $ qalc
&gt; $100 USD to CAD

  dollar * 100 * dollar = approx. 103.77108 CAD^2

&gt; $100 CAD to AUD

  dollar * 100 * CAD = approx. 105.79388 AUD^2

&gt; $27 AUD to GBP

  dollar * 27 * AUD = approx. 10.651537 GBP^2

&gt; $27 AUD to EUR

  dollar * 27 * AUD = approx. 15.120906 EUR^2

&gt; quit
</pre>
<p>Once again I didn&#8217;t use any sort of reference when punching in these commands, it was very intuitive and knew exactly what I wanted from it.  I was completely guessing on the currency codes and either I got them all right except my own country, having punched in CDN instead of CAD.  </p>
<p>So, what else can it do?  How about some unit conversions? I&#8217;ll admit I usually just Google my conversions as they have a built in tool, however it seems I now can do that quicker in my terminal.</p>
<pre class="brush: bash; title: ; notranslate">fettesps@ubuntu ~ $ qalc
&gt; 22 inches to meters

  22 * inch = 558.8 mm

&gt; 1/8 inch to feet

  (1 / <img src='http://www.fettesps.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> * inch = approx. 10.416667 mft

&gt; 1 yard to meters

  1 * yard = 914.4 mm

&gt; calories to joules

  calorie = 4.1868 J

&gt; 1 canadian football field to an american football field

  error: &quot;n&quot; is not a valid variable/function/unit.
  error: &quot;f&quot; is not a valid variable/function/unit.
  warning: Error(s) in unitexpression.
  1 * (centiare * nanoare * day * i * are) * (foot * barn * attoliter * liter) * (0 * i * e * liter * day) = 0 aL*L*a*ca*b*d*d*ft*m^4 * am

&gt; quit
</pre>
<p>Unfortunately, it can&#8217;t answer all of your questions&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fettesps.com/the-best-ubuntu-calculator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

