<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="/assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Code Ghar</title><link>https://codeghar.com/</link><description>Code Ghar is a place which various software projects call home. An accompanying blog provides code and guides as well as discussions.</description><atom:link href="https://codeghar.com/rss.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2019 &lt;a href="mailto:@aikchar"&gt;Hamza Sheikh&lt;/a&gt; License</copyright><lastBuildDate>Fri, 08 Feb 2019 22:22:38 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Build container images in Kubernetes with kaniko</title><link>https://codeghar.com/blog/build-container-images-in-kubernetes-with-kaniko.html</link><dc:creator>Hamza Sheikh</dc:creator><description>&lt;div&gt;&lt;p&gt;Building container images on Kubernetes is a desirable capability. It opens new
avenues of continuous integration (CI). We are no longer tied to using
something like Jenkins to schedule our CI build jobs. We can use the scheduling
proficiency of Kubernetes instead.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://codeghar.com/blog/build-container-images-in-kubernetes-with-kaniko.html"&gt; Read more …&lt;/a&gt; (6 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>aws</category><category>docker</category><category>kubernetes</category><category>terraform</category><guid>https://codeghar.com/blog/build-container-images-in-kubernetes-with-kaniko.html</guid><pubDate>Fri, 08 Feb 2019 07:22:14 GMT</pubDate></item><item><title>Apply Patch to OpenBSD</title><link>https://codeghar.com/blog/apply-patch-to-openbsd.html</link><dc:creator>Hamza Sheikh</dc:creator><description>&lt;div&gt;&lt;p&gt;Do a search and you'll find very little official comprehensive tutorial-type
documentation on how to apply one or more patches to OpenBSD. The information
is spread among different manual pages and such.&lt;/p&gt;
&lt;p&gt;As described in &lt;a href="https://www.openbsd.org/faq/faq10.html#Patches"&gt;Security updates FAQ&lt;/a&gt;:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;While applying fixes from the errata page typically requires less time
than a CVS checkout/update and rebuild, there is no universal set of
instructions to follow. Sometimes you must patch and recompile one
application, sometimes more.
&lt;/pre&gt;


&lt;p&gt;Here's how &lt;em&gt;I&lt;/em&gt; patched an OpenBSD 6.3 system running on
&lt;a href="https://www.openbsd.org/armv7.html"&gt;Cubox i4-pro&lt;/a&gt; with 32GB MicroSD card in
July of 2018.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://codeghar.com/blog/apply-patch-to-openbsd.html"&gt; Read more …&lt;/a&gt; (2 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>openbsd</category><guid>https://codeghar.com/blog/apply-patch-to-openbsd.html</guid><pubDate>Fri, 27 Jul 2018 18:34:33 GMT</pubDate></item><item><title>Terraform Recreates EC2 Instances on Every Plan</title><link>https://codeghar.com/blog/terraform-recreates-ec2-instances-on-every-plan.html</link><dc:creator>Hamza Sheikh</dc:creator><description>&lt;div&gt;&lt;p&gt;Have you ever seen an issue where Terraform recreates AWS EC2 instances on
every plan and apply?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://codeghar.com/blog/terraform-recreates-ec2-instances-on-every-plan.html"&gt; Read more …&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>aws</category><category>terraform</category><guid>https://codeghar.com/blog/terraform-recreates-ec2-instances-on-every-plan.html</guid><pubDate>Thu, 24 May 2018 00:14:25 GMT</pubDate></item><item><title>OpenBSD on Ubiquiti USG</title><link>https://codeghar.com/blog/openbsd-on-ubiquiti-usg.html</link><dc:creator>Hamza Sheikh</dc:creator><description>&lt;div&gt;&lt;p&gt;Ubiquiti Unifi Security Gateway (USG) is a great device to run at the edge of a
home network. It becomes even better when it's running OpenBSD. This guide
documents how to setup such a gateway. There are accompanying git repos to
somewhat automate the process as well.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://codeghar.com/blog/openbsd-on-ubiquiti-usg.html"&gt; Read more …&lt;/a&gt; (12 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>openbsd</category><guid>https://codeghar.com/blog/openbsd-on-ubiquiti-usg.html</guid><pubDate>Thu, 05 Apr 2018 05:40:19 GMT</pubDate></item><item><title>Package Python in a Snap</title><link>https://codeghar.com/blog/package-python-in-a-snap.html</link><dc:creator>Hamza Sheikh</dc:creator><description>&lt;div&gt;&lt;p&gt;Getting newer versions of Python on long term support releases of Linux
distributions, such as Ubuntu or CentOS, without interfering with the system
Python can be pretty involved. Doing it on multiple instances is even harder.
Fortunately, it is possible and quite easy by using &lt;tt class="docutils literal"&gt;snapd&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://codeghar.com/blog/package-python-in-a-snap.html"&gt; Read more …&lt;/a&gt; (2 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>python</category><category>ubuntu</category><guid>https://codeghar.com/blog/package-python-in-a-snap.html</guid><pubDate>Tue, 09 Jan 2018 04:20:24 GMT</pubDate></item><item><title>How to Use Python Virtualenv</title><link>https://codeghar.com/blog/how-to-use-python-virtualenv.html</link><dc:creator>Hamza Sheikh</dc:creator><description>&lt;div&gt;&lt;p&gt;A Python virtualenv is an isolated directory that serves as the root filesystem
(kind of) for an installation of Python. In simpler terms, Python is installed
in a non-privileged directory by a regular user. Anything installed for that
instance of Python does not affect any other Python instance installed on the
system.&lt;/p&gt;
&lt;p&gt;This guide will show you how each instance of a Python interpreter differs from
others and how to use this to your advantage.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://codeghar.com/blog/how-to-use-python-virtualenv.html"&gt; Read more …&lt;/a&gt; (8 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>python</category><guid>https://codeghar.com/blog/how-to-use-python-virtualenv.html</guid><pubDate>Wed, 01 Nov 2017 01:43:30 GMT</pubDate></item><item><title>Introduction to Makefile</title><link>https://codeghar.com/blog/introduction-to-makefile.html</link><dc:creator>Hamza Sheikh</dc:creator><description>&lt;div&gt;&lt;p&gt;Are you in the same boat as I was only a few weeks ago? That is, does  writing
a Makefile intimidates you beyond belief? Fear not! Makefiles appear to be
insurmountable (and some of the complicated ones really are) but if you start
with simple steps, they are really not that difficult.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://codeghar.com/blog/introduction-to-makefile.html"&gt; Read more …&lt;/a&gt; (12 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>make</category><guid>https://codeghar.com/blog/introduction-to-makefile.html</guid><pubDate>Fri, 27 Oct 2017 02:59:26 GMT</pubDate></item><item><title>Use select() in Python Socket Programming at Your Own Risk</title><link>https://codeghar.com/blog/use-select-in-python-socket-programming-at-your-own-risk.html</link><dc:creator>Hamza Sheikh</dc:creator><description>&lt;div&gt;&lt;p&gt;When one reads the
&lt;a class="reference external" href="https://docs.python.org/3/howto/sockets.html"&gt;Python Socket Programming HOWTO&lt;/a&gt;,
non-blocking sockets are mentioned along with &lt;tt class="docutils literal"&gt;select&lt;/tt&gt;. This is a tale of
when &lt;tt class="docutils literal"&gt;select&lt;/tt&gt; can cause issues if you're not careful.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://codeghar.com/blog/use-select-in-python-socket-programming-at-your-own-risk.html"&gt; Read more …&lt;/a&gt; (5 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>networking</category><category>python</category><guid>https://codeghar.com/blog/use-select-in-python-socket-programming-at-your-own-risk.html</guid><pubDate>Fri, 07 Jul 2017 21:38:20 GMT</pubDate></item><item><title>OpenBSD Network Gateway on EdgeRouter Lite</title><link>https://codeghar.com/blog/openbsd-network-gateway-on-edgerouter-lite.html</link><dc:creator>Hamza Sheikh</dc:creator><description>&lt;div&gt;&lt;p&gt;EdgeRouter Lite is a great device to run at the edge of a home network. It
becomes even better when it's running OpenBSD. This guide documents how to
setup such a gateway. There are accompanying git repos to somewhat automate
the process as well.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://codeghar.com/blog/openbsd-network-gateway-on-edgerouter-lite.html"&gt; Read more …&lt;/a&gt; (28 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>openbsd</category><guid>https://codeghar.com/blog/openbsd-network-gateway-on-edgerouter-lite.html</guid><pubDate>Tue, 06 Jun 2017 22:22:59 GMT</pubDate></item><item><title>Essential pkgsrc - The Missing Mini Handbook</title><link>https://codeghar.com/blog/essential-pkgsrc-the-missing-mini-handbook.html</link><dc:creator>Hamza Sheikh</dc:creator><description>&lt;div&gt;&lt;p&gt;pkgsrc is a cross operating system package manager. It supports -- among many
others -- NetBSD, Minix, SmartOS, Linux, and macOS. I like it because of this
portability. It also has the additional, and I would say the best, benefit of
being installed in the home directory and run completely without needing root
access. I also like that I don't have to depend on binary packages built by
someone else, say Joyent, although there's absolutely nothing wrong with it.
Finally, it provides a large number of different packages. I have never
encountered a package that I needed but was not available. In short pkgsrc is a
portable, featureful, and flexible package manager. What's not to like?&lt;/p&gt;
&lt;p&gt;pkgsrc can sometimes be a little behind native package managers, such
as MacPorts on macOS, but it catches up quickly. For my use case -- getting
access to multiple versions of Python -- it works well enough if I closely
follow its trunk branch.&lt;/p&gt;
&lt;p&gt;There's generally good and detailed documentation available for pkgsrc but an
introductory guide that pulled in some essential starter information was
lacking. This guide fills that void by making it easy to get started with
pkgsrc and learn about some of its core concepts. Thus, I dubbed it the mini
handbook or the missing starter handbook.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://codeghar.com/blog/essential-pkgsrc-the-missing-mini-handbook.html"&gt; Read more …&lt;/a&gt; (8 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>macos</category><category>netbsd</category><category>pkgsrc</category><category>python</category><guid>https://codeghar.com/blog/essential-pkgsrc-the-missing-mini-handbook.html</guid><pubDate>Sat, 25 Mar 2017 19:29:16 GMT</pubDate></item><item><title>FreeBSD Network Gateway on EdgeRouter Lite</title><link>https://codeghar.com/blog/freebsd-network-gateway-on-edgerouter-lite.html</link><dc:creator>Hamza Sheikh</dc:creator><description>&lt;div&gt;&lt;p&gt;EdgeRouter Lite is a great device to run at the edge of a home network. It
becomes even better when it's running FreeBSD. This guide documents how to
setup such a gateway. There are accompanying git repos to somewhat automate
the process as well.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://codeghar.com/blog/freebsd-network-gateway-on-edgerouter-lite.html"&gt; Read more …&lt;/a&gt; (15 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>freebsd</category><guid>https://codeghar.com/blog/freebsd-network-gateway-on-edgerouter-lite.html</guid><pubDate>Mon, 02 Jan 2017 03:35:14 GMT</pubDate></item><item><title>Shell Scripting Cookbook</title><link>https://codeghar.com/blog/shell-scripting-cookbook.html</link><dc:creator>Hamza Sheikh</dc:creator><description>&lt;div&gt;&lt;p&gt;Tips I have learned on how to do things in shell scripts.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://codeghar.com/blog/shell-scripting-cookbook.html"&gt; Read more …&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>shell</category><guid>https://codeghar.com/blog/shell-scripting-cookbook.html</guid><pubDate>Thu, 10 Nov 2016 19:36:14 GMT</pubDate></item><item><title>Use Fixtures Effectively in PyTest</title><link>https://codeghar.com/blog/use-fixtures-effectively-in-pytest.html</link><dc:creator>Hamza Sheikh</dc:creator><description>&lt;div&gt;&lt;p&gt;Fixtures are a great feature of PyTest but using them can be tricky. I found
them to be very useful when all important environment logic resides in them
and tests use a consistent interface without regard to how the environment
is actually set up.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://codeghar.com/blog/use-fixtures-effectively-in-pytest.html"&gt; Read more …&lt;/a&gt; (4 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>pytest</category><guid>https://codeghar.com/blog/use-fixtures-effectively-in-pytest.html</guid><pubDate>Tue, 30 Aug 2016 03:43:48 GMT</pubDate></item><item><title>Install Latest Python on CentOS 7</title><link>https://codeghar.com/blog/install-latest-python-on-centos-7.html</link><dc:creator>Hamza Sheikh</dc:creator><description>&lt;div&gt;&lt;p&gt;There are many options to install newer Python on CentOS, including building
from source, installing from
&lt;a class="reference external" href="https://fedoraproject.org/wiki/EPEL"&gt;EPEL&lt;/a&gt;,
installing from
&lt;a class="reference external" href="https://www.softwarecollections.org/en/"&gt;Software Collections&lt;/a&gt; (SCL),
installing third party rpm package, etc. These all work to some degree of
success. I had a different use case and could not find a pre-built rpm
package to fit it.&lt;/p&gt;
&lt;p&gt;My use case had these restraints:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Install newer Python alongside the default system version&lt;/li&gt;
&lt;li&gt;Install multiple Python versions simultaneously&lt;/li&gt;
&lt;li&gt;Install the latest release from upstream Python project not just the latest release from a repository (repo)&lt;/li&gt;
&lt;li&gt;Do not build from source unless absolutely necessary&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="https://codeghar.com/blog/install-latest-python-on-centos-7.html"&gt; Read more …&lt;/a&gt; (4 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>centos</category><category>python</category><guid>https://codeghar.com/blog/install-latest-python-on-centos-7.html</guid><pubDate>Wed, 13 Apr 2016 05:07:07 GMT</pubDate></item><item><title>Requiring Encryption in Apache Qpid</title><link>https://codeghar.com/blog/requiring-encryption-in-apache-qpid.html</link><dc:creator>Hamza Sheikh</dc:creator><description>&lt;div&gt;&lt;p&gt;I configured requiring encryption in Apache Qpid (C++ broker) by adding the
following line to &lt;em&gt;/etc/qpid/qpidd.conf&lt;/em&gt; file and restarting the broker&lt;/p&gt;
&lt;pre class="literal-block"&gt;
require-encryption=yes
&lt;/pre&gt;
&lt;p&gt;Later when I used &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;qpid-stat&lt;/span&gt;&lt;/tt&gt; I got an error message&lt;/p&gt;
&lt;pre class="literal-block"&gt;
$ qpid-stat -q -b user@password/localhost:5672
Failed: AuthenticationFailure - Error in sasl_client_start (-4) SASL(-4): no mechanism available
&lt;/pre&gt;
&lt;p&gt;After following a mailing list post to a JIRA to a
&lt;a class="reference external" href="https://reviews.apache.org/r/7207/"&gt;Review Board entry&lt;/a&gt; I found that when
broker requires a secure TLS connection then the connection string must use
&lt;tt class="docutils literal"&gt;amqps&lt;/tt&gt; protocol instead of &lt;tt class="docutils literal"&gt;amqp&lt;/tt&gt; like so&lt;/p&gt;
&lt;pre class="literal-block"&gt;
$ qpid-stat -q -b amqps://user@password/localhost:5672
&lt;/pre&gt;
&lt;p&gt;I was using version 0.34 of both broker and client.&lt;/p&gt;&lt;/div&gt;</description><category>qpid</category><guid>https://codeghar.com/blog/requiring-encryption-in-apache-qpid.html</guid><pubDate>Tue, 05 Apr 2016 06:12:48 GMT</pubDate></item><item><title>Build Bootable FreeBSD Image for Raspberry Pi 2 with Vagrant, Crochet, and Salt</title><link>https://codeghar.com/blog/build-bootable-freebsd-image-for-raspberry-pi-2-with-vagrant-crochet-and-salt.html</link><dc:creator>Hamza Sheikh</dc:creator><description>&lt;div&gt;&lt;p&gt;An issue in FreeBSD 11-CURRENT - where
&lt;a class="reference external" href="https://lists.freebsd.org/pipermail/freebsd-arm/2016-January/013049.html"&gt;make buildworld fails when run on RPi2&lt;/a&gt;
- prompted an investigation on automating the creation of bootable FreeBSD images
from 11-CURRENT on a Mac OS X machine.&lt;/p&gt;
&lt;p&gt;In an ideal situation, a build process can be kicked off at any time to produce
an image that can be written to a Micro SD card for the RPi2 to boot from.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://codeghar.com/blog/build-bootable-freebsd-image-for-raspberry-pi-2-with-vagrant-crochet-and-salt.html"&gt; Read more …&lt;/a&gt; (4 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>crochet</category><category>freebsd</category><category>git</category><category>salt</category><category>vagrant</category><category>virtualbox</category><guid>https://codeghar.com/blog/build-bootable-freebsd-image-for-raspberry-pi-2-with-vagrant-crochet-and-salt.html</guid><pubDate>Sat, 30 Jan 2016 05:47:29 GMT</pubDate></item><item><title>RaspBSD on Raspberry Pi 2 Model B</title><link>https://codeghar.com/blog/raspbsd-on-raspberry-pi-2-model-b.html</link><dc:creator>Hamza Sheikh</dc:creator><description>&lt;div&gt;&lt;p&gt;I bought a
&lt;a class="reference external" href="http://smile.amazon.com/gp/product/B008XVAVAW"&gt;Raspberry Pi 2 Model B from CanaKit&lt;/a&gt;
to install and learn FreeBSD. Fortunately for me (and you)
&lt;a class="reference external" href="http://raspbsd.org/"&gt;RaspBSD&lt;/a&gt; is available.&lt;/p&gt;
&lt;p&gt;I found at one point that using an 8GB Micro SD card caused me headaches as I
ran out of disk space at some points. I would recommend buying a bigger card.&lt;/p&gt;
&lt;p&gt;This guide was created using OS X 10.10 (Yosemite) as the "client". All
instructions assume:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Correct software installed on OS X&lt;/li&gt;
&lt;li&gt;You know how to use Disk Utility and CLI&lt;/li&gt;
&lt;li&gt;You have already assembled the Raspberry Pi (RPi) hardware (case, etc.)&lt;/li&gt;
&lt;li&gt;WiFi USB adapter is not connected initially (it's configured later)&lt;/li&gt;
&lt;li&gt;Ethernet, HDMI, keyboard, mouse are connected to Raspberry Pi&lt;/li&gt;
&lt;li&gt;USB to TTL serial cable is available for use (I bought this one: &lt;a class="reference external" href="http://www.amazon.com/gp/product/B00QT7LQ88"&gt;http://www.amazon.com/gp/product/B00QT7LQ88&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Drivers from &lt;a class="reference external" href="http://prolificusa.com/pl-2303hx-drivers/"&gt;http://prolificusa.com/pl-2303hx-drivers/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;WARNING: This is a "living document" and will be updated as I learn from
my mistakes. There may be a lot of errors in this doc so all the standard
disclaimers apply.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://codeghar.com/blog/raspbsd-on-raspberry-pi-2-model-b.html"&gt; Read more …&lt;/a&gt; (15 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>freebsd</category><category>mac os x</category><category>raspberry pi</category><guid>https://codeghar.com/blog/raspbsd-on-raspberry-pi-2-model-b.html</guid><pubDate>Wed, 14 Oct 2015 04:52:03 GMT</pubDate></item><item><title>Configure Atom as git Editor</title><link>https://codeghar.com/blog/configure-atom-as-git-editor.html</link><dc:creator>Hamza Sheikh</dc:creator><description>&lt;div&gt;&lt;p&gt;In Atom open the command palette (Shift-Command-p) and enter command &lt;cite&gt;Install Shell Commands&lt;/cite&gt;.&lt;/p&gt;
&lt;p&gt;Configure Atom as git's editor.&lt;/p&gt;
&lt;pre class="literal-block"&gt;
git config --global core.editor "atom --new-window --wait"
&lt;/pre&gt;
&lt;p&gt;Now when you do &lt;cite&gt;git commit&lt;/cite&gt; it should open a new Atom window for you to enter your commit message.&lt;/p&gt;&lt;/div&gt;</description><category>atom</category><category>git</category><guid>https://codeghar.com/blog/configure-atom-as-git-editor.html</guid><pubDate>Tue, 06 Oct 2015 22:53:12 GMT</pubDate></item><item><title>What is a Tight Loop?</title><link>https://codeghar.com/blog/what-is-a-tight-loop.html</link><dc:creator>Hamza Sheikh</dc:creator><description>&lt;div&gt;&lt;p&gt;One often hears about &lt;em&gt;tight loops&lt;/em&gt; in the context of programming. I never
really got what it meant. Until today.&lt;/p&gt;
&lt;p&gt;A tight loop may be described as a loop that does very little work itself
but has an impact on the performance of the larger program. For example,
in an O(n) loop the faster it can execute each iteration the tighter it is.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://codeghar.com/blog/what-is-a-tight-loop.html"&gt; Read more …&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>programming</category><guid>https://codeghar.com/blog/what-is-a-tight-loop.html</guid><pubDate>Tue, 06 Oct 2015 22:28:16 GMT</pubDate></item><item><title>Python readline Bug</title><link>https://codeghar.com/blog/python-readline-bug.html</link><dc:creator>Hamza Sheikh</dc:creator><description>&lt;div class="section" id="problem"&gt;
&lt;h2&gt;Problem&lt;/h2&gt;
&lt;p&gt;In the Python interpreter whenever I hit enter it would show a blank line
without a prompt and I'd have to press enter again to see the prompt. When
I exited the interpreter the terminal would not show anything I typed.
Pressing the return key would show my shell prompt on the same line. Up arrow
or down arrow keys did not make any difference. &lt;cite&gt;reset&lt;/cite&gt; was a last resort.&lt;/p&gt;
&lt;p&gt;For example,&lt;/p&gt;
&lt;pre class="literal-block"&gt;
Python 3.4.3 (default, Aug 26 2015, 18:29:14)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
&amp;gt;&amp;gt;&amp;gt; abs(1-0)
&amp;gt;&amp;gt;&amp;gt; 1

&amp;gt;&amp;gt;&amp;gt; ^D&amp;gt;&amp;gt;&amp;gt;
~ $ ~ $ ~ $ reset
&lt;/pre&gt;
&lt;p&gt;&lt;a href="https://codeghar.com/blog/python-readline-bug.html"&gt; Read more …&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>mac os x</category><category>python</category><guid>https://codeghar.com/blog/python-readline-bug.html</guid><pubDate>Tue, 06 Oct 2015 22:23:12 GMT</pubDate></item><item><title>FreeBSD Post Install Setup</title><link>https://codeghar.com/blog/freebsd-post-install-setup.html</link><dc:creator>Hamza Sheikh</dc:creator><description>&lt;div class="section" id="freebsd-post-install-setup"&gt;
&lt;h2&gt;&lt;a class="toc-backref" href="https://codeghar.com/blog/freebsd-post-install-setup.html#id2"&gt;FreeBSD Post Install Setup&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;After you have installed FreeBSD (10.1-RELEASE in my case) these steps
will help you set it up for use. I'd recommend going through this guide
and executing the sections in the order in which they appear here.&lt;/p&gt;
&lt;p&gt;Disclaimer: I'm very new to FreeBSD so these are meant more for my notes
than a canonical guide for others. Read the &lt;a class="reference external" href="https://www.freebsd.org/doc/en/books/handbook/"&gt;FreeBSD Handbook&lt;/a&gt;
instead.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://codeghar.com/blog/freebsd-post-install-setup.html"&gt; Read more …&lt;/a&gt; (3 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>freebsd</category><guid>https://codeghar.com/blog/freebsd-post-install-setup.html</guid><pubDate>Wed, 12 Aug 2015 00:28:43 GMT</pubDate></item><item><title>Get Started with GnuPG</title><link>https://codeghar.com/blog/get-started-with-gnupg.html</link><dc:creator>Hamza Sheikh</dc:creator><description>&lt;div class="section" id="get-started-with-gnupg"&gt;
&lt;h2&gt;Get Started with GnuPG&lt;/h2&gt;
&lt;div class="section" id="install"&gt;
&lt;h3&gt;Install&lt;/h3&gt;
&lt;p&gt;I'll assume you'll want to use GnuPG v2.&lt;/p&gt;
&lt;p&gt;If you're using Ubuntu install from the repos.&lt;/p&gt;
&lt;pre class="literal-block"&gt;
user@host:~$ sudo aptitude install gpgv2
&lt;/pre&gt;
&lt;p&gt;You can also install from Nix package manager. It'll usually have newer versions available than the Ubuntu respos (especially if it's LTS).&lt;/p&gt;
&lt;pre class="literal-block"&gt;
user@host:~$ nix-env -i gnupg-2.1.1
&lt;/pre&gt;
&lt;p&gt;WARNING: This is a "living document" and will be updated as I learn from
my mistakes.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="generate-your-key-pair"&gt;
&lt;h3&gt;Generate Your Key Pair&lt;/h3&gt;
&lt;p&gt;You'll need a lot of entropy while generating a key pair. I don't know how much it helps but I run the following in a separate terminal window while I generate a key pair.&lt;/p&gt;
&lt;pre class="literal-block"&gt;
user@host:~$ dd if=/dev/urandom of=/dev/null
&lt;/pre&gt;
&lt;p&gt;While the &lt;cite&gt;dd&lt;/cite&gt; process is running, run the following in a different terminal window to generate your key pair.&lt;/p&gt;
&lt;pre class="literal-block"&gt;
user@host:~$ gpg2 --gen-key
&lt;/pre&gt;
&lt;p&gt;You'll be asked for your real name and email address. This constructs an identity for you. Make sure to use your actual information here.&lt;/p&gt;
&lt;p&gt;You will also be asked to provide a passphrase. Choose a secure passphrase and do not lose it. It's often recommended to keep a printed copy in a safe place, locked away from prying eyes.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://codeghar.com/blog/get-started-with-gnupg.html"&gt; Read more …&lt;/a&gt; (6 min remaining to read)&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;</description><category>gpg</category><guid>https://codeghar.com/blog/get-started-with-gnupg.html</guid><pubDate>Tue, 11 Aug 2015 18:41:39 GMT</pubDate></item><item><title>Should Web Apps Go in /srv or /var/www?</title><link>https://codeghar.com/blog/should-web-apps-go-in-srv-or-var-www.html</link><dc:creator>Hamza Sheikh</dc:creator><description>&lt;div class="section" id="should-web-apps-go-in-srv-or-var-www"&gt;
&lt;h2&gt;Should Web Apps Go in /srv or /var/www?&lt;/h2&gt;
&lt;p&gt;Is it better to follow Debian's default webroot policy or FHS? Should I install my web apps in &lt;em&gt;/srv&lt;/em&gt; or &lt;em&gt;/var/www&lt;/em&gt;?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://codeghar.com/blog/should-web-apps-go-in-srv-or-var-www.html"&gt; Read more …&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>debian</category><category>fhs</category><category>freebsd</category><category>http</category><category>nginx</category><category>www</category><guid>https://codeghar.com/blog/should-web-apps-go-in-srv-or-var-www.html</guid><pubDate>Wed, 08 Apr 2015 04:43:02 GMT</pubDate></item><item><title>Should Your Software Go in /usr/local or /opt?</title><link>https://codeghar.com/blog/should-your-software-go-in-usr-local-or-opt.html</link><dc:creator>Hamza Sheikh</dc:creator><description>&lt;div class="section" id="should-your-software-go-in-usr-local-or-opt"&gt;
&lt;h2&gt;Should Your Software Go in /usr/local or /opt?&lt;/h2&gt;
&lt;p&gt;As you try to install software from source or a locally built package, where do you install it? Is /usr/local the right path or does /opt make sense?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://codeghar.com/blog/should-your-software-go-in-usr-local-or-opt.html"&gt; Read more …&lt;/a&gt; (2 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>fhs</category><category>linux</category><guid>https://codeghar.com/blog/should-your-software-go-in-usr-local-or-opt.html</guid><pubDate>Wed, 08 Apr 2015 04:39:27 GMT</pubDate></item><item><title>Install Kanboard on FreeBSD</title><link>https://codeghar.com/blog/install-kanboard-on-freebsd.html</link><dc:creator>Hamza Sheikh</dc:creator><description>&lt;div class="section" id="install-kanboard-on-freebsd"&gt;
&lt;h2&gt;&lt;a class="toc-backref" href="https://codeghar.com/blog/install-kanboard-on-freebsd.html#id1"&gt;Install Kanboard on FreeBSD&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Read the &lt;a class="reference external" href="http://kanboard.net/documentation/installation"&gt;Kanboard installation guide&lt;/a&gt; for updated information. This guide focuses on the FreeBSD, nginx, and Kanboard stack. It's tested on 10.1-RELEASE.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://codeghar.com/blog/install-kanboard-on-freebsd.html"&gt; Read more …&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>freebsd</category><category>kanboard</category><category>nginx</category><guid>https://codeghar.com/blog/install-kanboard-on-freebsd.html</guid><pubDate>Fri, 13 Mar 2015 17:06:06 GMT</pubDate></item></channel></rss>