<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>The Standard Output (linux)</title><link>http://thestandardoutput.com/</link><description></description><atom:link href="http://thestandardoutput.com/tag/linux.xml" type="application/rss+xml" rel="self"></atom:link><language>en</language><lastBuildDate>Fri, 08 Jan 2016 03:59:57 GMT</lastBuildDate><generator>https://getnikola.com/</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Convert a PKCS #12 file into certificate and key files</title><link>http://thestandardoutput.com/posts/convert-a-pkcs-12-file-into-certificate-and-key-files/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;In cryptography, &lt;em&gt;PKCS #12&lt;/em&gt; is one of the family of standards called Public-Key
Cryptography Standards published by RSA Laboratories. It defines an archive file
format for storing many cryptography objects as a single file. It is commonly
used to bundle a private key with its X.509 certificate or to bundle all the
members of a chain of trust. A &lt;em&gt;PKCS #12&lt;/em&gt; file may be encrypted and signed. The
internal storage containers, called &lt;em&gt;SafeBags&lt;/em&gt;, may also be encrypted and
signed. A few &lt;em&gt;SafeBags&lt;/em&gt; are predefined to store certificates, private keys and
certificate revocation lists. The filename extension for &lt;em&gt;PKCS #12&lt;/em&gt; files is
&lt;code&gt;.p12&lt;/code&gt; or &lt;code&gt;.pfx&lt;/code&gt;. These files can be created, parsed and read out with the
OpenSSL &lt;code&gt;pkcs12&lt;/code&gt; command.&lt;/p&gt;
&lt;p&gt;I'm going to show you the commands used to convert a &lt;code&gt;.pfx&lt;/code&gt; file into its
certificate and key components. This information can come in handy when you need
to import your certificates to devices like routers, load-balancers, handhelds,
or for use with webservers like apache or nginx, where you'll need to import the
certificates and key files in plain-text, unencrypted format. Follow these
steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Install &lt;code&gt;openssl&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Extract the private key:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;openssl pkcs12 -in filename.pfx -nocerts -out encryptedkey.key
&lt;/pre&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enter the &lt;code&gt;.pfx&lt;/code&gt; file password when prompted&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;Enter a new password for the encrypted key when prompted&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Extract the client certificate:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;openssl pkcs12 -in filename.pfx -nokeys -clcerts -out certificate.crt
&lt;/pre&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Extract the Certificate Authority certificates:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;openssl
&lt;/pre&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Sometimes you will need an unencrypted key file:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;openssl rsa -in encryptedkey.key -out decryptedkey.key
&lt;/pre&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enter the key password you created in step 4 above&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;Sometimes the private key needs to be in a PEM format:&lt;pre class="code literal-block"&gt;openssl rsa -in encryptedkey.key -outform PEM -out encryptedkey.pem
&lt;/pre&gt;


&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Always remember to keep your decrypted key in a safe place. Those are the
literal &lt;em&gt;keys to the kingdom&lt;/em&gt;.&lt;/p&gt;&lt;/div&gt;</description><category>crypto</category><category>linux</category><category>security</category><guid>http://thestandardoutput.com/posts/convert-a-pkcs-12-file-into-certificate-and-key-files/</guid><pubDate>Wed, 11 Nov 2015 03:43:09 GMT</pubDate></item><item><title>Kernel fails to load after Catalyst update</title><link>http://thestandardoutput.com/posts/kernel-fails-to-load-after-catalyst-update/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;Today I did a system update on my Arch Linux installation with the command
&lt;code&gt;yaourt -Syua&lt;/code&gt; and after that the Kernel refused to boot with an error message
similar to the following in &lt;code&gt;journalctl -b&lt;/code&gt;:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="n"&gt;kernel&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;RIP&lt;/span&gt; &lt;span class="n"&gt;firegl&lt;/span&gt; &lt;span class="nf"&gt;trace&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mh"&gt;0x61&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mh"&gt;0x1e0&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;There is a know problem with the proprietary catalyst drivers not supporting
linux kernels &amp;gt;= 4.2. So to fix this issue you have to configure the bootloader
to use a different kernel, such as &lt;code&gt;linux-lts&lt;/code&gt;. Install &lt;code&gt;linux-lts&lt;/code&gt; package and
then reinstall the &lt;code&gt;catalyst*&lt;/code&gt; packages from the Vi0L0 AUR repos and then
re-configure GRUB with &lt;code&gt;grub-mkconfig -o /boot/grub/grub.cfg&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;I had to boot and mount everything using the Arch live install system then
&lt;code&gt;chroot&lt;/code&gt; and reinstall the catalyst packages with the LTS kernel to fix the
issue.&lt;/p&gt;
&lt;p&gt;When rebooting make sure to pick the LTS kernel from the GRUB menu.&lt;/p&gt;
&lt;p&gt;Vi0L0 himself has crated a bug for this at the &lt;a href="http://ati.cchtml.com/show_bug.cgi?id=1189"&gt;Unofficial AMD
Bugzilla&lt;/a&gt;, but a fix may take a long
time if past behavior is any indication of current outcome.&lt;/p&gt;&lt;/div&gt;</description><category>archlinux</category><category>linux</category><guid>http://thestandardoutput.com/posts/kernel-fails-to-load-after-catalyst-update/</guid><pubDate>Sun, 11 Oct 2015 20:13:13 GMT</pubDate></item><item><title>Evaluating Ersatz Emacsen</title><link>http://thestandardoutput.com/posts/evaluating-ersatz-emacsen/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;I have been an &lt;code&gt;Emacs&lt;/code&gt; user for many years and the key sequences have become
ingrained muscle memory to me. Since most Linux or BSD distros come with &lt;code&gt;vi&lt;/code&gt;
installed by default, I have learned how to use it. But I still long for that
familiar fell of &lt;code&gt;Emacs&lt;/code&gt; under my fingers and, at the same time, wish there was
something with a smaller footprint than full GNU Emacs.&lt;/p&gt;
&lt;p&gt;Well, such software does exist, under many different implementations as a matter
of fact. They are &lt;em&gt;affectionately&lt;/em&gt; called Ersatz Emacs. Now that's a word your
don't see every day, &lt;em&gt;Ersatz&lt;/em&gt;. Search google for &lt;code&gt;ersatz definition&lt;/code&gt; and you get
the following:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;er·satz&lt;/p&gt;
&lt;p&gt;ˈerˌzäts,ˈerˌsäts/&lt;/p&gt;
&lt;p&gt;&lt;em&gt;adjective&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;(of a product) made or used as a substitute, typically an inferior one, for something else.
  "ersatz coffee"
  &lt;em&gt;synonyms&lt;/em&gt;: artificial, substitute, imitation, synthetic, fake, false, faux, mock, simulated; More&lt;/p&gt;
&lt;p&gt;not real or genuine.
  "ersatz emotion"&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It seems that we can think of a an Ersatz Emacs as a &lt;em&gt;fake emacs&lt;/em&gt;. And the &lt;a href="http://www.emacswiki.org/emacs/ErsatzEmacs"&gt;Emacs
Wiki&lt;/a&gt; pretty much confirms that:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A 'nonextensible imitation' of a supposed implementation of an Emacs;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;The culprits&lt;/h3&gt;
&lt;p&gt;The most common Ersatz implementations of &lt;code&gt;Emacs&lt;/code&gt; today are &lt;code&gt;mg&lt;/code&gt;, &lt;code&gt;jove&lt;/code&gt;, and
&lt;code&gt;zile&lt;/code&gt;. First let's learn a little bit about each of them.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Mg&lt;/code&gt; is a lightweight public-domain Ersatz Emacs, dating back to 1986. &lt;code&gt;Mg&lt;/code&gt; was
originally known as &lt;em&gt;Micro GNU Emacs&lt;/em&gt;, as it strove to adhere more closely to
the default behavior of &lt;em&gt;GNU Emacs&lt;/em&gt; than other contemporary Ersatz Emacsen, but
was renamed at the request of Richard Stallman. Modern versions of &lt;code&gt;mg&lt;/code&gt; are
maintained as a component of the OpenBSD source tree; the editor is included as
standard in OpenBSD &lt;em&gt;because there shouldn’t be any reason to learn more editor
types than emacs or vi&lt;/em&gt;. There is also a port available for Linux.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;JOVE&lt;/code&gt; (Jonathan’s Own Version of Emacs) is an open-source Ersatz Emacs
implementation. &lt;code&gt;JOVE&lt;/code&gt; is primarily intended for Unix-like operating systems,
but also supports MS-DOS and Microsoft Windows. &lt;code&gt;JOVE&lt;/code&gt; was inspired by Gosling
Emacs but is much smaller and simpler, lacking any form of LISP or other
extension language. It was originally created in 1983 by Jonathan Payne while at
Lincoln-Sudbury Regional High School in Massachusetts, USA on a PDP-11
minicomputer. &lt;code&gt;JOVE&lt;/code&gt; was distributed with several releases of BSD Unix,
including 2.9BSD, 4.3BSD-Reno and 4.4BSD-Lite2.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;GNU Zile&lt;/code&gt; ("Zile Implements Lua Editors") &lt;em&gt;"is a text editor development kit,
so that you can (relatively) quickly develop your own ideal text editor without
reinventing the wheel for many of the common algorithms and data-structures
needed to do so"&lt;/em&gt;. Prior to version 3 its name expanded to &lt;em&gt;"Zile Is Lossy
Emacs"&lt;/em&gt;. Its goal was to be a lightweight Ersatz Emacs from the Free Software
Foundation emulating the behavior of its &lt;em&gt;"big brother"&lt;/em&gt; in a small package, so
that Emacs users can feel at home in limited environments. For customization,
&lt;code&gt;Zile&lt;/code&gt; uses its own limited configuration language known as &lt;em&gt;Zile Lisp&lt;/em&gt;. &lt;em&gt;Zile
Lisp&lt;/em&gt; is a tiny subset of &lt;em&gt;Emacs Lisp&lt;/em&gt; that consists of the &lt;code&gt;Zile&lt;/code&gt; commands plus
&lt;code&gt;setq&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;Comparison&lt;/h3&gt;
&lt;p&gt;The main goal is to pick an Emacs-like editor to be used for quick edits in a
virtual host running a flavor of Debian Linux. To that end, I do not require any
customisation of the editor, and I want the smallest footprint in both disk and
memory.&lt;/p&gt;
&lt;table class="table table-striped table-condensed"&gt;
  &lt;tr&gt;
    &lt;th&gt;Implementation&lt;/th&gt;
    &lt;th&gt;First Appeared&lt;/th&gt;
    &lt;th&gt;Latest Version&lt;/th&gt;
    &lt;th&gt;Programming Language&lt;/th&gt;
    &lt;th&gt;License&lt;/th&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;mg&lt;/td&gt;
    &lt;td&gt;1986&lt;/td&gt;
    &lt;td&gt;20150316 (linux port)&lt;/td&gt;
    &lt;td&gt;C&lt;/td&gt;
    &lt;td&gt;Public Domain&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;jove&lt;/td&gt;
    &lt;td&gt;1983&lt;/td&gt;
    &lt;td&gt;4.16.0.73&lt;/td&gt;
    &lt;td&gt;C&lt;/td&gt;
    &lt;td&gt;Jove License&lt;/td&gt;
  &lt;/tr&gt;
    &lt;td&gt;zile&lt;/td&gt;
    &lt;td&gt;2005&lt;/td&gt;
    &lt;td&gt;2.4.11&lt;/td&gt;
    &lt;td&gt;C&lt;/td&gt;
    &lt;td&gt;GNU GPL&lt;/td&gt;
  
&lt;/table&gt;

&lt;p&gt;And for the technical details:&lt;/p&gt;
&lt;table class="table table-striped table-condensed"&gt;
  &lt;tr&gt;
    &lt;th&gt;&lt;/th&gt;
    &lt;th&gt;&lt;/th&gt;
    &lt;th colspan="3" align="center"&gt;Memory&lt;/th&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;th&gt;Implementation&lt;/th&gt;
    &lt;th&gt;Size on Disk&lt;/th&gt;
    &lt;th&gt;Virtual&lt;/th&gt;
    &lt;th&gt;Physical&lt;/th&gt;
    &lt;th&gt;Shared&lt;/th&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;mg&lt;/td&gt;
    &lt;td&gt;181 KB&lt;/td&gt;
    &lt;td&gt;10564 KB&lt;/td&gt;
    &lt;td&gt;2472 KB&lt;/td&gt;
    &lt;td&gt;2284 KB&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;jove&lt;/td&gt;
    &lt;td&gt;197 KB&lt;/td&gt;
    &lt;td&gt;8744 KB&lt;/td&gt;
    &lt;td&gt;2648 KB&lt;/td&gt;
    &lt;td&gt;2180 KB&lt;/td&gt;
  &lt;/tr&gt;
    &lt;td&gt;zile&lt;/td&gt;
    &lt;td&gt;260 KB&lt;/td&gt;
    &lt;td&gt;47272 KB&lt;/td&gt;
    &lt;td&gt;3968 KB&lt;/td&gt;
    &lt;td&gt;2584 KB&lt;/td&gt;
  
&lt;/table&gt;

&lt;h3&gt;The difference between Virtual, Physical, and Shared Memory&lt;/h3&gt;
&lt;p&gt;Time for a quick digression into what the different types of memory mean in Linux.&lt;/p&gt;
&lt;p&gt;Virtual memory is the virtual size of a process, which is the sum of memory it
is actually using, memory it has mapped into itself (for instance the video
card's RAM for the X server), files on disk that have been mapped into it (most
notably shared libraries), and memory shared with other processes. Virtual
memory represents how much memory the program is able to access at the present
moment.&lt;/p&gt;
&lt;p&gt;Physical memory stands for the resident size, which is an accurate
representation of how much actual physical memory a process is consuming.&lt;/p&gt;
&lt;p&gt;Shared memory indicates how much of the Virtual memmory size is actually
sharable memory or libraries. In the case of libraries, it does not necessarily
mean that the entire library is resident. For example, if a program only uses a
few functions in a library, the whole library is mapped and will be counted in
Virtual and Shared, but only the parts of the library file containing the
functions being used will actually be loaded in and be counted under Physical.&lt;/p&gt;
&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;zile&lt;/code&gt; is the largest on disk and biggest memory hog of the three, so that's and
easy cut. &lt;code&gt;jove&lt;/code&gt; is slightly larger on disk than &lt;code&gt;mg&lt;/code&gt;, but it's Virtual memory
size is the best. &lt;code&gt;mg&lt;/code&gt; has the smallest footprint on disk and the smallest
Physical memory footprint. Plus, all of the BSD's and all the major Linux
distros have packages for the &lt;code&gt;mg&lt;/code&gt;, so that's the one I am going with.&lt;/p&gt;&lt;/div&gt;</description><category>emacs</category><category>linux</category><guid>http://thestandardoutput.com/posts/evaluating-ersatz-emacsen/</guid><pubDate>Tue, 21 Jul 2015 10:57:44 GMT</pubDate></item><item><title>Renew IP lease on Linux</title><link>http://thestandardoutput.com/posts/renew-ip-lease-on-linux/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;I run a router at home with &lt;code&gt;dd-wrt&lt;/code&gt;. My main machine has a static IP lease based
on the MAC address. Sometimes when I reboot the main machine the static IP is
not properly released by the DHCP subsystem and the router holds on to it,
therefore assigning my machine a regular DHCP IP.&lt;/p&gt;
&lt;p&gt;To fix this without having to reboot the machine, follow these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Login to the &lt;code&gt;dd-wrt&lt;/code&gt; router.&lt;/li&gt;
&lt;li&gt;Go to the &lt;code&gt;Setup&lt;/code&gt; page and click the &lt;code&gt;Save&lt;/code&gt; button followed by the &lt;code&gt;Apply&lt;/code&gt;
   button. This will restart the DHCP daemon in the router without having to reboot
   it.&lt;/li&gt;
&lt;li&gt;Go to the &lt;code&gt;Status&lt;/code&gt; page on the router and click on the &lt;code&gt;Lan&lt;/code&gt; tab and verify that
   the IP was indeed released.&lt;/li&gt;
&lt;li&gt;On the main machine, run the following commands:&lt;pre class="code literal-block"&gt;sudo dhclient -v -r enp4s0
sudo dhclient -v enp4s0
&lt;/pre&gt;


&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The above will renew the IP lease to the default static IP assigned to that MAC
address. Note that the above assumes you are using &lt;code&gt;NetworkManager&lt;/code&gt; with
&lt;code&gt;dhclient&lt;/code&gt; under it and that your network interface is &lt;code&gt;enp4s0&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;</description><category>linux</category><category>quick hacks</category><guid>http://thestandardoutput.com/posts/renew-ip-lease-on-linux/</guid><pubDate>Sat, 13 Jun 2015 19:39:19 GMT</pubDate></item><item><title>Fixing package-query to pacman dependency in Arch Linux</title><link>http://thestandardoutput.com/posts/fixing-package-query-to-pacman-dependency-in-arch/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;I was recently trying to update my Arch Linux system and I ran into a peculiar
dependency error with &lt;code&gt;package-query&lt;/code&gt; that would complety halt the update.&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;failed&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;prepare&lt;/span&gt; &lt;span class="n"&gt;transaction&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;could&lt;/span&gt; &lt;span class="n"&gt;not&lt;/span&gt; &lt;span class="n"&gt;satisfy&lt;/span&gt; &lt;span class="n"&gt;dependencies&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;::&lt;/span&gt; &lt;span class="kd"&gt;package&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;requires&lt;/span&gt; &lt;span class="n"&gt;pacman&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mf"&gt;4.2&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;It turns out that this is totally expected and it has to do with the new version
of Pacman (4.2) breaking a few things related to backwards compatibility. This
changes will require me to recompile and reinstall &lt;code&gt;package-query&lt;/code&gt; and &lt;code&gt;yaourt&lt;/code&gt;
and here's how to do it:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Uninstall &lt;code&gt;package-query&lt;/code&gt; and &lt;code&gt;yaourt&lt;/code&gt;&lt;/p&gt;
&lt;pre class="code literal-block"&gt;sudo pacman -Rdd package-query
sudo pacman -Rdd yaourt
&lt;/pre&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Get the latest bits from the AUR&lt;/p&gt;
&lt;pre class="code literal-block"&gt;curl -O https://aur.archlinux.org/packages/pa/package-query/package-query.tar.gz
curl -O https://aur.archlinux.org/packages/ya/yaourt/yaourt.tar.gz
&lt;/pre&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Explode the tarball and go into the each folder&lt;/p&gt;
&lt;pre class="code literal-block"&gt;tar -zxf package-query.tar.gz
tar -zxf yaourt.tar.gz
cd package-query
&lt;/pre&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Compile&lt;/p&gt;
&lt;pre class="code literal-block"&gt;makepkg -s
&lt;/pre&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Install&lt;/p&gt;
&lt;pre class="code literal-block"&gt;sudo pacman -U package-query-1.5-2-x86_64.pkg.tar.gz
&lt;/pre&gt;


&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Make sure to do steps 4 and 5 for the &lt;code&gt;yaourt&lt;/code&gt; package also. And this is
it... All should be in order now.&lt;/p&gt;&lt;/div&gt;</description><category>archlinux</category><category>linux</category><category>package</category><guid>http://thestandardoutput.com/posts/fixing-package-query-to-pacman-dependency-in-arch/</guid><pubDate>Sat, 17 Jan 2015 03:07:51 GMT</pubDate></item><item><title>Debian: Install Packages that were Kept Back</title><link>http://thestandardoutput.com/posts/debian-install-packages-that-were-kept-back/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;Have you ever seen this message when updating your Debian-based system: &lt;em&gt;"The
following packages have been kept back"?&lt;/em&gt; Here's why you see it and how to solve
it:&lt;/p&gt;
&lt;p&gt;You just tried to run the following command:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;sudo apt-get update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; sudo apt-get upgrade --show-upgraded -y
&lt;/pre&gt;


&lt;p&gt;... and you get the message:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;The following packages have been kept back
&lt;/pre&gt;


&lt;p&gt;Running &lt;code&gt;apt-get dist-upgrade&lt;/code&gt; is dangerous for a stable environment. The wrong
&lt;code&gt;source.list&lt;/code&gt; setting and you end up with a broken Debian. You might get the
entire application upgraded to a version you don't want. For example, the kernel
upgrade is kept back. You just want to upgrade the kernel, not the entire
distribution.&lt;/p&gt;
&lt;p&gt;A better way to handle a &lt;em&gt;kept back&lt;/em&gt; package is:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;sudo aptitude&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;If you have kept back package you should see Upgradable Packages on top of
   the list.&lt;/li&gt;
&lt;li&gt;Hit &lt;code&gt;+&lt;/code&gt; on that list&lt;/li&gt;
&lt;li&gt;Hit &lt;code&gt;g&lt;/code&gt; twice&lt;/li&gt;
&lt;li&gt;Answer debconf stuff if asked&lt;/li&gt;
&lt;li&gt;Press &lt;code&gt;return&lt;/code&gt; to continue&lt;/li&gt;
&lt;li&gt;Press &lt;code&gt;Q&lt;/code&gt; to quit&lt;/li&gt;
&lt;li&gt;Press &lt;code&gt;yes&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The &lt;em&gt;kept back&lt;/em&gt; packages are now installed.&lt;/p&gt;&lt;/div&gt;</description><category>debian</category><category>linux</category><category>package</category><guid>http://thestandardoutput.com/posts/debian-install-packages-that-were-kept-back/</guid><pubDate>Wed, 03 Dec 2014 02:56:53 GMT</pubDate></item><item><title>Tracking down where disk space has gone on Linux</title><link>http://thestandardoutput.com/posts/tracking-down-where-disk-space-has-gone-on-linux/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;When administering Linux systems I often find myself struggling to track down
the culprit after a partition goes full. Here's a solution which relies on
standard Linux commands to find where all that disk space is being consumed.&lt;/p&gt;
&lt;pre class="code literal-block"&gt;du -h / | grep '[0-9\.]\+G'
&lt;/pre&gt;


&lt;p&gt;One caveat: Don't go straight to &lt;code&gt;du /&lt;/code&gt;. Use &lt;code&gt;df&lt;/code&gt; to find the partition that's
hurting you, and then try &lt;code&gt;du&lt;/code&gt; commands.&lt;/p&gt;&lt;/div&gt;</description><category>bash</category><category>linux</category><category>quick hacks</category><guid>http://thestandardoutput.com/posts/tracking-down-where-disk-space-has-gone-on-linux/</guid><pubDate>Tue, 23 Sep 2014 20:03:26 GMT</pubDate></item><item><title>Free GeoIp location web service</title><link>http://thestandardoutput.com/posts/free-geoip-location-web-service/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;This weekend I found a really cool web service at
&lt;a href="http://freegeoip.net/"&gt;FreeGeoIp.net&lt;/a&gt;. Their API is really simple... just send
a HTTP GET request to:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;http://freegeoip.net/{format}/{ip_or_hostname}
&lt;/pre&gt;


&lt;p&gt;Here are some of the implementation details:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;SSL is supported&lt;/li&gt;
&lt;li&gt;Formats are csv, json, and xml&lt;/li&gt;
&lt;li&gt;IP is optional. It defaults to your current IP.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I quickly implemented a comnmand line client written in Python 3. It uses the
awesome &lt;a href="http://docs.python-requests.org/en/latest/"&gt;requests&lt;/a&gt; library and
ElementTree to parse the resulting XML response. Here's the code...&lt;/p&gt;
&lt;pre class="code literal-block"&gt;def main():
    args = parse_args()

    MYIP_URL = 'http://freegeoip.net/xml/'
    MYIP_HEADERS = {'Accept': 'application/xml'}

    if args.ip is not None:
        MYIP_URL = MYIP_URL + args.ip

    rspn = requests.get(MYIP_URL, headers=MYIP_HEADERS)
    tree = etree.ElementTree(etree.fromstring(rspn.text))
    root = tree.getroot()

    ip = root.find('Ip')
    cntr = root.find('CountryName')
    reg = root.find('RegionName')
    city = root.find('City')

    print('Your Current IP: %s' % ip.text)
    print('You appear to be in %s, %s, %s' % (city.text, reg.text, cntr.text))
&lt;/pre&gt;


&lt;p&gt;Or you can get the
&lt;a href="https://github.com/gorauskas/Hacks/blob/master/python/myip"&gt;whole code&lt;/a&gt; from my
&lt;a href="https://github.com/gorauskas"&gt;github profile&lt;/a&gt;.&lt;/p&gt;&lt;/div&gt;</description><category>linux</category><category>programming</category><category>python</category><guid>http://thestandardoutput.com/posts/free-geoip-location-web-service/</guid><pubDate>Thu, 04 Sep 2014 05:54:04 GMT</pubDate></item><item><title>Quick Ref: Python Virtualenv use</title><link>http://thestandardoutput.com/posts/quick-ref-python-virtualenv-use/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;Supposing you have a clean install of a Debian-based distro such as Debian 7
proper or Xubuntu 14.04, this notes will walk you through setting up a Python
development environment where you can leverage the power of Virtualenv through
Virtualenvwrapper.&lt;/p&gt;
&lt;h3&gt;Why virtualenv?&lt;/h3&gt;
&lt;p&gt;When you code in python you will quickly find out that different projects have
different requirements for the python version you need to use and also the
versions of libraries you need to use. Virtualenv will allow you to
compartmentalize the requirements on a per project basis without making you
install libraries and python versions globally or system-wide.&lt;/p&gt;
&lt;h3&gt;Ok, ok... Here are the goods...&lt;/h3&gt;
&lt;p&gt;You have your new shinny install of Debian which comes with a fairly recent
version of python pre-installed (somewhere above 2.7.3). Now you need to install
a package manager for python and the one I use is pip.&lt;/p&gt;
&lt;pre class="code literal-block"&gt;sudo apt-get install python-pip
&lt;/pre&gt;


&lt;p&gt;Once you have pip installed, you will need to also install virtualenv, like so:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;sudo pip install virtualenvwrapper
&lt;/pre&gt;


&lt;p&gt;Virtualenvwrapper is a very nice layer on top of virtualenv that makes working
with it much more intuitive and convenient.&lt;/p&gt;
&lt;p&gt;Next, you may want to automate a couple of things like I did. First, create a
&lt;code&gt;~/.virtualenvs&lt;/code&gt; directory. This is where virtualenvwrapper will keep track of
your environments. Then open you &lt;code&gt;.bashrc&lt;/code&gt; file and add a few lines to it:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="x"&gt;export WORKON_HOME=&lt;/span&gt;&lt;span class="p"&gt;$&lt;/span&gt;&lt;span class="nv"&gt;HOME&lt;/span&gt;&lt;span class="x"&gt;/.virtualenvs&lt;/span&gt;
&lt;span class="x"&gt;if [ -f /usr/local/bin/virtualenvwrapper_lazy.sh ]; then&lt;/span&gt;
&lt;span class="x"&gt;    . /usr/local/bin/virtualenvwrapper_lazy.sh&lt;/span&gt;
&lt;span class="x"&gt;fi&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;Now you are ready to start working, so open a new terminal, setup a virtual
environment, and start cranking out some python code. Here's a quick reference
for virtualenvwrapper:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Start new virtual environment?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;mkvirtualenv [env-name]&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Leave the current virtual environment?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;deactivate&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;List all available virtual environments?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;workon&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;lsvirtualenv -b&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Enter an existing virtual environment?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;workon [env-name]&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;List packages installed in current virtual environment?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;pip freeze&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Remove a virtual environment?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;rmvirtualenv [env-name]&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Start a virtual environment with specific python version?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;mkvirtualenv [env-name] -p /usr/bin/python3.4&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Replace &lt;code&gt;[env-name]&lt;/code&gt; above with your actual environment name and enjoy!&lt;/p&gt;&lt;/div&gt;</description><category>debian</category><category>linux</category><category>programming</category><category>python</category><guid>http://thestandardoutput.com/posts/quick-ref-python-virtualenv-use/</guid><pubDate>Fri, 06 Jun 2014 07:55:33 GMT</pubDate></item><item><title>Basic WGET usage examples</title><link>http://thestandardoutput.com/posts/basic-wget-usage-examples/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;If you have ever used a relatively modern flavor of UNIX, you likely used a tool
called &lt;code&gt;wget&lt;/code&gt;. It comes as a standard piece of almost every single UNIX variant,
Linux included. Here are some ways that I use it on a daily basis:&lt;/p&gt;
&lt;h3&gt;Download file&lt;/h3&gt;
&lt;pre class="code literal-block"&gt;wget http://ftp.gnu.org/gnu/wget/wget-1.15.tar.gz
&lt;/pre&gt;


&lt;h3&gt;Downloading files with different names&lt;/h3&gt;
&lt;pre class="code literal-block"&gt;wget http://ftp.gnu.org/gnu/wget/{wget-1.15.tar.gz,wget-1.15.tar.gz.sig}
&lt;/pre&gt;


&lt;h3&gt;Multiple downloads using different protocols&lt;/h3&gt;
&lt;pre class="code literal-block"&gt;wget http://ftp.gnu.org/gnu/wget/wget-1.15.tar.gz ftp://ftp.gnu.org/gnu/wget/wget-1.15.tar.gz.sig
&lt;/pre&gt;


&lt;h3&gt;Using an input file&lt;/h3&gt;
&lt;p&gt;You can use an input file that contains a list of URLs to download, like so:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;wget -i ~/Downloads/urls-for-wget.txt
&lt;/pre&gt;


&lt;h3&gt;Resume incomplete download&lt;/h3&gt;
&lt;p&gt;Sometimes a download is interrupted in the middle. To resume a partial download
use the &lt;code&gt;-c&lt;/code&gt; option, like so:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;wget -c http://ftp.gnu.org/gnu/wget/wget-1.15.tar.gz
&lt;/pre&gt;


&lt;h3&gt;Download files in the background&lt;/h3&gt;
&lt;p&gt;Using the option &lt;code&gt;-b&lt;/code&gt; sends &lt;code&gt;wget&lt;/code&gt; to the background and also saves the output
to a log file:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;wget -b ~/Downloads/wget-log.txt http://ftp.gnu.org/gnu/wget/wget-1.15.tar.gz
&lt;/pre&gt;


&lt;h3&gt;Throttling download speeds&lt;/h3&gt;
&lt;p&gt;To limit the download speed, use the &lt;code&gt;--limit-rate&lt;/code&gt; option:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;wget --limit-rate=100k http://ftp.gnu.org/gnu/wget/wget-1.15.tar.gz
&lt;/pre&gt;


&lt;h3&gt;Performing downloads with authentication&lt;/h3&gt;
&lt;p&gt;Some sites restrict access to content by requiring a username and
password. &lt;code&gt;wget&lt;/code&gt; can handle that:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;wget --user=joeschmoe --password=p4sswOrd! http://ftp.gnu.org/gnu/wget/
&lt;/pre&gt;


&lt;h3&gt;More information&lt;/h3&gt;
&lt;p&gt;Of course, you can mix and match all of these options into a single command,
like so:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;wget -c -b -a ./wget-log --limit-rate=100k http://ftp.gnu.org/gnu/wget/wget-1.15.tar.gz
&lt;/pre&gt;


&lt;p&gt;You can also go much further than what I described above. The script below will
check the web page for the latest listed version of wget and then download it
and its signature file if the online version is newer than the local one.&lt;/p&gt;
&lt;pre class="code literal-block"&gt;wget -qN $(wget -qO- http://ftp.gnu.org/gnu/wget/ \
          | grep tar | cut -d\" -f6 \
          | tail -n4 | grep gz \
          | sed "s|^|http://ftp.gnu.org/gnu/wget/|")
&lt;/pre&gt;


&lt;p&gt;For more information, check online or use &lt;code&gt;man&lt;/code&gt; or &lt;code&gt;info&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;</description><category>bash</category><category>linux</category><category>quick hacks</category><guid>http://thestandardoutput.com/posts/basic-wget-usage-examples/</guid><pubDate>Mon, 24 Feb 2014 08:13:49 GMT</pubDate></item><item><title>Running XFCE 4.10 on Debian 7.4</title><link>http://thestandardoutput.com/posts/running-xfce-410-on-debian-74/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;The Debian 7 series (a.k.a. Wheezy or stable) repositories are currently serving
the &lt;code&gt;xfce4&lt;/code&gt; package at version 4.8 and the upgrade to XFCE 4.10 series is not
slated to occur until the next major version relase, known as Jessie or testing
currently. But I want to use XFCE 4.10 now...&lt;/p&gt;
&lt;p&gt;Luckly, there is a way for me to pick and choose certain packages from
different Debian repositories, while still maintaining proper dependencies. So,
here's how I installed it on Debian 7:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;First I installed the latest Debian stable with a default XFCE desktop. This
    is version 7.4 at the time of this writing. I got it
    &lt;a href="http://cdimage.debian.org/debian-cd/7.4.0/amd64/iso-cd/debian-7.4.0-amd64-xfce-CD-1.iso"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;I installed it with the Desktop, SSH, and Base System options checked.&lt;/li&gt;
&lt;li&gt;Next I booted the new Debian 7 system and logged in. I had a default Debian
    install with XFCE 4.8 desktop.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Next I edited my &lt;code&gt;sources.list&lt;/code&gt; file like so:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;sudo &amp;lt;editor-of-choice&amp;gt; /etc/apt/sources.list
&lt;/pre&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;And inserted the following repository at the bottom of the &lt;code&gt;sources.list&lt;/code&gt; file:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="k"&gt;deb&lt;/span&gt; &lt;span class="s"&gt;http://ftp.us.debian.org/debian/&lt;/span&gt; &lt;span class="kp"&gt;testing&lt;/span&gt; &lt;span class="kp"&gt;main&lt;/span&gt;
&lt;/pre&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I also had to ensure that the default release in the Apt system remained
    configured to use &lt;code&gt;wheezy&lt;/code&gt;. I created a file like so:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;sudo &amp;lt;editor-of-choice&amp;gt; /etc/apt/apt.conf.d/30default-release
&lt;/pre&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In that file I inserted the following directive:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="nt"&gt;APT&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="nd"&gt;:Default-Release&lt;/span&gt; &lt;span class="s2"&gt;"wheezy"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/pre&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I saved and closed the files above and then ran the following:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;sudo apt-get update
&lt;/pre&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Then I was able to install XFCE 4.10 by issuing the following command:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;sudo apt-get -t testing install xfce4 xfce4-terminal
&lt;/pre&gt;


&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Recap&lt;/h3&gt;
&lt;p&gt;This is what I have done so far: I installed Debian 7 with the default XFCE 4.8
desktop. I edited the &lt;code&gt;sources.list&lt;/code&gt; file to add a reference to the Debian
testing repository. I made sure that the default Apt repository remained the
stable one. Then I updated the Apt system and installed XFCE 4.10 from testing.
Note that with the &lt;code&gt;-t&lt;/code&gt; option, &lt;code&gt;apt&lt;/code&gt; will track the package in the given
release until the package version or newer is available in default release.&lt;/p&gt;
&lt;h3&gt;Let's Make it Look Better&lt;/h3&gt;
&lt;p&gt;At this point, I logged out and then back in and I had the new XFCE 4.10 desktop
available. But that's not quite enough. I wanted to make it look better by
installing a good looking theme. My personal favorite theme for XFCE is
&lt;a href="http://shimmerproject.org/project/greybird/"&gt;Greybird&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Let's dispense with the fluff and get down to just the stuff:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;sudo apt-get install gtk-engine-murrine
mkdir ~/.themes
cd ~/Downloads/
git clone https://github.com/shimmerproject/Greybird
cp -R Greybird ~/.themes
&lt;/pre&gt;


&lt;p&gt;Then I used XFCE &lt;em&gt;Settings Manager&lt;/em&gt; to set the &lt;em&gt;Appearance&lt;/em&gt; and the &lt;em&gt;Window
Manager&lt;/em&gt; settings to use the new Greybird theme.&lt;/p&gt;
&lt;p&gt;I also installed the Faenza icon theme:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;mkdir ~/Downloads/faenza
cd ~/Downloads/faenza
wget http://faenza-icon-theme.googlecode.com/files/faenza-icon-theme_1.3.zip
unzip faenza-icon-theme_1.3.zip
sudo ./INSTALL
&lt;/pre&gt;


&lt;p&gt;Running as sudo will install the theme globally in &lt;code&gt;/usr/share/icons&lt;/code&gt;. Also
ensure that the permissions on the Faenza folders under &lt;code&gt;/usr/share/icons&lt;/code&gt; is
properly set to &lt;code&gt;drwxr-xr-x&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;That's it... Enjoy!&lt;/p&gt;&lt;/div&gt;</description><category>debian</category><category>linux</category><category>xfce4</category><guid>http://thestandardoutput.com/posts/running-xfce-410-on-debian-74/</guid><pubDate>Sun, 16 Feb 2014 00:15:26 GMT</pubDate></item><item><title>Connecting to a Cisco VPN from Linux</title><link>http://thestandardoutput.com/posts/connecting-to-a-cisco-vpn-from-linux/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;The folks at the new job are running a Cisco VPN. While it's very straight
forward to connect using the AnyConnect client from Windows, the steps to do it
in Linux are not so clear cut, because the AnyConnect client for Linux
constantly drops the connection for me and won't hold it for more than 30
seconds. So, this is how you do it from a Debian-based Linux:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Install the "network-manager-openconnect-gnome" package&lt;/p&gt;
&lt;pre class="code literal-block"&gt;sudo apt-get install network-manager-openconnect-gnome
&lt;/pre&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Open the Network Manager applet from the task bar&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;Click on VPN Connections&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click Configure VPN...&lt;/p&gt;
&lt;p&gt;&lt;img alt="Connection Manager" src="http://farm4.staticflickr.com/3809/11579146506_34832851d9_o.png"&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click the Add button&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;VPN Connection Type should be Cisco AnyConnect Compatible VPN&lt;/p&gt;
&lt;p&gt;&lt;img alt="Edit VPN" src="http://farm6.staticflickr.com/5534/11578352075_b07319b0b6_o.png"&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enter a name for your connection&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;Enter a value for the Gateway (IP or Host Name)&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click Save&lt;/p&gt;
&lt;p&gt;&lt;img alt="VPN Connection Type" src="http://farm8.staticflickr.com/7300/11579146496_459710e377_o.png"&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Then go back to the Network Manager applet on the task bar&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;Select VPN Connections and then select the one you just created&lt;/li&gt;
&lt;li&gt;On the Connect to VPN dialog, choose the VPN host and&lt;/li&gt;
&lt;li&gt;Click the Conect button&lt;/li&gt;
&lt;li&gt;Enter your Username and Password&lt;/li&gt;
&lt;li&gt;Lastly, click Login&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This approach has been working really well and reliably for me and I hope it
will for you too.&lt;/p&gt;&lt;/div&gt;</description><category>debian</category><category>linux</category><guid>http://thestandardoutput.com/posts/connecting-to-a-cisco-vpn-from-linux/</guid><pubDate>Fri, 27 Dec 2013 06:15:00 GMT</pubDate></item><item><title>Manage your PostgreSQL Database from a Remote Machine</title><link>http://thestandardoutput.com/posts/manage-your-postgresql-database-from-a-remote-machine/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;At home I have my main development workstation and then I spin up VMs that mimic
my production environment to run different types of integration tests. One of
these VMs is running a relatively recent version of PostgreSQL. By default,
PostgreSQL is setup to allow connections coming from the local host only. In
this article I will walk through the steps of setting up PostgreSQL so that it
allows connections from other machines also.&lt;/p&gt;
&lt;h3&gt;Setup Remote Connections&lt;/h3&gt;
&lt;p&gt;There are, essentially, two lines in two different PostgreSQL configuration
files that need to be changed to allow remote connections to work.  The first
file is &lt;code&gt;postgresql.conf&lt;/code&gt; and this is usually found at
&lt;code&gt;/etc/postgresql/9.1/main/&lt;/code&gt; on Debian-based systems. Open that file and find the
line that starts with &lt;code&gt;listen_addresses&lt;/code&gt;. By default the value assigned to it
should be &lt;code&gt;'localhost'&lt;/code&gt;. Change that so the line reads like this:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;listen_addresses = '*'
&lt;/pre&gt;


&lt;p&gt;The second file is called &lt;code&gt;pg_hba.conf&lt;/code&gt;. In this file you need to look for a
IPv4 local connections line that starts with &lt;code&gt;host&lt;/code&gt;. By default, the line reads
the following:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;host    all             all             127.0.0.1/32            md5
&lt;/pre&gt;


&lt;p&gt;You need to change this line to read like this:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;host    all             all             10.0.0.0/24             trust
&lt;/pre&gt;


&lt;p&gt;For all intents and purposes, the default is telling PostgreSQL to accept
connections only from the localhost (that's what the &lt;code&gt;/32&lt;/code&gt; is for), while we are
changing the value to allow any host with an IP starting with 10.0.0.* to
connect. The above will only work after you restart PostgreSQL with the
following command:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;sudo /etc/init.d/postgresql restart
&lt;/pre&gt;


&lt;p&gt;Again, YMMV if you are using anything other than Debian.&lt;/p&gt;
&lt;h3&gt;Allowing Connections Through a Firewall&lt;/h3&gt;
&lt;p&gt;The above is really all you have to do with PostgreSQL proper to allow remote
connections. But if you are like me, you are probably running a firewall on your
systems also and you will need to punch a whole for PostgreSQL to talk through.
You can find out more about how I setup my IPTables firewall by
&lt;a href="http://gorauskas.org/SecuringYourDebianBasedVM.html" title="Securing your Debian-based VM"&gt;reading this&lt;/a&gt;. In my case, I need to allow only one system (my
workstation) to connect to the VM hosting PostgreSQL. I created the following
lines in my IPTables configuration file:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;# Allow connections to Postgres DB Server from hurricane
-A INPUT -p tcp -s 10.0.0.90 --sport 1024:65535 -d 10.0.0.60 --dport 5432 \
         -m state --state NEW,ESTABLISHED -j ACCEPT
-A OUTPUT -p tcp -s 10.0.0.60 --sport 5432 -d 10.0.0.90 --dport 1024:65535 \
         -m state --state ESTABLISHED -j ACCEPT
&lt;/pre&gt;


&lt;p&gt;In the above, the first line allows traffic on port 5432 into the local system
from the &lt;code&gt;10.0.0.90&lt;/code&gt; IP address, which is my development workstation. The second
line allows the local system to send traffic out via port 5432, which is the
default port used by PostgreSQL.&lt;/p&gt;
&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;To allow remote connections to your PostgreSQL instance, all you have to do is
edit &lt;code&gt;postgresql.conf&lt;/code&gt; and &lt;code&gt;pg_hba.conf&lt;/code&gt;. Also remember to address firewall
configuration issues that may arise.&lt;/p&gt;&lt;/div&gt;</description><category>database</category><category>debian</category><category>linux</category><category>postgresql</category><guid>http://thestandardoutput.com/posts/manage-your-postgresql-database-from-a-remote-machine/</guid><pubDate>Fri, 29 Nov 2013 05:56:11 GMT</pubDate></item><item><title>Resume interrupted downloads with cURL in Linux</title><link>http://thestandardoutput.com/posts/resume-interrupted-downloads-with-curl-in-linux/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;I have recently been trying to download an ISO of a certain Linux distro, but I
find myself at the wrong end of a crappy connection. I tried downloading it with
both Firefox and Chrome but both choked very early in the process and current
speed would go down to 0 and after a while the connection would just cutoff with
no way to resume the download from where I left off.&lt;/p&gt;
&lt;p&gt;Fear not because [cURL][curl] comes to the rescue. After typing &lt;code&gt;Up-Arrow&lt;/code&gt; and
&lt;code&gt;Enter&lt;/code&gt; more time than I care to admit, I decided to let the computer do the
hard work and automate this thing. So I created a small Bash script called
&lt;code&gt;acurl.sh&lt;/code&gt; (for Automated cURL) that looks like this:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="x"&gt;export ec=1;&lt;/span&gt;

&lt;span class="x"&gt;while [ &lt;/span&gt;&lt;span class="p"&gt;$&lt;/span&gt;&lt;span class="nv"&gt;ec&lt;/span&gt;&lt;span class="x"&gt; -gt 0 ]; do&lt;/span&gt;
&lt;span class="x"&gt;    /usr/bin/curl -O -C - &lt;/span&gt;&lt;span class="p"&gt;$&lt;/span&gt;&lt;span class="x"&gt;1;&lt;/span&gt;
&lt;span class="x"&gt;    export ec=&lt;/span&gt;&lt;span class="p"&gt;$&lt;/span&gt;&lt;span class="x"&gt;?;&lt;/span&gt;
&lt;span class="x"&gt;done&lt;/span&gt;

&lt;span class="x"&gt;if [ &lt;/span&gt;&lt;span class="p"&gt;$&lt;/span&gt;&lt;span class="nv"&gt;ec&lt;/span&gt;&lt;span class="x"&gt; -eq 0 ]; then&lt;/span&gt;
&lt;span class="x"&gt;    echo "Downloaded &lt;/span&gt;&lt;span class="p"&gt;$&lt;/span&gt;&lt;span class="x"&gt;1";&lt;/span&gt;
&lt;span class="x"&gt;fi&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;What's going on above is that I have a while loop that is checking the exit code
of &lt;code&gt;curl&lt;/code&gt;. This exit code is captured by assigning the value of &lt;code&gt;$?&lt;/code&gt; to the
variable &lt;code&gt;$ec&lt;/code&gt;. If &lt;code&gt;curl&lt;/code&gt; exit code is larger than 0 then continue trying to
download the file, which is represented by parameter &lt;code&gt;$1&lt;/code&gt;, from where we left
off, which is accomplished by passing the parameter &lt;code&gt;-C&lt;/code&gt; to &lt;code&gt;curl&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Assuming that the script above is located somewhere in the &lt;code&gt;$PATH&lt;/code&gt;, then using
it is as simple as this:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;acurl.sh http://distrodomain.org/downloads/linux-distro-version-platform.iso
&lt;/pre&gt;


&lt;p&gt;This is definitely a brute force approach, but it does the work.&lt;/p&gt;
&lt;p&gt;[curl]: http://curl.haxx.se/ "cURL"&lt;/p&gt;&lt;/div&gt;</description><category>bash</category><category>debian</category><category>linux</category><category>programming</category><category>quick hacks</category><guid>http://thestandardoutput.com/posts/resume-interrupted-downloads-with-curl-in-linux/</guid><pubDate>Mon, 14 Oct 2013 04:59:23 GMT</pubDate></item><item><title>How to Change the Default Browser in Xubuntu</title><link>http://thestandardoutput.com/posts/how-to-change-the-default-browser-in-xubuntu/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;I am using Xubuntu 12.04 on my main workstation at home and for the longest time
I have been trying to make Google Chrome my default browser on that
machine. I've tried several things that didn't work or worked but would not
persist when I rebooted the machine. Well, that changed just recently...&lt;/p&gt;
&lt;p&gt;Recently I found out that there is a configuration file at
&lt;code&gt;~/.local/share/applications/mimeapps.list&lt;/code&gt; that you can change and make it
stick. Just replace all references to &lt;code&gt;firefox.desktop&lt;/code&gt; with
&lt;code&gt;google-chrome.desktop&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Here are the relevant current values:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="k"&gt;[Added Associations]&lt;/span&gt;
&lt;span class="na"&gt;x-scheme-handler/http&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;exo-web-browser.desktop;google-chrome.desktop;&lt;/span&gt;
&lt;span class="na"&gt;x-scheme-handler/https&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;exo-web-browser.desktop;google-chrome.desktop;&lt;/span&gt;
&lt;span class="err"&gt;...&lt;/span&gt;
&lt;span class="na"&gt;x-scheme-handler/ftp&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop;&lt;/span&gt;
&lt;span class="na"&gt;x-scheme-handler/chrome&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop;&lt;/span&gt;
&lt;span class="na"&gt;text/html&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop;&lt;/span&gt;
&lt;span class="na"&gt;application/x-extension-htm&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop;&lt;/span&gt;
&lt;span class="na"&gt;application/x-extension-html&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop;&lt;/span&gt;
&lt;span class="na"&gt;application/x-extension-shtml&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop;&lt;/span&gt;
&lt;span class="na"&gt;application/xhtml+xml&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop;&lt;/span&gt;
&lt;span class="na"&gt;application/x-extension-xhtml&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop;&lt;/span&gt;
&lt;span class="na"&gt;application/x-extension-xht&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop;&lt;/span&gt;

&lt;span class="k"&gt;[Default Applications]&lt;/span&gt;
&lt;span class="err"&gt;...&lt;/span&gt;
&lt;span class="na"&gt;application/x-mimearchive&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop&lt;/span&gt;
&lt;span class="err"&gt;...&lt;/span&gt;
&lt;span class="na"&gt;x-scheme-handler/http&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop&lt;/span&gt;
&lt;span class="na"&gt;x-scheme-handler/https&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop&lt;/span&gt;
&lt;span class="na"&gt;x-scheme-handler/ftp&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop&lt;/span&gt;
&lt;span class="na"&gt;x-scheme-handler/chrome&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop&lt;/span&gt;
&lt;span class="na"&gt;text/html&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop&lt;/span&gt;
&lt;span class="na"&gt;application/x-extension-htm&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop&lt;/span&gt;
&lt;span class="na"&gt;application/x-extension-html&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop&lt;/span&gt;
&lt;span class="na"&gt;application/x-extension-shtml&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop&lt;/span&gt;
&lt;span class="na"&gt;application/xhtml+xml&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop&lt;/span&gt;
&lt;span class="na"&gt;application/x-extension-xhtml&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop&lt;/span&gt;
&lt;span class="na"&gt;application/x-extension-xht&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;google-chrome.desktop&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;The &lt;code&gt;...&lt;/code&gt; above means that I omitted 1 or more lines for brevity. Hope this
works for you too.&lt;/p&gt;&lt;/div&gt;</description><category>debian</category><category>linux</category><guid>http://thestandardoutput.com/posts/how-to-change-the-default-browser-in-xubuntu/</guid><pubDate>Sun, 13 Oct 2013 03:38:00 GMT</pubDate></item><item><title>Burn an ISO to a USB stick</title><link>http://thestandardoutput.com/posts/burn-an-iso-to-a-usb-stick/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;Several of the Debian CD and Debian Live images are created using isohybrid
technology, which means that they may be used in two different ways:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;They may be written to CD/DVD and used as normal for CD/DVD booting.&lt;/li&gt;
&lt;li&gt;They may be written to USB flash drives, bootable directly from the BIOS of
  most PCs.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The most common way to copy an image to a USB flash drive is to use the dd
command on a Linux machine:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;dd if=file.iso of=/dev/device bs=4M; sync
&lt;/pre&gt;


&lt;p&gt;where:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;file.iso&lt;/code&gt; is the name of the input image, e.g. netinst.iso&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/dev/device&lt;/code&gt; is the device matching the USB flash drive, e.g. /dev/sda,
  /dev/sdb. Be careful to make sure you have the right device name, as this
  command is capable of writing over your hard disk just as easily if you get
  the wrong one!&lt;/li&gt;
&lt;li&gt;&lt;code&gt;bs=4M&lt;/code&gt; tells dd to read/write in 4 megabyte chunks for better performance;
  the default is 512 bytes, which will be much slower&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;sync&lt;/code&gt; is to make sure that all the writes are flushed out before the
  command returns.&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</description><category>debian</category><category>linux</category><guid>http://thestandardoutput.com/posts/burn-an-iso-to-a-usb-stick/</guid><pubDate>Fri, 11 Oct 2013 07:20:26 GMT</pubDate></item><item><title>Virtual Box Fails to Start Virtual Machine</title><link>http://thestandardoutput.com/posts/virtual-box-fails-to-start-virtual-machine/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;I recently moved to a new house and during the move something really peculiar
occured with my computer: It seems that the UEFI chip reset to the factory
defaults. The 2 visible outcomes of this was that the computer clock was reset
back to &lt;code&gt;2009-01-01 00:00:00&lt;/code&gt; and that the Hardware Virtualization on the CPU
was turned off. The latter manifested itself as an error when I tried to run
virtual machines with Virtual Box. This was the error generated by Virtual Box:&lt;/p&gt;
&lt;p&gt;&lt;img alt="VBox Error" src="http://farm3.staticflickr.com/2826/9028489579_329cc402f6_o.png"&gt;&lt;/p&gt;
&lt;p&gt;To fix these errors I had to first set the correct system date and timezone
offset and then I had to boot into the UEFI setup utility and enable hardware
virtualization for the Intel i7 CPU. This setting is going to be slightly
different on every motherboard, but after I enabled it VBox started to run the
VMs as usual.&lt;/p&gt;&lt;/div&gt;</description><category>hardware</category><category>linux</category><category>virtualbox</category><category>virtualization</category><guid>http://thestandardoutput.com/posts/virtual-box-fails-to-start-virtual-machine/</guid><pubDate>Thu, 13 Jun 2013 04:17:02 GMT</pubDate></item><item><title>Install the Real Firefox on Debian 7</title><link>http://thestandardoutput.com/posts/install-the-real-firefox-on-debian-7/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;If you have ever played around with the Debian distribution proper, you will
quickly notice that Firefox is not available as a browser and in its place is
something called IceWeasel. Here I will show you how to install the real Firefox
browser on Debian 7.&lt;/p&gt;
&lt;p&gt;The first step is to remove the IceWeasel package if it's installed:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;sudo apt-get remove iceweasel
&lt;/pre&gt;


&lt;p&gt;Next, we will make use of a Linux Mint package repository that targets Debian
proper. To do this add the following line to you &lt;code&gt;/etc/apt/sources.list&lt;/code&gt; file:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="k"&gt;deb&lt;/span&gt; &lt;span class="s"&gt;http://packages.linuxmint.com&lt;/span&gt; &lt;span class="kp"&gt;debian&lt;/span&gt; &lt;span class="kp"&gt;import&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;Now when you update your package list you will see an error like so:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;sudo apt-get update
... a ton of output ...
W: GPG error: http://packages.linuxmint.com debian Release: The following
signatures couldn&lt;span class="err"&gt;'&lt;/span&gt;t be verified because the public key is not available:
NO_PUBKEY 3EE67F3D0FF405B2
&lt;/pre&gt;


&lt;p&gt;This happens because you don't have the proper key for the Linux Mint
repository. To get a valid PGP key do the following:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;sudo gpg --keyserver pgp.mit.edu --recv-keys 3EE67F3D0FF405B2
&lt;span class="nv"&gt;$ &lt;/span&gt;sudo gpg --export 3EE67F3D0FF405B2 &amp;gt; 3EE67F3D0FF405B2.gpg
&lt;span class="nv"&gt;$ &lt;/span&gt;sudo apt-key add ./3EE67F3D0FF405B2.gpg
&lt;span class="nv"&gt;$ &lt;/span&gt;sudo rm ./3EE67F3D0FF405B2.gpg
&lt;/pre&gt;


&lt;p&gt;Now you should be able to update the package list successfully. Then what's left
to do is to install firefox and you can do that like so:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;sudo apt-get install firefox firefox-l10n-en-us
&lt;/pre&gt;


&lt;p&gt;Enjoy firefox!&lt;/p&gt;&lt;/div&gt;</description><category>debian</category><category>linux</category><guid>http://thestandardoutput.com/posts/install-the-real-firefox-on-debian-7/</guid><pubDate>Sun, 02 Jun 2013 09:35:22 GMT</pubDate></item><item><title>Build Emacs from Source in Ubuntu 13.04</title><link>http://thestandardoutput.com/posts/build-emacs-from-source-in-ubuntu-1304/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;Over the years I have written several of these articles and I find that every 2
to 3 years I need to re-write these notes because the installation process
diverges enough from the previous set of steps that it warrants a re-write.&lt;/p&gt;
&lt;p&gt;The main Linux distribution that I have settled on lately is Xubuntu, which is a
XFCE-based version of Ubuntu. I dabble in other distros also and I am
experimenting a lot lately with Arch and other Debian-based distros. One thing
is clear, the versions of GNU Emacs available with each distribution are
different. So, as a standard I will always try to download the latest stable GNU
Emacs sources and build it on the system I am using at the moment. This ensures
that I have a homogeneous set of features across the different machines and also
that I am pretty close to the bleeding edge.&lt;/p&gt;
&lt;p&gt;In order to get to this state with your Emacs install you can follow the below
steps. These steps are focused on a Debian-based distro using APT. I will assume
that you have a base Debian or Ubuntu system already installed with a common GUI
environment. Again, I wrote these notes for a Xubuntu system running XFCE.
Let's start by downloading and installing the tools needed to build Emacs:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;sudo apt-get install build-essential git git-core curl
&lt;span class="nv"&gt;$ &lt;/span&gt;sudo apt-get install automake autogen autoconf ssh
&lt;/pre&gt;


&lt;p&gt;Next, you need to get the sources for Emacs. There is two ways to go about doing
this: 1) Clone the sources from an Emacs repository directly or 2) Download the
latest compressed source tarball from a FSF/GNU mirror site.&lt;/p&gt;
&lt;p&gt;To clone the Emacs source from a repo, do the following:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/Downloads
&lt;span class="nv"&gt;$ &lt;/span&gt;git clone git://git.savannah.gnu.org/emacs.git
&lt;/pre&gt;


&lt;p&gt;Cloning will take several minutes, because git will get all the history and
changes and we all know that Emacs has a &lt;em&gt;long&lt;/em&gt; history. The clone method is the
way to go for those who will hack on emacs itself. The easier way to do this,
however, and the way that I prefer is to pull the source tarball from a
mirror. A list of available mirrors can be found at the &lt;a href="http://www.gnu.org/prep/ftp.html" title="GNU Emacs mirror list"&gt;FSF site&lt;/a&gt;. You can
pick any of these sites and download from it. The command to do that will differ
based on the mirror you pick, but should look something like this:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;curl -O http://mirror.sdunix.com/gnu/emacs/emacs-24.3.tar.gz
&lt;/pre&gt;


&lt;p&gt;While you are downloading the tarball or cloning the repo you should open
another terminal window and start installing some needed Emacs dependencies in
parallel:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;sudo apt-get install texinfo libncurses5-dev libgtk2.0-dev libgif-dev
&lt;span class="nv"&gt;$ &lt;/span&gt;sudo apt-get install libjpeg-dev libpng-dev libxpm-dev libtiff4-dev
&lt;span class="nv"&gt;$ &lt;/span&gt;sudo apt-get install libxml2-dev librsvg2-dev libotf-dev libm17n-dev
&lt;span class="nv"&gt;$ &lt;/span&gt;sudo apt-get install libgpm-dev libgnutls-dev libgconf2-dev libdbus-1-dev
&lt;/pre&gt;


&lt;p&gt;Once the above deps are installed and you finished retrieving the sources for
Emacs, it's time to do the actual build. Decompress the source if you downloaded
it and change directory into the Emacs source:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;tar -zxvf emacs-24.3.tar.gz
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/Downloads/emacs-24.3/
&lt;/pre&gt;


&lt;p&gt;Configure the build according to what you want your installation to look like:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;sudo ./autogen.sh
&lt;span class="nv"&gt;$ &lt;/span&gt;./configure
&lt;/pre&gt;


&lt;p&gt;I use the vanilla configuration, but you can change it to what suits you best
and you can view all alternatives by using &lt;code&gt;./configure --help&lt;/code&gt; ... If you don't
like what &lt;code&gt;configure&lt;/code&gt; has done for you (read the &lt;code&gt;configure&lt;/code&gt; output) you can
also clean things up and start over with &lt;code&gt;make distclean&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The key thing that I am trying to achieve is a message from &lt;code&gt;configure&lt;/code&gt; that
looks very similar to the below output. Note all the &lt;code&gt;yes&lt;/code&gt; values next to all
the stuff that &lt;code&gt;configure&lt;/code&gt; checks for; this is a direct outcome of installing
all the dependency packages above. Emacs absolutely needs &lt;code&gt;texinfo&lt;/code&gt;, &lt;code&gt;ncurses&lt;/code&gt;,
an X toolkit and the image libraries to even build. The rest of the stuff is
nice to have, but if you don't install it you will get a &lt;code&gt;no&lt;/code&gt; from &lt;code&gt;configure&lt;/code&gt;
for that feature check.&lt;/p&gt;
&lt;pre class="code literal-block"&gt;... a ton of output

Configured for `x86_64-unknown-linux-gnu'.

  Where should the build process find the source code?    ~/Downloads/emacs-24.3
  What compiler should emacs be built with?               gcc -std=gnu99 -g3 -O2
  Should Emacs use the GNU version of malloc?             yes
      (Using Doug Lea's new malloc from the GNU C Library.)
  Should Emacs use a relocating allocator for buffers?    no
  Should Emacs use mmap(2) for buffer allocation?         no
  What window system should Emacs use?                    x11
  What toolkit should Emacs use?                          GTK2
  Where do we find X Windows header files?                Standard dirs
  Where do we find X Windows libraries?                   Standard dirs
  Does Emacs use -lXaw3d?                                 no
  Does Emacs use -lXpm?                                   yes
  Does Emacs use -ljpeg?                                  yes
  Does Emacs use -ltiff?                                  yes
  Does Emacs use a gif library?                           yes -lgif
  Does Emacs use -lpng?                                   yes
  Does Emacs use -lrsvg-2?                                yes
  Does Emacs use imagemagick?                             no
  Does Emacs use -lgpm?                                   yes
  Does Emacs use -ldbus?                                  yes
  Does Emacs use -lgconf?                                 yes
  Does Emacs use GSettings?                               yes
  Does Emacs use -lselinux?                               no
  Does Emacs use -lgnutls?                                yes
  Does Emacs use -lxml2?                                  yes
  Does Emacs use -lfreetype?                              yes
  Does Emacs use -lm17n-flt?                              yes
  Does Emacs use -lotf?                                   yes
  Does Emacs use -lxft?                                   yes
  Does Emacs use toolkit scroll bars?                     yes

... more output
&lt;/pre&gt;


&lt;p&gt;Now you can go into the actual build of Emacs by issuing the following command:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;make
&lt;/pre&gt;


&lt;p&gt;And then last step is to install the Emacs you just finished building:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;sudo make install
&lt;/pre&gt;


&lt;p&gt;... and run it:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;emacs &lt;span class="p"&gt;&amp;amp;&lt;/span&gt;amp&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;Enjoy hacking with Emacs!&lt;/p&gt;
&lt;p&gt;&lt;em&gt;P. S.&lt;/em&gt; One last step that is personal and relevant to me only is to install my
Emacs configuration. Execute the following to accomplish that:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;rm -r .emacs.d
&lt;span class="nv"&gt;$ &lt;/span&gt;git clone git@github.com:gorauskas/.emacs.d.git
&lt;/pre&gt;


&lt;p&gt;You will of course need to have the correct encryption key in order to clone the
repo like the line above.&lt;/p&gt;&lt;/div&gt;</description><category>emacs</category><category>linux</category><category>programming</category><guid>http://thestandardoutput.com/posts/build-emacs-from-source-in-ubuntu-1304/</guid><pubDate>Mon, 06 May 2013 22:28:28 GMT</pubDate></item><item><title>Grepping Multiple Files Recursively</title><link>http://thestandardoutput.com/posts/grepping-multiple-files-recursively/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;Recently I was faced with the task of looking for the occurences of a variable
name in all files in a directory recursively. Here is a quick bash incantation
that accomplishes that:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;find . -type f -print0 &lt;span class="p"&gt;|&lt;/span&gt; xargs -0 grep -l variable-name
&lt;/pre&gt;


&lt;p&gt;The above can be understood better if we break it down at the pipe character. To
the left of the pipe we use the &lt;code&gt;find&lt;/code&gt; command to generate a list of file names
recursively starting at the current directory. We use &lt;code&gt;find&lt;/code&gt; with the &lt;code&gt;-print0&lt;/code&gt;
action because we are passing the output to another program via a pipe and this
way the list of file names come out delimited by a null character. Next, we feed
the output of &lt;code&gt;find&lt;/code&gt; to the input of &lt;code&gt;xargs&lt;/code&gt; which will split the long list of
file names into sublists and calls &lt;code&gt;grep&lt;/code&gt; once for every sublist. The &lt;code&gt;grep&lt;/code&gt;
command then filters the list of file names and returns only the ones that
contain the &lt;code&gt;variable-name&lt;/code&gt; string in them.&lt;/p&gt;
&lt;p&gt;Pretty cool, eh?&lt;/p&gt;&lt;/div&gt;</description><category>bash</category><category>debian</category><category>linux</category><category>quick hacks</category><guid>http://thestandardoutput.com/posts/grepping-multiple-files-recursively/</guid><pubDate>Thu, 18 Apr 2013 04:26:25 GMT</pubDate></item></channel></rss>