<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <id>https://anton.maurovic.com/</id>
  <title>anton.maurovic.com</title>
  <updated>2017-01-02T00:00:00Z</updated>
  <link rel="alternate" href="https://anton.maurovic.com/"/>
  <link rel="self" href="https://anton.maurovic.com/feeds/all.xml"/>
  <author>
    <name>Anton Maurovic</name>
    <uri>https://anton.maurovic.com</uri>
  </author>
  <entry>
    <id>tag:anton.maurovic.com,2017-01-02:/posts/ammauro-2-linux-vm-under-windows-or-macos/</id>
    <title type="html">AMMAURO #2:
Linux VM for developers</title>
    <published>2017-01-02T00:00:00Z</published>
    <updated>2017-01-02T00:00:00Z</updated>
    <link rel="alternate" href="https://anton.maurovic.com/posts/ammauro-2-linux-vm-under-windows-or-macos/"/>
    <content type="html">&lt;div style="display:none;"&gt;&lt;img src="/posts/ammauro-2-linux-vm-under-windows-or-macos/thumb.jpg" alt="AMMAURO #2: Linux VM for developers" width="160" height="120" border="0"&gt;&lt;/div&gt;

&lt;p class="overview"&gt;My 2nd video in the
&lt;a href="https://www.youtube.com/playlist?list=PLD6La5JxCaO6rYKpoR0cf4cgB470JlS9Y"&gt;AMMAURO series&lt;/a&gt; shows how Windows and macOS (OS X) users can install a Linux virtual machine to help supplement their development environment, and get the most out of all platforms.&lt;/p&gt;

&lt;h2 id="ammauro-2---linux-vm-under-windows-or-macos-to-enhance-your-development"&gt;AMMAURO #2 - Linux VM under Windows or macOS to enhance your development&lt;/h2&gt;
&lt;p&gt;It’s been a long time since my last post, and my last video in the &lt;a href="https://www.youtube.com/playlist?list=PLD6La5JxCaO6rYKpoR0cf4cgB470JlS9Y"&gt;AMMAURO series&lt;/a&gt;.
This new video lays the foundation for future videos about electronics design and experiments, hardware development and hacking, and software development.
It shows you how you can (and maybe even should) keep running your existing
Windows or macOS desktop development environment, but also leverage the full
power of Linux in that same environment, using a VM (Virtual Machine).&lt;/p&gt;

&lt;div class="youtube-embed"&gt;
&lt;iframe width="672" height="378" src="https://www.youtube.com/embed/kYEzEFH5LiM" frameborder="0" allowfullscreen="allowfullscreen"&gt;&lt;/iframe&gt;
&lt;/div&gt;

&lt;p&gt;NOTE: Step 6 in the video refers to instructions and commands to install
some essential packages, which I’ll repeat below for your convenience.
Please note that the following were taken from &lt;a href="https://github.com/pfalcon/esp-open-sdk"&gt;https://github.com/pfalcon/esp-open-sdk&lt;/a&gt;…&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Run the following for Ubuntu 14.04 and above:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;sudo apt-get install make unrar-free autoconf automake libtool gcc g++ \
  gperf flex bison texinfo gawk ncurses-dev libexpat-dev python-dev \
  python python-serial sed git unzip bash help2man wget bzip2
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;…and for newer versions of Ubuntu you may &lt;strong&gt;also&lt;/strong&gt; need to run:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;sudo apt-get install libtool-bin
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;From time to time you will hopefully
see me post new videos on &lt;a href="https://www.youtube.com/user/antonmaurovic/videos"&gt;my YouTube channel&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you’d like to comment – say, with feedback, requests, or suggestions – the best
way will be via the YouTube comments of each video.&lt;/p&gt;

</content>
    <summary type="html">&lt;p&gt;My 2nd video in the
&lt;a href="https://www.youtube.com/playlist?list=PLD6La5JxCaO6rYKpoR0cf4cgB470JlS9Y"&gt;AMMAURO series&lt;/a&gt; shows how Windows and macOS (OS X) users can install a Linux virtual machine to help supplement their development environment, and get the most out of all platforms.&lt;/p&gt;</summary>
  </entry>
  <entry>
    <id>tag:anton.maurovic.com,2014-05-11:/posts/my-first-youtube-video-inkjet-printer-teardown/</id>
    <title type="html">My First YouTube Video:
Inkjet Printer Teardown</title>
    <published>2014-05-11T00:00:00Z</published>
    <updated>2014-05-11T00:00:00Z</updated>
    <link rel="alternate" href="https://anton.maurovic.com/posts/my-first-youtube-video-inkjet-printer-teardown/"/>
    <content type="html">&lt;div style="display:none;"&gt;&lt;img src="/posts/my-first-youtube-video-inkjet-printer-teardown/thumb.jpg" alt="My First YouTube Video: Inkjet Printer Teardown" width="160" height="120" border="0"&gt;&lt;/div&gt;

&lt;p class="overview"&gt;I made a YouTube video. I plan to make a series of them. It will mostly just be about
electronics stuff, and pretty random at that. Will it make me rich and famous?
Probably only “a bit”.&lt;/p&gt;

&lt;h2 id="ammauro-1---inkjet-printer-teardown"&gt;AMMAURO #1 - Inkjet Printer Teardown&lt;/h2&gt;
&lt;p&gt;Here’s a video in which I take a grimy old inkjet printer that I found on the side of
the road, and tear it down to see what parts I can salvage from it:&lt;/p&gt;

&lt;div class="youtube-embed"&gt;
&lt;iframe width="672" height="378" src="https://www.youtube.com/embed/ZLX43uyyEko" frameborder="0" allowfullscreen="allowfullscreen"&gt;&lt;/iframe&gt;
&lt;/div&gt;

&lt;p&gt;This is my first attempt at creating a YouTube video. From time to time you will hopefully
see me post new videos on &lt;a href="https://www.youtube.com/user/antonmaurovic/videos"&gt;my YouTube channel&lt;/a&gt;.
They’ll likely all focus on electronics, hacker/maker stuff, and maybe other
science and technology. All of my videos of this ilk will be marked with the
&lt;a href="https://www.youtube.com/results?search_query=ammauro"&gt;“AMMAURO” prefix&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you’d like to comment – say, with feedback, requests, or suggestions – the best
way will be via the YouTube comments of each video.&lt;/p&gt;

</content>
    <summary type="html">&lt;p&gt;I made a YouTube video. I plan to make a series of them. It will mostly just be about
electronics stuff, and pretty random at that. Will it make me rich and famous?
Probably only “a bit”.&lt;/p&gt;</summary>
  </entry>
  <entry>
    <id>tag:anton.maurovic.com,2014-01-26:/posts/good-news-feel-good-with-positive-news-websites/</id>
    <title type="html">Good News! Feel good with
positive news websites</title>
    <published>2014-01-26T00:00:00Z</published>
    <updated>2014-01-26T00:00:00Z</updated>
    <link rel="alternate" href="https://anton.maurovic.com/posts/good-news-feel-good-with-positive-news-websites/"/>
    <content type="html">&lt;div style="display:none;"&gt;&lt;img src="/posts/good-news-feel-good-with-positive-news-websites/thumb.jpg" alt="Good News! Feel good with positive news websites" width="160" height="120" border="0"&gt;&lt;/div&gt;

&lt;p class="overview"&gt;Since I no longer subject myself to daily news, I’m happier.
It takes an attitude shift to stop indulging in gossip and
the likes of “current affairs”, Facebook, newspapers, and the
general doom and gloom of modern journalism. Having said that, I still need
to know what’s going on in the world. If you want a better outlook
but still need to stay informed, then I have good news for you…&lt;/p&gt;

&lt;ul class="toc" id="markdown-toc"&gt;
  &lt;li&gt;&lt;a href="#no-news-is-good-news"&gt;No news is good news&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#good-news-is-better-news"&gt;Good news is better news&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#positive-news-sites-worth-checking-out"&gt;Positive news sites worth checking out&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#lesser-quality-positive-news-sites"&gt;Lesser-quality positive news sites&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#sites-to-avoid"&gt;Sites to avoid&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#conclusion"&gt;Conclusion&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#see-also"&gt;See Also&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id="no-news-is-good-news"&gt;No news is good news&lt;/h2&gt;

&lt;div class="rounded right-pic-wrapper pic-with-caption"&gt;  &lt;a class="liteup rounded right liteup-noborder" href="/posts/good-news-feel-good-with-positive-news-websites/pics/bad-news-feed@big.jpg" target="_blank" title='"BEST from news"? Really??'&gt;&lt;img src="/posts/good-news-feel-good-with-positive-news-websites/pics/bad-news-feed@custom.jpg" alt='"BEST from news"? Really??'&gt;&lt;/a&gt;  &lt;span&gt;"BEST from news"? Really??&lt;/span&gt;  &lt;/div&gt;

&lt;p&gt;As a child I respected what I understood to be “the news”.
Adults seemed to rely on it for stories of
greater human importance, of world-wide relevance, of intelligent meaningful facts,
and of cultural enrichment. I assumed that some day it would help me to make important
decisions, and otherwise shape my life for the better. As I grew up, though, my
perspective changed. In particular, a couple of years ago, I noticed something
interesting…&lt;/p&gt;

&lt;p&gt;Frequently my job has required that I work on others people’s computers. I’d launch their web
browser, and be presented with the system default homepage.
To be specific, it was mostly “ninemsn”, and &lt;em&gt;something&lt;/em&gt; on that page would inevitably catch
my eye. Before I knew it, I’d be robotically clicking through news articles, and brooding.&lt;/p&gt;

&lt;p&gt;I &lt;em&gt;say&lt;/em&gt; “news articles”, but more often I’d be poring over articles covering: the stupidity
of Stereotype A; the absurdity unfolding amongst Minority B; or what Teacher C had been doing
to Student D with object E under circumstances that seemed wholly un-curricular.
And then I’d get angry – at humanity, at the world, at life, at myself for wasting time – but the
clincher was when I realised I was &lt;em&gt;more&lt;/em&gt; angry at the site for making this readily
available to me. It was insulting too, that I was
&lt;a href="http://theoatmeal.com/comics/pop_star"&gt;probably just being manipulated anyway&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I decided to stop paying attention to mass-media, which at first was difficult; it’s all
around in one form or another. I’d become addicted to being incensed by society – as though
my outrage reinforced &lt;em&gt;that I&lt;/em&gt; was a better person and deserved more out of life than others.&lt;/p&gt;

&lt;p&gt;After a while, though, I became apathetic to keeping up with current events and
I felt happier. I didn’t so much like the sense of being ignorant, though. I needed
to be informed &lt;em&gt;somehow&lt;/em&gt;, so what could I do?&lt;/p&gt;

&lt;h2 id="good-news-is-better-news"&gt;Good news is better news&lt;/h2&gt;

&lt;p&gt;It stands to reason that if you’re immersed in an environment dominated by negative views,
then you’re likely to become negative yourself. A negative environment drags you down,
and we’re all inclined to sway with that &lt;a href="http://en.wikipedia.org/wiki/Herd_behavior"&gt;pack mentality&lt;/a&gt;.
This is not to say that wearing rose-coloured glasses is a solution.
Rather, one should have a healthy mix of reality to keep informed, positive,
and &lt;em&gt;appropriately&lt;/em&gt; impassioned all at once. With this in mind, I set out to find some sources of
&lt;strong&gt;positive&lt;/strong&gt; news on the Internet, using the following as a makeshift set of guidelines
for assessing any candidate sites:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;An ideal site &lt;strong&gt;should&lt;/strong&gt;:
    &lt;ol&gt;
      &lt;li&gt;Have truthful, important stories from around the world;&lt;/li&gt;
      &lt;li&gt;Show alternative positive views on current negative topics;&lt;/li&gt;
      &lt;li&gt;Suitably present the &lt;em&gt;specific&lt;/em&gt; importance of serious/grave issues to its audience;&lt;/li&gt;
      &lt;li&gt;Present researched and moderated content of high quality, with intelligent, adult writing;&lt;/li&gt;
      &lt;li&gt;Show &lt;em&gt;suitable&lt;/em&gt; respect to the people covered in its stories;&lt;/li&gt;
      &lt;li&gt;Balance important world-stage news with uplifting, forward-focused stories.&lt;/li&gt;
      &lt;li&gt;Really be worth sharing. &lt;/li&gt;
    &lt;/ol&gt;
  &lt;/li&gt;
  &lt;li&gt;An ideal site should &lt;strong&gt;NOT&lt;/strong&gt;:
    &lt;ol&gt;
      &lt;li&gt;Promote any particular interest, political view, cultural view, or religious standing;&lt;/li&gt;
      &lt;li&gt;Sugar-coat anything;&lt;/li&gt;
      &lt;li&gt;Resort to hyperbolic headlines to get attention, or any other &lt;a href="http://en.wikipedia.org/wiki/Link_bait"&gt;link baiting&lt;/a&gt;;&lt;/li&gt;
      &lt;li&gt;Present an idealised substitute for reality;&lt;/li&gt;
      &lt;li&gt;Show a preoccupation with hollow celebrities;&lt;/li&gt;
      &lt;li&gt;Take an elitist view, or otherwise try to exclude a willing audience;&lt;/li&gt;
      &lt;li&gt;Make a spectacle of the suffering of others.&lt;/li&gt;
      &lt;li&gt;Function as promotion for a news service that shamelessly profits from negativity,
or from manipulating people’s views.&lt;/li&gt;
    &lt;/ol&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A quick Google search for
&lt;a href="http://www.google.com/search?q=positive+news+sites"&gt;“positive news sites”&lt;/a&gt; turned
up a lot of results and it seemed it should be easy to find some that would meet at least most
of the criteria above. However, as I started working through the list, my optimism faded somewhat.
At best, most sites seemed to be little more than a blog, and really didn’t feel like true journalistic
outlets at all.&lt;/p&gt;

&lt;p&gt;Nevertheless I persevered and my findings are interesting…&lt;/p&gt;

&lt;h2 id="positive-news-sites-worth-checking-out"&gt;Positive news sites worth checking out&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p class="list-major"&gt;&lt;a href="http://odewire.com/"&gt;OdeWire&lt;/a&gt; – &lt;em&gt;&lt;a href="http://odewire.com"&gt;http://odewire.com&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

    &lt;div class="bordered right-pic-wrapper"&gt;  &lt;a class="liteup bordered right" href="/posts/good-news-feel-good-with-positive-news-websites/pics/odewire-website@big.png" target="_blank" title="OdeWire website screenshot"&gt;&lt;img src="/posts/good-news-feel-good-with-positive-news-websites/pics/odewire-website@custom.jpg" alt="OdeWire website screenshot"&gt;&lt;/a&gt;  &lt;/div&gt;

    &lt;p&gt;I was impressed with this site. By the time I came across it, I had been through a dozen poor-quality
“good news” sites, and I was ready for the fresh, balanced perspective that &lt;a href="http://odewire.com/"&gt;OdeWire&lt;/a&gt;
provides. As a site maintained by &lt;a href="http://theoptimist.com/"&gt;The Intelligent Optimist&lt;/a&gt; magazine
(formerly “Ode Magazine”), it does not simply avoid bad news and pile on feel-good filler.
Rather it offers a stream of realistically &lt;em&gt;objective&lt;/em&gt; stories that seem to be hand-selected from
many reputable news outlets around the world. To quote a &lt;a href="http://theoptimist.com/do-you-persevere/"&gt;recent article&lt;/a&gt;
of theirs:&lt;/p&gt;

    &lt;blockquote class="quote"&gt;
      &lt;p&gt;Optimism has nothing to do with ignoring reality and denying the bad hands that life often deals us.&lt;/p&gt;
    &lt;/blockquote&gt;

    &lt;p&gt;The site’s tagline of “News for Intelligent Optimists” appears to be backed up by good content.
There seems to be an even mix here: Encouraging positive stories are interspersed with reports
of serious world events, presented in a way that is both informative and mature.
Reading through this site gives me a sense that I am participating in something intelligent and
important, that really &lt;strong&gt;is&lt;/strong&gt; news, while maintaining a sense of calm and neutrality.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p class="list-major"&gt;&lt;a href="http://positivenews.org.uk/"&gt;Positive News&lt;/a&gt; – &lt;em&gt;&lt;a href="http://positivenews.org.uk"&gt;http://positivenews.org.uk&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

    &lt;div class="bordered right-pic-wrapper"&gt;  &lt;a class="liteup bordered right" href="/posts/good-news-feel-good-with-positive-news-websites/pics/positive-news-website@big.png" target="_blank" title="Positive News website"&gt;&lt;img src="/posts/good-news-feel-good-with-positive-news-websites/pics/positive-news-website@custom.jpg" alt="Positive News website"&gt;&lt;/a&gt;  &lt;/div&gt;

    &lt;p&gt;“Positive News” claims itself as
&lt;a href="http://positivenews.org.uk/about/positive-news/"&gt;“the world’s first positive newspaper”&lt;/a&gt;,
and is another site which seems to be professional in its presentation and writing,
while staying true to its message.
Amongst its benefits are that it has an accompanying newspaper &lt;em&gt;in print&lt;/em&gt; and it has a
strong community involvement. As a publication of the
&lt;a href="http://positivenews.org.uk/about/positive-news-trust/"&gt;Positive News Trust&lt;/a&gt; charity,
its staff largely comprise young volunteers, including up-and-coming journalists
who have an opportunity to gain valuable experience.&lt;/p&gt;

    &lt;p&gt;The overall quality and value of the stories is generally pleasing, with world-wide
relevance (including &lt;a href="http://noticiaspositivas.org/"&gt;Argentinian&lt;/a&gt; and
&lt;a href="http://noticiaspositivas.net/"&gt;Spanish&lt;/a&gt; counterparts).
There is an even spread of detailed reports of higher importance, as well as shorter stories
that are up-lifting and motivational, while remaining relevant and down-to-earth.
If you benefit from the site, or at least believe in their purpose, you are
encouraged to &lt;a href="http://positivenews.org.uk/donate/"&gt;make a donation&lt;/a&gt; at the end of each
article.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p class="list-major"&gt;&lt;a href="http://www.globalgoodnews.com/"&gt;Global Good News&lt;/a&gt; – &lt;em&gt;&lt;a href="http://www.globalgoodnews.com"&gt;http://www.globalgoodnews.com&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

    &lt;div class="bordered right-pic-wrapper"&gt;  &lt;a class="liteup bordered right" href="/posts/good-news-feel-good-with-positive-news-websites/pics/global-good-news-website@big.png" target="_blank" title="Global Good News website screenshot"&gt;&lt;img src="/posts/good-news-feel-good-with-positive-news-websites/pics/global-good-news-website@custom.jpg" alt="Global Good News website screenshot"&gt;&lt;/a&gt;  &lt;/div&gt;

    &lt;p&gt;This one may surprise you, as it did me. When I saw it I nearly abandoned it, for two reasons:
(a) its visual presentation seems to be very “tacky”, for want of a better word; and
(b) there is an overt religious aspect, which often means you can expect the journalistic
integrity of the stories to suffer. Despite this, though,
&lt;strong&gt;the stories themselves seem to actually be of high quality&lt;/strong&gt;, with perhaps the highest
number of new stories per week of any other sites I’ve reviewed.&lt;/p&gt;

    &lt;p&gt;As an Australian, I was pleased to see at least a couple of stories on the first page that
were highly relevant to me. The same seems to be true for readers from many other countries,
particularly with an &lt;a href="http://goodnews.arabictm.org/nov2013/"&gt;Arabic counterpart&lt;/a&gt;.
I have seen perhaps the most diverse range of cultures and demographics represented at this site,
making it live up to its “Global Good News” name. As with the other two examples above, this
site features mature, intelligent articles that are meaningful and informative.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p class="list-major"&gt;&lt;a href="http://optimistworld.com/News.aspx"&gt;Optimist World News&lt;/a&gt; – &lt;em&gt;&lt;a href="http://optimistworld.com/News.aspx"&gt;http://optimistworld.com/News.aspx&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

    &lt;div class="bordered right-pic-wrapper"&gt;  &lt;a class="liteup bordered right" href="/posts/good-news-feel-good-with-positive-news-websites/pics/optimist-world-news-website@big.png" target="_blank" title="Optimist World News website"&gt;&lt;img src="/posts/good-news-feel-good-with-positive-news-websites/pics/optimist-world-news-website@custom.jpg" alt="Optimist World News website"&gt;&lt;/a&gt;  &lt;/div&gt;

    &lt;p&gt;This newsfeed is actually part of a larger site called &lt;a href="http://optimistworld.com/"&gt;Optimist World&lt;/a&gt;,
which aims to
&lt;a href="http://optimistworld.com/Welcome-To-Optimist-World-for-daily-good-news-inspiring-stories-about-charities-companies-sport-and-sustainable-travel/"&gt;inspire its readers&lt;/a&gt;
and promote goodwill in general.
The site as a whole has a friendly and polished appearance, giving it a more-youthful feel.&lt;/p&gt;

    &lt;p&gt;Articles at Optimist World are well-written and easy to read for all ages. They give a sense
of light-hearted satisfaction, without being immature or saccharine. My only criticisms are
that: (1) the articles seem to have more of a Western focus with less attention to important
world-wide events; and (2) compared to other sites, it is not updated all that frequently.
Other than that, it is definitely worth a read from time to time.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id="lesser-quality-positive-news-sites"&gt;Lesser-quality positive news sites&lt;/h2&gt;

&lt;p&gt;Finding high-quality positive news sites is difficult; the ones given above stand out of the dozens
I inspected. Most of the rest are a little cheesy (especially when there’s a religious message
involved), or simply have a very amateurish “blog-like” feel and are unashamed about manipulating
you to wander aimlessly through their pages to generate advertising revenue.&lt;/p&gt;

&lt;p&gt;While the following sites don’t meet as many of my key criteria, I can at least commend them for
the positive impact they aim to provide. There are &lt;strong&gt;many&lt;/strong&gt; sites that follow in the style of these,
so I’ve only listed a handful. Search around, and you may find some that really appeal to you or otherwise
contribute further value in your daily quest to be optimistic.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href="http://gimundo.com/"&gt;Gimundo&lt;/a&gt; – &lt;em&gt;&lt;a href="http://gimundo.com"&gt;http://gimundo.com&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

    &lt;div class="bordered right-pic-wrapper"&gt;  &lt;a class="liteup bordered right" href="/posts/good-news-feel-good-with-positive-news-websites/pics/gimundo-website@big.jpg" target="_blank" title="Gimundo website"&gt;&lt;img src="/posts/good-news-feel-good-with-positive-news-websites/pics/gimundo-website@custom.jpg" alt="Gimundo website"&gt;&lt;/a&gt;  &lt;/div&gt;

    &lt;p&gt;This one pops up a bit in other people’s recommendations for Good News websites. While
it has a nobile purpose, like many of the sites I list here, I find it to be a
little weak overall. The site is not updated very often, which is more of a problem given
that the articles are not particularly important or relevant. The stories seem to have a
strong focus on the USA, with subjects &lt;em&gt;and&lt;/em&gt; headlines that are selected specifically to
snare your clicks (and hence push more ads). Gimundo is fine if you’re looking for a 
quick pick-me-up, but beyond that has limited intellectual appeal.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href="http://www.sunnyskyz.com/"&gt;Sunny Skyz&lt;/a&gt; – &lt;em&gt;&lt;a href="http://www.sunnyskyz.com"&gt;http://www.sunnyskyz.com&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

    &lt;div class="bordered right-pic-wrapper"&gt;  &lt;a class="liteup bordered right" href="/posts/good-news-feel-good-with-positive-news-websites/pics/sunny-skyz-website@big.jpg" target="_blank" title="Sunny Skyz website"&gt;&lt;img src="/posts/good-news-feel-good-with-positive-news-websites/pics/sunny-skyz-website@custom.jpg" alt="Sunny Skyz website"&gt;&lt;/a&gt;  &lt;/div&gt;

    &lt;p&gt;As with Gimundo, this site and its &lt;a href="http://www.sunnyskyz.com/good-news"&gt;“Good News” newsfeed&lt;/a&gt;
do meet their targets of being positive, but &lt;em&gt;also&lt;/em&gt; like Gimundo the stories are a bit
thin, and the professionalism a bit sparse. The site is easily-accessible and has a lot to offer, but
most of what it offers is again designed to snare clicks and just keep you browsing.
What this leads to is hyperbolic headlines (e.g. “This is amazing. You have to see this…”
and “Incredible thing happens. Watch the video!” without qualification), very short stories loaded
with pictures, and topics that are not overly important or realistic. This is fine if you
have nothing better to do, but I get about as much intellectual satisfaction from an article on
this site as I do from reading a proverb inside the lid of a fruit juice bottle.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href="http://www.goodnewsnetwork.org/"&gt;Good News Network&lt;/a&gt; – &lt;em&gt;&lt;a href="http://www.goodnewsnetwork.org"&gt;http://www.goodnewsnetwork.org&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

    &lt;div class="bordered right-pic-wrapper"&gt;  &lt;a class="liteup bordered right" href="/posts/good-news-feel-good-with-positive-news-websites/pics/good-news-network-website@big.jpg" target="_blank" title="Good News Network website"&gt;&lt;img src="/posts/good-news-feel-good-with-positive-news-websites/pics/good-news-network-website@custom.jpg" alt="Good News Network website"&gt;&lt;/a&gt;  &lt;/div&gt;

    &lt;p&gt;Here’s another site which seems to feature prominently, but doesn’t impress me much.
It suffers from mostly the same problems as the other examples given above, though I can
at least credit the fact that it “feels” more like a news site and provides a
frequent stream of stories that have intellectual appeal without being too sugar-coated.
Still, those stories are often thin, and have a heavily American focus from what I can tell.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href="http://www.happynews.com/"&gt;Happy News&lt;/a&gt; – &lt;em&gt;&lt;a href="http://www.happynews.com"&gt;http://www.happynews.com&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

    &lt;div class="bordered right-pic-wrapper"&gt;  &lt;a class="liteup bordered right" href="/posts/good-news-feel-good-with-positive-news-websites/pics/happy-news-website@big.jpg" target="_blank" title="Happy News website"&gt;&lt;img src="/posts/good-news-feel-good-with-positive-news-websites/pics/happy-news-website@custom.jpg" alt="Happy News website"&gt;&lt;/a&gt;  &lt;/div&gt;

    &lt;p&gt;The articles at this site are fine, if a bit light. Few of the stories are what I would call
“news”, in that they are not particularly ground-breaking or relevant to current events,
and are more of what you’d expect from a blog. That’s OK, and I commend the fact that they
are informative and are presented well with meaningful, mature headlines. I’d &lt;em&gt;almost&lt;/em&gt;
bump this site up to the list of better sites worth checking out, except that at the time
of writing, Happy News hasn’t been updated for at least 6 weeks; the most recent
article is dated October 16th, 2013.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href="http://www.greatnewsnetwork.org/"&gt;Great News Network&lt;/a&gt; – &lt;em&gt;&lt;a href="http://www.greatnewsnetwork.org"&gt;http://www.greatnewsnetwork.org&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

    &lt;div class="bordered right-pic-wrapper"&gt;  &lt;a class="liteup bordered right" href="/posts/good-news-feel-good-with-positive-news-websites/pics/great-news-network-website@big.jpg" target="_blank" title="Great News Network website"&gt;&lt;img src="/posts/good-news-feel-good-with-positive-news-websites/pics/great-news-network-website@custom.jpg" alt="Great News Network website"&gt;&lt;/a&gt;  &lt;/div&gt;

    &lt;p&gt;This site is reasonably good, with meaningful stories presented in a mature way.
It’s worth reading, and has value overall. The only problems with it are that the presentation
is very basic, there’s &lt;em&gt;slightly&lt;/em&gt; too much focus on US stories, and it is infrequently updated.
Besides that, though, I’d suggest you keep an eye on it.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href="http://www.nbcnews.com/id/13282721/"&gt;Wonderful World (NBC News)&lt;/a&gt; – &lt;em&gt;&lt;a href="http://www.nbcnews.com/id/13282721/"&gt;http://www.nbcnews.com/id/13282721/&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

    &lt;div class="bordered right-pic-wrapper"&gt;  &lt;a class="liteup bordered right" href="/posts/good-news-feel-good-with-positive-news-websites/pics/wonderful-world-nbc-news-website@big.png" target="_blank" title="NBC News 'Wonderful World' website"&gt;&lt;img src="/posts/good-news-feel-good-with-positive-news-websites/pics/wonderful-world-nbc-news-website@custom.jpg" alt="NBC News 'Wonderful World' website"&gt;&lt;/a&gt;  &lt;/div&gt;

    &lt;p&gt;Here we start to get into the curiosity that is major news outlets trying to capitalise on a
growing interest in positive news. There are some cases where this really becomes farcical
(and we’ll see a couple below), but NBC News’ “Wonderful World” section isn’t too bad.
It’s quite glorified with an almost exclusive focus on American stories, some of which
are a bit on the banal side, but at least NBC News seems to be trying to maintain some
sense of integrity, which is more than I can say for the following examples. Doesn’t
it deserve a nicer URL, though?&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id="sites-to-avoid"&gt;Sites to avoid&lt;/h2&gt;

&lt;p&gt;I see the sites below as ones you should avoid because they really miss the mark overall.
They rarely offer anything original or of value, often have &lt;a href="http://www.explainxkcd.com/wiki/index.php?title=1283"&gt;infantile headlines designed to catch clicks&lt;/a&gt;, and besides failing on many
of &lt;a href="#good-news-is-better-news"&gt;my guidelines&lt;/a&gt; they are often shameless commercial
exploitations being peddled by the major news networks. All in all, these will waste
your time, do nothing to inform you on the world stage, and offer nothing intellectual.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href="http://www.huffingtonpost.com/good-news/"&gt;HuffPost Good News&lt;/a&gt; – &lt;em&gt;&lt;a href="http://www.huffingtonpost.com/good-news/"&gt;http://www.huffingtonpost.com/good-news/&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

    &lt;div class="bordered right-pic-wrapper"&gt;  &lt;a class="liteup bordered right" href="/posts/good-news-feel-good-with-positive-news-websites/pics/huffpost-good-news-website@big.jpg" target="_blank" title="HuffPost Good News website"&gt;&lt;img src="/posts/good-news-feel-good-with-positive-news-websites/pics/huffpost-good-news-website@custom.jpg" alt="HuffPost Good News website"&gt;&lt;/a&gt;  &lt;/div&gt;

    &lt;p&gt;This site stands out as the only “good news” site that makes me &lt;em&gt;actually&lt;/em&gt; angry. The stories
are trite, and heavily American. The presentation is childish; categories such as “AWW”
and “OMG”, with endless hyperbolic headlines, really insult my intelligence. The cluttered noise of links
begging you to click everywhere really cheapens this site by highlighting how they
don’t care what you do, so long as you see as many ads as possible.&lt;/p&gt;

    &lt;p&gt;All that aside, the one thing which openly infuriates me is that a big chunk of the
page – one &lt;strong&gt;third&lt;/strong&gt; of the right-hand side of the first few screenfuls – is
dedicated to stories from the &lt;em&gt;rest&lt;/em&gt; of Huffington Post. These are almost always
horrible or at least highly negative, and tailored to enrage.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href="http://abcnews.go.com/US/Good_News/"&gt;Good News (ABC News)&lt;/a&gt; – &lt;em&gt;&lt;a href="http://abcnews.go.com/US/Good_News/"&gt;http://abcnews.go.com/US/Good_News/&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

    &lt;div class="bordered right-pic-wrapper"&gt;  &lt;a class="liteup bordered right" href="/posts/good-news-feel-good-with-positive-news-websites/pics/good-news-abc-news-website@big.png" target="_blank" title="ABC News 'Good News' website"&gt;&lt;img src="/posts/good-news-feel-good-with-positive-news-websites/pics/good-news-abc-news-website@custom.jpg" alt="ABC News 'Good News' website"&gt;&lt;/a&gt;  &lt;/div&gt;

    &lt;p&gt;Unlike HuffPost, above, this site is not terrible. There are some key things about it,
though, which mean it won’t be part of my daily hunt for positive news. Besides
failing to meet several of my guidelines,
it is a little too focused on America, and – as seems to be typical of the major
news sites now – relies far too much on video content. This is incredibly frustrating,
as I often want to &lt;strong&gt;read&lt;/strong&gt; articles (especially during a quick break at the office).&lt;/p&gt;

    &lt;p&gt;What’s more frustrating is that the video stream seems to start, run,
and roll on to the next article all on its own, each time playing the same annoying
ad before each brief “news” segment. At first I loaded up several stories as separate
tabs, in advance, expecting to read each one in turn. Instead, I heard one ad fire up
three times with overlapping audio, while my browser started to grind to a halt,
trapping me in an endless Orwellian spiel about baby oil.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href="http://www.feelgoodnews.com/"&gt;Feel Good News&lt;/a&gt; – &lt;em&gt;&lt;a href="http://www.feelgoodnews.com"&gt;http://www.feelgoodnews.com&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

    &lt;div class="bordered right-pic-wrapper"&gt;  &lt;a class="liteup bordered right" href="/posts/good-news-feel-good-with-positive-news-websites/pics/feel-good-news-website@big.jpg" target="_blank" title="Feel Good News website"&gt;&lt;img src="/posts/good-news-feel-good-with-positive-news-websites/pics/feel-good-news-website@custom.jpg" alt="Feel Good News website"&gt;&lt;/a&gt;  &lt;/div&gt;

    &lt;p&gt;This really isn’t what I’d call news. It’s just YouTube videos. Some may be from commercial
news networks, but most are just mental “candy” with footage of babies, animals, and
minor thrills. This is highly un-informative, and we can get an endless stream
of this sort of stuff from anywhere.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href="http://www.darynkagan.com/"&gt;DarynKagan.com&lt;/a&gt; – &lt;em&gt;&lt;a href="http://www.darynkagan.com"&gt;http://www.darynkagan.com&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

    &lt;div class="bordered right-pic-wrapper"&gt;  &lt;a class="liteup bordered right" href="/posts/good-news-feel-good-with-positive-news-websites/pics/darynkagancom-website@big.png" target="_blank" title="Daryn Kagan website"&gt;&lt;img src="/posts/good-news-feel-good-with-positive-news-websites/pics/darynkagancom-website@custom.jpg" alt="Daryn Kagan website"&gt;&lt;/a&gt;  &lt;/div&gt;

    &lt;p&gt;I don’t really know &lt;a href="http://en.wikipedia.org/wiki/Daryn_Kagan"&gt;who Daryn Kagan is&lt;/a&gt;, and
though I suppose she deserves some recognition for what appears to be a personal plight
to bring positives stories to the fore, I am not overly impressed with her website.
Measuring it by my guidelines,
it misses the mark a bit, largely just linking to the same sort of unimportant
“filler” videos found on all of these low-quality sites.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id="conclusion"&gt;Conclusion&lt;/h2&gt;

&lt;div class="rounded right-pic-wrapper pic-with-caption"&gt;  &lt;img class="rounded right" src="/posts/good-news-feel-good-with-positive-news-websites/pics/springfield-action-news-death-toll@custom.jpg" alt="Springfield Action News weatherman with Death Toll" title="Springfield Action News weatherman with Death Toll"&gt;  &lt;span&gt;"...but it IS ready to shoot right up!"&lt;/span&gt;  &lt;/div&gt;

&lt;p&gt;While it may be difficult for some of us – maybe most of us – to avoid being emotionally
manipulated by big business and especially Big News, we can take measures to avoid its
triggers and traps. This can, at times, be an effort or even inconvenient in this modern
world saturated in advertising, social media, endless immediately-accessible information,
and commercial entertainment. Nevertheless, time out is an important thing. There’s a lot to be
said for going off the grid occasionally, and just experiencing the world for yourself.&lt;/p&gt;

&lt;p&gt;If you &lt;em&gt;MUST&lt;/em&gt; be subjected to negativity, try to find something to balance it, in the
realm of good news. There is actually a lot of good news to be found; times may not
actually be so bad as what the relentless thrust of negative news would otherwise
have us believe. When you do find something &lt;em&gt;genuinely&lt;/em&gt; and &lt;em&gt;valuably&lt;/em&gt; good,
share it, and do so in an intelligent way. Feel free to &lt;a href="/contact.php"&gt;share with me&lt;/a&gt;, too!&lt;/p&gt;

&lt;h2 id="see-also"&gt;See Also&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;Some regional good news sites:
    &lt;ul&gt;
      &lt;li&gt;
&lt;a href="http://www.sagoodnews.co.za/"&gt;South Africa - The Good News&lt;/a&gt;
  and its sister site &lt;a href="http://africagoodnews.com/"&gt;Africa the Good News&lt;/a&gt;
&lt;/li&gt;
      &lt;li&gt;&lt;a href="http://goodnews.pk/"&gt;goodnews.pk (Pakistan)&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Similar articles:
    &lt;ul&gt;
      &lt;li&gt;&lt;a href="http://www.schumachercollege.org.uk/blog/what-if-the-news-was-good"&gt;Schumacher College: What if… the news was good?&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="http://www.cjr.org/the_news_frontier/the_glass-half-full_beat.php"&gt;Columbia Journalism Review: The Glass-Half-Full Beat&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="http://www.nytimes.com/2013/03/19/science/good-news-spreads-faster-on-twitter-and-facebook.html?emc=eta1&amp;amp;_r=1&amp;amp;"&gt;The New York Times: Good News Beats Bad on Social Networks&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="http://www.forbes.com/sites/lorikozlowski/2013/07/10/future-of-content-the-case-for-good-news-and-action/"&gt;Forbes: The Future of Content: The Case for Good News and Action&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Indices of Good News sites and resources:
    &lt;ul&gt;
      &lt;li&gt;&lt;em&gt;&lt;a href="http://www.dmoz.org/News/Alternative/Good_News/"&gt;http://www.dmoz.org/News/Alternative/Good_News/&lt;/a&gt;&lt;/em&gt;&lt;/li&gt;
      &lt;li&gt;&lt;em&gt;&lt;a href="http://dir.yahoo.com/news_and_media/good_news/"&gt;http://dir.yahoo.com/news_and_media/good_news/&lt;/a&gt;&lt;/em&gt;&lt;/li&gt;
      &lt;li&gt;&lt;em&gt;&lt;a href="http://good-news.alltop.com/"&gt;http://good-news.alltop.com/&lt;/a&gt;&lt;/em&gt;&lt;/li&gt;
      &lt;li&gt;&lt;em&gt;&lt;a href="http://www.reddit.com/r/UpliftingNews/"&gt;http://www.reddit.com/r/UpliftingNews/&lt;/a&gt;&lt;/em&gt;&lt;/li&gt;
      &lt;li&gt;&lt;em&gt;&lt;a href="http://www.reddit.com/r/goodnews/"&gt;http://www.reddit.com/r/goodnews/&lt;/a&gt;&lt;/em&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

</content>
    <summary type="html">&lt;p&gt;Since I no longer subject myself to daily news, I’m happier.
It takes an attitude shift to stop indulging in gossip and
the likes of “current affairs”, Facebook, newspapers, and the
general doom and gloom of modern journalism. Having said that, I still need
to know what’s going on in the world. If you want a better outlook
but still need to stay informed, then I have good news for you…&lt;/p&gt;</summary>
  </entry>
  <entry>
    <id>tag:anton.maurovic.com,2013-11-10:/posts/nintendo-nes-gamedev-part-1-setting-up/</id>
    <title type="html">Nintendo (NES) Gamedev,
part 1: Setting up</title>
    <published>2013-11-10T00:00:00Z</published>
    <updated>2013-11-10T00:00:00Z</updated>
    <link rel="alternate" href="https://anton.maurovic.com/posts/nintendo-nes-gamedev-part-1-setting-up/"/>
    <content type="html">&lt;div style="display:none;"&gt;&lt;img src="/posts/nintendo-nes-gamedev-part-1-setting-up/thumb.jpg" alt="Nintendo (NES) Gamedev, part 1: Setting up" width="160" height="120" border="0"&gt;&lt;/div&gt;

&lt;p class="overview"&gt;This is the first article in a short series on throwing yourself quickly
into learning game development for the Nintendo Entertainment System.
The idea will be to get quick results
by example, while learning some key details of how the platform
&lt;em&gt;and development tools&lt;/em&gt; work.&lt;/p&gt;

&lt;ul class="toc" id="markdown-toc"&gt;
  &lt;li&gt;&lt;a href="#introduction"&gt;Introduction&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;
&lt;a href="#nes-development-environment"&gt;NES Development Environment&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href="#installing-on-windows"&gt;Installing on Windows&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#installing-on-mac-os-x"&gt;Installing on Mac OS X&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#installing-on-linux"&gt;Installing on Linux&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href="#testing-your-emulator"&gt;Testing your emulator&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#testing-cc65-by-building-example-code"&gt;Testing cc65 by building example code&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#conclusion"&gt;Conclusion&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;
&lt;a href="#appendices"&gt;Appendices&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href="#mirrors-of-cc65"&gt;Mirrors of cc65&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#building-cc65-and-fceux-from-source-on-mac-os-x"&gt;Building cc65 and FCEUX from source on Mac OS X&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#building-cc65-and-fceux-from-source-on-linux"&gt;Building cc65 and FCEUX from source on Linux&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#alternative-software-for-nes-development"&gt;Alternative Software for NES Development&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;

&lt;div class="right-pic-wrapper"&gt;  &lt;img class="right" src="/posts/nintendo-nes-gamedev-part-1-setting-up/pics/nes-console-set@custom.jpg" alt="Nintendo Entertainment System (NES) Control Deck" title="Nintendo Entertainment System (NES) Control Deck"&gt;  &lt;/div&gt;

&lt;p&gt;I love the aesthetic of classic videogames, and the technical oddities of their platforms.
I got into game development for the NES (Nintendo Entertainment System) to understand and enjoy
these aspects more, but also for the challenge and skills to hopefully ready me for some
related future projects.&lt;/p&gt;

&lt;p&gt;After reading a lot of articles I really just wanted small examples that did something
useful, while explaining them well. While there are many tutorials on game development
for the Nintendo Entertainment System, my objectives in this short series will be to
help you &lt;em&gt;quickly&lt;/em&gt; get an environment going, build some very basic examples, try them out,
and then expose exactly what’s going on.&lt;/p&gt;

&lt;p&gt;In this first article, I cover the bare essentials for Windows, Mac OS X, and Linux.
That is, a means to compile code that targets the NES, and a way to see that code
running on your PC. At the end of this article, you will compile and run some example code to
prove that your environment works. This will set the stage for fun stuff starting in the &lt;strong&gt;next&lt;/strong&gt;
article, &lt;em&gt;when it is ready&lt;/em&gt;.&lt;/p&gt;

&lt;h2 id="nes-development-environment"&gt;NES Development Environment&lt;/h2&gt;

&lt;p&gt;Of all the PC-based tools you may use when developing for the Nintendo Entertainment System,
these are the &lt;strong&gt;essentials&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;A compiler/assembler&lt;/strong&gt;. I strongly recommend the &lt;a href="http://oliverschmidt.github.io/cc65/" title="New cc65 website"&gt;cc65&lt;/a&gt; cross-compiler/assembler for the
&lt;a href="http://en.wikipedia.org/wiki/6502"&gt;6502 CPU&lt;/a&gt;. It is very well-written, highly configurable, and available for
Windows, Linux, and Mac OS X. Future articles will focus on how to use it effectively.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;A NES emulator&lt;sup id="fnref:cart"&gt;&lt;a href="#fn:cart" rel="footnote"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/strong&gt;. With an emulator, any NES-format files you create can be run
directly on your PC – much as they would run on a real NES – for quick testing. Some
emulators are better than others at precisely emulating all known features
(and quirks) of the real NES hardware. A handful of emulators offer
inspection and debugging features, too.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Choosing an emulator depends on your platform, but for now I recommend &lt;a href="http://www.fceux.com/web/home.html"&gt;FCEUX&lt;/a&gt;
as it is available for Windows, Linux, and Mac OS X. Note that while it has
&lt;a href="http://www.fceux.com/web/help/fceux.html?Debug.html"&gt;excellent debugging features&lt;/a&gt;
in the Windows version, disappointingly these are absent from the Mac and Linux
versions at this time. See the
&lt;a href="#alternative-software-for-nes-development"&gt;alternative software appendix&lt;/a&gt;
below for other compilers and emulators, but note that this article focuses on
cc65 and FCEUX.&lt;/p&gt;

&lt;p&gt;In the instructions below, I show you how to install both cc65 and FCEUX, under
&lt;a href="#installing-on-windows"&gt;Windows&lt;/a&gt;,
&lt;a href="#installing-on-mac-os-x"&gt;OS X&lt;/a&gt;, and
&lt;a href="#installing-on-linux"&gt;Linux&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id="installing-on-windows"&gt;Installing on Windows&lt;/h3&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;First, we install FCEUX:&lt;/strong&gt;&lt;/p&gt;

    &lt;p&gt;Go to the &lt;a href="http://www.fceux.com/web/download.html"&gt;FCEUX download page&lt;/a&gt;,
download the “FCEUX win32 Binary” (I used the latest available &lt;em&gt;at the time&lt;/em&gt;,
2.2.2), and extract it. It has no installer, so just place the extracted
files wherever you like, and run &lt;code&gt;fceux.exe&lt;/code&gt; to test that it launches.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Make sure the location where you placed &lt;code&gt;fceux.exe&lt;/code&gt; is added to your system &lt;code&gt;PATH&lt;/code&gt;,
because you will usually want to launch compiled files with FCEUX, directly from
your command-line.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Then, we install cc65:&lt;/strong&gt;&lt;/p&gt;

    &lt;p&gt;Download the cc65 installer. You’re looking for &lt;code&gt;cc65-2.13.3-1.exe&lt;/code&gt; or similar. I went to the
&lt;a href="ftp://ftp.musoftware.de/pub/uz/cc65/" title="Old cc65 FTP site"&gt;&lt;em&gt;original&lt;/em&gt; cc65 FTP site&lt;/a&gt;
and &lt;a href="ftp://ftp.musoftware.de/pub/uz/cc65/cc65-2.13.3-1.exe" title="Old cc65 Windows installer"&gt;downloaded &lt;code&gt;cc65-2.13.3-1.exe&lt;/code&gt;&lt;/a&gt;
but that may be closed down at some point. If so,
&lt;a href="#mirrors-of-cc65"&gt;mirrors are available&lt;/a&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Launch the &lt;code&gt;cc65-2.13.3-1.exe&lt;/code&gt; installer, and perform a default install.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Verify that it has installed by bringing up a new Command Prompt and running:&lt;/p&gt;

    &lt;pre&gt;&lt;code class="language-shellex"&gt;&lt;span class="prompt"&gt;&amp;gt;&lt;/span&gt; &lt;span class="command_line"&gt;cc65 --version&lt;/span&gt;
&lt;span class="output"&gt;cc65 V2.13.3&lt;/span&gt;
&lt;span class="output"&gt;SVN version: 5495&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now you can proceed to &lt;a href="#testing-your-emulator"&gt;the ‘Testing your emulator’ section&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id="installing-on-mac-os-x"&gt;Installing on Mac OS X&lt;/h3&gt;

&lt;p class="summary"&gt;These steps rely on
&lt;a href="/posts/mac-os-x-development-environment-with-ruby/#installing-homebrew"&gt;Homebrew&lt;/a&gt;
to install both cc65 and FCEUX. You can alternatively
&lt;a href="#building-cc65-and-fceux-from-source-on-mac-os-x"&gt;compile the latest source for cc65 and FCEUX&lt;/a&gt;,
but that’s the hard way to go about it.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Make sure Homebrew is up-to-date, and that its environment is set up correctly:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;brew update
brew doctor
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Install the &lt;code&gt;cc65&lt;/code&gt; package:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;brew install cc65
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Test:&lt;/p&gt;

    &lt;pre&gt;&lt;code class="language-shellex"&gt;&lt;span class="prompt"&gt;$&lt;/span&gt; &lt;span class="command_line"&gt;cc65 --version&lt;/span&gt;
&lt;span class="output"&gt;cc65 V2.13.3&lt;/span&gt;
&lt;span class="output"&gt;SVN version: unknown&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Next we’ll install FCEUX, but please note that FCEUX requires an X11 environment. If you have
OS X 10.7 &lt;strong&gt;or below&lt;/strong&gt;, then you already have &lt;code&gt;X11.app&lt;/code&gt; built in, and there’s nothing you need
to do. &lt;strong&gt;If you have OS X 10.8 (Mountain Lion) or above&lt;/strong&gt;,
&lt;a href="http://support.apple.com/kb/ht5293"&gt;Apple recommends&lt;/a&gt; installing &lt;a href="http://xquartz.macosforge.org/landing/"&gt;XQuartz&lt;/a&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Now install the &lt;code&gt;fceux&lt;/code&gt; package, which for me took &lt;strong&gt;about 40 minutes&lt;/strong&gt; due to all
the extra packages required to build it on OS X:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;brew update
brew install homebrew/games/fceux
&lt;/code&gt;&lt;/pre&gt;

    &lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; Previously, FCEUX could be installed with just &lt;code&gt;brew install fceux&lt;/code&gt;, but the package has
been removed from the standard Homebrew set.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now you can proceed to &lt;a href="#testing-your-emulator"&gt;the ‘Testing your emulator’ section&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id="installing-on-linux"&gt;Installing on Linux&lt;/h3&gt;

&lt;p&gt;So far I have only attempted to install cc65 and FCEUX on Ubuntu 12.04 LTS (64-bit), where I
rely on &lt;a href="http://en.wikipedia.org/wiki/Advanced_Packaging_Tool"&gt;APT&lt;/a&gt; (i.e. &lt;code&gt;apt-get&lt;/code&gt;, as used by Ubuntu and Debian). I also have an appendix for
&lt;a href="#building-cc65-and-fceux-from-source-on-linux"&gt;instructions to compile cc65 and FCEUX on Linux&lt;/a&gt;.
If you have reliable and complete instructions for other platforms, please &lt;a href="/contact.php"&gt;let me know&lt;/a&gt;.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;First we install cc65:&lt;/strong&gt;&lt;/p&gt;

    &lt;p&gt;&lt;a href="http://www.trikaliotis.net/debian"&gt;Spiro Trikaliotis&lt;/a&gt;
has prepared, and hosts, an APT repository that can be used to install cc65 as a Debian package.
To use it, first make sure you have &lt;code&gt;debian-keyring&lt;/code&gt; installed.&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;sudo apt-get install debian-keyring
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Add the key for Spiro’s repository:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;# NOTE: Sometimes this server can take over 90 seconds to respond:
gpg --keyserver wwwkeys.pgp.net --recv-key 2AF47E44
gpg -a --export 2AF47E44 | sudo apt-key add -
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Add Spiro’s repository to your APT sources, by editing &lt;code&gt;/etc/apt/sources.list&lt;/code&gt; and
adding the following lines at the end:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;deb     http://debian.trikaliotis.net/ stable contrib
deb-src http://debian.trikaliotis.net/ stable contrib
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Update your APT sources:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;sudo apt-get update
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Install specifically&lt;sup id="fnref:initirq-error"&gt;&lt;a href="#fn:initirq-error" rel="footnote"&gt;2&lt;/a&gt;&lt;/sup&gt; version &lt;code&gt;2.13.3-1&lt;/code&gt; of &lt;code&gt;cc65&lt;/code&gt; and &lt;code&gt;cc65-nes&lt;/code&gt;:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;sudo apt-get install cc65=2.13.3-1 cc65-nes=2.13.3-1
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Check &lt;code&gt;cc65&lt;/code&gt;:&lt;/p&gt;

    &lt;pre&gt;&lt;code class="language-shellex"&gt;&lt;span class="prompt"&gt;$&lt;/span&gt; &lt;span class="command_line"&gt;cc65 --version&lt;/span&gt;
&lt;span class="output"&gt;cc65 V2.13.3&lt;/span&gt;
&lt;span class="output"&gt;SVN version: 5401&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Now we install FCEUX:&lt;/strong&gt;&lt;/p&gt;

    &lt;p&gt;First, make sure &lt;code&gt;curl&lt;/code&gt; and &lt;code&gt;unzip&lt;/code&gt; are installed, as they will come in handy later:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;sudo apt-get install curl unzip
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Install the &lt;code&gt;fceux&lt;/code&gt; package:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;sudo apt-get install fceux
&lt;/code&gt;&lt;/pre&gt;

    &lt;p&gt;…which, at the time of writing, installs specifically version &lt;code&gt;2.1.5+repack-0buntu1&lt;/code&gt;
on Ubuntu 12.04.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now you can carry on into &lt;a href="#testing-your-emulator"&gt;the ‘Testing your emulator’ section&lt;/a&gt; below.&lt;/p&gt;

&lt;h2 id="testing-your-emulator"&gt;Testing your emulator&lt;/h2&gt;

&lt;ol&gt;
  &lt;li id="test-fceux"&gt;
    &lt;p&gt;Download a NES ROM package file (i.e. a &lt;code&gt;.nes&lt;/code&gt; file) from somewhere,
and launch it with &lt;code&gt;fceux&lt;/code&gt;. For example, grab the free
&lt;a href="http://www.zophar.net/pdroms/nes/bombsweeper-for-nes.html"&gt;BombSweeper&lt;/a&gt;,
extract the file, and launch it.&lt;/p&gt;

    &lt;p&gt;&lt;strong&gt;On Windows&lt;/strong&gt;, just download the file and extract it. Then go into Command Prompt,
and into the directory where you extracted it, and you should be able to launch it
with:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;fceux BombSweeper.nes
&lt;/code&gt;&lt;/pre&gt;

    &lt;p&gt;&lt;strong&gt;On Mac OS X and Linux&lt;/strong&gt;, you should just be able to do:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;curl -Lo bombsweeper.zip http://www.zophar.net/download_file/11839
unzip bombsweeper.zip
fceux BombSweeper.nes
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;You will probably want to scale the display, so go to FCEUX’s video configuration
and set both the X and Y scaling factors to &lt;code&gt;2.0&lt;/code&gt; (or maybe even &lt;code&gt;3.0&lt;/code&gt;).&lt;/p&gt;

    &lt;p&gt;&lt;strong&gt;On Windows&lt;/strong&gt;, go to the ‘Config’ menu, select ‘Video…’ and
change the ‘Size Multiplier’ fields:&lt;/p&gt;

    &lt;div class="-pic-wrapper"&gt;  &lt;img class="" src="/posts/nintendo-nes-gamedev-part-1-setting-up/pics/fceux-video-config-windows@custom.jpg" alt="FCEUX NES emulation video config options on Windows" title="FCEUX NES emulation video config options on Windows"&gt;  &lt;/div&gt;

    &lt;p&gt;&lt;strong&gt;On Mac and Linux&lt;/strong&gt;, you need to go to the ‘Options’ menu and select ‘Video Config’:&lt;/p&gt;

    &lt;div class="-pic-wrapper"&gt;  &lt;img class="" src="/posts/nintendo-nes-gamedev-part-1-setting-up/pics/fceux-video-config@custom.jpg" alt="FCEUX NES emulation video config options on Mac OS X" title="FCEUX NES emulation video config options on Mac OS X"&gt;  &lt;/div&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id="testing-cc65-by-building-example-code"&gt;Testing cc65 by building example code&lt;/h2&gt;

&lt;p&gt;Though I won’t get into explaining NES coding concepts until the &lt;em&gt;next&lt;/em&gt; article
in this series, we should at least grab some example code now and make sure it
compiles and runs.&lt;/p&gt;

&lt;p&gt;I have set up a public GitHub repository
(&lt;a href="https://github.com/algofoogle/nes-gamedev-examples"&gt;&lt;code&gt;algofoogle/nes-gamedev-examples&lt;/code&gt;&lt;/a&gt;)
which will be fleshed out with example source code corresponding to each article
in this series.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Grab my &lt;code&gt;nes-gamedev-examples&lt;/code&gt; repo:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;git clone https://github.com/algofoogle/nes-gamedev-examples.git
&lt;/code&gt;&lt;/pre&gt;

    &lt;p&gt;&lt;strong&gt;Alternatively,&lt;/strong&gt; you can
&lt;a href="https://github.com/algofoogle/nes-gamedev-examples/archive/master.zip"&gt;direct-download the &lt;code&gt;master&lt;/code&gt; branch&lt;/a&gt;
as a ZIP file, and extract it.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;In your shell/command-prompt, go into the &lt;code&gt;part01/ex01-c-example&lt;/code&gt; directory,
which is source code in &lt;strong&gt;C&lt;/strong&gt; that displays a simple message and plays a tone.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Build it with cc65 (specifically the &lt;code&gt;cl65&lt;/code&gt; “compile-and-link” tool) as follows:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;cl65 -t nes hello-nes.c -o hello.nes
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Try launching the resulting &lt;code&gt;hello.nes&lt;/code&gt; file with FCEUX:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;fceux hello.nes
&lt;/code&gt;&lt;/pre&gt;

    &lt;div class="inline-pic-wrapper"&gt;  &lt;img class="inline" src="/posts/nintendo-nes-gamedev-part-1-setting-up/pics/ex01-screenshot@custom.png" alt="FCEUX screenshot of 'ex01-c-example' program" title="FCEUX screenshot of 'ex01-c-example' program"&gt;  &lt;/div&gt;

    &lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt; that I’ve sometimes seen &lt;em&gt;on Mac OS X&lt;/em&gt; that FCEUX will take a long
time to properly launch if X11 is not already running. If you’re on OS X 10.7 or below,
you can launch X11 &lt;strong&gt;in advance&lt;/strong&gt; with:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;open /Applications/X11.app
&lt;/code&gt;&lt;/pre&gt;

    &lt;p&gt;…and there would be an equivalent for OS X 10.8 and above with XQuartz.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;NOW&lt;/strong&gt; we will try assembling an example written in 6502 assembly language:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Go into the the &lt;code&gt;part01/ex02-asm-example&lt;/code&gt; directory of the repo.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Assemble the &lt;code&gt;test.s&lt;/code&gt; file, with:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;ca65 test.s
&lt;/code&gt;&lt;/pre&gt;

    &lt;p&gt;…which produces the &lt;code&gt;test.o&lt;/code&gt; &lt;a href="http://en.wikipedia.org/wiki/Object_file"&gt;object file&lt;/a&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;“Link” the object file into a &lt;code&gt;.nes&lt;/code&gt; binary file, with:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;ld65 test.o -o test.nes -C nesfile.ini
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Try launching the resulting &lt;code&gt;test.nes&lt;/code&gt; file with FCEUX:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;fceux test.nes
&lt;/code&gt;&lt;/pre&gt;

    &lt;div class="inline-pic-wrapper"&gt;  &lt;img class="inline" src="/posts/nintendo-nes-gamedev-part-1-setting-up/pics/ex02-screenshot@custom.png" alt="FCEUX screenshot of 'ex02-asm-example' program" title="FCEUX screenshot of 'ex02-asm-example' program"&gt;  &lt;/div&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id="conclusion"&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;So, where to from here? You now have a way to take raw source code and build a &lt;code&gt;.nes&lt;/code&gt;
file from it, that can then be played on your PC in a Nintendo Entertainment System emulator.&lt;/p&gt;

&lt;p&gt;You can have a go at figuring out what’s going on in the
&lt;a href="https://github.com/algofoogle/nes-gamedev-examples/tree/master/part01"&gt;example source code&lt;/a&gt; if you
like, but some of it is quite complex and counter-intuitive, so don’t feel bad
if it just gives you a headache.&lt;/p&gt;

&lt;p&gt;In my next article I intend to explain what a &lt;code&gt;.nes&lt;/code&gt; file &lt;em&gt;actually&lt;/em&gt; is and how cc65’s
build process (and configuration) works. Then I’ll start explaining the core code found
in every game for the Nintendo Entertainment System.
I’ll begin with much simpler examples (that also uncover
key 6502 assembly concepts), and work up through essential features of a minimal
functioning NES program.&lt;/p&gt;

&lt;p&gt;If you’re keen to get on with it, though, you might want to read the following:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href="#alternative-software-for-nes-development"&gt;Alternative Software for NES Development&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="http://nintendoage.com/forum/messageview.cfm?catid=22&amp;amp;threadid=7155"&gt;Nerdy Nights NES programming tutorials&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="http://shiru.untergrund.net/articles/programming_nes_games_in_c.htm"&gt;Programming NES games in C&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Good luck, and see you next time!&lt;/p&gt;

&lt;div class="rounded inline-pic-wrapper"&gt;  &lt;img class="rounded inline" src="/posts/nintendo-nes-gamedev-part-1-setting-up/pics/nes-controller@custom.jpg" alt="Nintendo Entertainment System (NES) D-Pad Controller" title="Nintendo Entertainment System (NES) D-Pad Controller"&gt;  &lt;/div&gt;

&lt;h2 id="appendices"&gt;Appendices&lt;/h2&gt;

&lt;p&gt;Each appendix here is provided in case you are having trouble with installing cc65
or FCEUX, or for those who want to try out alternatives to the process I’ve recommended 
above. You don’t need to read any of this if you have successfully
completed the above &lt;a href="#testing-cc65-by-building-example-code"&gt;build-and-run test&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id="mirrors-of-cc65"&gt;Mirrors of cc65&lt;/h3&gt;

&lt;p&gt;At the time of writing, the latest version of cc65 is maintained by Oliver Schmidt,
at the &lt;a href="http://oliverschmidt.github.io/cc65/" title="New cc65 website"&gt;new cc65 website&lt;/a&gt;. The latest source code
is available via Oliver’s &lt;a href="https://github.com/oliverschmidt/cc65/"&gt;cc65 GitHub repo&lt;/a&gt;, and is still actively maintained.&lt;/p&gt;

&lt;p&gt;In principle, you can find everything you need via: the &lt;a href="http://oliverschmidt.github.io/cc65/" title="New cc65 website"&gt;new cc65 website&lt;/a&gt;;
the &lt;a href="https://github.com/oliverschmidt/cc65/wiki" title="New cc65 Wiki on GitHub"&gt;new cc65 Wiki pages&lt;/a&gt;; and
the &lt;a href="https://github.com/oliverschmidt/cc65/"&gt;cc65 GitHub repo&lt;/a&gt;.
This includes
&lt;a href="http://oliverschmidt.github.io/cc65/getting-started.html#Windows"&gt;instructions for building on Windows&lt;/a&gt;,
where you may prefer (or need) to take the 2nd option (“Use prebuilt cc65 binaries”)
rather than compiling those binaries yourself – so long as you first install
“Make for Windows” as described on that page.&lt;/p&gt;

&lt;p&gt;I, however, was lazy and opted to just download the &lt;code&gt;cc65-2.13.3-1.exe&lt;/code&gt; installer
&lt;strong&gt;for Windows&lt;/strong&gt;. This can can be obtained (with the source code, amongst other
things) from any of the following mirrors:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href="http://cc65.oldos.net/"&gt;http://cc65.oldos.net/&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="http://cc65.civitas64.de/"&gt;http://cc65.civitas64.de/&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="http://www.breitband-anbieter.com/cc65/"&gt;http://www.breitband-anbieter.com/cc65/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I also have my own copy of all the files; if you’re really stuck,
&lt;a href="/contact.php"&gt;contact me&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id="building-cc65-and-fceux-from-source-on-mac-os-x"&gt;Building cc65 and FCEUX from source on Mac OS X&lt;/h3&gt;

&lt;p class="warning"&gt;Be warned: Compiling cc65 is easy enough, but compiling FCEUX on OS X may be
painful. &lt;a href="#installing-on-mac-os-x"&gt;Installing with Homebrew&lt;/a&gt;
is strongly preferred. Otherwise, proceed with caution.&lt;/p&gt;

&lt;h4 id="building-cc65-on-mac-os-x"&gt;Building cc65 on Mac OS X&lt;/h4&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Make sure you have &lt;code&gt;git&lt;/code&gt; installed. If not, see: &lt;a href="https://help.github.com/articles/set-up-git#platform-mac" title="GitHub's instructions for installing Git on Mac"&gt;Set Up Git&lt;/a&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;I assume you will keep all your projects in a folder called &lt;code&gt;projects&lt;/code&gt; in
your home directory. So, following this, go into Terminal and:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;mkdir -p ~/projects
cd ~/projects
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Use &lt;code&gt;git&lt;/code&gt; to clone the &lt;code&gt;https://github.com/oliverschmidt/cc65.git&lt;/code&gt;
&lt;a href="https://github.com/oliverschmidt/cc65/"&gt;repository&lt;/a&gt;:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;git clone https://github.com/oliverschmidt/cc65.git
cd cc65
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;You now have the source code for cc65. Simply build it with:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;make
&lt;/code&gt;&lt;/pre&gt;

    &lt;p&gt;If it fails straight away on this &lt;code&gt;make&lt;/code&gt; command, you probably need to
&lt;a href="/posts/mac-os-x-development-environment-with-ruby/#installing-xcode-command-line-tools"&gt;install the Xcode Command Line Tools&lt;/a&gt;.&lt;/p&gt;

    &lt;p&gt;If you &lt;em&gt;do&lt;/em&gt; have a working &lt;code&gt;make&lt;/code&gt;, it will spew a lot of information as it
compiles all the source files and builds the final binaries. In my case
it also gave a warning at the end:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;ar65: Warning: Library `../lib/supervision.lib' not found - will be created
&lt;/code&gt;&lt;/pre&gt;

    &lt;p&gt;…but this can be ignored.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Do a test run:&lt;/p&gt;

    &lt;pre&gt;&lt;code class="language-shellex"&gt;&lt;span class="prompt"&gt;$&lt;/span&gt; &lt;span class="command_line"&gt;bin/cc65 --version&lt;/span&gt;
&lt;span class="output"&gt;cc65 V2.14.0&lt;/span&gt;
&lt;span class="output"&gt;cc65: No input files&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Now install it system-wide:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;sudo make install
&lt;/code&gt;&lt;/pre&gt;

    &lt;p&gt;&lt;strong&gt;OR if that doesn’t work&lt;/strong&gt;, try this instead:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;sudo make avail 
&lt;/code&gt;&lt;/pre&gt;

    &lt;p&gt;…and the binaries (&lt;code&gt;cc65&lt;/code&gt;, &lt;code&gt;ca65&lt;/code&gt;, etc) should now be found in (say)
&lt;code&gt;/usr/local/bin&lt;/code&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Test again:&lt;/p&gt;

    &lt;pre&gt;&lt;code class="language-shellex"&gt;&lt;span class="prompt"&gt;$&lt;/span&gt; &lt;span class="command_line"&gt;cc65 --version&lt;/span&gt;
&lt;span class="output"&gt;cc65 V2.14.0&lt;/span&gt;
&lt;span class="output"&gt;cc65: No input files&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;You should also ensure you have the &lt;code&gt;CC65_HOME&lt;/code&gt; environment variable set to
the path which contains your cc65 binaries. You can add this, for example,
to your &lt;code&gt;~/.profile&lt;/code&gt; (or, if you already have a &lt;code&gt;~/.bash_profile&lt;/code&gt; file,
add it to that instead; &lt;code&gt;~/.bash_profile&lt;/code&gt; overrides &lt;code&gt;~/.profile&lt;/code&gt;):&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;echo "export CC65_HOME=$(dirname `which cc65`)" &amp;gt;&amp;gt; ~/.profile
source ~/.profile
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h4 id="building-fceux-on-mac-os-x"&gt;Building FCEUX on Mac OS X&lt;/h4&gt;

&lt;p class="summary"&gt;If you have OS X 10.8 or above, you will need an X11 environment to build &lt;em&gt;and&lt;/em&gt;
run FCEUX. &lt;a href="http://support.apple.com/kb/ht5293"&gt;Apple recommends&lt;/a&gt; installing
&lt;a href="http://xquartz.macosforge.org/landing/"&gt;XQuartz&lt;/a&gt; in this case.&lt;/p&gt;

&lt;p&gt;Apparently, building FCEUX on Mac OS X is not exactly easy. There are a lot
of depenencies required, and many people end up managing these dependencies
with &lt;a href="http://brew.sh/"&gt;Homebrew&lt;/a&gt;, &lt;a href="http://www.macports.org/"&gt;MacPorts&lt;/a&gt;, or &lt;a href="http://fink.thetis.ig42.org/"&gt;Fink&lt;/a&gt; anyway.&lt;/p&gt;

&lt;p&gt;I’ve found that &lt;a href="http://consoleemu.com/"&gt;ConsoleEmu.com&lt;/a&gt; – despite occasional page load errors&lt;sup id="fnref:cemu-errors"&gt;&lt;a href="#fn:cemu-errors" rel="footnote"&gt;3&lt;/a&gt;&lt;/sup&gt; – has
&lt;a href="http://consoleemu.com/emulator/fceux"&gt;builds of FCEUX for Mac OS X&lt;/a&gt; (with more
recent ones at the bottom). Note that I can’t vouch for how good these are, as I haven’t
tried them out. If you &lt;strong&gt;do&lt;/strong&gt; have success with them, please let me know, including anything
that you had to do besides just extracting and launching.&lt;/p&gt;

&lt;p&gt;Anyway, if you are determined to build FCEUX on Mac OS X, you may find the following
links helpful:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
&lt;a href="http://www.fceux.com/web/osx.html"&gt;Official FCEUX build instructions for OS X&lt;/a&gt;;&lt;/li&gt;
  &lt;li&gt;
&lt;a href="http://www.natesprogramming.com/?p=94"&gt;Some tips on building FCEUX on Mountain Lion&lt;/a&gt;;&lt;/li&gt;
  &lt;li&gt;
&lt;a href="https://github.com/mxcl/homebrew/blob/master/Library/Formula/fceux.rb"&gt;FCEUX Homebrew formula code&lt;/a&gt; and
&lt;a href="http://blog.xannode.com/?p=124"&gt;original announcement&lt;/a&gt;, which may give you some tips
on how a working build process can be achieved.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id="building-cc65-and-fceux-from-source-on-linux"&gt;Building cc65 and FCEUX from source on Linux&lt;/h3&gt;

&lt;p&gt;I only tested this lightly, from a fresh install of Ubuntu 12.04 LTS (Precise Pangolin) 64-bit.
I did the following:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Update APT sources:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;sudo apt-get update
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Install &lt;code&gt;git&lt;/code&gt; and &lt;code&gt;make&lt;/code&gt;:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;sudo apt-get install git make
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Grab the cc65 repository:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;mkdir -p ~/projects
cd ~/projects
git clone https://github.com/oliverschmidt/cc65.git
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Build cc65:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;cd ~/projects/cc65
make
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Install cc65:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;sudo make avail
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Test:&lt;/p&gt;

    &lt;pre&gt;&lt;code class="language-shellex"&gt;&lt;span class="prompt"&gt;$&lt;/span&gt; &lt;span class="command_line"&gt;cc65 --version&lt;/span&gt;
&lt;span class="output"&gt;cc65 V2.14.0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Now, when it came to building FCEUX on Linux, I didn’t bother trying.
Hopefully you will find adequate instructions via one of the following:&lt;/p&gt;

    &lt;ul&gt;
      &lt;li&gt;
&lt;a href="http://maxolasersquad.blogspot.com.au/2013/08/compiling-fceux-on-ubuntu.html"&gt;Jack David Baucum’s instructions for building FCEUX on Ubuntu&lt;/a&gt;;&lt;/li&gt;
      &lt;li&gt;
&lt;a href="https://github.com/mxcl/homebrew/blob/master/Library/Formula/fceux.rb"&gt;The Homebrew formula for building FCEUX&lt;/a&gt;.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id="alternative-software-for-nes-development"&gt;Alternative Software for NES Development&lt;/h3&gt;

&lt;p class="summary"&gt;I won’t keep these tables up-to-date. Hence, the “Version” and “Last updated” columns may fall behind the
&lt;em&gt;actual&lt;/em&gt; latest versions.&lt;/p&gt;

&lt;p&gt;Below, I have listed some alternative software you can use for assembling NES-targeted
6502 assembly code, as well as alternative emulators for running &lt;code&gt;.nes&lt;/code&gt; files. I certainly
haven’t done any sort of review of the information below; I have tried to dig around and
find out a little bit about each package, but I haven’t really tried any of them out.&lt;/p&gt;

&lt;p id="nesicide"&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; I’d like to give special mention to &lt;a href="http://www.nesicide.com/"&gt;NESICIDE&lt;/a&gt;, which is a new
NES IDE (Integrated Development Environment). It has been in development for some time
and hopes to combine several NES development tools into one package.
The plan is that it will comprise a source editor, emulator, compiler/assembler, debugger,
and graphics/sound editor. It looks promising, but development on it seems to have slowed,
and most features are so far only available for Windows; not so much for Mac OS X and Linux.
Keep an eye on it, though, and maybe you feel like contributing to the project, or
making a donation?&lt;/p&gt;

&lt;h4 id="alternative-6502-assemblers"&gt;Alternative 6502 assemblers&lt;/h4&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Product&lt;/th&gt;
      &lt;th&gt;Version&lt;/th&gt;
      &lt;th&gt;Last updated&lt;/th&gt;
      &lt;th&gt;Win?&lt;/th&gt;
      &lt;th&gt;Mac?&lt;/th&gt;
      &lt;th&gt;Linux?&lt;/th&gt;
      &lt;th&gt;Source?&lt;/th&gt;
      &lt;th&gt;Notes&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;a href="http://oliverschmidt.github.io/cc65/" title="New cc65 website"&gt;cc65&lt;/a&gt;&lt;/td&gt;
      &lt;td&gt;2.14.0&lt;/td&gt;
      &lt;td&gt;2013-10-18&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;YES&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;YES&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;YES&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;&lt;a href="https://github.com/oliverschmidt/cc65"&gt;YES&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Includes C compiler, and config targeting many 6502 systems.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;a href="http://home.comcast.net/~olimar/NES/"&gt;ASM6&lt;/a&gt;&lt;/td&gt;
      &lt;td&gt;1.6&lt;/td&gt;
      &lt;td&gt;2010-11-03&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;YES&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;No&lt;/td&gt;
      &lt;td&gt;No&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;YES&lt;sup id="fnref:asm6-source"&gt;&lt;a href="#fn:asm6-source" rel="footnote"&gt;4&lt;/a&gt;&lt;/sup&gt;&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Releases of ASM6 are ad-hoc, not “managed”.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;a href="http://www.nespowerpak.com/nesasm/"&gt;NESASM3&lt;/a&gt;&lt;/td&gt;
      &lt;td&gt;3.1&lt;/td&gt;
      &lt;td&gt;2011-01-08&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;YES&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;No&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;Yes?&lt;sup id="fnref:nesasm3-linux"&gt;&lt;a href="#fn:nesasm3-linux" rel="footnote"&gt;5&lt;/a&gt;&lt;/sup&gt;&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;&lt;a href="http://www.nespowerpak.com/nesasm/nesasmsrc.zip"&gt;YES&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Simplistic, NES-specific. Focus of &lt;a href="http://nintendoage.com/forum/messageview.cfm?catid=22&amp;amp;threadid=7155"&gt;“Nerdy Nights” tutorials&lt;/a&gt;.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;a href="http://dasm-dillon.sourceforge.net/"&gt;DASM&lt;/a&gt;&lt;/td&gt;
      &lt;td&gt;2.20.11&lt;/td&gt;
      &lt;td&gt;2008-09-22&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;YES&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;&lt;a href="http://sourceforge.net/projects/dasm-dillon/files/dasm-dillon/2.20.11/"&gt;Yes?&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;&lt;a href="http://sourceforge.net/projects/dasm-dillon/files/dasm-dillon/2.20.11/"&gt;Yes?&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;&lt;a href="http://sourceforge.net/p/dasm-dillon/code/HEAD/tree/"&gt;YES&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Targets multiple platforms and other 8-bit CPUs.&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h4 id="alternative-nes-emulators"&gt;Alternative NES emulators&lt;/h4&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Product&lt;/th&gt;
      &lt;th&gt;Version&lt;/th&gt;
      &lt;th&gt;Last updated&lt;/th&gt;
      &lt;th&gt;Win?&lt;/th&gt;
      &lt;th&gt;Mac?&lt;/th&gt;
      &lt;th&gt;Linux?&lt;/th&gt;
      &lt;th&gt;Source?&lt;/th&gt;
      &lt;th&gt;Notes&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;a href="http://www.fceux.com/web/home.html"&gt;FCEUX&lt;/a&gt;&lt;/td&gt;
      &lt;td&gt;2.2.2&lt;/td&gt;
      &lt;td&gt;2013-09-23&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;YES&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;YES&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;YES&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;&lt;a href="http://sourceforge.net/p/fceultra/code/HEAD/tree/"&gt;YES&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Debugging excellent in Win, but absent from Mac/Linux.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;a href="https://code.google.com/p/macifom/"&gt;Macifom&lt;/a&gt;&lt;/td&gt;
      &lt;td&gt;0.16&lt;/td&gt;
      &lt;td&gt;2011-09-27&lt;/td&gt;
      &lt;td&gt;No&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;YES&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;No&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;&lt;a href="http://code.google.com/p/macifom/source/checkout"&gt;YES&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Native Mac app with &lt;code&gt;.dmg&lt;/code&gt; available. Basic debugger.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;a href="http://www.qmtpro.com/~nes/nintendulator/"&gt;Nintendulator&lt;/a&gt;&lt;/td&gt;
      &lt;td&gt;0.970&lt;/td&gt;
      &lt;td&gt;2013-04-23&lt;sup id="fnref:nintendulator-beta"&gt;&lt;a href="#fn:nintendulator-beta" rel="footnote"&gt;6&lt;/a&gt;&lt;/sup&gt;
&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;YES&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;No&lt;/td&gt;
      &lt;td&gt;No&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;&lt;a href="http://www.qmtpro.com/~nes/nintendulator/nintendulator0970src.zip"&gt;YES&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Good debugging tools. Trying for high-accuracy.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;a href="http://nestopia.sourceforge.net/"&gt;Nestopia&lt;/a&gt;&lt;/td&gt;
      &lt;td&gt;1.45&lt;/td&gt;
      &lt;td&gt;(Various)&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;YES&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;YES&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;YES&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;YES&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;
&lt;a href="#nestopia-versions"&gt;See below for more info&lt;/a&gt;.&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h4 id="nestopia-versions"&gt;Nestopia versions&lt;/h4&gt;

&lt;p&gt;Nestopia was originally (?) a Windows-only NES emulator, but there have been different
forks of it to support Linux and Mac OS X also.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;The &lt;em&gt;original&lt;/em&gt; Windows version of Nestopia is 1.40, and since 2008 has been abandoned.
It can be found on the
&lt;a href="http://nestopia.sourceforge.net/downloads.html"&gt;Nestopia downloads page&lt;/a&gt;
along with source code.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;A Mac OS X version (1.4.1), from September 2008, is available via
&lt;a href="http://www.bannister.org/software/nestopia.htm"&gt;Richard Bannister’s website&lt;/a&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;It seems &lt;a href="https://github.com/rdanbrook"&gt;rdanbrook&lt;/a&gt; (aka &lt;a href="https://twitter.com/0ldsk00lca"&gt;0ldsk00lca&lt;/a&gt;)
has &lt;strong&gt;taken over creating &lt;a href="http://0ldsk00l.ca/nestopia.html"&gt;more-recent versions of Nestopia&lt;/a&gt;&lt;/strong&gt;,
which is up to &lt;strong&gt;version 1.45&lt;/strong&gt;:&lt;/p&gt;

    &lt;ul&gt;
      &lt;li&gt;A &lt;a href="http://0ldsk00l.ca/nestopia.html#downloads"&gt;Windows binary is available&lt;/a&gt;.&lt;/li&gt;
      &lt;li&gt;Source code is available &lt;a href="http://github.com/rdanbrook/nestopia"&gt;via GitHub&lt;/a&gt;.&lt;/li&gt;
      &lt;li&gt;There are packages available for installing on &lt;a href="http://packages.debian.org/sid/nestopia"&gt;Debian&lt;/a&gt;,
&lt;a href="https://www.archlinux.org/packages/community/i686/nestopia/"&gt;Arch Linux&lt;/a&gt;,
and &lt;a href="http://ports.su/emulators/nestopia"&gt;OpenBSD&lt;/a&gt;.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;div class="footnotes"&gt;
  &lt;ol&gt;
    &lt;li id="fn:cart"&gt;

      &lt;p&gt;&lt;strong&gt;While this article focuses on PC-based emulation&lt;/strong&gt; for testing, in a future
article I will demonstrate making a basic reprogrammable cartridge (“GamePak”)
that can be used in a real NES.&lt;a href="#fnref:cart" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id="fn:initirq-error"&gt;

      &lt;p&gt;I found that if I did a default install with &lt;code&gt;sudo apt-get install cc65&lt;/code&gt;, it
would install a more-recent (unstable?) version: &lt;code&gt;2.13.9-svn5990-1&lt;/code&gt;. This seems
to have a problem where it reports the following errors when I try to target
the NES using C source:&lt;/p&gt;

      &lt;pre&gt;&lt;code&gt;$ cl65 -t nes hello-nes.c -o hello.nes
Unresolved external `doneirq' referenced in:
  callirq.s(41)
Unresolved external `initirq' referenced in:
  callirq.s(40)
ld65: Error: 2 unresolved external(s) found - cannot create output file
&lt;/code&gt;&lt;/pre&gt;
      &lt;p&gt;&lt;a href="#fnref:initirq-error" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id="fn:cemu-errors"&gt;

      &lt;p&gt;At the time of writing, links within &lt;a href="http://consoleemu.com/"&gt;ConsoleEmu.com&lt;/a&gt; are coming up partly blank,
or reporting 404 errors. I’ve noticed that it sometimes appends a PHP Session ID
(e.g. &lt;code&gt;?PHPSESSID=44baf3d2xxx8b610e3b&lt;/code&gt;) on some URLs, and these seem to screw up
its internal link parsing. In those cases, I just remove this suffix (including
the question mark), and it seems to work.&lt;a href="#fnref:cemu-errors" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id="fn:asm6-source"&gt;

      &lt;p&gt;Source code for ASM6 is supplied as a single C file, along with the ASM6 binary,
in the &lt;a href="http://home.comcast.net/~olimar/NES/asm6.zip"&gt;downloadable ASM6 archive&lt;/a&gt;.&lt;a href="#fnref:asm6-source" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id="fn:nesasm3-linux"&gt;

      &lt;p&gt;&lt;a href="http://www.nintendoage.com/forum/messageview.cfm?catid=22&amp;amp;threadid=32737"&gt;This article on NintendoAge&lt;/a&gt;
suggests, in the “ASSEMBLERS” grid, that NESASM3 &lt;strong&gt;is&lt;/strong&gt;
available for Linux. It’s not clear whether you just have to compile it for Linux yourself
&lt;a href="http://www.nespowerpak.com/nesasm/nesasmsrc.zip"&gt;from the source&lt;/a&gt; which appears to be managed as a
&lt;a href="http://orwelldevcpp.blogspot.com.au/"&gt;Dev-C++&lt;/a&gt; project.&lt;a href="#fnref:nesasm3-linux" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id="fn:nintendulator-beta"&gt;

      &lt;p&gt;The “current release” (0.970) is from 2010-01-02.
The &lt;a href="http://www.qmtpro.com/~nes/nintendulator/#downloads"&gt;Downloads page for Nintendulator&lt;/a&gt;
has a sub-heading describing the “Latest unstable build” which, at the time of writing,
is 0.975 Beta, last updated on 2013-04-23.
&lt;a href="http://www.qmtpro.com/~nes/nintendulator/nintendulator_src.zip"&gt;Latest source&lt;/a&gt;
is also available, as well as
&lt;a href="http://www.qmtpro.com/~nes/nintendulator/mappers_src.zip"&gt;source code for the mapper DLLs&lt;/a&gt;.&lt;a href="#fnref:nintendulator-beta" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;

</content>
    <summary type="html">&lt;p&gt;This is the first article in a short series on throwing yourself quickly
into learning game development for the Nintendo Entertainment System.
The idea will be to get quick results
by example, while learning some key details of how the platform
&lt;em&gt;and development tools&lt;/em&gt; work.&lt;/p&gt;</summary>
  </entry>
  <entry>
    <id>tag:anton.maurovic.com,2013-10-20:/posts/simple-but-delicious-nasi-goreng/</id>
    <title type="html">Simple but Delicious
Nasi Goreng</title>
    <published>2013-10-20T00:00:00Z</published>
    <updated>2013-10-20T00:00:00Z</updated>
    <link rel="alternate" href="https://anton.maurovic.com/posts/simple-but-delicious-nasi-goreng/"/>
    <content type="html">&lt;div style="display:none;"&gt;&lt;img src="/posts/simple-but-delicious-nasi-goreng/thumb.jpg" alt="Simple but Delicious Nasi Goreng" width="160" height="120" border="0"&gt;&lt;/div&gt;

&lt;p class="overview"&gt;Nasi Goreng is Indonesian fried rice. This variation is quite simple,
with the &lt;em&gt;main&lt;/em&gt; flavouring ingredients being only bacon, onion, mushroom, and a few
basic spices. Despite that, it is quite delicious and filling, and quick to prepare.&lt;/p&gt;

&lt;div class="bordered-pic-wrapper"&gt;  &lt;a class="liteup bordered" href="/posts/simple-but-delicious-nasi-goreng/pics/nasi-goreng-served@big.jpg" target="_blank" title="Nasi Goreng served"&gt;&lt;img src="/posts/simple-but-delicious-nasi-goreng/pics/nasi-goreng-served@wide.jpg" alt="Nasi Goreng served"&gt;&lt;/a&gt;  &lt;/div&gt;

&lt;ul class="summary"&gt;
  &lt;li&gt;Serves: 4&lt;/li&gt;
  &lt;li&gt;Preparation time: 10 minutes&lt;/li&gt;
  &lt;li&gt;Cooking time: 20 minutes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Nasi Goreng is an Indonesian dish, with “nasi” meaning “rice” and “goreng” meaning “fried”.
The recipe here has fewer ingredients than is traditional&lt;sup id="fnref:traditional"&gt;&lt;a href="#fn:traditional" rel="footnote"&gt;1&lt;/a&gt;&lt;/sup&gt;, making it simpler
and more-economical, as well as faster to prepare. I have always loved this one as a kid, as it
is very moreish, with excellent flavour and aroma. It’s a good base for adding many other things
that may take your fancy, too.&lt;/p&gt;

&lt;h2 id="ingredients"&gt;Ingredients&lt;/h2&gt;

&lt;div class="rounded right-pic-wrapper"&gt;  &lt;img class="rounded right" src="/posts/simple-but-delicious-nasi-goreng/pics/nasi-goreng-ingredients@custom.jpg" alt="Nasi Goreng Ingredients" title="Nasi Goreng Ingredients"&gt;  &lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Main recipe:
    &lt;ul&gt;
      &lt;li&gt;2 large onions&lt;/li&gt;
      &lt;li&gt;6 rashers of middle bacon&lt;/li&gt;
      &lt;li&gt;8 medium mushrooms&lt;/li&gt;
      &lt;li&gt;3 tbsp butter&lt;/li&gt;
      &lt;li&gt;1½ tsp curry powder&lt;/li&gt;
      &lt;li&gt;1½ tsp paprika&lt;/li&gt;
      &lt;li&gt;½ tsp chilli flakes&lt;/li&gt;
      &lt;li&gt;4 tsp vegetable stock powder&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Rice:
    &lt;ul&gt;
      &lt;li&gt;3 cups basmati rice&lt;/li&gt;
      &lt;li&gt;3 cups water&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id="method"&gt;Method&lt;/h2&gt;

&lt;div class="rounded right-pic-wrapper"&gt;  &lt;img class="rounded right" src="/posts/simple-but-delicious-nasi-goreng/pics/bacon-mushroom-onion-butter@custom.jpg" alt="Diced Nasi Goreng ingredients" title="Diced Nasi Goreng ingredients"&gt;  &lt;/div&gt;

&lt;ol&gt;
  &lt;li&gt;Dice the onions and bacon.&lt;/li&gt;
  &lt;li&gt;Dice the mushrooms into a separate bowl.&lt;/li&gt;
  &lt;li&gt;Melt the butter in a frying pan on high heat.&lt;/li&gt;
  &lt;li&gt;Gradually fry all of the onion and bacon, until it is just starting to brown.
This will take about 10 minutes.&lt;/li&gt;
  &lt;li&gt;While frying the onion and bacon, start steaming the rice. With a typical rice
cooker, 3 cups of water is enough to ensure the rice doesn’t go mushy.&lt;/li&gt;
  &lt;li&gt;Stir in the diced mushroom.&lt;/li&gt;
  &lt;li&gt;Add all of the spices and vegetable stock to the frying pan, stirring it
around thoroughly as it cooks. Using a wooden spoon or spatula, keep
dislodging ingredients that congeal and stick to the frying pan.&lt;/li&gt;
  &lt;li&gt;After about 5 minutes, the contents of the frying pan should be a deep
golden-brown colour. The fragrance of the spices should now be more blended.&lt;/li&gt;
  &lt;li&gt;When the rice is cooked, stir it in to the frying pan, and set it to medium-low
heat.&lt;/li&gt;
  &lt;li&gt;Keep stirring it around for another 5 minutes as the mixture combines,
turning the rice an even yellow-golden colour.&lt;/li&gt;
  &lt;li&gt;Serve!&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="rounded-pic-wrapper"&gt;  &lt;img class="rounded" src="/posts/simple-but-delicious-nasi-goreng/pics/nasi-goreng-stages@wide.jpg" alt="Stages of preparation for Nasi Goreng" title="Stages of preparation for Nasi Goreng"&gt;  &lt;/div&gt;

&lt;h2 id="variations"&gt;Variations&lt;/h2&gt;

&lt;p&gt;The definition of “Nasi Goreng” is very broad, so you can add just about anything you like to it.
Here are some suggestions for how to mix up the recipe a bit:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;For a more-lean variant, replace the butter with an oil, such as a
couple of tablespoons of olive oil.&lt;/li&gt;
  &lt;li&gt;Try using less bacon, and more chicken. Dice the chicken and cook it with
the onions and bacon from the start, or marinade chicken tenderloins and cook them
alongside the main recipe, adding them in at the end.&lt;/li&gt;
  &lt;li&gt;Substitute ziti, penne, or macaroni pasta for the rice.
This was also a favourite of mine, as a kid.&lt;/li&gt;
  &lt;li&gt;If you’re looking to cook a larger quantity, you may find it easier to stir in the rice
if you started preparing the dish in a wok or electric frying pan.&lt;/li&gt;
  &lt;li&gt;Try the &lt;a href="http://en.wikipedia.org/wiki/Nasi_goreng#Ingredients"&gt;more-traditional ingredients&lt;/a&gt; and garnishes.
For example, check out &lt;a href="http://www.taste.com.au/recipes/187/nasi+goreng"&gt;this Nasi Goreng recipe&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="footnotes"&gt;
  &lt;ol&gt;
    &lt;li id="fn:traditional"&gt;

      &lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Nasi_goreng#Ingredients"&gt;According to Wikipedia&lt;/a&gt;, a &lt;em&gt;key&lt;/em&gt; ingredient in
traditional Nasi Goreng is sweet soy sauce. Other common ingredients include: garlic; shallot; spring onions;
nutmeg; turmeric; palm sugar; and ginger garlic paste.&lt;a href="#fnref:traditional" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;

</content>
    <summary type="html">&lt;p&gt;Nasi Goreng is Indonesian fried rice. This variation is quite simple,
with the &lt;em&gt;main&lt;/em&gt; flavouring ingredients being only bacon, onion, mushroom, and a few
basic spices. Despite that, it is quite delicious and filling, and quick to prepare.&lt;/p&gt;</summary>
  </entry>
  <entry>
    <id>tag:anton.maurovic.com,2013-10-12:/posts/mac-os-x-development-environment-with-ruby/</id>
    <title type="html">Mac OS X Development Environment with Ruby</title>
    <published>2013-10-12T00:00:00Z</published>
    <updated>2013-10-12T00:00:00Z</updated>
    <link rel="alternate" href="https://anton.maurovic.com/posts/mac-os-x-development-environment-with-ruby/"/>
    <content type="html">&lt;div style="display:none;"&gt;&lt;img src="/posts/mac-os-x-development-environment-with-ruby/thumb.png" alt="Mac OS X Development Environment with Ruby" width="160" height="120" border="0"&gt;&lt;/div&gt;

&lt;p class="overview"&gt;As a programmer it helps to be comfortable across many different platforms, and learn to
leverage the benefits of each. After purchasing my first Mac – an old MacBook – I set out
to create a tailored environment that would help my Ruby (and other) development sing.&lt;/p&gt;

&lt;div class="bordered-pic-wrapper"&gt;  &lt;img class="bordered" src="/posts/mac-os-x-development-environment-with-ruby/pics/mac-and-ruby-with-cat@wide.jpg" alt="Essential tools for awesome software development" title="Essential tools for awesome software development"&gt;  &lt;/div&gt;

&lt;ul class="toc" id="markdown-toc"&gt;
  &lt;li&gt;&lt;a href="#summary"&gt;Summary&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#checking-existing-environment"&gt;Checking existing environment&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;
&lt;a href="#installation-steps"&gt;Installation Steps&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href="#pre-requisites"&gt;Pre-requisites&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#installing-xcode-command-line-tools"&gt;Installing “Xcode Command Line Tools”&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#installing-homebrew"&gt;Installing Homebrew&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#installing-git-and-configuring-for-github"&gt;Installing Git, and configuring for GitHub&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#installing-rvm"&gt;Installing RVM&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#install-bundler"&gt;Install Bundler&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;
&lt;a href="#install-optional-stuff"&gt;Install optional stuff&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href="#install-imagemagick"&gt;Install ImageMagick&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#install-git-flow"&gt;Install git-flow&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#fix-vim-config"&gt;Fix &lt;code&gt;vim&lt;/code&gt; config&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#install-iterm2"&gt;Install iTerm2&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#install-sublime-text"&gt;Install Sublime Text&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href="#other-stuff-worth-checking-out"&gt;Other stuff worth checking out&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#troubleshooting"&gt;Troubleshooting&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#tips-for-installing-on-mac-os-x-108-and-above"&gt;Tips for installing on Mac OS X 10.8 and above&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#installing-xcode-clt-via-command-line"&gt;Installing Xcode &lt;abbr title="Command-Line Tools"&gt;CLT&lt;/abbr&gt; via command-line&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#conclusion"&gt;Conclusion&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id="summary"&gt;Summary&lt;/h2&gt;

&lt;div class="rightup-pic-wrapper"&gt;  &lt;img class="rightup" src="/posts/mac-os-x-development-environment-with-ruby/pics/mac-os-x-ruby@custom.jpg" alt="Mac OS X with Ruby" title="Mac OS X with Ruby"&gt;  &lt;/div&gt;

&lt;p&gt;There are lots of options for setting up a development environment on a Mac, and even more
options for the Ruby side of things. Starting with a clean install of Mac OS X 10.7 (Lion),
in this case, I worked out the best combination of development tools to suit my needs. While
these lean towards Ruby, they should be a good baseline for other development needs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;UPDATE - 24 January 2014:&lt;/strong&gt; I have since tested these instructions on Mac OS X 10.8.5
(Mountain Lion) and made some minor edits to ensure that both OS X 10.7 and OS X 10.8 are
covered. Particular revisions for OS X 10.8 are covered in:
&lt;a href="#tips-for-installing-on-mac-os-x-108-and-above"&gt;Tips for installing on Mac OS X 10.8 and above&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here’s a summary of the choices I made:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
&lt;strong&gt;Mac OS X 10.7.5&lt;/strong&gt;. I had 10.7, and it’s necessary to “Software Update” this to
the latest version. Other guides&lt;sup id="fnref:other-osx"&gt;&lt;a href="#fn:other-osx" rel="footnote"&gt;1&lt;/a&gt;&lt;/sup&gt; may assist with filling in the gaps
for more-recent versions of OS X.&lt;/li&gt;
  &lt;li&gt;
&lt;strong&gt;Xcode Command Line Tools&lt;/strong&gt; (Xcode &lt;abbr title="Command-Line Tools"&gt;CLT&lt;/abbr&gt;). At about 140MB, this gives us various essential
build tools without needing the full Xcode package;&lt;/li&gt;
  &lt;li&gt;
&lt;strong&gt;&lt;a href="http://brew.sh/"&gt;Homebrew&lt;/a&gt;&lt;/strong&gt;. Mac package management has never been easier, or more reliable!&lt;/li&gt;
  &lt;li&gt;
&lt;strong&gt;&lt;a href="http://rvm.io/"&gt;RVM&lt;/a&gt;&lt;/strong&gt;. This is my preferred&lt;sup id="fnref:rvm"&gt;&lt;a href="#fn:rvm" rel="footnote"&gt;2&lt;/a&gt;&lt;/sup&gt; Ruby version manager. It makes
installing/updating Ruby easier, and gives you more options.&lt;/li&gt;
  &lt;li&gt;
&lt;strong&gt;Ruby 1.9.3&lt;/strong&gt;. It’s a well-established standard. I will make the switch to
Ruby 2.x when it’s more mature and dominant.&lt;/li&gt;
  &lt;li&gt;
&lt;strong&gt;&lt;a href="http://bundler.io/"&gt;Bundler&lt;/a&gt;&lt;/strong&gt;. Managing gems is delightfully simple and transparent with this.&lt;/li&gt;
  &lt;li&gt;
&lt;strong&gt;&lt;a href="http://www.iterm2.com/"&gt;iTerm2&lt;/a&gt;&lt;/strong&gt;. I haven’t yet found a Terminal program on any OS that I like more
than iTerm2.&lt;/li&gt;
  &lt;li&gt;
&lt;strong&gt;&lt;a href="http://www.sublimetext.com/"&gt;Sublime Text&lt;/a&gt;&lt;/strong&gt;. Available for Mac, Windows, and Linux; it supports most of
the stuff you can plug into TextMate, with many other cool features.&lt;/li&gt;
  &lt;li&gt;
&lt;strong&gt;Git and &lt;a href="http://github.com/"&gt;GitHub&lt;/a&gt;&lt;/strong&gt;. They’re just done so well, and really you can’t do without them.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Things &lt;strong&gt;NOT&lt;/strong&gt; covered by this article:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
&lt;strong&gt;Targeting specific platforms&lt;/strong&gt;. I’m not yet worrying about building stuff
specifically &lt;em&gt;for&lt;/em&gt; OS X, iOS, Android, or otherwise. I’m sure there are plenty of
excellent guides on the web if you’re looking to get heavily into conventional app
development or otherwise use the full suite of tools provided by Xcode.&lt;/li&gt;
  &lt;li&gt;
&lt;strong&gt;Database engine&lt;/strong&gt;. I’d probably go for SQLite3 for basic stuff and private apps,
and PostgreSQL for web apps or apps dealing with big data. I’m not much interested
in MySQL anymore.&lt;/li&gt;
  &lt;li&gt;
&lt;strong&gt;Shell&lt;/strong&gt;. Though I’ve used Z-Shell (&lt;code&gt;zsh&lt;/code&gt;) before and I like it,
I will stick with the default &lt;code&gt;bash&lt;/code&gt; for now.&lt;/li&gt;
  &lt;li&gt;
&lt;strong&gt;Ruby on Rails&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p class="warning"&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; Developing on a Mac may not &lt;em&gt;necessarily&lt;/em&gt; be the right choice for you.
Be aware of &lt;a href="http://programmers.stackexchange.com/questions/51670/why-do-programmers-use-or-recommend-mac-os-x#answer-65381"&gt;some of the arguments for using other platforms&lt;/a&gt;
before jumping head-long into purchasing a Mac or otherwise abandoning an existing
platform that is working for you.&lt;/p&gt;

&lt;h2 id="checking-existing-environment"&gt;Checking existing environment&lt;/h2&gt;

&lt;p class="summary"&gt;This is just a background check, for your reference. It might not really be that important,
unless you already use your Mac for other development stuff and need to maintain an environment.
You can &lt;a href="#installation-steps"&gt;skip to the next section&lt;/a&gt; if you prefer.&lt;/p&gt;

&lt;div class="rightup-pic-wrapper"&gt;  &lt;img class="rightup" src="/posts/mac-os-x-development-environment-with-ruby/pics/mac-os-x-software-update@custom.png" alt="Mac OS X Software Update icon" title="Mac OS X Software Update icon"&gt;  &lt;/div&gt;

&lt;p&gt;I started with a fresh (not-yet-updated) install of Mac OS X 10.7 (Lion) on an old
Mid-2007 black MacBook (&lt;code&gt;MacBook2,1&lt;/code&gt;, model A1181) with 2GB of RAM and an
Intel Core 2 Duo CPU (x86 only&lt;sup id="fnref:x86"&gt;&lt;a href="#fn:x86" rel="footnote"&gt;3&lt;/a&gt;&lt;/sup&gt;). I’ve found the performance of Lion and my dev
tools, on this Mac, to be &lt;em&gt;adequate&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;This is how I inspected my existing environment, in Terminal:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Find out Mac OS X details:&lt;/p&gt;

    &lt;pre&gt;&lt;code class="language-shellex"&gt;&lt;span class="prompt"&gt;$&lt;/span&gt; &lt;span class="command_line"&gt;system_profiler SPSoftwareDataType&lt;/span&gt;
&lt;span class="output"&gt;Software:&lt;/span&gt;

    &lt;span class="output"&gt;System Software Overview:&lt;/span&gt;

&lt;span class="note"&gt;      System Version: Mac OS X 10.7 (11A511)&lt;/span&gt;
      &lt;span class="output"&gt;Kernel Version: Darwin 11.0.0&lt;/span&gt;
      &lt;span class="output"&gt;Boot Volume: Anton250GB&lt;/span&gt;
      &lt;span class="output"&gt;Boot Mode: Normal&lt;/span&gt;
      &lt;span class="output"&gt;Computer Name: OldMacBook&lt;/span&gt;
      &lt;span class="output"&gt;User Name: Anton Maurovic (amaurovic)&lt;/span&gt;
      &lt;span class="output"&gt;Secure Virtual Memory: Enabled&lt;/span&gt;
      &lt;span class="output"&gt;64-bit Kernel and Extensions: No&lt;/span&gt;
      &lt;span class="output"&gt;Time since boot: 1 day11:50&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Check the versions of Ruby and Rubygems that come bundled with 10.7:&lt;/p&gt;

    &lt;pre&gt;&lt;code class="language-shellex"&gt;&lt;span class="prompt"&gt;$&lt;/span&gt; &lt;span class="command_line"&gt;ruby --version&lt;/span&gt;
&lt;span class="output"&gt;ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]&lt;/span&gt;
    
&lt;span class="prompt"&gt;$&lt;/span&gt; &lt;span class="command_line"&gt;gem --version&lt;/span&gt;
&lt;span class="output"&gt;1.3.6&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Verify that there is not (yet) any C compiler, or &lt;code&gt;make&lt;/code&gt;:&lt;/p&gt;

    &lt;pre&gt;&lt;code class="language-shellex"&gt;&lt;span class="prompt"&gt;$&lt;/span&gt; &lt;span class="command_line"&gt;gcc --version&lt;/span&gt;
&lt;span class="output"&gt;-bash: gcc: command not found&lt;/span&gt;

&lt;span class="prompt"&gt;$&lt;/span&gt; &lt;span class="command_line"&gt;cc --version&lt;/span&gt;
&lt;span class="output"&gt;-bash: cc: command not found&lt;/span&gt;

&lt;span class="prompt"&gt;$&lt;/span&gt; &lt;span class="command_line"&gt;make --version&lt;/span&gt;
&lt;span class="output"&gt;-bash: make: command not found&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id="installation-steps"&gt;Installation Steps&lt;/h2&gt;

&lt;p class="warning"&gt;NOTE: I only show use of &lt;code&gt;sudo&lt;/code&gt; (i.e. root operations) where strictly required.
Many commands are best run just as your regular, un-elevated user. Your user should
still be in the class of “Administrators”, however, for when you get to steps that
&lt;strong&gt;do&lt;/strong&gt; require &lt;code&gt;sudo&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;These instructions are intended for OS X 10.7 and above. Earlier versions of OS X
probably require that you download and install the full Xcode package from Apple,
suitable for your specific version of OS X.&lt;/p&gt;

&lt;h3 id="pre-requisites"&gt;Pre-requisites&lt;/h3&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Use your Mac’s “Software Update” to ensure&lt;sup id="fnref:osx-update"&gt;&lt;a href="#fn:osx-update" rel="footnote"&gt;4&lt;/a&gt;&lt;/sup&gt; you have the latest version of your OS X.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Check &lt;code&gt;system_profiler SPSoftwareDataType&lt;/code&gt; again:&lt;/p&gt;

    &lt;pre&gt;&lt;code class="language-shellex"&gt;&lt;span class="prompt"&gt;$&lt;/span&gt; &lt;span class="command_line"&gt;system_profiler SPSoftwareDataType&lt;/span&gt;
&lt;span class="output"&gt;Software:&lt;/span&gt;

    &lt;span class="output"&gt;System Software Overview:&lt;/span&gt;

&lt;span class="note"&gt;      System Version: Mac OS X 10.7.5 (11G63)&lt;/span&gt;
      &lt;span class="output"&gt;Kernel Version: Darwin 11.4.2&lt;/span&gt;
      &lt;span class="output"&gt;Boot Volume: Anton250GB&lt;/span&gt;
      &lt;span class="output"&gt;Boot Mode: Normal&lt;/span&gt;
      &lt;span class="output"&gt;Computer Name: OldMacBook&lt;/span&gt;
      &lt;span class="output"&gt;User Name: Anton (amaurovic)&lt;/span&gt;
      &lt;span class="output"&gt;Secure Virtual Memory: Enabled&lt;/span&gt;
      &lt;span class="output"&gt;64-bit Kernel and Extensions: No&lt;/span&gt;
      &lt;span class="output"&gt;Time since boot: 2:48&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Check Ruby version:&lt;/p&gt;

    &lt;pre&gt;&lt;code class="language-shellex"&gt;&lt;span class="prompt"&gt;$&lt;/span&gt; &lt;span class="command_line"&gt;ruby --version&lt;/span&gt;
&lt;span class="output"&gt;ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin11.0]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id="installing-xcode-command-line-tools"&gt;Installing “Xcode Command Line Tools”&lt;/h3&gt;

&lt;p class="summary"&gt;People have suggested &lt;a href="https://github.com/kennethreitz/osx-gcc-installer/"&gt;osx-gcc-installer&lt;/a&gt;
instead, but since SOME stuff can’t be compiled with it, even its maintainer
(&lt;a href="http://kennethreitz.org/about/"&gt;Kenneth Reitz&lt;/a&gt;) seems to
&lt;a href="http://kennethreitz.org/xcode-gcc-and-homebrew/"&gt;advocate using Xcode Command Line Tools&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Xcode &lt;abbr title="Command-Line Tools"&gt;CLT&lt;/abbr&gt; is &lt;a href="https://github.com/Homebrew/homebrew/wiki/Installation#wiki-fn3"&gt;needed for Homebrew&lt;/a&gt;.
So that we don’t have to install the full Xcode (over 1.6GB!) we’ll install
“Xcode Command Line Tools” (between 100MB and 140MB):&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Go to: &lt;a href="https://developer.apple.com/downloads"&gt;https://developer.apple.com/downloads&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;You will need an Apple Developer account (which you can register for free).&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Once you hit the main download page, you may need to search for “&lt;code&gt;command line tools&lt;/code&gt;”
to find the right one for your OS X version:&lt;/p&gt;

    &lt;div class="-pic-wrapper"&gt;  &lt;a class="liteup liteup-noborder" href="/posts/mac-os-x-development-environment-with-ruby/pics/xcode-clt-download@big.png" target="_blank" title="Xcode Command Line Tools package download"&gt;&lt;img src="/posts/mac-os-x-development-environment-with-ruby/pics/xcode-clt-download@photo.jpg" alt="Xcode Command Line Tools package download"&gt;&lt;/a&gt;  &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;IF you have to do everything via command-line&lt;/strong&gt;, for some reason, see the
&lt;a href="#installing-xcode-clt-via-command-line"&gt;instructions for installing Xcode &lt;abbr title="Command-Line Tools"&gt;CLT&lt;/abbr&gt; via command-line&lt;/a&gt;.
Otherwise, just do the following…&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Double-click the DMG file you downloaded, to mount it.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;From the Finder window that pops up, double-click &lt;code&gt;Command Line Tools (...).mpkg&lt;/code&gt; or whatever
your package is called.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Step through all defaults, to install.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Unmount the DMG.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now we should have &lt;code&gt;gcc&lt;/code&gt;, &lt;code&gt;make&lt;/code&gt;, and a few other important things. For example:&lt;/p&gt;

&lt;pre&gt;&lt;code class="language-shellex"&gt;&lt;span class="prompt"&gt;$&lt;/span&gt; &lt;span class="command_line"&gt;gcc --version&lt;/span&gt;
&lt;span class="output"&gt;i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)&lt;/span&gt;&lt;span class="c"&gt;
...
&lt;/span&gt;
&lt;span class="prompt"&gt;$&lt;/span&gt; &lt;span class="command_line"&gt;make --version&lt;/span&gt;
&lt;span class="output"&gt;GNU Make 3.81&lt;/span&gt;&lt;span class="c"&gt;
...
&lt;/span&gt;
&lt;span class="prompt"&gt;$&lt;/span&gt; &lt;span class="command_line"&gt;git --version&lt;/span&gt;
&lt;span class="output"&gt;git version 1.7.12.4 (Apple Git-37)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id="installing-homebrew"&gt;Installing Homebrew&lt;/h3&gt;

&lt;div class="rightup-pic-wrapper"&gt;  &lt;img class="rightup" src="/posts/mac-os-x-development-environment-with-ruby/pics/homebrew-icon@custom.png" alt="Homebrew icon" title="Homebrew icon"&gt;  &lt;/div&gt;

&lt;p&gt;&lt;a href="http://brew.sh/"&gt;Homebrew&lt;/a&gt; is described as “the missing package manager for OS X”. It is basically like the
Debian/Ubuntu &lt;a href="http://en.wikipedia.org/wiki/Advanced_Packaging_Tool"&gt;APT&lt;/a&gt; system, and makes it quite fast and easy to find software packages, install them,
update them, and remove them. There is an alternative – &lt;a href="http://www.macports.org/"&gt;MacPorts&lt;/a&gt; – but I strongly prefer Homebrew
for its simplicity and reliability.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Go into Terminal and run:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Check with:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;brew doctor
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;In my case it has nothing to recommend: &lt;code&gt;Your system is ready to brew&lt;/code&gt;.
Otherwise, you &lt;em&gt;may&lt;/em&gt; need to tweak some things to make it happy, but it
should tell you what to do.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Run:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;brew update
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id="installing-git-and-configuring-for-github"&gt;Installing Git, and configuring for GitHub&lt;/h3&gt;

&lt;div class="rightup-pic-wrapper"&gt;  &lt;img class="rightup" src="/posts/mac-os-x-development-environment-with-ruby/pics/github-octocat-logo@custom.png" alt="GitHub Octocat icon" title="GitHub Octocat icon"&gt;  &lt;/div&gt;

&lt;p&gt;Now that we have Homebrew, installing packages is so much easier. We’ll start by installing
Git, then configure it to enhance your shell prompt, test it out, and optionally link it
up to your &lt;a href="http://github.com/"&gt;GitHub&lt;/a&gt; account, &lt;em&gt;if&lt;/em&gt; you have one.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Run:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;brew install git
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Now, at this point I ran &lt;code&gt;git --version&lt;/code&gt; and found it was still executing
the old (&lt;code&gt;Apple Git-37&lt;/code&gt;) version instead of the new one I just installed.
I exited my Terminal and started up a new one, to load
the latest config, and ran &lt;code&gt;brew doctor&lt;/code&gt; again, which told me: &lt;/p&gt;

    &lt;pre&gt;&lt;code class="language-shellex"&gt;&lt;span class="prompt"&gt;$&lt;/span&gt; &lt;span class="command_line"&gt;brew doctor&lt;/span&gt;
&lt;span class="output"&gt;Warning: /usr/bin occurs before /usr/local/bin&lt;/span&gt;
&lt;span class="output"&gt;This means that system-provided programs will be used instead of those&lt;/span&gt;
&lt;span class="output"&gt;provided by Homebrew. The following tools exist at both paths:&lt;/span&gt;

    &lt;span class="output"&gt;git&lt;/span&gt;
    &lt;span class="output"&gt;git-cvsserver&lt;/span&gt;
    &lt;span class="output"&gt;git-receive-pack&lt;/span&gt;
    &lt;span class="output"&gt;git-shell&lt;/span&gt;
    &lt;span class="output"&gt;git-upload-archive&lt;/span&gt;
    &lt;span class="output"&gt;git-upload-pack&lt;/span&gt;

&lt;span class="output"&gt;Consider setting your PATH so that /usr/local/bin&lt;/span&gt;
&lt;span class="output"&gt;occurs before /usr/bin. Here is a one-liner:&lt;/span&gt;
&lt;span class="warn"&gt;    echo export PATH="/usr/local/bin:$PATH" &amp;gt;&amp;gt; ~/.bash_profile&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

    &lt;p class="alert"&gt;…&lt;strong&gt;but there’s an error, in this one-liner at the end&lt;/strong&gt;. Here is the
exact, &lt;em&gt;revised&lt;/em&gt; statement that I executed:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;echo export PATH="/usr/local/bin:\$PATH" &amp;gt;&amp;gt; ~/.bash_profile
&lt;/code&gt;&lt;/pre&gt;

    &lt;p&gt;The difference is the extra backslash at &lt;code&gt;\$PATH&lt;/code&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;After executing that statement to update my &lt;code&gt;~/.bash_profile&lt;/code&gt;, I exited
my Terminal, and then went into it again to ensure all settings were refreshed.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Now &lt;code&gt;git --version&lt;/code&gt; gives:&lt;/p&gt;

    &lt;pre&gt;&lt;code class="language-shellex"&gt;&lt;span class="prompt"&gt;$&lt;/span&gt; &lt;span class="command_line"&gt;git --version&lt;/span&gt;
&lt;span class="output"&gt;git version 1.8.4&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Configure Git, using &lt;strong&gt;your preferred personal details&lt;/strong&gt;:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;git config --global color.ui true
git config --global user.name "Yourfull Namehere"
git config --global user.email "ifyoureally@wantto.com"
    
git config --global push.default simple   # !! SEE BELOW !!
&lt;/code&gt;&lt;/pre&gt;

    &lt;p class="warning"&gt;Note that the last option for &lt;code&gt;push.default&lt;/code&gt; &lt;strong&gt;should only be set for Git 1.8.x or above&lt;/strong&gt;.
It tells Git that when we do a &lt;code&gt;git push&lt;/code&gt;, we only want to push commits for the branch that
we’re currently on rather than all branches. You don’t have to do this, if you don’t want.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;You can now enhance your prompt, so that it will reveal information about your
Git branch, any time you’re in a directory inside a Git repository. These
instructions are adapted from &lt;a href="http://code-worrier.com/blog/git-branch-in-bash-prompt/"&gt;this article&lt;/a&gt;,
but have been re-written slightly to make it clearer what, exactly, you need to do:&lt;/p&gt;

    &lt;ol&gt;
      &lt;li&gt;
        &lt;p&gt;First, download the &lt;code&gt;.git-prompt.sh&lt;/code&gt; script to your home directory:&lt;/p&gt;

        &lt;pre&gt;&lt;code&gt;curl -Lo ~/.git-prompt.sh https://raw.github.com/git/git/master/contrib/completion/git-prompt.sh
&lt;/code&gt;&lt;/pre&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;p&gt;Add the following lines to the end of your &lt;code&gt;~/.bash_profile&lt;/code&gt; script (creating the file
if it doesn’t already exist):&lt;/p&gt;

        &lt;pre&gt;&lt;code&gt;source ~/.git-prompt.sh
    NONE="\[\033[0m\]"
     RED="\[\033[0;31m\]"
   GREEN="\[\033[0;32m\]"
  YELLOW="\[\033[0;33m\]"
    BLUE="\[\033[0;34m\]"
 MAGENTA="\[\033[0;35m\]"
   WHITE="\[\033[1;37m\]"
PS1="$GREEN\t$RED-$BLUE\u:$YELLOW\W$MAGENTA\$(__git_ps1)$WHITE\$$NONE "
# OR, if you don't want to use a colour prompt:
#PS1="\t-\u:\W\$(__git_ps1)\$ "
&lt;/code&gt;&lt;/pre&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;p&gt;Reload your shell’s environment to see the new prompt:&lt;/p&gt;

        &lt;pre&gt;&lt;code&gt;source ~/.bash_profile
&lt;/code&gt;&lt;/pre&gt;
      &lt;/li&gt;
    &lt;/ol&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Create &lt;code&gt;~/projects&lt;/code&gt;:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;mkdir -p ~/projects
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li id="git-test"&gt;
    &lt;p&gt;Test git, and your updated prompt:&lt;/p&gt;

    &lt;pre&gt;&lt;code class="language-shellex"&gt;&lt;span class="prompt"&gt;$&lt;/span&gt; &lt;span class="command_line"&gt;cd ~/projects&lt;/span&gt;
    
&lt;span class="prompt"&gt;$&lt;/span&gt; &lt;span class="command_line"&gt;git clone https://github.com/mechanicles/ruby-tictactoe.git&lt;/span&gt;
&lt;span class="output"&gt;Cloning into 'ruby-tictactoe'...&lt;/span&gt;
&lt;span class="output"&gt;remote: Counting objects: 6, done.&lt;/span&gt;
&lt;span class="output"&gt;remote: Compressing objects: 100% (6/6), done.&lt;/span&gt;
&lt;span class="output"&gt;remote: Total 6 (delta 0), reused 6 (delta 0)&lt;/span&gt;
&lt;span class="output"&gt;Receiving objects: 100% (6/6), done.&lt;/span&gt;
    
&lt;span class="prompt"&gt;$&lt;/span&gt; &lt;span class="command_line"&gt;cd ruby-tictactoe&lt;/span&gt;
&lt;span class="note"&gt;21:57:52-amaurovic:ruby-tictactoe (master)$ &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

    &lt;p&gt;NOTE appearance of the &lt;code&gt;(master)&lt;/code&gt; branch identifier.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;The following GitHub steps are optional, if you’re going to use GitHub…&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href="https://help.github.com/articles/generating-ssh-keys#platform-mac"&gt;Generate an SSH key&lt;/a&gt;,
noting that a passphrase is optional.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Configure your git…&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;git config --global github.user "your_github_username"
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Restart your shell; i.e. exit Terminal and then bring it up again.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id="installing-rvm"&gt;Installing RVM&lt;/h3&gt;

&lt;div class="rightup-pic-wrapper"&gt;  &lt;img class="rightup" src="/posts/mac-os-x-development-environment-with-ruby/pics/rvm-logo@custom.png" alt="RVM (Ruby Version Manager) logo" title="RVM (Ruby Version Manager) logo"&gt;  &lt;/div&gt;

&lt;p&gt;&lt;a href="http://rvm.io/"&gt;RVM&lt;/a&gt; – Ruby Version Manager – lets you easily install Ruby, and optionally multiple
different &lt;em&gt;versions&lt;/em&gt; of Ruby on the same machine, such as 1.9.3; 2.0.0; 
&lt;a href="https://www.ruby-lang.org/en/news/2013/06/30/we-retire-1-8-7/"&gt;the retired 1.8.7&lt;/a&gt;; and even
&lt;a href="http://jruby.org/"&gt;JRuby&lt;/a&gt; and &lt;a href="http://www.rubyenterpriseedition.com/"&gt;Ruby Enterprise Edition&lt;/a&gt;. It can
manage multiple Gemsets for each, and allow each &lt;em&gt;project&lt;/em&gt; to
&lt;a href="http://rvm.io/workflow/projects"&gt;specify particular Ruby and Gemset requirements&lt;/a&gt; at runtime.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Install &lt;a href="http://rvm.io/"&gt;RVM&lt;/a&gt;:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;\curl -L https://get.rvm.io | bash -s stable
&lt;/code&gt;&lt;/pre&gt;

    &lt;p&gt;NOTE: The leading backslash is deliberate&lt;sup id="fnref:no-alias"&gt;&lt;a href="#fn:no-alias" rel="footnote"&gt;5&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Add the following as the last line of your &lt;code&gt;~/.bash_profile&lt;/code&gt; file:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;[[ -s "$HOME/.rvm/scripts/rvm" ]] &amp;amp;&amp;amp; . "$HOME/.rvm/scripts/rvm"
&lt;/code&gt;&lt;/pre&gt;

    &lt;p&gt;This ensures RVM will be loaded when you log in, and will hence activate when required.    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Restart your shell (i.e. exit Terminal and then go back into it).&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Check:&lt;/p&gt;

    &lt;pre&gt;&lt;code class="language-shellex"&gt;&lt;span class="prompt"&gt;$&lt;/span&gt; &lt;span class="command_line"&gt;type rvm | head -1&lt;/span&gt;
&lt;span class="output"&gt;rvm is a function&lt;/span&gt;
    
&lt;span class="prompt"&gt;$&lt;/span&gt; &lt;span class="command_line"&gt;ruby --version&lt;/span&gt;
&lt;span class="output"&gt;ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin11.0]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p id="rvm-install-193"&gt;Install Ruby 1.9.3:&lt;/p&gt;

    &lt;pre&gt;&lt;code class="language-shellex"&gt;&lt;span class="output"&gt;rvm install 1.9.3&lt;/span&gt;
&lt;span class="output"&gt;rvm --default 1.9.3&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

    &lt;p class="warning"&gt;&lt;strong&gt;Be aware:&lt;/strong&gt; When testing these instructions on Mac OS X 10.8.5, I found that
&lt;code&gt;rvm install 1.9.3&lt;/code&gt; failed about 22 minutes in, and an extra step was
required. See below re &lt;a href="#fix-gcc"&gt;tips for installing on Mac OS X 10.8 and above&lt;/a&gt;.&lt;/p&gt;

    &lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; This isn’t necessarily going to happen quickly, as it may have to do a lot of
work in downloading prerequisites, and then compiling. For me, on my slow old MacBook,
this took about &lt;strong&gt;1 hour&lt;/strong&gt;. On a 2013-model iMac with OS X 10.8.5, it took
about &lt;strong&gt;30 minutes&lt;/strong&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Now run:&lt;/p&gt;

    &lt;pre&gt;&lt;code class="language-shellex"&gt;&lt;span class="prompt"&gt;$&lt;/span&gt; &lt;span class="command_line"&gt;ruby --version&lt;/span&gt;
&lt;span class="output"&gt;ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-darwin11.4.2]&lt;/span&gt;
    
&lt;span class="prompt"&gt;$&lt;/span&gt; &lt;span class="command_line"&gt;rvm list&lt;/span&gt;

&lt;span class="output"&gt;rvm rubies&lt;/span&gt;

&lt;span class="output"&gt;=* ruby-1.9.3-p448 [ x86_64 ]&lt;/span&gt;

&lt;span class="output"&gt;# =&amp;gt; - current&lt;/span&gt;
&lt;span class="output"&gt;# =* - current &amp;amp;&amp;amp; default&lt;/span&gt;
&lt;span class="output"&gt;#  * - default&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id="install-bundler"&gt;Install Bundler&lt;/h3&gt;

&lt;div class="rightup-pic-wrapper"&gt;  &lt;img class="rightup" src="/posts/mac-os-x-development-environment-with-ruby/pics/bundler-icon@custom.png" alt="Bundler icon" title="Bundler icon"&gt;  &lt;/div&gt;

&lt;p&gt;&lt;a href="http://bundler.io/"&gt;Bundler&lt;/a&gt; is a very popular, and widely-supported way to manage a set of Gems per each
of your Ruby projects. By use of a &lt;code&gt;Gemfile&lt;/code&gt; (which is a very simple Ruby script that dynamically defines
dependencies for specific Gems and respective versions), you can ensure the correct
environment is managed in the scope of your application for development, production,
and other purposes. And it’s just so easy!&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;As per &lt;a href="http://bundler.io/#getting-started"&gt;the instructions&lt;/a&gt;:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;gem install bundler
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Create the file &lt;code&gt;~/.gemrc&lt;/code&gt;:&lt;/p&gt;

    &lt;pre&gt;&lt;code class="language-yaml"&gt;&lt;span class="head"&gt;&lt;span class="head"&gt;---&lt;/span&gt;&lt;/span&gt;
&lt;span class="sy"&gt;:benchmark&lt;/span&gt;: &lt;span class="er"&gt;false&lt;/span&gt;
&lt;span class="ke"&gt;gem&lt;/span&gt;: &lt;span class="s"&gt;--no-ri --no-rdoc&lt;/span&gt;
&lt;span class="sy"&gt;:update_sources&lt;/span&gt;: &lt;span class="er"&gt;true&lt;/span&gt;
&lt;span class="sy"&gt;:bulk_threshold&lt;/span&gt;: &lt;span class="er"&gt;1000&lt;/span&gt;
&lt;span class="sy"&gt;:verbose&lt;/span&gt;: &lt;span class="er"&gt;true&lt;/span&gt;
&lt;span class="sy"&gt;:sources&lt;/span&gt;:
- &lt;span class="s"&gt;http://rubygems.org&lt;/span&gt;
&lt;span class="sy"&gt;:backtrace&lt;/span&gt;: &lt;span class="er"&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

    &lt;p&gt;…this sets various global parameters for the &lt;code&gt;gem&lt;/code&gt; command, in particular ensures the
&lt;code&gt;--no-ri --no-rdoc&lt;/code&gt; parameters are always used when installing gems. This is intended
to speed things up, and makes the assumption that you will always use a documentation
source &lt;em&gt;other&lt;/em&gt; than the gem files themselves – e.g. online, such as from the excellent
&lt;a href="http://apidock.com/"&gt;APIdock&lt;/a&gt; website.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id="install-optional-stuff"&gt;Install optional stuff&lt;/h2&gt;

&lt;p class="summary"&gt;The following packages are optional, but highly-recommended as they add a lot of value.
You can also customise them as you need.&lt;/p&gt;

&lt;h3 id="install-imagemagick"&gt;Install ImageMagick&lt;/h3&gt;

&lt;div class="right-pic-wrapper"&gt;  &lt;img class="right" src="/posts/wrangling-ruby-and-imagemagick-in-cygwin/pics/imagemagick-logo@figure.png" alt="ImageMagick logo" title="ImageMagick logo"&gt;  &lt;/div&gt;

&lt;p&gt;If you intend to programmatically process images, say via a script or Ruby
app, you will most likely find yourself using &lt;a href="http://www.imagemagick.org/script/index.php"&gt;ImageMagick&lt;/a&gt;. In my case, I use
it both via command-line (i.e. &lt;a href="http://www.imagemagick.org/script/convert.php"&gt;&lt;code&gt;convert&lt;/code&gt; command&lt;/a&gt;) and via a Gem
(with &lt;a href="http://rmagick.rubyforge.org/"&gt;RMagick for Ruby&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;I expected to get a &lt;em&gt;stable&lt;/em&gt; ImageMagick install with a single Homebrew
command: &lt;code&gt;brew install imagemagick&lt;/code&gt;. However, after doing this, &lt;a href="http://www.w3.org/Graphics/SVG/"&gt;SVG&lt;/a&gt; files I wanted
to process were &lt;em&gt;randomly&lt;/em&gt; problematic. I found that the solution was to install ImageMagick
specifically with &lt;a href="https://wiki.gnome.org/LibRsvg"&gt;librsvg&lt;/a&gt; integration. I did that as follows:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;If ImageMagick has already been installed with Homebrew, remove it first:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;brew uninstall imagemagick
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p id="retry-librsvg"&gt;&lt;code&gt;librsvg&lt;/code&gt; needs to be installed before you can build ImageMagick against it.
Note that this took over half an hour for me:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;brew install librsvg
&lt;/code&gt;&lt;/pre&gt;

    &lt;p class="warning"&gt;If you’re running Mac OS X 10.8 or above, this may give an error
that X11 is absent, with a recommendation to install XQuartz. For more info, 
see below re &lt;a href="#install-xquartz"&gt;tips for installing on Mac OS X 10.8 and above&lt;/a&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Then, install &lt;code&gt;imagemagick&lt;/code&gt; specifically using the &lt;code&gt;--with-librsvg&lt;/code&gt; option:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;brew install imagemagick --with-librsvg
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id="install-git-flow"&gt;Install git-flow&lt;/h3&gt;

&lt;div class="rounded right-pic-wrapper"&gt;  &lt;img class="rounded right" src="/posts/mac-os-x-development-environment-with-ruby/pics/git-flow-branching@custom.jpg" alt="git-flow branching" title="git-flow branching"&gt;  &lt;/div&gt;

&lt;p&gt;&lt;a href="https://github.com/nvie/gitflow"&gt;git-flow&lt;/a&gt; is an extension to the &lt;code&gt;git&lt;/code&gt; command that helps you manage formal development-grade
and production-grade streams in any given repository. Sometimes this may be overkill for a
small, internal, or otherwise private project, but it may still turn out to be more useful
than you expect.&lt;/p&gt;

&lt;p&gt;To understand git-flow better, I suggest you read
&lt;a href="http://nvie.com/posts/a-successful-git-branching-model/"&gt;the original description of the git-flow model&lt;/a&gt;,
but bear in mind that it was written before the git-flow helper commands were created.
That document just explains basically &lt;em&gt;how&lt;/em&gt; it works.&lt;/p&gt;

&lt;p&gt;Whether you read that or not, there is a great
&lt;a href="http://danielkummer.github.io/git-flow-cheatsheet/"&gt;git-flow cheatsheet&lt;/a&gt;
which shows clearly what the git-flow helper commands are, and how to use them.&lt;/p&gt;

&lt;p&gt;So, to actually install git-flow, simply do this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;brew install git-flow
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;…and then verify it with:&lt;/p&gt;

&lt;pre&gt;&lt;code class="language-shellex"&gt;&lt;span class="prompt"&gt;$&lt;/span&gt; &lt;span class="command_line"&gt;git flow help&lt;/span&gt;
&lt;span class="output"&gt;usage: git flow &amp;lt;subcommand&amp;gt;&lt;/span&gt;

&lt;span class="output"&gt;Available subcommands are:&lt;/span&gt;
   &lt;span class="output"&gt;init      Initialize a new git repo with support for the branching model.&lt;/span&gt;
   &lt;span class="output"&gt;feature   Manage your feature branches.&lt;/span&gt;
   &lt;span class="output"&gt;release   Manage your release branches.&lt;/span&gt;
   &lt;span class="output"&gt;hotfix    Manage your hotfix branches.&lt;/span&gt;
   &lt;span class="output"&gt;support   Manage your support branches.&lt;/span&gt;
   &lt;span class="output"&gt;version   Shows version information.&lt;/span&gt;

&lt;span class="output"&gt;Try 'git flow &amp;lt;subcommand&amp;gt; help' for details.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id="fix-vim-config"&gt;Fix &lt;code&gt;vim&lt;/code&gt; config&lt;/h3&gt;

&lt;div class="rightup-pic-wrapper"&gt;  &lt;img class="rightup" src="/posts/mac-os-x-development-environment-with-ruby/pics/vim-icon@custom.png" alt="Vim icon" title="Vim icon"&gt;  &lt;/div&gt;

&lt;p&gt;I use &lt;code&gt;vim&lt;/code&gt; for quickly editing files from time to time at the command-line,
including over SSH. If you don’t use it, you can &lt;a href="#install-iterm2"&gt;skip this section&lt;/a&gt;.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Grab a template that fixes cursor keys:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;VIMRC_EXAMPLE="`ls -d1 /usr/share/vim/vim*/vimrc_example.vim | head -1`"
cp "$VIMRC_EXAMPLE" ~/.vimrc
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Add the following to &lt;code&gt;~/.vimrc&lt;/code&gt; for other enhancements:&lt;/p&gt;

    &lt;pre&gt;&lt;code class="language-vimrc"&gt;" Add these if needed:
"   filetype plugin indent on
"   syntax on
" Two-space soft tabs, always:
set tabstop=2
set softtabstop=2
set shiftwidth=2
set expandtab
" Line numbers:
set number
" Disable backup files:
set nobackup
" Configure F6 to toggle 'paste mode'
set pastetoggle=&amp;lt;F6&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The config file above does the following:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Uses a template that defines proper Vim handling of your Mac’s Home/End and other
such navigation keys.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Globally uses ‘soft tabs’ (i.e. runs of space characters instead of actual tab
characters), at intervals of 2 spaces.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Turns on line number display.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Disables generation of backup files that have a &lt;code&gt;~&lt;/code&gt; appended. I find this really annoying,
and since I use version control (Git) for most things it’s unnecessary. There are plenty of
cases, however, where it might be better to comment out the &lt;code&gt;set nobackup&lt;/code&gt; line so that
you’re safe instead of sorry.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Configures the F6 key on your keyboard to toggle
“&lt;a href="http://vim.wikia.com/wiki/Toggle_auto-indenting_for_code_paste"&gt;paste mode&lt;/a&gt;”.
In Vim you may find, by
default, that it tries to apply some indentation ‘smarts’ to text that you type in,
and when you try to &lt;strong&gt;paste&lt;/strong&gt; in a block of text, things go awry. With the configuration
shown above, you can press F6 while in Insert mode, and it will show that it has gone
into &lt;code&gt;-- INSERT (paste) --&lt;/code&gt; mode. If you now paste in content while in this mode, its indentation
will not be altered by Vim. Hit F6 again to exit out of paste mode.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There’s a vast amount of stuff you can configure and customise for Vim. For example, if you
want, you can
&lt;a href="http://vim.wikia.com/wiki/Indenting_source_code#Different_settings_for_different_file_types"&gt;specify different tab formatting for different file types&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id="install-iterm2"&gt;Install iTerm2&lt;/h3&gt;

&lt;div class="rightup-pic-wrapper"&gt;  &lt;img class="rightup" src="/posts/mac-os-x-development-environment-with-ruby/pics/iterm2-icon@custom.png" alt="iTerm2 icon" title="iTerm2 icon"&gt;  &lt;/div&gt;

&lt;p&gt;As a terminal replacement, there are many things I really like about iTerm2. Aside from being
heavily customisable, it has features such as:
&lt;a href="http://www.iterm2.com/#/section/features/profiles"&gt;saved profiles&lt;/a&gt;;
&lt;a href="http://www.iterm2.com/#/section/features/instant_replay"&gt;session playback&lt;/a&gt;;
&lt;a href="http://www.iterm2.com/#/section/features/split_panes"&gt;split windows&lt;/a&gt;;
and a &lt;a href="http://www.iterm2.com/#/section/features"&gt;lot of other conveniences&lt;/a&gt; that just make sense.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Go to: &lt;a href="http://www.iterm2.com"&gt;http://www.iterm2.com&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Hit the ‘Download’ button (1.0.0 at the time of writing).&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Extract the &lt;code&gt;.zip&lt;/code&gt; file that you download, and you should end up with &lt;code&gt;iTerm.app&lt;/code&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Move &lt;code&gt;iTerm.app&lt;/code&gt; into your Mac’s &lt;code&gt;Applications&lt;/code&gt; folder and, if desired, drag it to your dock.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Launch “iTerm”.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id="install-sublime-text"&gt;Install Sublime Text&lt;/h3&gt;

&lt;div class="rightup-pic-wrapper"&gt;  &lt;img class="rightup" src="/posts/mac-os-x-development-environment-with-ruby/pics/sublime-text-icon@custom.png" alt="Sublime Text icon" title="Sublime Text icon"&gt;  &lt;/div&gt;

&lt;p&gt;&lt;a href="http://www.sublimetext.com/"&gt;Sublime Text&lt;/a&gt; is an excellent programmer’s text editor that is modelled on TextMate but with
many other enhancements. It supports a lot of TextMate’s actual config files and syntax
highlighting definitions, and is available for Mac, Windows, and Linux. I strongly recommend it
because it is attractive, highly customisable, and rich in sensible features. &lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Go to the &lt;a href="http://www.sublimetext.com/"&gt;Sublime Text website&lt;/a&gt;, download it
(v2.0.2 at the time of writing), open the &lt;code&gt;.dmg&lt;/code&gt;, and drag the &lt;code&gt;Sublime Text&lt;/code&gt; app into the
&lt;code&gt;Applications&lt;/code&gt; folder (as is typical of most simple Mac software installs).&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Go into &lt;code&gt;Applications&lt;/code&gt; and try launching it.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Quit out of Sublime Text.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Make sure you have a local &lt;code&gt;~/bin&lt;/code&gt; directory, and that &lt;code&gt;$HOME/bin&lt;/code&gt; is
part of your &lt;code&gt;PATH&lt;/code&gt;. You can ensure that this is the case, using this:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;cd ~
mkdir -p bin
if [[ "$PATH" == *"$HOME/bin"* ]]; then
    echo -e "\n--- $HOME/bin is already in your path\n"
else
    echo 'PATH=$PATH:$HOME/bin' &amp;gt;&amp;gt; .bash_profile
    source .bash_profile
    echo -e "\n+++ \$HOME/bin has been added to your path in .bash_profile\n"
fi
&lt;/code&gt;&lt;/pre&gt;

    &lt;p&gt;NOTE that while this will update your &lt;code&gt;PATH&lt;/code&gt; in the current shell, any other open
shells will not yet be up-to-date unless you run:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;source ~/.bash_profile
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Install the &lt;code&gt;subl&lt;/code&gt; command-line utility:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl
&lt;/code&gt;&lt;/pre&gt;

    &lt;p&gt;This allows you to launch Sublime Text from command-line, to get it to open a file or folder.
See the
&lt;a href="http://www.sublimetext.com/docs/2/osx_command_line.html"&gt;&lt;code&gt;subl&lt;/code&gt; command-line utility&lt;/a&gt;
documentation for more info.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Try out &lt;code&gt;subl&lt;/code&gt;; if we assume you have the &lt;code&gt;ruby-tictactoe&lt;/code&gt; repo as per
&lt;a href="#git-test"&gt;the example given earlier&lt;/a&gt; in this article, you should now be able to:&lt;/p&gt;

    &lt;ul&gt;
      &lt;li&gt;
        &lt;p&gt;Open an individual file:&lt;/p&gt;

        &lt;pre&gt;&lt;code&gt;subl ~/projects/ruby-tictactoe/README.md
&lt;/code&gt;&lt;/pre&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;p&gt;Open the whole “project”:&lt;/p&gt;

        &lt;pre&gt;&lt;code&gt;subl ~/projects/ruby-tictactoe
&lt;/code&gt;&lt;/pre&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Now, if you want, you can customise Sublime Text. For example, I write a lot of documents
in &lt;a href="http://kramdown.rubyforge.org/"&gt;kramdown&lt;/a&gt;, and there are two ‘Themes’ (i.e. colour schemes) which seem to show
Markdown/kramdown highlighting the best:&lt;/p&gt;

    &lt;ul&gt;
      &lt;li&gt;
&lt;strong&gt;Dawn&lt;/strong&gt;: Light background.&lt;/li&gt;
      &lt;li&gt;
&lt;strong&gt;Sunburst&lt;/strong&gt;: Dark background – which I prefer because it’s easy on the eyes but also
gives great highlighting in general.&lt;/li&gt;
    &lt;/ul&gt;

    &lt;p&gt;To choose a colour scheme, go to the main “Sublime Text 2” menu =&amp;gt; “Preferences” =&amp;gt; “Color Scheme”
and pick one.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;NOTE: If you use &lt;a href="http://kramdown.rubyforge.org/"&gt;kramdown&lt;/a&gt; files with the &lt;code&gt;.kd&lt;/code&gt; file extension, you will either need to specify
that each file you open is in Markdown format (by clicking the bottom-right corner of
the window and choosing ‘Markdown’ =&amp;gt; ‘Markdown’ or the same via the ‘View’ =&amp;gt; ‘Syntax’ menu),
or configure Sublime Text to recognise &lt;code&gt;.kd&lt;/code&gt; automatically as Markdown. Below are some links with
more information on how to customise Sublime Text, including for Markdown/kramdown:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
&lt;a href="https://github.com/jonschlinkert/sublime-markdown-extended"&gt;Extended Markdown support for Sublime Text&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;
&lt;a href="https://gist.github.com/CrazyApi/2354062"&gt;Adding Markdown/kramdown syntax highlighting to any Sublime Text theme&lt;/a&gt;:
Make sure you read all the instructions for &lt;strong&gt;where&lt;/strong&gt; to insert the given code.&lt;/li&gt;
  &lt;li&gt;
&lt;a href="http://phrogz.net/syntax-highlighting-fenced-code-blocks"&gt;Example of extending Markdown syntax highlighting with extra kramdown features&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id="other-stuff-worth-checking-out"&gt;Other stuff worth checking out&lt;/h2&gt;

&lt;p&gt;The following is just a collection of other random pointers which you might find to be of interest
in your development workflow:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;If you’re going to be developing web apps, you will almost certainly be using
&lt;a href="http://rubyonrails.org/"&gt;Ruby on Rails&lt;/a&gt; (right?) but you might also want to give
&lt;a href="http://www.sinatrarb.com/"&gt;Sinatra&lt;/a&gt; a try if you’re looking to build lightweight
apps and utilities that need a simple web interface.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;For spinning up and testing web apps, especially where you want to simulate multiple domains and
sub-domains, you might also want to check out &lt;a href="http://pow.cx/"&gt;Pow&lt;/a&gt;
and &lt;a href="https://github.com/Rodreegez/powder"&gt;Powder&lt;/a&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;In terms of a good database platform both for local development, testing systems, and
even enterprise production systems, I’ve grown quite fond of
&lt;a href="http://www.postgresql.org/"&gt;PostgreSQL&lt;/a&gt;. A project I haven’t
checked out yet, but which sounds promising, is &lt;a href="http://postgresapp.com/"&gt;Postgres.app&lt;/a&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;If you work with &lt;a href="http://github.com/"&gt;GitHub&lt;/a&gt; a bit, and in particular if you participate with a few
Open Source projects, you might want to check out &lt;a href="http://hub.github.com/"&gt;hub&lt;/a&gt;.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id="troubleshooting"&gt;Troubleshooting&lt;/h2&gt;

&lt;div class="rounded right-pic-wrapper"&gt;  &lt;img class="rounded right" src="/posts/mac-os-x-development-environment-with-ruby/pics/kitty-troubleshooting@custom.jpg" alt="Kitty troubleshooting" title="Kitty troubleshooting"&gt;  &lt;/div&gt;

&lt;p&gt;If you started from a clean machine and exactly followed the instructions above, I would
expect that everything worked perfectly. It is possible, however, that things will go
wrong (even if you &lt;em&gt;did&lt;/em&gt; start with a clean machine), due to various factors:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;You’re using a more recent version of OS X, for which you should be able to find
solutions (e.g. see &lt;a href="#fn:other-osx"&gt;below&lt;/a&gt;) – resorting to Googling actual error
messages if necessary.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;You may have other stuff pre-installed which is getting in the way, particularly
packages managed by something else such as MacPorts or Fink. If that’s the case,
you &lt;a href="https://gist.github.com/Blackshawk/5290038"&gt;may need to migrate from MacPorts to Homebrew&lt;/a&gt;,
or whatever.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;You may have chosen to customise your installation paths or other such things
in a way which challenges the assumptions that these various tools make.
In this case, there should be a way to diagnose these problems or get help,
again by Googling or asking questions via one of the &lt;a href="http://stackexchange.com/sites"&gt;Stack Exchange&lt;/a&gt; sites
such as &lt;a href="http://superuser.com/"&gt;Super User&lt;/a&gt;, &lt;a href="http://stackoverflow.com/"&gt;Stack Overflow&lt;/a&gt;, or &lt;a href="http://apple.stackexchange.com/"&gt;Ask Different&lt;/a&gt;. You can also
try Homebrew’s self-diagnosis (i.e. &lt;code&gt;brew doctor&lt;/code&gt;), and
&lt;a href="http://rvm.io/support/troubleshooting"&gt;RVM troubleshooting tips&lt;/a&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Since I wrote this article, some of the tools and packages I documented may have been
deprecated, either rendering them unavailable, or making the current &lt;em&gt;default&lt;/em&gt; a
newer version that has different compatibility. If that’s the case, you might
have to investigate other people’s guides to fill in the blanks for getting new
versions to work.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you encounter any problems, please provide feedback by &lt;a href="#id-comments"&gt;commenting below&lt;/a&gt;
or by filling in my &lt;a href="/contact.php"&gt;contact form&lt;/a&gt;. Feel free to ask any questions and
report things you’re stuck on, though I would be hugely grateful if you identify a
&lt;strong&gt;solution&lt;/strong&gt; to any issues you find, and want me to include them in this article.&lt;/p&gt;

&lt;h2 id="tips-for-installing-on-mac-os-x-108-and-above"&gt;Tips for installing on Mac OS X 10.8 and above&lt;/h2&gt;

&lt;p&gt;While the instructions above worked fine for me on Mac OS X 10.7.5, I hit a couple of
errors while installing on Mac OS X 10.8.5. This is how I worked around them:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p id="fix-gcc"&gt;While trying to install a Ruby version for the first time using RVM (i.e. with
&lt;code&gt;rvm install 1.9.3&lt;/code&gt;), I hit an error that gave output along the lines of:&lt;/p&gt;

    &lt;pre&gt;&lt;code class="language-shellex"&gt;&lt;span class="note"&gt; Installing Ruby from source to: /Users/anton/.rvm/rubies/ruby-1.9.3-p484,&lt;/span&gt;
&lt;span class="note"&gt; this may take a while depending on your cpu(s)...&lt;/span&gt;
&lt;span class="output"&gt;...etc...&lt;/span&gt;
&lt;span class="note"&gt; ruby-1.9.3-p484 - #applying patch /Users/anton/.rvm/patches/ruby/GH-488.patch.&lt;/span&gt;
&lt;span class="note"&gt; ruby-1.9.3-p484 - #configuring.&lt;/span&gt;
&lt;span class="warn"&gt; Error running './configure --prefix=/Users/anton/.rvm/rubies/ruby-1.9.3-p484&lt;/span&gt;
&lt;span class="warn"&gt;  --with-opt-dir=/usr/local/opt/libyaml:/usr/local/opt/readline:/usr/local/opt/libksba:/usr/local/opt/openssl&lt;/span&gt;
&lt;span class="warn"&gt;  --without-tcl --without-tk --enable-shared',&lt;/span&gt;
&lt;span class="warn"&gt; showing last 15 lines of /Users/anton/.rvm/log/1390447207_ruby-1.9.3-p484/configure.log&lt;/span&gt;
&lt;span class="output"&gt;...etc...&lt;/span&gt;
&lt;span class="output"&gt;checking target system type... i386-apple-darwin12.5.0&lt;/span&gt;
&lt;span class="warn"&gt; checking whether the C compiler works... no&lt;/span&gt;
&lt;span class="warn"&gt; configure: error: in `/Users/anton/.rvm/src/ruby-1.9.3-p484':&lt;/span&gt;
&lt;span class="warn"&gt; configure: error: C compiler cannot create executables&lt;/span&gt;
&lt;span class="warn"&gt; See `config.log' for more details&lt;/span&gt;
&lt;span class="warn"&gt; There has been an error while running configure. Halting the installation.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

    &lt;p&gt;A further inspection of &lt;code&gt;/Users/anton/.rvm/src/ruby-1.9.3-p484/config.log&lt;/code&gt; revealed:&lt;/p&gt;

    &lt;pre&gt;&lt;code class="language-shellex"&gt;&lt;span class="c"&gt;...&lt;/span&gt;
&lt;span class="warn"&gt; configure:3417: /bin/gcc-4.6 --version &amp;gt;&amp;amp;5&lt;/span&gt;
&lt;span class="warn"&gt; ./configure: line 3419: /bin/gcc-4.6: No such file or directory&lt;/span&gt;
&lt;span class="output"&gt;...etc...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

    &lt;p&gt;For whatever reason, the build process assumes that &lt;code&gt;/bin/gcc-4.6&lt;/code&gt; exists, but
in our case it is actually elsewhere (though still in the &lt;code&gt;PATH&lt;/code&gt;):
&lt;code&gt;/usr/local/bin/gcc-4.6&lt;/code&gt;&lt;/p&gt;

    &lt;p&gt;The &lt;a href="http://stackoverflow.com/a/19746622"&gt;proposed solution for this&lt;/a&gt; is to simply
symlink &lt;code&gt;gcc-4.6&lt;/code&gt; where the script expects it:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;sudo ln -s /usr/local/bin/gcc-4.6 /bin/gcc-4.6
&lt;/code&gt;&lt;/pre&gt;

    &lt;p&gt;After this, you should be able to
&lt;a href="#rvm-install-193"&gt;resume installing a Ruby version with RVM&lt;/a&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p id="install-xquartz"&gt;X11 has been removed from Mac OS as of OS X 10.8. Since &lt;code&gt;librsvg&lt;/code&gt; (which
we require for ImageMagick) relies on X11, you may get an error when trying to install it with
Homebrew on OS X 10.8 and above.
The &lt;a href="http://support.apple.com/kb/ht5293"&gt;Apple-recommended solution&lt;/a&gt; is to
install &lt;a href="http://xquartz.macosforge.org/landing/"&gt;XQuartz&lt;/a&gt;.&lt;/p&gt;

    &lt;p&gt;Once XQuartz is installed, you may be advised that you have to log out and log back in again.
After doing this, you should be able to
&lt;a href="#retry-librsvg"&gt;resume installing ImageMagick with librsvg&lt;/a&gt;.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id="installing-xcode-clt-via-command-line"&gt;Installing Xcode &lt;abbr title="Command-Line Tools"&gt;CLT&lt;/abbr&gt; via command-line&lt;/h2&gt;

&lt;p&gt;I just provided these instructions as an example of how some of the installation steps given
above can be done remotely via SSH instead of via the Mac OS X GUI. In particular, this shows
how you can mount a &lt;code&gt;.dmg&lt;/code&gt; file, and use &lt;code&gt;installer&lt;/code&gt; to install from a &lt;code&gt;.pkg&lt;/code&gt; (or &lt;code&gt;.mpkg&lt;/code&gt;) file.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Download Xcode Command Line Tools however you can, and get the file up to the filesystem of
the Mac onto which you will install. If we assume for now it’s in
&lt;code&gt;~/Downloads&lt;/code&gt;, and called something &lt;em&gt;like&lt;/em&gt; &lt;code&gt;xcode462_cltools_10_76938260a.dmg&lt;/code&gt;…&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Go into Terminal and mount the DMG:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;cd ~/Downloads
hdiutil attach xcode*cltools*.dmg
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Install the extracted &lt;code&gt;.mpkg&lt;/code&gt;:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;cd /Volumes/*"Command Line Tools"*
time sudo installer -verbose -pkg *.pkg -target /
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Test:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;gcc --version
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Unmount the DMG:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;hdiutil detach /Volumes/*"Command Line Tools"*
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id="conclusion"&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;You should now have quite a capable Ruby development environment, that
is easy to manage and reconfigure. 
While not a complete development environment for other platforms, this
combination of tools should make for a stable and sensible foundation to install other
software to suit your programming and testing needs, including:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Other Ruby favourites, e.g. &lt;a href="http://rspec.info/"&gt;rspec&lt;/a&gt;, &lt;a href="http://cukes.info/"&gt;Cucumber&lt;/a&gt;, and &lt;a href="http://www.capistranorb.com/"&gt;Capistrano&lt;/a&gt; (or maybe &lt;a href="http://nadarei.co/mina/"&gt;Mina&lt;/a&gt; or &lt;a href="http://docs.opscode.com/chef_overview.html"&gt;Chef&lt;/a&gt;?)&lt;/li&gt;
  &lt;li&gt;Other compilers and interpreters&lt;sup id="fnref:other-compilers"&gt;&lt;a href="#fn:other-compilers" rel="footnote"&gt;6&lt;/a&gt;&lt;/sup&gt;.&lt;/li&gt;
  &lt;li&gt;Other shared libraries and utility packages.&lt;/li&gt;
  &lt;li&gt;Tools such as &lt;a href="http://www.gimp.org/downloads/"&gt;GIMP&lt;/a&gt;, &lt;a href="https://wiki.jenkins-ci.org/display/JENKINS/Meet+Jenkins"&gt;Jenkins&lt;/a&gt;, and &lt;a href="http://www.virtualbox.org"&gt;VirtualBox&lt;/a&gt; (maybe with &lt;a href="http://www.vagrantup.com/"&gt;Vagrant&lt;/a&gt;?)&lt;/li&gt;
  &lt;li&gt;
&lt;a href="http://docs.sublimetext.info/en/latest/extensibility/extensibility.html"&gt;Sublime Text plug-ins, packages, and other customisations&lt;/a&gt;. See also:
&lt;a href="https://sublime.wbond.net/"&gt;Package Control&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;The full Xcode platform.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In coming articles, I may switch between different environments (including Mac, Windows, and Linux).
There are some cases where I will build upon what I’ve written in this article, showing
installation guides that assume you’ve already taken these steps or the ones in
&lt;a href="/posts/wrangling-ruby-and-imagemagick-in-cygwin/"&gt;my Cygwin article&lt;/a&gt;, if you’re using Windows.&lt;/p&gt;

&lt;p&gt;For now though, good luck, and happy coding!&lt;/p&gt;

&lt;div class="rounded inline-pic-wrapper"&gt;  &lt;img class="rounded inline" src="/posts/mac-os-x-development-environment-with-ruby/pics/cat-with-laptop@custom.jpg" alt="Kitty approves of your efforts" title="Kitty approves of your efforts"&gt;  &lt;/div&gt;

&lt;div class="footnotes"&gt;
  &lt;ol&gt;
    &lt;li id="fn:other-osx"&gt;

      &lt;p&gt;For information which may help with getting a similar environment working on
OS X 10.8 (Mountain Lion) or above, see:
&lt;a href="http://robots.thoughtbot.com/post/27985816073/the-hitchhikers-guide-to-riding-a-mountain-lion"&gt;The Hitchhiker’s Guide to Riding a Mountain Lion&lt;/a&gt;&lt;a href="#fnref:other-osx" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id="fn:rvm"&gt;

      &lt;p&gt;Another alternative to RVM is &lt;a href="https://github.com/sstephenson/rbenv"&gt;rbenv&lt;/a&gt;.
With &lt;code&gt;ruby-build&lt;/code&gt; installed,
&lt;a href="http://jonathan-jackson.net/rvm-and-rbenv"&gt;RVM and rbenv both offer very similar functionality&lt;/a&gt;,
and in some respects rbenv may be the smarter, more-lightweight choice
&lt;a href="http://edapx.com/2013/05/23/switching-from-rvm-to-rbenv/"&gt;if you’re using Bundler&lt;/a&gt;.
Here is &lt;a href="http://jacobswanner.com/2012/07/13/ruby-1-9-3-without-gcc.html"&gt;a brief guide that shows use of rbenv on a Mac&lt;/a&gt;.&lt;a href="#fnref:rvm" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id="fn:x86"&gt;

      &lt;p&gt;That is, only 32-bit capable, not x64-compatible. Most Macs since then have a 64-bit capable CPU.&lt;a href="#fnref:x86" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id="fn:osx-update"&gt;

      &lt;p&gt;Many tools will require that your OS X is up-to-date. At the time of writing, OS X Lion (10.7) is
up to 10.7.5. The Apple “Command Line Tools (OS X Lion) for Xcode - April 2013”, for instance, needs
10.7.4 or above.&lt;a href="#fnref:osx-update" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id="fn:no-alias"&gt;

      &lt;p&gt;A shell command prefixed with a backslash will ignore any alias of that command, if there
is one in effect. For more information, see
&lt;a href="http://stackoverflow.com/questions/15691977/why-start-a-shell-command-with-a-backslash"&gt;this question on Stack Overflow&lt;/a&gt;&lt;a href="#fnref:no-alias" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id="fn:other-compilers"&gt;

      &lt;p&gt;You may find several other compilers and interpreters are already installed and ready for use,
including &lt;code&gt;perl&lt;/code&gt;, &lt;code&gt;python&lt;/code&gt;, &lt;code&gt;php&lt;/code&gt;, and &lt;code&gt;gcc&lt;/code&gt;. Some of these, however, can be replaced with
newer versions that are nicely managed by Homebrew. In any case, though, I recommend reading more
about them before trying to install or replace these defaults.&lt;a href="#fnref:other-compilers" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;

</content>
    <summary type="html">&lt;p&gt;As a programmer it helps to be comfortable across many different platforms, and learn to
leverage the benefits of each. After purchasing my first Mac – an old MacBook – I set out
to create a tailored environment that would help my Ruby (and other) development sing.&lt;/p&gt;</summary>
  </entry>
  <entry>
    <id>tag:anton.maurovic.com,2013-09-11:/posts/wrangling-ruby-and-imagemagick-in-cygwin/</id>
    <title type="html">Wrangling Ruby and ImageMagick in Cygwin</title>
    <published>2013-09-11T00:00:00Z</published>
    <updated>2013-09-11T00:00:00Z</updated>
    <link rel="alternate" href="https://anton.maurovic.com/posts/wrangling-ruby-and-imagemagick-in-cygwin/"/>
    <content type="html">&lt;div style="display:none;"&gt;&lt;img src="/posts/wrangling-ruby-and-imagemagick-in-cygwin/thumb.png" alt="Wrangling Ruby and ImageMagick in Cygwin" width="160" height="120" border="0"&gt;&lt;/div&gt;

&lt;p class="overview"&gt;Cygwin can be a clever way for Windows environments to leverage
the power of tools that might otherwise only be available
in the Unix realm. If you attempt Ruby and ImageMagick stuff in
it, though, be prepared for a fight…&lt;/p&gt;

&lt;div class="bordered-pic-wrapper"&gt;  &lt;img class="bordered" src="/posts/wrangling-ruby-and-imagemagick-in-cygwin/pics/rubiks-cube-masthead@wide.jpg" alt="Cygwin-ImageMagick-Ruby Cube" title="Cygwin-ImageMagick-Ruby Cube"&gt;  &lt;/div&gt;

&lt;ul class="toc" id="markdown-toc"&gt;
  &lt;li&gt;&lt;a href="#introduction"&gt;Introduction&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#the-problem"&gt;The Problem&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#my-specific-problem-with-ruby-and-imagemagick"&gt;My Specific Problem with Ruby and ImageMagick&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#my-solution"&gt;My Solution&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;
&lt;a href="#the-steps"&gt;The Steps&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href="#part-1-install-cygwin"&gt;Part 1: Install Cygwin&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#part-2-install-devtools-and-rvm"&gt;Part 2: Install &lt;code&gt;devtools&lt;/code&gt; and RVM&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#part-3-install-apt-cyg"&gt;Part 3: Install &lt;code&gt;apt-cyg&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#part-4-enable-openssh-server"&gt;Part 4: Enable OpenSSH server&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#part-5-fix-vim-config"&gt;Part 5: Fix &lt;code&gt;vim&lt;/code&gt; config&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#part-6-set-yourself-up-for-github"&gt;Part 6: Set yourself up for GitHub&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#part-7-create-an-example-ruby-project"&gt;Part 7: Create an example Ruby project&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href="#troubleshooting"&gt;Troubleshooting&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p class="summary"&gt;Rejected titles for this article include: (a) &lt;em&gt;“It’s not whether you Cygwin or
Cyglose: Just quit now!”&lt;/em&gt;; (b) &lt;em&gt;“Build a Ruby Goldberg Machine in 146 Easy Steps”&lt;/em&gt;;
and (c) &lt;em&gt;“Cygwin and Ruby: Forking Hell!”&lt;/em&gt;&lt;/p&gt;

&lt;div class="right-pic-wrapper"&gt;  &lt;img class="right" src="/posts/wrangling-ruby-and-imagemagick-in-cygwin/pics/cygwin@figure.png" alt="Cygwin Logo" title="Cygwin Logo"&gt;  &lt;/div&gt;

&lt;p&gt;I won’t explain much of &lt;a href="http://en.wikipedia.org/wiki/Cygwin"&gt;Cygwin&lt;/a&gt; other than to say it’s a way to run Unix software
natively on Windows. More-precisely, it’s a platform that allows for Unix software
to be compiled to target Windows. This
is done with shared Cygwin DLLs which seek to provide &lt;a href="http://en.wikipedia.org/wiki/POSIX"&gt;POSIX&lt;/a&gt;-compliant
system calls, path mapping, and so-on through a Unix compatibility layer.&lt;/p&gt;

&lt;p&gt;While Cygwin is a clever piece of work and a means to an end, I’ve concluded that it is
&lt;em&gt;not&lt;/em&gt; a suitable way to build a complete development environment, especially where Ruby is
involved. You will probably be better off if you switch entirely to (say) Linux, or
stick with Windows, optionally with Cygwin playing a minor role in your toolchain.&lt;/p&gt;

&lt;p&gt;Having said that, I will share my experiences with getting Ruby, &lt;a href="http://rvm.io/"&gt;RVM&lt;/a&gt;, &lt;a href="http://www.imagemagick.org/"&gt;ImageMagick&lt;/a&gt;,
and ultimately my entire &lt;a href="/posts/blogging-with-nanoc-and-kramdown-part-1/"&gt;nanoc&lt;/a&gt; site build process to work under Cygwin.&lt;/p&gt;

&lt;h2 id="the-problem"&gt;The Problem&lt;/h2&gt;
&lt;p class="warning"&gt;If you don’t
care about the background of the issues, and just want to trace my steps that
arrive at a usable environment, just see &lt;a href="#my-solution"&gt;My Solution&lt;/a&gt; and
&lt;a href="#the-steps"&gt;The Steps&lt;/a&gt; below.&lt;/p&gt;

&lt;p&gt;One great thing about Unix software is the intent that the source code be portable
between different Unix flavours. Libraries and conventions are used,
as defined by the &lt;a href="http://en.wikipedia.org/wiki/POSIX"&gt;POSIX&lt;/a&gt; standards, such that there are accepted ways that common tasks
are usually done. Most &lt;em&gt;free and open&lt;/em&gt; Unix software is &lt;em&gt;initially&lt;/em&gt; distributed
as source code, able to be compiled specifically for the target system.
In principle, any Operating System that is at least &lt;em&gt;mostly&lt;/em&gt; POSIX-compliant should be
able to compile and run this software without issues.&lt;/p&gt;

&lt;p&gt;Unfortunately, Windows is not particularly POSIX-compliant, and while Cygwin makes a noble
attempt to bridge the gap, there are some things which either haven’t been adequately
realised in Cygwin, or will never be possible due to key differences in Windows’ core design.&lt;/p&gt;

&lt;div class="left-pic-wrapper"&gt;  &lt;img class="left" src="/posts/wrangling-ruby-and-imagemagick-in-cygwin/pics/imagemagick-fork@photo.jpg" alt="ImageMagick reflected in a fork" title="ImageMagick reflected in a fork"&gt;  &lt;/div&gt;

&lt;p&gt;One issue which comes up regularly is &lt;code&gt;fork()&lt;/code&gt; problems, related to multi-threading.
While Unix software relies heavily
on the &lt;a href="http://en.wikipedia.org/wiki/Fork-exec"&gt;fork-exec model&lt;/a&gt;, Windows uses a completely different approach which is not
compatible. Cygwin attempts to work around this by ensuring libraries (e.g. DLLs) will
be loaded into fixed, known address spaces between processes, and this requires “rebasing”
of the libraries to prevent collisions (and hence prevent them from relocating).&lt;/p&gt;

&lt;p&gt;In dealing with this issue, the
&lt;a href="http://pipeline.lbl.gov/code/3rd_party/licenses.win/Cygwin/rebase-3.0.README"&gt;&lt;code&gt;rebaseall&lt;/code&gt; command&lt;/a&gt; 
comes up a lot, and there are
&lt;a href="http://www.cygwin.com/ml/cygwin/2009-05/msg00413.html"&gt;discussions&lt;/a&gt; on the topic
and &lt;a href="http://code.google.com/p/chromium/wiki/CygwinDllRemappingFailure"&gt;why the issue manifests&lt;/a&gt;, but
it can’t always be solved because:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;The &lt;code&gt;rebaseall&lt;/code&gt; command doesn’t always know how to automatically find all
libraries/modules that may need treatment in order to be loaded properly;&lt;/li&gt;
  &lt;li&gt;Sometimes there simply isn’t enough address space for all libraries; and&lt;/li&gt;
  &lt;li&gt;Adding a new Cygwin package may require that you rebase all over again.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id="my-specific-problem-with-ruby-and-imagemagick"&gt;My Specific Problem with Ruby and ImageMagick&lt;/h2&gt;
&lt;p&gt;I’ve found that the &lt;code&gt;fork()&lt;/code&gt; problem has the potential to be significantly harder to deal with
when you’re using Ruby, as each &lt;a href="http://en.wikipedia.org/wiki/Rubygems"&gt;gem&lt;/a&gt; may require
its own library to be loaded by the Ruby environment, and it is hard to get the
&lt;code&gt;rebaseall&lt;/code&gt; command to consider these.&lt;/p&gt;

&lt;div class="right-pic-wrapper"&gt;  &lt;img class="right" src="/posts/wrangling-ruby-and-imagemagick-in-cygwin/pics/imagemagick-logo@figure.png" alt="ImageMagick logo" title="ImageMagick logo"&gt;  &lt;/div&gt;

&lt;p&gt;When I started using the &lt;a href="http://rmagick.rubyforge.org/"&gt;RMagick&lt;/a&gt; gem, I hit a wall
and I couldn’t proceed. RMagick provides Ruby bindings for the &lt;a href="http://www.imagemagick.org/"&gt;ImageMagick&lt;/a&gt;
image processing libraries. I had intended to use it to process the images of my
blog, producing inline-sized versions and thumbnails from full-sized originals,
while also handling things like web optimisation. Instead, though, I was met with
errors along the lines of the following, at the instant that Ruby tries to load
the RMagick gem via &lt;code&gt;require 'rmagick'&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;4 [main] ruby 3004 child_info_fork::abort: C:\cygwin\bin\cygpixman-1-0.dll: Loaded to different address: parent(0x5DF00000) != child(0x2B80000)
2 [main] ruby 284 child_info_fork::abort: C:\cygwin\bin\cygpixman-1-0.dll: Loaded to different address: parent(0x5DF00000) != child(0x5B0000)
1 [main] ruby 4548 child_info_fork::abort: C:\cygwin\bin\cygpixman-1-0.dll: Loaded to different address: parent(0x5DF00000) != child(0x370000)
2 [main] ruby 3052 child_info_fork::abort: C:\cygwin\bin\cygpixman-1-0.dll: Loaded to different address: parent(0x5DF00000) != child(0x2B50000)
...
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Supposedly, this problem should all but disappear in a 64-bit version of Cygwin,
but I had problems with that too. Namely, &lt;a href="#why-cygwin-32"&gt;&lt;code&gt;curl&lt;/code&gt; is faulty&lt;/a&gt;, and this is critical
to some of the other installation processes on which I rely. So, I had to stick
with the 32-bit version of Cygwin and figure out how to continue without RMagick.&lt;/p&gt;

&lt;h2 id="my-solution"&gt;My Solution&lt;/h2&gt;
&lt;p&gt;Though the &lt;code&gt;rebase&lt;/code&gt; issue is more general than just Ruby and ImageMagick,
it was only since I started loading RMagick in my project that I started having &lt;code&gt;fork()&lt;/code&gt; problems.
So, I had considered replacing RMagick with the (more lean) &lt;a href="http://freeimage.sourceforge.net/"&gt;FreeImage&lt;/a&gt;
Ruby bindings (i.e. the &lt;a href="https://rubygems.org/gems/free-image"&gt;&lt;code&gt;free-image&lt;/code&gt; gem&lt;/a&gt;),
and even got it working in a way that I liked… But I then learned that it has no support
for vector images (e.g. SVG files), and I rely on this for many diagrams in my site.
So, what to do?&lt;/p&gt;

&lt;p&gt;I decided to rework the RMagick code I had and instead call the
&lt;a href="http://www.imagemagick.org/script/convert.php"&gt;&lt;code&gt;convert&lt;/code&gt; command-line utility&lt;/a&gt;
provided with a standard installation of ImageMagick. This is a bit of a kludge, but
I simply couldn’t find a way to get RMagick to work properly in my app under Cygwin.
I left the RMagick code in place for other platforms, but routed around it to instead
call &lt;code&gt;system("convert ...")&lt;/code&gt; when using Cygwin.&lt;/p&gt;

&lt;p&gt;By way of an example, the following RMagick code:&lt;/p&gt;

&lt;pre&gt;&lt;code class="language-ruby"&gt;&lt;span class="c"&gt;# Load the image:&lt;/span&gt;
pic = &lt;span class="co"&gt;Magick&lt;/span&gt;::&lt;span class="co"&gt;Image&lt;/span&gt;.read(&lt;span class="s"&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="k"&gt;my_file.png&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;/span&gt;).first
&lt;span class="c"&gt;# Resize down (hence trailing "&amp;gt;" after dimensions) to fit a 400x300 space:&lt;/span&gt;
pic.change_geometry(&lt;span class="s"&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="k"&gt;400x300&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;/span&gt;) &lt;span class="r"&gt;do&lt;/span&gt; |cols, rows, img|
  img.resize!(cols, rows, &lt;span class="co"&gt;Magick&lt;/span&gt;::&lt;span class="co"&gt;CatromFilter&lt;/span&gt;)
&lt;span class="r"&gt;end&lt;/span&gt;
&lt;span class="c"&gt;# Reduce to 64 colours without dithering:&lt;/span&gt;
pic = pic.quantize(&lt;span class="i"&gt;64&lt;/span&gt;, &lt;span class="co"&gt;Magick&lt;/span&gt;::&lt;span class="co"&gt;YUVColorspace&lt;/span&gt;, &lt;span class="co"&gt;Magick&lt;/span&gt;::&lt;span class="co"&gt;NoDitherMethod&lt;/span&gt;)
&lt;span class="c"&gt;# Write out an 8-bit PNG image:&lt;/span&gt;
pic.write(&lt;span class="s"&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="k"&gt;png8:output_file.png&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;/span&gt;)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;…became something like this:&lt;/p&gt;

&lt;pre&gt;&lt;code class="language-ruby"&gt;&lt;span class="c"&gt;# Build one long command-line string...&lt;/span&gt;
&lt;span class="c"&gt;# Load the file:&lt;/span&gt;
cmd =  &lt;span class="s"&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="k"&gt;convert my_file.png &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;/span&gt;
&lt;span class="c"&gt;# Resize (scale down, only; not up-size) to fit within a 400x300 space:&lt;/span&gt;
cmd &amp;lt;&amp;lt; &lt;span class="s"&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="k"&gt;-resize '400x300&amp;gt;' &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;/span&gt;
&lt;span class="c"&gt;# Reduce to 64 colours (web optimisation):&lt;/span&gt;
cmd &amp;lt;&amp;lt; &lt;span class="s"&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="k"&gt;-quantize yuv +dither -colors 64 &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;/span&gt;
&lt;span class="c"&gt;# Write out the file as an 8-bit PNG:&lt;/span&gt;
cmd &amp;lt;&amp;lt; &lt;span class="s"&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="k"&gt;png8:output_file.png&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;/span&gt;
&lt;span class="c"&gt;# Now call the command...&lt;/span&gt;
convert_ok = system(cmd)
raise &lt;span class="s"&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="k"&gt;ERROR: convert command failed with status: $?&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;/span&gt; &lt;span class="r"&gt;unless&lt;/span&gt; convert_ok
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id="the-steps"&gt;The Steps&lt;/h2&gt;
&lt;p&gt;This documents what I did to install Cygwin from scratch, with some additions,
followed by RVM, Ruby, and ImageMagick.&lt;/p&gt;

&lt;h3 id="part-1-install-cygwin"&gt;Part 1: Install Cygwin&lt;/h3&gt;

&lt;p id="why-cygwin-32"&gt;I had to install the 32-bit version of Cygwin because it looks like there is a
&lt;a href="http://cygwin.com/ml/cygwin/2013-04/msg00375.html"&gt;bug with the 64-bit version of &lt;code&gt;curl&lt;/code&gt;&lt;/a&gt;
on Cygwin. This leads to problems including:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Cannot install RVM easily.&lt;/li&gt;
  &lt;li&gt;
&lt;code&gt;apt-cyg&lt;/code&gt; is broken.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, this is the procedure I followed, influenced by instructions for &lt;a href="http://blog.developwithpassion.com/2012/03/30/installing-rvm-with-cygwin-on-windows/"&gt;Installing RVM on Cygwin&lt;/a&gt;:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Download the &lt;a href="http://cygwin.com/install.html"&gt;Cygwin Installer&lt;/a&gt;, &lt;strong&gt;specifically&lt;/strong&gt; the
32-bit version: &lt;a href="http://cygwin.com/setup-x86.exe"&gt;setup-x86.exe&lt;/a&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Make sure you are an Administrator when you run the installer, and if you’re using
Windows Vista, 7, or above, be sure to right-click the installer and select
the “Run as Administrator” option.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Advance through the wizard to the “Local Package Directory” and specify &lt;code&gt;C:\cygwin_setup&lt;/code&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Advance through to the mirror list and choose any mirror which sounds close to you.
In principle, any mirror should do, though occasionally some of them are not completely
up-to-date.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;In the package list, add the following besides the defaults:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;ca-certificates
colorgcc      (if available)
curl
gcc           (note that this is "Src?" only)
gcc-core      (this is the compiler)
git
git-completion
git-gui
gitk
git-svn
ImageMagick
libMagick-devel
libncurses-devel
libtool
libxml2-devel
libxslt
libxslt-devel
libyaml0_2
libyaml-devel
make
mercurial     (if available)
ncurses
openssh
openssl
openssl-devel
patch
pkg-config
readline
rsync
subversion
unzip
vim
wget
zlib
zlib-devel
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Proceed with the installation and it starts downloading what it needs.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;At the end, launch the “Cygwin Terminal” &lt;strong&gt;as Administrator&lt;/strong&gt; and verify it seems
to work OK, optionally setting the scrollback count to 20,000 lines or more.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id="part-2-install-devtools-and-rvm"&gt;Part 2: Install &lt;code&gt;devtools&lt;/code&gt; and RVM&lt;/h3&gt;

&lt;p&gt;The &lt;a href="https://github.com/developwithpassion/devtools"&gt;&lt;code&gt;devtools&lt;/code&gt; repository&lt;/a&gt;
is an unofficial set of scripts to assist with setting up an RVM environment, including
a script for Cygwin. These instructions are taken from: &lt;a href="http://blog.developwithpassion.com/2012/03/30/installing-rvm-with-cygwin-on-windows/"&gt;Installing RVM on Cygwin&lt;/a&gt;.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Run the following commands (noting that the actual paths are important, in this case):&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;mkdir -p repositories/developwithpassion
cd repositories/developwithpassion
git clone git://github.com/developwithpassion/devtools
cd devtools
./osx_or_cygwin_kick_off
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;This will have created a file such as &lt;code&gt;$USER.settings&lt;/code&gt; (i.e. &lt;code&gt;your_windows_user.settings&lt;/code&gt;)
which you &lt;em&gt;can&lt;/em&gt; alter to:&lt;/p&gt;

    &lt;ol&gt;
      &lt;li&gt;Specify your GitHub account details (&lt;strong&gt;if&lt;/strong&gt; you have one).&lt;/li&gt;
      &lt;li&gt;Comment out all of the &lt;code&gt;:windows[:paths]&lt;/code&gt; options, since they probably
are not relevant for your machine (as they were indeed not relevant for mine).&lt;/li&gt;
    &lt;/ol&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Run this command again:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;./osx_or_cygwin_kick_off
&lt;/code&gt;&lt;/pre&gt;

    &lt;p&gt;…which will now use your &lt;code&gt;...settings&lt;/code&gt; file to do its install.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;You may see some errors along the way, but just ignore them until you see a prompt
to &lt;code&gt;press any key to continue&lt;/code&gt;; hit ENTER each time it prompts you.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;As it progresses, it will compile a version of Ruby (1.9.3?) and this will take a while; probably
more than 15 minutes. Afterwards it will wait for you to hit ENTER again before
trying to install Ruby 2.0.0.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; It &lt;em&gt;may&lt;/em&gt; stall while installing Ruby 2.0.0, after this point:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;Installing rubygems-2.0.6 for ruby-2.0.0-p247.........(and so on)......
Installation of rubygems completed successfully.
Saving wrappers to '/home/anton/.rvm/wrappers/ruby-2.0.0-p247'...........

ruby-2.0.0-p247 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
ruby-2.0.0-p247 - #importing default gemsets, this may take time.................
&lt;/code&gt;&lt;/pre&gt;

    &lt;p&gt;After waiting at least half an hour, I hit &lt;code&gt;CTRL+C&lt;/code&gt;. It gave some errors,
but I was able to proceed as follows…&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Exit the Cygwin Terminal and launch it again. This will &lt;em&gt;ensure&lt;/em&gt; the correct environment
gets loaded.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;At this point, you will probably be on Ruby 2.0.0. Install the latest Ruby &lt;em&gt;1.9.3&lt;/em&gt;
and switch to it:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;rvm install 1.9.3
rvm use 1.9.3 --default
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id="part-3-install-apt-cyg"&gt;Part 3: Install &lt;code&gt;apt-cyg&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="http://code.google.com/p/apt-cyg/"&gt;&lt;code&gt;apt-cyg&lt;/code&gt;&lt;/a&gt; is loosely equivalent to
&lt;a href="http://en.wikipedia.org/wiki/Advanced_Packaging_Tool"&gt;APT&lt;/a&gt;
(e.g. &lt;code&gt;apt-get&lt;/code&gt;). It is a way to search for, and install packages
from the Cygwin command-line. It is not perfect but can be a convenient way
to install packages on demand or via a script. I recommend installing it, as
it may come in handy.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Run the following commands, which dump &lt;code&gt;apt-cyg&lt;/code&gt; directly into your path
and then make it executable:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;svn --force export http://apt-cyg.googlecode.com/svn/trunk/ /bin/
chmod +x /bin/apt-cyg
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Use &lt;code&gt;apt-cyg&lt;/code&gt; to install something:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;apt-cyg install bc
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Verify that it worked:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;bc --version
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; &lt;em&gt;If&lt;/em&gt; you retrospectively install any packages with &lt;code&gt;apt-cyg&lt;/code&gt;
(or the Cygwin &lt;code&gt;setup-x86.exe&lt;/code&gt;
for that matter), you &lt;strong&gt;may&lt;/strong&gt; need to take the following steps, if you start
getting errors related to &lt;code&gt;fork()&lt;/code&gt;:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Exit out of any Cygwin processes, including the Cygwin Terminal.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Launch a Windows Command Prompt, “As Administrator”.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Run:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;c:\cygwin\bin\dash -c '/usr/bin/rebaseall'
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id="part-4-enable-openssh-server"&gt;Part 4: Enable OpenSSH server&lt;/h3&gt;

&lt;p class="warning"&gt;This assumes you want to be able to SSH into your machine and use the Cygwin
command-line (i.e. your default shell in Cygwin). Being able to do so is quite
convenient, but not required in this process, and may pose security risks
depending on your circumstances.&lt;/p&gt;

&lt;p&gt;The steps below are based on &lt;a href="http://www.noah.org/ssh/cygwin-sshd.html"&gt;these instructions&lt;/a&gt;:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Run:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;ssh-host-config -y
&lt;/code&gt;&lt;/pre&gt;

    &lt;p&gt;…and when prompted, supply any password for the &lt;code&gt;cyg_server&lt;/code&gt; user that it will create.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Log in as each user that will need SSH access (or just stay as the current user),
and per each run:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;ssh-user-config -y
&lt;/code&gt;&lt;/pre&gt;

    &lt;p&gt;…hitting ENTER to avoid entering a passphrase for each key.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Start the &lt;code&gt;sshd&lt;/code&gt; service with:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;cygrunsrv -S sshd
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;You should now be able to SSH into your host, with your Windows username and password.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; Doing this will probably reveal a new “Privileged server” user on your
Windows login screen. For more info, see:
&lt;a href="http://www.codylogan.net/2011/04/14/ssh-into-a-windows-computer/"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id="part-5-fix-vim-config"&gt;Part 5: Fix &lt;code&gt;vim&lt;/code&gt; config&lt;/h3&gt;

&lt;p class="summary"&gt;&lt;code&gt;vim&lt;/code&gt; is my preferred editor. If you don’t use it, you can skip this section.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Grab a template that fixes cursor keys:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;cp /usr/share/vim/vim73/vimrc_example.vim ~/.vimrc
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Add the following to it for other enhancements:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;" Add these if needed:
"   filetype plugin indent on
"   syntax on
" Two-space soft tabs, always:
set tabstop=2
set softtabstop=2
set shiftwidth=2
set expandtab
" Line numbers:
set number
" Disable backup files:
set nobackup
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id="part-6-set-yourself-up-for-github"&gt;Part 6: Set yourself up for GitHub&lt;/h3&gt;

&lt;p class="summary"&gt;Again, these steps are only required if you plan to use &lt;code&gt;git&lt;/code&gt; (and GitHub).&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Create a place where project repos can be kept. For example:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;cd ~
mkdir /cygdrive/c/projects
ln -s /cygdrive/c
ln -s c/projects
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Configure Git:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;git config --global color.ui true
git config --global user.name "Your Full Name"
git config --global user.email "your.email@address.com"
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href="https://help.github.com/articles/generating-ssh-keys#platform-linux"&gt;Set up GitHub SSH keys&lt;/a&gt;.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id="part-7-create-an-example-ruby-project"&gt;Part 7: Create an example Ruby project&lt;/h3&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Create a directory for your project:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;cd ~/projects
mkdir mydemo
cd mydemo
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Create files that tell RVM which Ruby version to use, and that you want a specific
set of gems to be tracked for this project:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;echo "1.9.3" &amp;gt; .ruby-version
echo "mydemo-gemset" &amp;gt; .ruby-gemset
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Change out of, and back into the directory, to get it to reload the RVM config:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;pushd ~
popd
rvm list gemsets
&lt;/code&gt;&lt;/pre&gt;

    &lt;p&gt;…the final line of which should show something like:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;=&amp;gt; ruby-1.9.3-p448@mydemo-gemset [ i386 ]
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Install &lt;a href="http://bundler.io/"&gt;Bundler&lt;/a&gt;:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;gem install bundler
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Create a &lt;code&gt;Gemfile&lt;/code&gt; which is used by Bundler, for now just to select v1.1.1
of the &lt;a href="http://stoneship.org/software/adsf/"&gt;&lt;code&gt;adsf&lt;/code&gt; gem&lt;/a&gt;:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;source 'https://rubygems.org'

gem 'adsf', '1.1.1'
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Test Bundler, getting it to read and respect &lt;code&gt;Gemfile&lt;/code&gt;:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;bundle install
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Test that it worked:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;which adsf
# /home/myuser/.rvm/gems/ruby-1.9.3-p448@mydemo-gemset/bin/adsf
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id="troubleshooting"&gt;Troubleshooting&lt;/h2&gt;
&lt;p&gt;If you get &lt;code&gt;child_info_fork&lt;/code&gt; errors, try:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Run this command, to find any modules (i.e. that may have been installed
by Ruby gems):&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;find ~ -iname '*.so' &amp;gt; /tmp/rubygems.so.list
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;Exit any Cygwin Terminals or processes.&lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Go in to an Administrator command prompt and run:&lt;/p&gt;

    &lt;pre&gt;&lt;code&gt;c:\cygwin\bin\dash -c '/usr/bin/rebaseall -T /tmp/rubygems.so.list'
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;div class="-pic-wrapper"&gt;  &lt;img class="" src="/posts/wrangling-ruby-and-imagemagick-in-cygwin/pics/rubiks-cube-solved@photo.jpg" alt="The cube, solved" title="The cube, solved"&gt;  &lt;/div&gt;


</content>
    <summary type="html">&lt;p&gt;Cygwin can be a clever way for Windows environments to leverage
the power of tools that might otherwise only be available
in the Unix realm. If you attempt Ruby and ImageMagick stuff in
it, though, be prepared for a fight…&lt;/p&gt;</summary>
  </entry>
  <entry>
    <id>tag:anton.maurovic.com,2012-06-26:/posts/more-packaging-designs-for-seeed-studio/</id>
    <title type="html">More Packaging Designs
for Seeed Studio</title>
    <published>2012-06-26T00:00:00Z</published>
    <updated>2012-06-26T00:00:00Z</updated>
    <link rel="alternate" href="https://anton.maurovic.com/posts/more-packaging-designs-for-seeed-studio/"/>
    <content type="html">&lt;div style="display:none;"&gt;&lt;img src="/posts/more-packaging-designs-for-seeed-studio/thumb.jpg" alt="More Packaging Designs for Seeed Studio" width="160" height="120" border="0"&gt;&lt;/div&gt;

&lt;p class="overview"&gt;I’m not a qualified or professional graphic designer, but from time to time
I get the opportunity to contribute to a company’s marketing material.
&lt;a href="http://www.seeedstudio.com/"&gt;Seeed Studio&lt;/a&gt; have commissioned a few designs in the past, which I’d like
to share here.&lt;/p&gt;

&lt;div class="left-pic-wrapper"&gt;  &lt;img class="left" src="/posts/more-packaging-designs-for-seeed-studio/pics/seeed@figure.png" alt="" title=""&gt;  &lt;/div&gt;

&lt;p&gt;&lt;a href="http://www.seeedstudio.com/"&gt;Seeed Studio&lt;/a&gt; is a company based in Shenzhen, China. They are
part of a new breed of
&lt;a href="http://singularityhub.com/2010/05/10/13-open-source-hardware-companies-making-1-million-or-more-video/"&gt;businesses&lt;/a&gt; that cater to the &lt;a href="http://en.wikipedia.org/wiki/Open_source_hardware"&gt;Open Hardware&lt;/a&gt;
community and &lt;a href="http://en.wikipedia.org/wiki/Maker_subculture"&gt;“maker” movement&lt;/a&gt;.
Their products target the interests (and the tight budgets)
of the growing market of electronics hobbyists, hardware design enthusiasts,
and inventors.&lt;/p&gt;

&lt;div class="right-pic-wrapper"&gt;  &lt;img class="right" src="/posts/more-packaging-designs-for-seeed-studio/pics/ideas@figure.png" alt="" title=""&gt;  &lt;/div&gt;

&lt;p&gt;One thing that gives Seeed an edge and really engages their customers, is
close involvement with the community they supply: both sourcing
&lt;em&gt;and&lt;/em&gt; sharing designs within that community. In that spirit, individuals
around the world often contribute to various aspects of Seeed’s production.&lt;/p&gt;

&lt;p&gt;I was pleased to get involved, by contributing some graphic design work.
This began with a
&lt;a href="/posts/prize-winning-dso-quad-box-design/"&gt;winning box-art design&lt;/a&gt;
I submitted to one of their competitions, and continued with a few
other commissioned works…&lt;/p&gt;

&lt;h2 id="maker-faire-banners"&gt;Maker Faire Banners&lt;/h2&gt;
&lt;p&gt;Seeed Studio exhibited at the
&lt;a href="http://makerfaire.com/bayarea/2011/"&gt;Bay Area Maker Faire in 2011&lt;/a&gt; and
asked me to come up with some banner designs
that illustrated their open approach to development, prototyping, manufacturing,
and marketing:&lt;/p&gt;

&lt;div class="-pic-wrapper pic-with-caption"&gt;  &lt;a class="liteup liteup-noborder" href="/posts/more-packaging-designs-for-seeed-studio/pics/banners@big.jpg" target="_blank" title="Wall banners for Seeed's booth at Maker Faire"&gt;&lt;img src="/posts/more-packaging-designs-for-seeed-studio/pics/banners@photo.jpg" alt="Wall banners for Seeed's booth at Maker Faire"&gt;&lt;/a&gt;  &lt;span&gt;Wall banners for Seeed's booth at Maker Faire&lt;/span&gt;  &lt;/div&gt;

&lt;p&gt;I designed the banners to work together, or separately, and demonstrate
the flow of ideas from inception to production. See also:
&lt;a href="http://www.seeedstudio.com/blog/2011/05/10/eye-candy-banners/"&gt;Seeed’s original blog post&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id="adk-dash-kit---box-art"&gt;ADK Dash Kit - Box Art&lt;/h2&gt;
&lt;div class="right-pic-wrapper"&gt;  &lt;img class="right" src="/posts/more-packaging-designs-for-seeed-studio/pics/android@figure.png" alt="" title=""&gt;  &lt;/div&gt;

&lt;p&gt;Seeed distribute their own version of the
&lt;a href="http://developer.android.com/guide/topics/connectivity/usb/adk.html"&gt;Android Open Accessory Development Kit&lt;/a&gt;,
known as the
&lt;a href="http://www.seeedstudio.com/depot/seeeduino-adk-main-board-p-846.html?cPath=132_206"&gt;Seeeduino ADK&lt;/a&gt;.
They decided to pair it up with some of their 
&lt;a href="http://www.seeedstudio.com/depot/index.php?main_page=advanced_search_result&amp;amp;search_in_description=1&amp;amp;keyword=grovefamily"&gt;Grove&lt;/a&gt;
real-world interface accessories, to create the
&lt;a href="http://www.seeedstudio.com/depot/grove-adk-dash-kit-p-929.html?cPath=138"&gt;ADK Dash Kit&lt;/a&gt;.
Using a new universal box template, they needed a design for a sticker that would wrap
around the box, and communicate the great sensory, control, and feedback capabilities
of the kit.&lt;/p&gt;

&lt;div class="bordered-pic-wrapper pic-with-caption"&gt;  &lt;a class="liteup bordered" href="/posts/more-packaging-designs-for-seeed-studio/pics/adkdash@big.png" target="_blank" title="ADK Dask Kit wrap-around sticker design"&gt;&lt;img src="/posts/more-packaging-designs-for-seeed-studio/pics/adkdash@photo.jpg" alt="ADK Dask Kit wrap-around sticker design"&gt;&lt;/a&gt;  &lt;span&gt;ADK Dask Kit wrap-around sticker design&lt;/span&gt;  &lt;/div&gt;

&lt;p&gt;The design brief specified use of the existing Seeed corporate image, while adding some
geek appeal and tying it in with Google Android. I created a few 
icons and other visual metaphors that reflect the components supplied in the box.&lt;/p&gt;

&lt;div class="-pic-wrapper pic-with-caption"&gt;  &lt;a class="liteup liteup-noborder" href="/posts/more-packaging-designs-for-seeed-studio/pics/adkexamples@big.jpg" target="_blank" title="Product shots of the ADK Dash Kit"&gt;&lt;img src="/posts/more-packaging-designs-for-seeed-studio/pics/adkexamples@photo.jpg" alt="Product shots of the ADK Dash Kit"&gt;&lt;/a&gt;  &lt;span&gt;Product shots of the ADK Dash Kit&lt;/span&gt;  &lt;/div&gt;

&lt;h2 id="rainbow-cube-ready-to-shine---box-art"&gt;Rainbow Cube, Ready to Shine - Box Art&lt;/h2&gt;
&lt;p&gt;One of the more aesthetic kits produced by Seeed is the “Rainbow Cube”, which 
is a 4x4x4 array of RGB LEDs. The
“&lt;a href="http://www.seeedstudio.com/blog/2011/11/01/open-source-electronic-ornament-rainbow-cube/"&gt;Rainbow Cube, Ready to Shine&lt;/a&gt;”
combines a pre-assembled Rainbow Cube, in an acrylic case, with everything required
to start programming it straight away – including an
&lt;a href="http://makezine.com/arduino/"&gt;Arduino&lt;/a&gt;-compatible
microcontroller/driver board.&lt;/p&gt;

&lt;p&gt;Seeed commissioned me to design the packaging for this product, which required an eye-catching
main box and a smaller accessories box that would be
included inside. This is a 3D render of the main box:&lt;/p&gt;

&lt;div class="bordered-pic-wrapper pic-with-caption"&gt;  &lt;a class="liteup bordered" href="/posts/more-packaging-designs-for-seeed-studio/pics/rainbowcube@big.jpg" target="_blank" title="Test render of the 'Rainbow Cube - Ready to Shine!' box artwork"&gt;&lt;img src="/posts/more-packaging-designs-for-seeed-studio/pics/rainbowcube@photo.jpg" alt="Test render of the 'Rainbow Cube - Ready to Shine!' box artwork"&gt;&lt;/a&gt;  &lt;span&gt;Test render of the 'Rainbow Cube - Ready to Shine!' box artwork&lt;/span&gt;  &lt;/div&gt;

&lt;p&gt;After some minor changes, here is how the final product turned out,
including the smaller accessories box:&lt;/p&gt;

&lt;div class="-pic-wrapper pic-with-caption"&gt;  &lt;a class="liteup liteup-noborder" href="/posts/more-packaging-designs-for-seeed-studio/pics/rcboxes@big.jpg" target="_blank" title="Rainbow Cube, Ready to Shine! The final product"&gt;&lt;img src="/posts/more-packaging-designs-for-seeed-studio/pics/rcboxes@photo.jpg" alt="Rainbow Cube, Ready to Shine! The final product"&gt;&lt;/a&gt;  &lt;span&gt;Rainbow Cube, Ready to Shine! The final product&lt;/span&gt;  &lt;/div&gt;

&lt;p&gt;One challenge with this design was the stylised sketch of the device itself. Instead
of drawing it, it was easier to model the whole thing in 3D and convert it to vector art.&lt;/p&gt;


</content>
    <summary type="html">&lt;p&gt;I’m not a qualified or professional graphic designer, but from time to time
I get the opportunity to contribute to a company’s marketing material.
&lt;a href="http://www.seeedstudio.com/"&gt;Seeed Studio&lt;/a&gt; have commissioned a few designs in the past, which I’d like
to share here.&lt;/p&gt;</summary>
  </entry>
  <entry>
    <id>tag:anton.maurovic.com,2012-03-17:/posts/antons-warm-chicken-salad/</id>
    <title type="html">Anton's Warm Chicken Salad</title>
    <published>2012-03-17T00:00:00Z</published>
    <updated>2012-03-17T00:00:00Z</updated>
    <link rel="alternate" href="https://anton.maurovic.com/posts/antons-warm-chicken-salad/"/>
    <content type="html">&lt;div style="display:none;"&gt;&lt;img src="/posts/antons-warm-chicken-salad/thumb.jpg" alt="Anton's Warm Chicken Salad" width="160" height="120" border="0"&gt;&lt;/div&gt;

&lt;p class="overview"&gt;One day I needed to whip something up quickly, using only what I had in my fridge and
pantry. Fortunately, it turns out I actually had a lot of good stuff. So, it wasn’t too
hard to put together a light, delicious recipe…&lt;/p&gt;

&lt;div class="bordered-pic-wrapper pic-with-caption"&gt;  &lt;a class="liteup bordered" href="/posts/antons-warm-chicken-salad/pics/wcs-served@big.jpg" target="_blank" title="Anton's Warm Chicken Salad, being heartily enjoyed"&gt;&lt;img src="/posts/antons-warm-chicken-salad/pics/wcs-served@wide.jpg" alt="Anton's Warm Chicken Salad, being heartily enjoyed"&gt;&lt;/a&gt;  &lt;span&gt;Anton's Warm Chicken Salad, being heartily enjoyed&lt;/span&gt;  &lt;/div&gt;

&lt;p&gt;I expect that any sort of “Warm Chicken Salad” is something in which you can easily
exchange various ingredients to suit your taste. This recipe includes some key ingredients
that I like, to make a basic “sauce” that you could probably put over any sort of salad,
rice, or pasta.&lt;/p&gt;

&lt;p&gt;Note that I really enjoy balsamic vinegar. You may prefer to cook with a little light wine
instead, and use a dash of a simple salad dressing over the dish (if any at all).&lt;/p&gt;

&lt;h2 id="ingredients"&gt;Ingredients&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;1 x Large Onion, chopped&lt;/li&gt;
  &lt;li&gt;2 x Rashers Middle Bacon, chopped&lt;/li&gt;
  &lt;li&gt;12 x Cherry tomatoes, quartered&lt;/li&gt;
  &lt;li&gt;1 x Cos lettuce, cut into fat ribbons&lt;/li&gt;
  &lt;li&gt;¾ of a red capsicum, cut into fine strips&lt;/li&gt;
  &lt;li&gt;6 x Large button mushrooms, finely diced&lt;/li&gt;
  &lt;li&gt;170g Semi-dried tomatoes in their own oil&lt;/li&gt;
  &lt;li&gt;2 blocks, Danish fetta, cubed&lt;/li&gt;
  &lt;li&gt;2 x Chicken breasts, diced&lt;/li&gt;
  &lt;li&gt;1 tsp Chicken stock&lt;/li&gt;
  &lt;li&gt;1 tsp Paprika&lt;/li&gt;
  &lt;li&gt;½ tsp Chilli flakes&lt;/li&gt;
  &lt;li&gt;3 tbsp pizza sauce&lt;/li&gt;
  &lt;li&gt;2 slices of a good, thick white bread – toasted, buttered, then dried in the oven (75°C) until crunchy and cut into croutons&lt;/li&gt;
  &lt;li&gt;Olive oil&lt;/li&gt;
  &lt;li&gt;Balsamic vinegar&lt;/li&gt;
  &lt;li&gt;Shaved parmesan cheese&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id="method"&gt;Method&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;Brown onion in 1bsp oil, then the bacon.&lt;/li&gt;
  &lt;li&gt;Lower the heat &amp;amp; add capsicum, chicken stock, paprika, chilli flakes, and &lt;strong&gt;half&lt;/strong&gt; the mushroom.&lt;/li&gt;
  &lt;li&gt;Simmer until capsicum is soft, then sear, then put this mix aside.&lt;/li&gt;
  &lt;li&gt;Remove any burnt muck from the pan, add more oil, and lightly cook semi-dried tomatoes (with their oil) and &lt;strong&gt;half&lt;/strong&gt; the fetta on medium heat. Add chicken, and a few bursts of balsamic to the uncooked side of the chicken.&lt;/li&gt;
  &lt;li&gt;Cook for a while, stirring occasionally, until it starts to thicken. Start adding a little more balsamic when the chicken is mostly cooked.&lt;/li&gt;
  &lt;li&gt;Add pizza sauce and the earlier capsicum mix, cook a short while longer until all well-mixed.&lt;/li&gt;
  &lt;li&gt;Turn off heat, add croutons, stir up.&lt;/li&gt;
  &lt;li&gt;Combine and toss lettuce, cherry tomatoes, and remaining raw mushroom and fetta. Dress with more balsamic, and a touch of oil, salt, and pepper to taste.&lt;/li&gt;
  &lt;li&gt;Top the salad with the cooked mixture, and parmesan cheese.&lt;/li&gt;
&lt;/ol&gt;

</content>
    <summary type="html">&lt;p&gt;One day I needed to whip something up quickly, using only what I had in my fridge and
pantry. Fortunately, it turns out I actually had a lot of good stuff. So, it wasn’t too
hard to put together a light, delicious recipe…&lt;/p&gt;</summary>
  </entry>
  <entry>
    <id>tag:anton.maurovic.com,2012-02-19:/posts/electronics-part-1-analog-basics/</id>
    <title type="html">Electronics, part 1:
Analog Basics</title>
    <published>2012-02-19T00:00:00Z</published>
    <updated>2012-02-19T00:00:00Z</updated>
    <link rel="alternate" href="https://anton.maurovic.com/posts/electronics-part-1-analog-basics/"/>
    <content type="html">&lt;div style="display:none;"&gt;&lt;img src="/posts/electronics-part-1-analog-basics/thumb.png" alt="Electronics, part 1: Analog Basics" width="160" height="120" border="0"&gt;&lt;/div&gt;

&lt;p class="overview"&gt;Despite playing with electronics for years, there’s a lot I didn’t know about
the basics. I find that a good way to learn something and understand it well,
is by explaining it to someone else. This article is the first of (hopefully)
many, and kicks off with some simple concepts that are fundamental to all
electrical systems.&lt;/p&gt;

&lt;ul class="toc" id="markdown-toc"&gt;
  &lt;li&gt;&lt;a href="#introduction"&gt;Introduction&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#assumptions"&gt;Assumptions&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#what-does-analog-electronics-mean"&gt;What does “Analog Electronics” mean?&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#what-is-an-electrical-circuit"&gt;What is an electrical circuit?&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#understanding-current-voltage-and-resistance"&gt;Understanding Current, Voltage, and Resistance&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#bringing-it-all-together-with-ohms-law"&gt;Bringing it all together with Ohm’s law&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#examples"&gt;Examples&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#conclusion"&gt;Conclusion&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#further-reading"&gt;Further Reading&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p class="summary"&gt;In these articles I hope not only to teach others, but reinforce my own
understanding. If you think I’ve explained something incorrectly or poorly,
please &lt;a href="/contact.php"&gt;correct me&lt;/a&gt;. If I pass briefly over a topic that you feel
really needs more detail, suggest a web link or a short addition that I can
include here.&lt;/p&gt;

&lt;p&gt;In studying electronics, you’ll learn about two models: “Analog Electronics”
and then “Digital Electronics”. Both are valid, and have their own specific applications.
This article gives a brief summary of analog electronics, and simple facts which are
crucial to &lt;em&gt;all&lt;/em&gt; electrical behaviour.&lt;/p&gt;

&lt;p&gt;With an understanding of analog electronics, you will be able to examine and
even design more complex systems, including the analog components and behaviours
that affect, support, and drive digital systems.&lt;/p&gt;

&lt;p&gt;I will avoid the physics of electronics, and some of the detailed
theory. I am going to focus more on the practical side, so
I can take you through these topics quickly. If you want the “nitty-gritty”,
maybe take a look at the &lt;a href="#further-reading"&gt;Further Reading&lt;/a&gt; section.&lt;/p&gt;

&lt;h2 id="assumptions"&gt;Assumptions&lt;/h2&gt;
&lt;p class="summary"&gt;&lt;em&gt;Even if&lt;/em&gt; the following concepts are all new to you, hopefully you will still
be able to follow this article.&lt;/p&gt;

&lt;p&gt;In these articles, I will assume that:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;You observe &lt;strong&gt;&lt;a href="http://www.learningelectronics.net/vol_1/chpt_3/1.html"&gt;Electrical Safety&lt;/a&gt;&lt;/strong&gt; – do &lt;strong&gt;not&lt;/strong&gt; experiment with
anything connected to mains power.&lt;/li&gt;
  &lt;li&gt;You’ve had at least some basic hands-on experience with electricity,
maybe just to light something up, install or fix some wiring,
or charge a car battery – even if just from someone else’s instructions.&lt;/li&gt;
  &lt;li&gt;You more-or-less know what &lt;a href="http://www.learnabout-electronics.org/resistors_01.php"&gt;“conductors” and
“insulators”&lt;/a&gt; are;&lt;/li&gt;
  &lt;li&gt;You know how to interpret at least the basics of
&lt;a href="http://blog.makezine.com/2011/01/25/reading-circuit-diagrams/"&gt;circuit diagrams&lt;/a&gt;
(i.e. schematics);&lt;/li&gt;
  &lt;li&gt;
&lt;em&gt;Optionally&lt;/em&gt;, you know the difference between &lt;a href="http://www.mi.mun.ca/users/cchaulk/eltk1100/ivse/ivse.htm"&gt;conventional current and
electron flow&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id="what-does-analog-electronics-mean"&gt;What does “Analog Electronics” mean?&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;Commonly&lt;/em&gt;, “analog electronics” refers to designs that respect electricity as a
&lt;a href="http://en.wikipedia.org/wiki/Continuous_function"&gt;continuous&lt;/a&gt;, variable quantity, where even small variations in electrical levels may be
important, calculated, and used purposefully. These variations have a direct measurable
effect on (and drive operation of) the system as a whole.&lt;/p&gt;

&lt;div class="right-pic-wrapper pic-with-caption"&gt;  &lt;img class="right" src="/posts/electronics-part-1-analog-basics/pics/system1@figure.png" alt="Figure 1: Example of an analog system" title="Figure 1: Example of an analog system"&gt;  &lt;span&gt;Figure 1: Example of an analog system&lt;/span&gt;  &lt;/div&gt;

&lt;p&gt;The word “analog” means “proportional”. This describes how “information” in the system
is directly represented by varying electrical levels. For example, a microphone
senses air pressure waves (sound), and may express the pressure as a tiny, proportional,
electrical level. That electrical level can then be modified by an electronic
device, to proportionally enlarge (amplify) it. The now-amplified signal
may then be converted back into sound, by mechanically driving a loudspeaker.&lt;/p&gt;

&lt;p&gt;All electrical systems are fundamentally analog in nature: The analog model describes
electrical phenomena in &lt;a href="http://en.wikipedia.org/wiki/Continuous_function"&gt;continuous&lt;/a&gt; mathematical terms, and we’ll start with the
simplest aspects of this.&lt;/p&gt;

&lt;h2 id="what-is-an-electrical-circuit"&gt;What is an electrical circuit?&lt;/h2&gt;
&lt;p class="warning"&gt;The following is an example of the simplest circuit, but &lt;em&gt;don’t&lt;/em&gt; try assembling it as
described because it has no limiting factors, and hence will have damaging
effects.&lt;/p&gt;

&lt;p&gt;Any work done by an electrical device, is because of “charge” flowing through it.
“Charge” is like a quantity of electricity&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" rel="footnote"&gt;1&lt;/a&gt;&lt;/sup&gt;, and is often visualised as a liquid.
It can be made to “flow” in one direction or another through the material of a
“conductor”, such as a metal. The &lt;em&gt;solid&lt;/em&gt; of the conductor “contains” the charge
in much the same way that the &lt;em&gt;hollow&lt;/em&gt; inside a pipe can contain water.&lt;/p&gt;

&lt;div class="center-pic-wrapper pic-with-caption"&gt;  &lt;img class="center" src="/posts/electronics-part-1-analog-basics/pics/circuit1@figure.png" alt="Figure 2: Simplest complete circuit" title="Figure 2: Simplest complete circuit"&gt;  &lt;span&gt;Figure 2: Simplest complete circuit&lt;/span&gt;  &lt;/div&gt;

&lt;p&gt;If an electrical conductor is in direct physical contact with an electrical
&lt;em&gt;energy&lt;/em&gt; (“voltage”) source, electrical &lt;em&gt;charge&lt;/em&gt; will flow at a given rate
(“current”) so long as it has a return path. The amount of current is 
restricted by the imperfect nature of the conductor (“resistance”), which is usually
deliberately controlled. &lt;strong&gt;This is a circuit&lt;/strong&gt;, in that an energised charge can come
from one place, follow a direct path, and return to another place – to be
re-energised for as long as the energy supply lasts.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Example conductor: A continuous piece of metal, such as a wire.&lt;/li&gt;
  &lt;li&gt;Example voltage source: A battery, with two terminals. High-energy charge
leaves via one terminal – call it “positive” (usually indicated by a plus (&lt;script type="math/tex"&gt; + &lt;/script&gt;)
symbol or a red marking).&lt;/li&gt;
  &lt;li&gt;With a battery, the return path is via the &lt;em&gt;other&lt;/em&gt; terminal that
receives charge that has spent its energy – call it “negative” (usually
indicated by a minus (&lt;script type="math/tex"&gt; - &lt;/script&gt;) symbol, or a black marking).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Note that the source of energy (the positive end, which has the “higher relative voltage”)
is sometimes said to “source current”, while the return path (the negative end, which
has the “lower relative voltage”) is said to “sink current”.&lt;/p&gt;

&lt;div class="right-pic-wrapper pic-with-caption"&gt;  &lt;img class="right" src="/posts/electronics-part-1-analog-basics/pics/circuit2@figure.png" alt="Figure 3: Simple lightbulb circuit" title="Figure 3: Simple lightbulb circuit"&gt;  &lt;span&gt;Figure 3: Simple lightbulb circuit&lt;/span&gt;  &lt;/div&gt;

&lt;p&gt;Now, if a gap is created in the circuit (i.e. a cut and separation in the conductor)…&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;And a suitably-chosen component (e.g. lightbulb) is inserted…&lt;/li&gt;
  &lt;li&gt;Such that electrical charge is able to flow into one end of it…&lt;/li&gt;
  &lt;li&gt;And flow out of the other end and back onto the return path…&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;…then a simple &lt;em&gt;useful&lt;/em&gt; circuit has been created, as the current supplies energy
that lights the bulb. It is the insertion of extra components and more paths
between the voltage source’s positive and negative terminals
that allows for creation of more complex circuits that perform useful tasks.&lt;/p&gt;

&lt;div class="left-pic-wrapper pic-with-caption"&gt;  &lt;img class="left" src="/posts/electronics-part-1-analog-basics/pics/broken-circuit1@figure.png" alt="Figure 4: A broken, or 'open' circuit" title="Figure 4: A broken, or 'open' circuit"&gt;  &lt;span&gt;Figure 4: A broken, or 'open' circuit&lt;/span&gt;  &lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Why is the &lt;em&gt;circuit&lt;/em&gt; configuration (i.e. return path) necessary?&lt;/strong&gt; A voltage source
(battery) does not simply “leak” or eject charge as soon as
a conductor is attached. Rather, energy is added to the charge as it
passes &lt;em&gt;through&lt;/em&gt; the voltage source. If there is no charge arriving at the negative
end, then there is nothing to energise and push onwards. Hence, no current will flow.&lt;/p&gt;

&lt;p&gt;In this sense,
a voltage source is like a pump. You will notice in Figure 4 that the bulb
is not lit because there is no current: Though a conductor path &lt;em&gt;apparently&lt;/em&gt; joins a
positive terminal with a negative one, there is no way to continuously get charge into
(or out of) the batteries, and hence they have no effect.&lt;/p&gt;

&lt;p class="alert"&gt;&lt;em&gt;WARNING:&lt;/em&gt; When mains power is involved, touching even &lt;em&gt;one&lt;/em&gt; terminal &lt;strong&gt;may harm or kill you&lt;/strong&gt;.
The voltage is high enough that a &lt;em&gt;lethal&lt;/em&gt; current can pass through your body and complete a circuit
with the ground beneath you, even if it doesn’t &lt;strong&gt;appear&lt;/strong&gt; that there’s a conductor
path between you and the ground.&lt;/p&gt;

&lt;h2 id="understanding-current-voltage-and-resistance"&gt;Understanding Current, Voltage, and Resistance&lt;/h2&gt;
&lt;p&gt;I’m not going to explain the details of what current, voltage, and resistance
actually are at the physical level, but here’s a summary of how they’re
the most fundamental characteristics of an electrical circuit:&lt;/p&gt;

&lt;h4 id="current"&gt;Current&lt;/h4&gt;

&lt;p&gt;Denoted &lt;script type="math/tex"&gt; \mathbf{I} &lt;/script&gt;, “current” is an instantaneous measurement of the rate of
flow of electric charge. It is because of current that there is activity
in a circuit. It can be imagined that as current increases, a circuit
becomes more “active” or more “energised”. Current is measured in “Amperes”
(or “amps”, more commonly) – denoted &lt;strong&gt;A&lt;/strong&gt;.&lt;/p&gt;

&lt;h4 id="resistance"&gt;Resistance&lt;/h4&gt;

&lt;p&gt;Denoted &lt;script type="math/tex"&gt; \mathbf{R} &lt;/script&gt;, “resistance” is the property of an electrical component
(or simple conductor) to restrict the flow of charge (i.e. to resist, and
hence reduce, the current). It’s measured in “Ohms”, denoted &lt;strong&gt;Ω&lt;/strong&gt;.
With higher resistance, there will be less current.&lt;/p&gt;

&lt;h4 id="voltage"&gt;Voltage&lt;/h4&gt;

&lt;p&gt;Denoted &lt;script type="math/tex"&gt; \mathbf{V} &lt;/script&gt;, or sometimes &lt;script type="math/tex"&gt; \mathbf{E} &lt;/script&gt;, “voltage” can be thought of as &lt;em&gt;relative&lt;/em&gt;
electrical “pressure” that encourages charge to flow (and hence “causes”
current). More-formally it is a difference of electrical potential energy, between
two points, that acts as a force to cause electrons to flow through a suitable
conductor medium. Voltage is measured in “volts”, denoted &lt;strong&gt;V&lt;/strong&gt;.&lt;/p&gt;

&lt;h2 id="bringing-it-all-together-with-ohms-law"&gt;Bringing it all together with Ohm’s law&lt;/h2&gt;
&lt;div class="right-pic-wrapper pic-with-caption"&gt;  &lt;img class="right" src="/posts/electronics-part-1-analog-basics/pics/ohm-triangle@figure.png" alt="Ohm's Law Triangle" title="Ohm's Law Triangle"&gt;  &lt;span&gt;Ohm's Law Triangle&lt;/span&gt;  &lt;/div&gt;

&lt;p&gt;So, voltage causes current, but current is restricted by resistance.
&lt;a href="http://en.wikipedia.org/wiki/Ohm%27s_law"&gt;Ohm’s law&lt;/a&gt; explicitly states the
inter-dependence between voltage (&lt;script type="math/tex"&gt; \mathbf{V} &lt;/script&gt;), current (&lt;script type="math/tex"&gt; \mathbf{I} &lt;/script&gt;), and resistance (&lt;script type="math/tex"&gt; \mathbf{R} &lt;/script&gt;):&lt;/p&gt;

&lt;script type="math/tex; mode=display"&gt;
\mathbf{V} = \mathbf{IR} \quad \therefore \quad
\mathbf{I} = \frac{\mathbf{V}}{\mathbf{R}} \quad \therefore \quad
\mathbf{R} = \frac{\mathbf{V}}{\mathbf{I}}
&lt;/script&gt;

&lt;p&gt;When you have:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Any pair of points in a circuit…&lt;/li&gt;
  &lt;li&gt;That have a voltage difference between them (i.e. a difference in potential)…&lt;/li&gt;
  &lt;li&gt;And are connected by an uninterrupted electrical path…&lt;/li&gt;
  &lt;li&gt;For which, you can express a total equivalent resistance…&lt;/li&gt;
  &lt;li&gt;With no other external voltage influences along that path…&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;…then there will be a current that is &lt;strong&gt;equal&lt;/strong&gt; at &lt;strong&gt;all&lt;/strong&gt; non-divided
points along that path, and which can be calculated using Ohm’s law.&lt;/p&gt;

&lt;h2 id="examples"&gt;Examples&lt;/h2&gt;
&lt;p&gt;Very simple applications of Ohm’s law are demonstrated in the circuit diagrams below.
Though these specifically use a known voltage and resistance to calculate current,
you can use the
&lt;a href="#bringing-it-all-together-with-ohms-law"&gt;identities of Ohm’s law&lt;/a&gt; with any two &lt;em&gt;known&lt;/em&gt;
variables to calculate the third &lt;em&gt;unknown&lt;/em&gt; variable.&lt;/p&gt;

&lt;p class="note"&gt;Though it &lt;strong&gt;appears&lt;/strong&gt; most of these examples are not &lt;strong&gt;circuits&lt;/strong&gt;,
the presence of a voltage difference at points &lt;strong&gt;A&lt;/strong&gt; and &lt;strong&gt;B&lt;/strong&gt;
&lt;em&gt;implies&lt;/em&gt; that they’re connected to an unseen
voltage source that completes the circuit. You can assume that the
voltage source is a battery, power supply, or possibly even two points in a
larger circuit.&lt;/p&gt;

&lt;div class="-pic-wrapper pic-with-caption"&gt;  &lt;img class="" src="/posts/electronics-part-1-analog-basics/pics/circuit-examples@wide.png" alt="Figure 5: Example circuits demonstrating Ohm's Law" title="Figure 5: Example circuits demonstrating Ohm's Law"&gt;  &lt;span&gt;Figure 5: Example circuits demonstrating Ohm's Law&lt;/span&gt;  &lt;/div&gt;

&lt;h4 id="example-1"&gt;Example 1&lt;/h4&gt;

&lt;blockquote&gt;
  &lt;p&gt;The total resistance between points &lt;strong&gt;A&lt;/strong&gt; and &lt;strong&gt;B&lt;/strong&gt; is shown to be 350Ω,
while the voltage difference is 7V. So, the current from &lt;strong&gt;A&lt;/strong&gt; to &lt;strong&gt;B&lt;/strong&gt;
(and at all points along the undivided path) is:&lt;/p&gt;

&lt;script type="math/tex; mode=display"&gt; \mathbf{I} = \frac{\mathbf{V}}{\mathbf{R}} = \frac{7}{350} = 0.02 &lt;/script&gt;

  &lt;p&gt;Hence, &lt;script type="math/tex"&gt; \mathbf{I} = 20mA &lt;/script&gt; (20 milliamps) from &lt;strong&gt;A&lt;/strong&gt; to &lt;strong&gt;B&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4 id="example-2"&gt;Example 2&lt;/h4&gt;

&lt;blockquote&gt;
  &lt;p&gt;The voltage difference between &lt;strong&gt;A&lt;/strong&gt; and &lt;strong&gt;B&lt;/strong&gt; is &lt;script type="math/tex"&gt; 5V - (-7V) = 12V &lt;/script&gt;.
We don’t know the respective resistances of &lt;strong&gt;R2&lt;/strong&gt; and &lt;strong&gt;R3&lt;/strong&gt;, but &lt;strong&gt;if&lt;/strong&gt; we were
told that the total equivalent resistance is, say, 1kΩ between &lt;strong&gt;A&lt;/strong&gt; and
&lt;strong&gt;B&lt;/strong&gt;, then:&lt;/p&gt;

&lt;script type="math/tex; mode=display"&gt; \mathbf{I} = \frac{12}{1000} = 0.012 &lt;/script&gt;

  &lt;p&gt;Hence, &lt;script type="math/tex"&gt; \mathbf{I} = 12mA &lt;/script&gt; from &lt;strong&gt;A&lt;/strong&gt; to &lt;strong&gt;B&lt;/strong&gt;. Again, because the path is
undivided, this current is the same at all points along the path, including
through each resistor, and the wire that joins them in the middle.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4 id="example-3"&gt;Example 3&lt;/h4&gt;

&lt;blockquote&gt;
  &lt;p&gt;In this example, there’s a different symbol at point &lt;strong&gt;B&lt;/strong&gt;, which is the
‘ground’ symbol. It does not literally refer to the ground
or “earth” beneath you, but rather indicates a reference point, which is always considered
to be a relative 0 volts. Any points in a circuit that use this symbol are
assumed to be directly connected to each other, and hence at the same
reference voltage.
Any other voltages are expressed as &lt;em&gt;relative&lt;/em&gt; (positive or negative) to
the ground 0-volt reference.&lt;/p&gt;

  &lt;p&gt;In this
case, the voltage difference between &lt;strong&gt;A&lt;/strong&gt; and &lt;strong&gt;B&lt;/strong&gt; is &lt;script type="math/tex"&gt; (-6V) - 0V = -6V &lt;/script&gt;.
Again, we don’t know the resistances of the two resistors, but &lt;strong&gt;if&lt;/strong&gt; we were
told that the total equivalent resistance between &lt;strong&gt;A&lt;/strong&gt; and &lt;strong&gt;B&lt;/strong&gt; is, say,
2.4kΩ, then:&lt;/p&gt;

&lt;script type="math/tex; mode=display"&gt; \mathbf{I} = \frac{-6}{2400} = -0.0025 &lt;/script&gt;

  &lt;p&gt;Hence, &lt;script type="math/tex"&gt; \mathbf{I} = -2.5mA &lt;/script&gt; from &lt;strong&gt;A&lt;/strong&gt; to &lt;strong&gt;B&lt;/strong&gt;. The negative current simply
indicates that the charge is flowing in the reverse direction, since &lt;script type="math/tex"&gt; A &lt; B &lt;/script&gt;.
Note that in this case, because the path is divided, we can’t say that the
current across &lt;strong&gt;R4&lt;/strong&gt; (or &lt;strong&gt;R5&lt;/strong&gt;) &lt;em&gt;individually&lt;/em&gt; is the same as across the whole path.
However, we &lt;strong&gt;can&lt;/strong&gt; say that the current across the &lt;em&gt;pair&lt;/em&gt; of them is still &lt;script type="math/tex"&gt; \mathbf{I} &lt;/script&gt;.
Ohm’s law also lets us conclude the following:&lt;/p&gt;

  &lt;ol&gt;
    &lt;li&gt;The voltage at the top point where &lt;strong&gt;R4&lt;/strong&gt; and &lt;strong&gt;R5&lt;/strong&gt; are connected, is -6V.&lt;/li&gt;
    &lt;li&gt;Likewise, the voltage at the bottom point where they’re connected is 0V.&lt;/li&gt;
    &lt;li&gt;Given this, the voltage across &lt;em&gt;each of&lt;/em&gt; &lt;strong&gt;R4&lt;/strong&gt; and &lt;strong&gt;R5&lt;/strong&gt; is known to be
-6V (looking downwards).&lt;/li&gt;
    &lt;li&gt;Hence, if we knew the resistances of &lt;strong&gt;R4&lt;/strong&gt; and &lt;strong&gt;R5&lt;/strong&gt; respectively, we could
calculate their respective currents…&lt;/li&gt;
  &lt;/ol&gt;

&lt;script type="math/tex; mode=display"&gt;
\begin{aligned}
\mathbf{I_{R4}}&amp; = -6 / \mathbf{R4} \\
\mathbf{I_{R5}}&amp; = -6 / \mathbf{R5}
\end{aligned}
&lt;/script&gt;

  &lt;p&gt;…and we would actually find that &lt;script type="math/tex"&gt; \mathbf{I} = \mathbf{I_{R4}} + \mathbf{I_{R5}} &lt;/script&gt;,
which forms the basis of Kirchhoff’s Current Law, which is a topic for my next article.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4 id="example-4"&gt;Example 4&lt;/h4&gt;

&lt;blockquote&gt;
  &lt;p&gt;This circuit looks a little different from Example 3, but is basically the same
configuration. Instead of being given explicit voltages for points &lt;strong&gt;A&lt;/strong&gt; and &lt;strong&gt;B&lt;/strong&gt;
and having to find the difference, we can see that the voltage source &lt;strong&gt;BAT1&lt;/strong&gt; sets
the voltage difference between these two points to 10V.&lt;/p&gt;

  &lt;p&gt;The ground symbol at the
bottom doesn’t change anything, but establishes that we wish to consider this
point to be our reference 0 volts, meaning that the relative voltage at &lt;strong&gt;A&lt;/strong&gt;
will be 10 volts. In larger circuits, this may be important to illustrate how
multiple parts of the circuit are connected to the same baseline voltage.&lt;/p&gt;

  &lt;p&gt;&lt;strong&gt;If&lt;/strong&gt; we were told that
the equivalent resistance from &lt;strong&gt;A&lt;/strong&gt; to &lt;strong&gt;B&lt;/strong&gt; (through the network of resistors)
was 80Ω, then the current from &lt;strong&gt;A&lt;/strong&gt; to &lt;strong&gt;B&lt;/strong&gt; is:&lt;/p&gt;

&lt;script type="math/tex; mode=display"&gt;
\begin{aligned}
\mathbf{I} &amp; = \frac{10}{80} = 0.125 \\
&amp; = \mathbf{I_{R7}} + \mathbf{I_{R8}} \\
&amp; = \mathbf{I_{R6}}
\end{aligned}
&lt;/script&gt;

  &lt;p&gt;That is, the current through the whole loop from &lt;strong&gt;A&lt;/strong&gt; to &lt;strong&gt;B&lt;/strong&gt; is 125mA, which
is hence the current through &lt;strong&gt;R6&lt;/strong&gt;, and hence the current through the &lt;em&gt;pair&lt;/em&gt;
of &lt;strong&gt;R7&lt;/strong&gt; and &lt;strong&gt;R8&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2 id="conclusion"&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;By now you should understand the relationship between voltage, current, and
resistance, and be able to perform simple calculations involving the three. You should
also understand the importance of a circuit, in allowing electricity to flow.
So far we have looked at simple circuits that do not have a changing state.
In the next article we will expand on this by learning how to analyse
voltage, current, and resistance in more complex multi-path circuits,
using &lt;a href="http://en.wikipedia.org/wiki/Kirchhoff%27s_circuit_laws"&gt;Kirchhoff’s Circuit Laws&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id="further-reading"&gt;Further Reading&lt;/h2&gt;
&lt;p class="summary"&gt;These references are not essential to learning and applying electronic theory.
They will, however, give you a more in-depth understanding of the physics of electricity,
and help explain &lt;strong&gt;why&lt;/strong&gt; certain components or circuits behave they way they do.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href="http://www.learningelectronics.net/vol_1/chpt_3/1.html"&gt;Electrical Safety&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="http://www.learnabout-electronics.org/"&gt;Learn About Electronics&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="http://www.electronicstheory.com/COURSES/ELECTRONICS/e101-1.htm"&gt;Electronics Theory&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="http://www.eskimo.com/~billb/miscon/elect.html"&gt;Electricity Misconceptions&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;
&lt;a href="http://en.wikipedia.org/wiki/Hydraulic_analogy"&gt;Hydraulic Analogy&lt;/a&gt; – visualising
electricity using water flow models.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="footnotes"&gt;
  &lt;ol&gt;
    &lt;li id="fn:1"&gt;

      &lt;p&gt;Stricly-speaking, “charge” is a proton-electron imbalance. If a medium contains more
protons than electrons, it will have a positive charge. Conversely, it will have
a negative charge if there are more electrons than protons.&lt;a href="#fnref:1" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;

</content>
    <summary type="html">&lt;p&gt;Despite playing with electronics for years, there’s a lot I didn’t know about
the basics. I find that a good way to learn something and understand it well,
is by explaining it to someone else. This article is the first of (hopefully)
many, and kicks off with some simple concepts that are fundamental to all
electrical systems.&lt;/p&gt;</summary>
  </entry>
</feed>


