<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Linux on Hashbang.ca</title>
		<link>https://hashbang.ca/tag/linux</link>
		<description>Recent content in Linux on Hashbang.ca</description>
		<generator>Hugo</generator>
		<language>en-us</language>
		
		
		
		
			<lastBuildDate>Wed, 03 Jun 2015 21:31:00 -0700</lastBuildDate>
		
			<atom:link href="https://hashbang.ca/tag/linux/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Diagnosing performance degradation under adverse circumstances</title>
				<link>https://hashbang.ca/post/diagnosing-performance-degradation-under-adverse-circumstances</link>
				<pubDate>Wed, 03 Jun 2015 21:31:00 -0700</pubDate>
				<guid>https://hashbang.ca/post/diagnosing-performance-degradation-under-adverse-circumstances/</guid>
				<description>&lt;small&gt;[This post is a few years old and was never published. Recently, I was reminded about memcached slab imbalance, which in turn reminded me of this post.]&lt;/small&gt;&#xA;&#xA;&lt;p&gt;At work, we encountered a sudden and precipitous performance regression on one particular page of a legacy application. It&amp;rsquo;s a Perl web application, running under mod_perl, using &lt;code&gt;ModPerl::RegistryLoader&lt;/code&gt; to compile scripts at server startup, and &lt;code&gt;Apache::DBI&lt;/code&gt; to provide persistent database connections.&lt;/p&gt;&#xA;&lt;p&gt;Our users suddenly began complaining about one particular page being &amp;ldquo;three times slower than normal.&amp;rdquo; Later examination of the Apache logs showed a 20x(!!) slowdown.&lt;/p&gt;&#xA;&lt;p&gt;Investigating this performance problem was interesting because we didn&amp;rsquo;t have good access to required data, and our technology choices slowed us down or completely prevented us from collecting it. Although we solved the mystery, the experience had several important lessons.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Validating SSL certificates for IRC bouncers</title>
				<link>https://hashbang.ca/post/validating-ssl-certificates-for-irc-bouncers</link>
				<pubDate>Sat, 14 Sep 2013 10:28:00 -0400</pubDate>
				<guid>https://hashbang.ca/post/validating-ssl-certificates-for-irc-bouncers/</guid>
				<description>&lt;p&gt;&lt;a href=&#34;https://en.wikipedia.org/wiki/BNC_(software)#IRC&#34;&gt;IRC bouncers&lt;/a&gt; are sort of like a proxy. Your bouncer stays online, connected to IRC, all the time, and then you connect to the bouncer using a normal IRC client. I connect to my bouncer with an &lt;a href=&#34;https://en.wikipedia.org/wiki/Transport_Layer_Security&#34;&gt;SSL&lt;/a&gt;-encrypted connection, but I hadn&amp;rsquo;t been validating the certificate until now. Validating the SSL certificate is critical for thwarting &lt;a href=&#34;https://en.wikipedia.org/wiki/Man-in-the-middle_attack&#34;&gt;man-in-the-middle (MITM) attacks&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;In a MITM attack, the victim connects to the attacker, thinking it is the service they want to talk to (the IRC bouncer in this case). The attacker then forwards the connection to the service. Both connections might use SSL, but in the middle, the attacker can see the plaintext. They can simply eavesdrop, or modify the data flowing in both directions. SSL is supposed to prevent that, but if you don&amp;rsquo;t validate the certificate, then you don&amp;rsquo;t know who you&amp;rsquo;re talking to. I want to know I&amp;rsquo;m really talking to my IRC bouncer, so let&amp;rsquo;s figure out how to validate that certificate.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Adding LUKS hard disk encryption on LVM after the fact</title>
				<link>https://hashbang.ca/post/adding-luks-hard-disk-encryption-on-lvm-after-the-fact</link>
				<pubDate>Sat, 15 Jun 2013 17:20:00 -0400</pubDate>
				<guid>https://hashbang.ca/post/adding-luks-hard-disk-encryption-on-lvm-after-the-fact/</guid>
				<description>&lt;p&gt;I have an external hard disk enclosure with two disks. I used Logical Volume Manager to create a single logical volume that spanned them, and slowly filled it to about 60% capacity. Lately, I&amp;rsquo;ve been trying to be more conscious of using encryption, and this was one area where I hadn&amp;rsquo;t done so. At the time I felt like learning how to do LVM was enough, and LUKS could wait until later. Well, it&amp;rsquo;s later. Here&amp;rsquo;s how I added encryption after the fact (without a spare hard disk).&lt;/p&gt;</description>
			</item>
			<item>
				<title>Introducing mvr: like mv, but clever</title>
				<link>https://hashbang.ca/post/introducing-mvr-like-mv-but-clever</link>
				<pubDate>Fri, 19 Apr 2013 19:11:00 -0400</pubDate>
				<guid>https://hashbang.ca/post/introducing-mvr-like-mv-but-clever/</guid>
				<description>&lt;p&gt;I wanted to move a large number of files from one directory to another, but the target directory already had many of the filenames already used. This is a common enough problem &amp;ndash; digital cameras use &lt;code&gt;DSC#&lt;/code&gt;, video downloaders often append numbers to get a unique filename, and so on. In both those examples, the sequence restarts if you empty the program&amp;rsquo;s work directory. So, you&amp;rsquo;ll end up with &lt;code&gt;DSC0001.jpg&lt;/code&gt; every time you empty your camera&amp;rsquo;s memory card. If you&amp;rsquo;re trying to move such files into a single directory, you&amp;rsquo;ll get conflicts every time.&lt;/p&gt;&#xA;&lt;p&gt;Instead of manually renaming the files before transferring them, I wrote a simple script to give each file a unique name in the destination directory.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Book review: &#39;Coding Freedom&#39; by Gabriella Coleman</title>
				<link>https://hashbang.ca/post/book-review-coding-freedom-by-gabriella-coleman</link>
				<pubDate>Mon, 21 Jan 2013 22:35:00 -0400</pubDate>
				<guid>https://hashbang.ca/post/book-review-coding-freedom-by-gabriella-coleman/</guid>
				<description>&lt;p&gt;I&amp;rsquo;ve just finished reading &lt;a href=&#34;http://gabriellacoleman.org&#34;&gt;Gabriella Coleman&lt;/a&gt;&amp;rsquo;s new book &lt;em&gt;&amp;ldquo;Coding Freedom: The ethics and aesthetics of hacking&amp;rdquo;&lt;/em&gt; (&lt;a href=&#34;http://press.princeton.edu/titles/9883.html&#34;&gt;2013, Princeton University Press&lt;/a&gt;) which culminates over a decade of field research, in-depth interviews, observation, and participation in the hacker scene globally. In this case, &amp;ldquo;hacker&amp;rdquo; refers to the free/open-source software (FOSS) hacker, and in particular the Debian project.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Hacking is where craft and craftiness converge.&lt;/p&gt;&#xA;&lt;/blockquote&gt;</description>
			</item>
			<item>
				<title>Automating server build-out with Module::Build</title>
				<link>https://hashbang.ca/post/automating-server-build-out-with-modulebuild</link>
				<pubDate>Thu, 08 Nov 2012 13:25:00 -0400</pubDate>
				<guid>https://hashbang.ca/post/automating-server-build-out-with-modulebuild/</guid>
				<description>&lt;p&gt;At &lt;a href=&#34;http://www.pythian.com&#34;&gt;Pythian&lt;/a&gt;, we have one application that is composed of several components, the deployment of which needs to conform to our slightly peculiar server setup. Until recently, this required manually deploying each component. I did this a couple weeks ago, and it took me something like &lt;strong&gt;40 hours&lt;/strong&gt; to figure out and complete. As I went, I started reading up on &lt;code&gt;Module::Build&lt;/code&gt;, trying to figure out how to automate as much as possible. It turns out that this core module gives us a surprisingly powerful tool for customized deployment. First, it will help to understand a few aspects of how our code is deployed.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Introducing File::Symlink::Atomic</title>
				<link>https://hashbang.ca/post/introducing-filesymlinkatomic</link>
				<pubDate>Sat, 26 May 2012 00:39:00 -0400</pubDate>
				<guid>https://hashbang.ca/post/introducing-filesymlinkatomic/</guid>
				<description>&lt;p&gt;In &lt;a href=&#34;https://hashbang.ca/post/tips-tricks-from-my-4-months-at-pythian&#34;&gt;Tips &amp;amp; tricks from my 4 months at Pythian&lt;/a&gt;, I showed how to give a symlink a new target atomically. I wasn&amp;rsquo;t aware of any module to encapsulate that, so I quickly put together &lt;code&gt;File::Symlink::Atomic&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;This module is useful because it eliminates the need to know how to do this safely - simply &lt;code&gt;use File::Symlink::Atomic&lt;/code&gt; and you get a drop-in replacement for &lt;code&gt;CORE::symlink&lt;/code&gt;. It creates a temporary symlink (using &lt;code&gt;File::Temp&lt;/code&gt; to get a unique pathname) pointing to your new target, then moves it into place with a &lt;code&gt;rename&lt;/code&gt; call. On POSIX systems, the rename system call &lt;a href=&#34;http://pubs.opengroup.org/onlinepubs/9699919799/functions/rename.html&#34;&gt;guarantees atomicity&lt;/a&gt;.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Tips &amp; tricks from my 4 months at Pythian</title>
				<link>https://hashbang.ca/post/tips-tricks-from-my-4-months-at-pythian</link>
				<pubDate>Sat, 19 May 2012 21:15:00 -0400</pubDate>
				<guid>https://hashbang.ca/post/tips-tricks-from-my-4-months-at-pythian/</guid>
				<description>&lt;p&gt;After working with &lt;a href=&#34;https://www.linkedin.com/in/yanickchampoux&#34;&gt;Yanick Champoux&lt;/a&gt; on a few little Perl projects here and there, we finally &lt;a href=&#34;https://hashbang.ca/post/yapcna-day-1&#34;&gt;met face-to-face at YAPC::NA&lt;/a&gt; last summer. A few months later, when I was looking for a co-op position, I immediately thought of Pythian.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Wherein I realize the bliss of writing init scripts with Daemon::Control</title>
				<link>https://hashbang.ca/post/wherein-i-realize-the-bliss-of-writing-init-scripts-with-daemoncontrol</link>
				<pubDate>Mon, 16 Apr 2012 16:59:00 -0400</pubDate>
				<guid>https://hashbang.ca/post/wherein-i-realize-the-bliss-of-writing-init-scripts-with-daemoncontrol/</guid>
				<description>&lt;p&gt;Init scripts are annoying little things &amp;ndash; almost entirely boilerplate. Here&amp;rsquo;s how I learned to stop struggling, and love &lt;code&gt;Daemon::Control&lt;/code&gt; to control my daemons.&lt;/p&gt;&#xA;&lt;p&gt;The module really is as simple as the &lt;a href=&#34;https://metacpan.org/module/Daemon::Control#SYNOPSIS&#34;&gt;synopsis&lt;/a&gt; &amp;ndash; you describe the daemon, have it write an init script (which actually just runs your &lt;code&gt;Daemon::Control&lt;/code&gt; script) for you, then &lt;code&gt;update-rc.d&lt;/code&gt; and you&amp;rsquo;re golden. It really is that simple.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Trimming whitespace in gedit with Perl</title>
				<link>https://hashbang.ca/post/trimming-whitespace-in-gedit-with-perl</link>
				<pubDate>Sun, 14 Aug 2011 00:03:00 -0400</pubDate>
				<guid>https://hashbang.ca/post/trimming-whitespace-in-gedit-with-perl/</guid>
				<description>&lt;p&gt;With gedit plugins, you can turn this simple text editor into a lightweight IDE. It&amp;rsquo;s fast, has good syntax highlighting, and can have code completion, shell integration, and many similar feature you might expect from an IDE. One feature it lacked was trimming whitespace from files. I searched for plugins to do this, and found several, but none of them quite met my expectations, because none were configurable. I typically want my files to end with one and only one newline. Of course, the solution is Perl.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Understanding load averages</title>
				<link>https://hashbang.ca/post/load-average</link>
				<pubDate>Sat, 29 Jan 2011 16:50:00 -0400</pubDate>
				<guid>https://hashbang.ca/post/load-average/</guid>
				<description>&lt;p&gt;Load averages are at once hugely simple and hideously complex. Understading what these numbers mean is important for correctly applying this simple indicator of system health.&lt;/p&gt;&#xA;&lt;p&gt;First, a load average is not CPU percentage. That is simply a snapshot of how often a process was found being executed on the CPU. The load average differs in that it includes all demand for CPU, not just what is currently running.&lt;/p&gt;</description>
			</item>
			<item>
				<title>If Linux were popular</title>
				<link>https://hashbang.ca/post/if-linux-were-popular</link>
				<pubDate>Mon, 20 Dec 2010 16:48:00 -0400</pubDate>
				<guid>https://hashbang.ca/post/if-linux-were-popular/</guid>
				<description>&lt;p&gt;This essay was originally written in &lt;a href=&#34;http://www.ataliba.eti.br/node/1956&#34;&gt;Portuguese&lt;/a&gt;, and subsequently &lt;a href=&#34;http://www.beli.ws/blog/?p=202&#34;&gt;translated to English&lt;/a&gt;. I rewrote the English version so it reads like an anglophone wrote it.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;p&gt;I understand that some people have problems switching from Windows to linux. Since all my friends keep telling me how great Windows is, I thought I&amp;rsquo;d try an experiment.&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
