<?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 Evan Hoffman</title><link>https://evan.wtf/tags/linux/</link><description>Recent content in Linux on Evan Hoffman</description><generator>Hugo</generator><language>en-US</language><copyright>Evan Hoffman</copyright><lastBuildDate>Thu, 05 Feb 2026 06:18:40 +0000</lastBuildDate><atom:link href="https://evan.wtf/tags/linux/index.xml" rel="self" type="application/rss+xml"/><item><title>Home NAS build - 2026 Edition</title><link>https://evan.wtf/2026/02/05/home-nas-build-2026-edition/</link><pubDate>Thu, 05 Feb 2026 06:18:40 +0000</pubDate><guid>https://evan.wtf/2026/02/05/home-nas-build-2026-edition/</guid><description>My journey building a new home NAS in 2026 I outgrew the one I had previously built in 2017. I discuss CPU and disk selection, benchmarking raid levels, optimizing configurations with docker and how to leverage AI assistants to simplify configurations.</description></item><item><title>Home NAS build, 2017 Edition</title><link>https://evan.wtf/2017/02/09/home-nas-build-2017-edition/</link><pubDate>Thu, 09 Feb 2017 20:04:14 +0000</pubDate><guid>https://evan.wtf/2017/02/09/home-nas-build-2017-edition/</guid><description>&lt;p&gt;Many years ago, before WiFi or even routers were common in homes, I was faced with the problem of how to connect multiple computers in my home to the internet when our cable provider only provided a single IP address. Being the late 1990s-early 2000s, this was a problem largely faced only by super-nerds like me, and the generally accepted solution was to build your own router, generally using a Linux box with two Ethernet ports, ipchains (or iptables, if you were bleeding-edge) to do NAT, DHCP and DNS. I had an old computer laying around so that’s what I did. This box served me well for many years, ultimately being replaced by a &lt;a href="https://en.wikipedia.org/wiki/Linksys_WRT54G_series#WRT54G"&gt;Linksys WRT54g&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>My brief love affair with Synology</title><link>https://evan.wtf/2017/01/24/my-brief-love-affair-with-synology/</link><pubDate>Tue, 24 Jan 2017 20:11:59 +0000</pubDate><guid>https://evan.wtf/2017/01/24/my-brief-love-affair-with-synology/</guid><description>&lt;p&gt;For several years I’ve been missing the loss of my Linux file server and contemplating either building a new one or buying a home NAS. About 3 weeks ago I made the plunge and ordered a Synology DS416 from Newegg.&lt;/p&gt;&#10;&lt;p&gt;Setup was very easy, though I was surprised to learn the device doesn’t work at all without a drive in it. I expected there would be a built on OS volume for running native services but apparently everything gets copied onto the data volume once the drives are inserted.&lt;/p&gt;</description></item><item><title>How (the hell) do you set up Splunk Cloud on Linux?</title><link>https://evan.wtf/2014/10/29/how-the-hell-do-you-set-up-splunk-cloud-on-linux/</link><pubDate>Wed, 29 Oct 2014 14:11:40 +0000</pubDate><guid>https://evan.wtf/2014/10/29/how-the-hell-do-you-set-up-splunk-cloud-on-linux/</guid><description>&lt;p&gt;This took me way longer than I would&amp;rsquo;ve thought, mostly due to horrible documentation. Here&amp;rsquo;s my TL;DR version:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Sign up for &lt;a href="http://www.splunk.com/getsplunk/cloudtrial"&gt;Splunk Cloud&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;Download and install the forwarder binary from &lt;a href="http://www.splunk.com/download/universalforwarder"&gt;here&lt;/a&gt;.- Log in &lt;a href="https://www.splunk.com/page/cloudtrial_status"&gt;here&lt;/a&gt; and note the URL of your Splunk instance:&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;&lt;a href="https://evan.wtf/wp-content/uploads/2014/10/splunk_cloud.png"&gt;&lt;img src="https://evan.wtf/wp-content/uploads/2014/10/splunk_cloud.png" alt="splunk_cloud"&gt;&lt;/a&gt;&#10;In the above picture, assume the URL is &lt;strong&gt;&lt;a href="https://prd-p-jxxxxxxxx.splunk6.splunktrial.com"&gt;https://prd-p-jxxxxxxxx.splunk6.splunktrial.com&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Make sure your instances can connect to port tcp/9997 on your input host. Your input host is the hostname from above with &amp;ldquo;input-&amp;rdquo; prepended to it. So in our example, the input host is &lt;strong&gt;input-prd-p-jxxxxxxxx.splunk6.splunktrial.com&lt;/strong&gt;. To ensure you can connect, try &lt;code&gt;telnet input-prd-p-jxxxxxxxx.splunk6.splunktrial.com 9997&lt;/code&gt;. If it can&amp;rsquo;t connect you may need to adjust your firewall rules / Security groups to allow outbound tcp/9997&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Below are the actual commands I used to get data into our Splunk Cloud trial instance:&lt;/p&gt;</description></item><item><title>Can I create an EC2 MySQL slave to an RDS master?</title><link>https://evan.wtf/2014/10/08/can-i-create-an-ec2-mysql-slave-to-an-rds-master/</link><pubDate>Wed, 08 Oct 2014 15:25:10 +0000</pubDate><guid>https://evan.wtf/2014/10/08/can-i-create-an-ec2-mysql-slave-to-an-rds-master/</guid><description>&lt;h2 id="no"&gt;No.&lt;a class="heading-anchor" href="#no" aria-label="Link to this section"&gt;&#10; &lt;svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2"&#10; stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"&gt;&#10; &lt;path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/&gt;&#10; &lt;path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/&gt;&#10; &lt;/svg&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;Here&amp;rsquo;s what happens if you try:&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;mysql&amp;gt; grant replication slave on *.* to &amp;#39;ec2-slave&amp;#39;@&amp;#39;%&amp;#39;;&#10;ERROR 1045 (28000): Access denied for user &amp;#39;rds_root&amp;#39;@&amp;#39;%&amp;#39; (using password: YES)&#10;mysql&amp;gt; update mysql.user set Repl_slave_priv=&amp;#39;Y&amp;#39; WHERE user=&amp;#39;rds_root&amp;#39; AND host=&amp;#39;%&amp;#39;;&#10;ERROR 1054 (42S22): Unknown column &amp;#39;ERROR (RDS): REPLICA SLAVE PRIVILEGE CANNOT BE GRANTED OR MAINTAINED&amp;#39; in &amp;#39;field list&amp;#39;&#10;mysql&amp;gt;&#10;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Note: this is for MySQL 5.5, which is unfortunately what I&amp;rsquo;m currently stuck with.&lt;/p&gt;</description></item><item><title>The m3.medium is terrible</title><link>https://evan.wtf/2014/08/12/the-m3-medium-is-terrible/</link><pubDate>Tue, 12 Aug 2014 13:51:08 +0000</pubDate><guid>https://evan.wtf/2014/08/12/the-m3-medium-is-terrible/</guid><description>&lt;p&gt;I&amp;rsquo;ve been doing some testing of various instance types in our staging environment, originally just to see if Amazon&amp;rsquo;s t2.* line of instances is usable in a real-world scenario. In the end, I found that not only are the t2.mediums viable for what I want them to do, but they&amp;rsquo;re far better suited than the m3.medium, which I wouldn&amp;rsquo;t use for anything that you ever expect to reach any load.&lt;/p&gt;</description></item><item><title>Using OpenSWAN to connect two VPCs in different AWS regions</title><link>https://evan.wtf/2014/08/07/using-openswan-to-connect-two-vpcs-in-different-aws-regions/</link><pubDate>Thu, 07 Aug 2014 13:16:19 +0000</pubDate><guid>https://evan.wtf/2014/08/07/using-openswan-to-connect-two-vpcs-in-different-aws-regions/</guid><description>&lt;p&gt;Amazon has a pretty decent writeup on how to do this (&lt;a href="https://aws.amazon.com/articles/5472675506466066"&gt;here&lt;/a&gt;), but in trying to establish Postgres replication across regions, I found some weird behavior where I could connect to the port directly (telnet to 5432) but psql (or pg_basebackup) didn&amp;rsquo;t work. tcpdump showed this:&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;16:11:28.419642 IP 10.121.11.47.35039 &amp;gt; 10.1.11.254.postgresql: Flags [P.], seq 9:234, ack 2, win 211, options [nop,nop,TS val 11065893 ecr 1811434], length 225&#10;16:11:28.419701 IP 10.121.11.47.35039 &amp;gt; 10.1.11.254.postgresql: Flags [P.], seq 9:234, ack 2, win 211, options [nop,nop,TS val 11065893 ecr 1811434], length 225&#10;16:11:28.421186 IP 10.1.11.254.postgresql &amp;gt; 10.121.11.47.35039: Flags [.], ack 234, win 219, options [nop,nop,TS val 1811520 ecr 11065893,nop,nop,sack 1 {9:234}], length 0&#10;16:11:28.425273 IP 10.1.11.254.postgresql &amp;gt; 10.121.11.47.35039: Flags [P.], seq 2:1377, ack 234, win 219, options [nop,nop,TS val 1811522 ecr 11065893], length 1375&#10;16:11:28.425291 IP 10.1.96.20 &amp;gt; 10.1.11.254: ICMP 10.121.11.47 unreachable - need to frag (mtu 1422), length 556&#10;16:11:28.697397 IP 10.1.11.254.postgresql &amp;gt; 10.121.11.47.35039: Flags [P.], seq 2:1377, ack 234, win 219, options [nop,nop,TS val 1811590 ecr 11065893], length 1375&#10;16:11:28.697438 IP 10.1.96.20 &amp;gt; 10.1.11.254: ICMP 10.121.11.47 unreachable - need to frag (mtu 1422), length 556&#10;16:11:29.241311 IP 10.1.11.254.postgresql &amp;gt; 10.121.11.47.35039: Flags [P.], seq 2:1377, ack 234, win 219, options [nop,nop,TS val 1811726 ecr 11065893], length 1375&#10;16:11:29.241356 IP 10.1.96.20 &amp;gt; 10.1.11.254: ICMP 10.121.11.47 unreachable - need to frag (mtu 1422), length 556&#10;16:11:30.333438 IP 10.1.11.254.postgresql &amp;gt; 10.121.11.47.35039: Flags [P.], seq 2:1377, ack 234, win 219, options [nop,nop,TS val 1811999 ecr 11065893], length 1375&#10;16:11:30.333488 IP 10.1.96.20 &amp;gt; 10.1.11.254: ICMP 10.121.11.47 unreachable - need to frag (mtu 1422), length 556&#10;16:11:32.513418 IP 10.1.11.254.postgresql &amp;gt; 10.121.11.47.35039: Flags [P.], seq 2:1377, ack 234, win 219, options [nop,nop,TS val 1812544 ecr 11065893], length 1375&#10;16:11:32.513467 IP 10.1.96.20 &amp;gt; 10.1.11.254: ICMP 10.121.11.47 unreachable - need to frag (mtu 1422), length 556&#10;16:11:36.881409 IP 10.1.11.254.postgresql &amp;gt; 10.121.11.47.35039: Flags [P.], seq 2:1377, ack 234, win 219, options [nop,nop,TS val 1813636 ecr 11065893], length 1375&#10;16:11:36.881460 IP 10.1.96.20 &amp;gt; 10.1.11.254: ICMP 10.121.11.47 unreachable - need to frag (mtu 1422), length 556&#10;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;After quite a bit of Google and mucking in network ACLs and security groups, the fix ended up being this:&lt;/p&gt;</description></item><item><title>OpenVPN CLI Cheat Sheet</title><link>https://evan.wtf/2014/07/22/openvpn-cli-cheat-sheet/</link><pubDate>Tue, 22 Jul 2014 10:58:21 +0000</pubDate><guid>https://evan.wtf/2014/07/22/openvpn-cli-cheat-sheet/</guid><description>&lt;h3 id="adding-a-regular-user-called-testing"&gt;Adding a regular user called testing&lt;a class="heading-anchor" href="#adding-a-regular-user-called-testing" aria-label="Link to this section"&gt;&#10; &lt;svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2"&#10; stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"&gt;&#10; &lt;path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/&gt;&#10; &lt;path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/&gt;&#10; &lt;/svg&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;p&gt;/usr/local/openvpn_as/scripts/sacli -u testing -k type -v user_connect UserPropPut&lt;/p&gt;&#10;&lt;h3 id="add-an-autologin-user-called-knock"&gt;Add an autologin user called knock&lt;a class="heading-anchor" href="#add-an-autologin-user-called-knock" aria-label="Link to this section"&gt;&#10; &lt;svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2"&#10; stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"&gt;&#10; &lt;path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/&gt;&#10; &lt;path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/&gt;&#10; &lt;/svg&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;p&gt;/usr/local/openvpn_as/scripts/sacli -u knock -k prop_autologin -v true UserPropPut&lt;/p&gt;</description></item><item><title>Create CloudWatch alerts for all Elastic Load Balancers</title><link>https://evan.wtf/2014/07/18/create-cloudwatch-alerts-for-all-elastic-load-balancers/</link><pubDate>Fri, 18 Jul 2014 10:29:57 +0000</pubDate><guid>https://evan.wtf/2014/07/18/create-cloudwatch-alerts-for-all-elastic-load-balancers/</guid><description>&lt;p&gt;I manage a bunch of ELBs but we were missing an alert on a pretty basic metric: how many errors the load balancer was returning. Rather than wade through the UI to add these alerts I figured it would be easier to do it via the CLI.&lt;/p&gt;&#10;&lt;p&gt;Assuming aws-cli is installed and the ARN for your SNS topic (in my case, just an email alert) is $arn:&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;for i in `aws elb describe-load-balancers | grep LoadBalancerName | &#10;perl -ne &amp;#39;chomp; my @a=split(/s+/); $a[2] =~ s/[&amp;#34;,]//g ; print &amp;#34;$a[2] &amp;#34;;&amp;#39; ` ; &#10;do aws cloudwatch put-metric-alarm --alarm-name &amp;#34;$i ELB 5XX Errors&amp;#34; --alarm-description &#10;&amp;#34;High $i ELB 5XX error count&amp;#34; --metric-name HTTPCode_ELB_5XX --namespace AWS/ELB &#10;--statistic Sum --period 300 --evaluation-periods 1 --threshold 50 &#10;--comparison-operator GreaterThanThreshold --dimensions Name=LoadBalancerName,Value=$i &#10;--alarm-actions $arn --ok-actions $arn ; done&#10;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;That huge one-liner creates a CloudWatch notification that sends an alarm when the number of 5XX errors returned by the ELB is greater than 50 over 5 minutes, and sends an &amp;ldquo;ok&amp;rdquo; message via the same SNS topic. The for loop creates/modifies the alarm for every ELB.&lt;/p&gt;</description></item><item><title>Super quick wordpress exploit stopper</title><link>https://evan.wtf/2013/10/25/super-quick-wordpress-exploit-stopper/</link><pubDate>Fri, 25 Oct 2013 09:27:38 +0000</pubDate><guid>https://evan.wtf/2013/10/25/super-quick-wordpress-exploit-stopper/</guid><description>&lt;p&gt;I got an email yesterday from my host (DigitalOcean) that I was running a phishing website. So, I&amp;rsquo;m not, but I quickly guessed what happened: my Wordpress got hacked. This is just one of the risks of running silly little PHP apps. I logged in, deleted the themes directories, reinstalled clean ones, and ensured this doesn&amp;rsquo;t happen again by doing the following:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;useradd apache_ro&lt;/li&gt;&#10;&lt;li&gt;chown -R apache_ro:apache_ro $WP/wp-content/themes&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Now apache can&amp;rsquo;t write to those directories. This means you can&amp;rsquo;t update Wordpress via the web UI, but I&amp;rsquo;m ok with that.&lt;/p&gt;</description></item><item><title>The not-so-secret secret to Postgres performance</title><link>https://evan.wtf/2013/10/07/the-not-so-secret-secret-to-postgres-performance/</link><pubDate>Mon, 07 Oct 2013 10:19:05 +0000</pubDate><guid>https://evan.wtf/2013/10/07/the-not-so-secret-secret-to-postgres-performance/</guid><description>&lt;p&gt;I manage a bunch of Postgres DBs and one of the things I almost always forget to do when setting up a new one is set the readahead up from the default of 256. I created this script and run it out of /etc/rc.local and sometimes cron it too. The 3 commands at the top are only really relevant on systems with &amp;ldquo;huge&amp;rdquo; memory - probably over 64 GB. We &lt;a href="https://evan.wtf/2012/09/25/problems-with-postgresql-9-0-on-centos-6-3-with-a-2-6-32-series-kernel/"&gt;ran into some memory problems&lt;/a&gt; with CentOS 6 on a box with 128 GB ram which we ended up working around by reinstalling CentOS 5, but the &lt;code&gt;/sys/kernel/mm/redhat_transparent_hugepage/&lt;/code&gt; options below should fix them in 6.x (though we haven&amp;rsquo;t actually tried it on that DB, we haven&amp;rsquo;t seen any problems in other large DBs).&lt;/p&gt;</description></item><item><title>Goodbye, pg_dump</title><link>https://evan.wtf/2013/09/26/goodbye-pg_dump/</link><pubDate>Thu, 26 Sep 2013 09:12:05 +0000</pubDate><guid>https://evan.wtf/2013/09/26/goodbye-pg_dump/</guid><description>&lt;p&gt;I&amp;rsquo;ve been a Postgres user and administrator for a while. Over the years, my views on backups have evolved.&lt;/p&gt;&#10;&lt;p&gt;Originally, like most people, I started out with good old pg_dump. With a reasonably small database (under 50 GB) dumping to a flat text file is a fine option. I&amp;rsquo;d generally do something like &lt;code&gt;pg_dump -Upostgres dbname | gzip &amp;gt; dbname.sql.gz&lt;/code&gt; to compress it on the fly and save space. For years this seemed perfect: dumping the entire database in a single transaction into a single file that can be restored anywhere.&lt;/p&gt;</description></item><item><title>Linux 'date' stuff I didn't know until recently.</title><link>https://evan.wtf/2013/07/26/linux-date-stuff-i-didnt-know-until-recently/</link><pubDate>Fri, 26 Jul 2013 12:47:32 +0000</pubDate><guid>https://evan.wtf/2013/07/26/linux-date-stuff-i-didnt-know-until-recently/</guid><description>&lt;p&gt;I&amp;rsquo;ve been using Linux for a long time but I had no idea you could do this.&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;evan@evbox:~$ date -d yesterday&#10;Thu Jul 25 12:44:39 EDT 2013&#10;evan@evbox:~$ date -d &amp;#39;42 days ago&amp;#39;&#10;Fri Jun 14 12:44:51 EDT 2013&#10;evan@evbox:~$ date -d &amp;#39;65 minutes ago&amp;#39;&#10;Fri Jul 26 11:41:18 EDT 2013&#10;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;As epoch:&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;evan@evbox:~$ date -d &amp;#39;65 minutes ago&amp;#39; +%s&#10;1374853307&#10;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Amazing.&lt;/p&gt;</description></item><item><title>Digital Ocean - First Impressions</title><link>https://evan.wtf/2013/07/24/digital-ocean-first-impressions/</link><pubDate>Wed, 24 Jul 2013 08:59:06 +0000</pubDate><guid>https://evan.wtf/2013/07/24/digital-ocean-first-impressions/</guid><description>&lt;p&gt;For the past few years I&amp;rsquo;ve been hosting this site on an old desktop in my basement on my FiOS connection. This was one of the things I really liked when I switched from Cablevision to Verizon - they don&amp;rsquo;t block port 80 inbound, so I didn&amp;rsquo;t have to pay for separate hosting. My &amp;ldquo;server&amp;rdquo; was an old AMD desktop with 1 gig ram and a sata drive. It was ok; my site was slow but I was ok with that. I configured Nginx to cache the static assets which sped most things up to &amp;ldquo;ok&amp;rdquo; levels but it was never fast.&lt;/p&gt;</description></item><item><title>XFS write speeds: software RAID 0/5/6 across 45 spindles</title><link>https://evan.wtf/2013/01/02/xfs-write-speeds-software-raid-056-across-45-spindles/</link><pubDate>Wed, 02 Jan 2013 16:05:07 +0000</pubDate><guid>https://evan.wtf/2013/01/02/xfs-write-speeds-software-raid-056-across-45-spindles/</guid><description>&lt;p&gt;We&amp;rsquo;re currently building a new storage server to store low-priority data (tertiary backups, etc). One of the requirements for the project is that it needs to be on cheap storage (as opposed to expensive enterprise SAN/NAS). After some research we decided to build a &lt;a href="http://blog.backblaze.com/2011/07/20/petabytes-on-a-budget-v2-0revealing-more-secrets/"&gt;Backblaze pod&lt;/a&gt;. Backblaze used 3TB Hitachi drives in their system, but the ones they listed in their blog post are discontinued and the reviews for all other 3TB+ drives were terrible, so we went with &lt;a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16822152245"&gt;Samsung ST2000DL004&lt;/a&gt; 2TB 7200 RPM drives. Like Backblaze, we&amp;rsquo;re going with software raid, but I figured a good first step would be to figure out what RAID level we want to use, and if we want to use the mdadm/LVM mish-mosh Backblaze uses, or find something simpler. For my testing I created a RAID6 of all 45 drives and created a single XFS volume (XFS&amp;rsquo;s size limit is ~8 exabytes vs ext4&amp;rsquo;s 16TB). Ext4 may present some performance advantages, but the management overhead is probably not worth it in our case.&lt;/p&gt;</description></item><item><title>Using Nginx as a caching proxy in front of Wordpress</title><link>https://evan.wtf/2012/03/07/using-nginx-as-a-caching-proxy-in-front-of-wordpress/</link><pubDate>Wed, 07 Mar 2012 16:43:28 +0000</pubDate><guid>https://evan.wtf/2012/03/07/using-nginx-as-a-caching-proxy-in-front-of-wordpress/</guid><description>Why you may want to use Nginx as a caching reverse-proxy in front of Apache for Wordpress, and config examples for doing so.</description></item><item><title>Reorganizing photos in 1 line with exiftool</title><link>https://evan.wtf/2012/03/02/reorganizing-photos-in-1-line-with-exiftool/</link><pubDate>Fri, 02 Mar 2012 10:01:11 +0000</pubDate><guid>https://evan.wtf/2012/03/02/reorganizing-photos-in-1-line-with-exiftool/</guid><description>&lt;p&gt;A few years ago I wrote &lt;a href="https://evan.wtf/2007/03/28/java-utility-to-reorganize-photos-by-date-taken-via-exif-metadata/"&gt;a utility&lt;/a&gt; in Java to find all JPG files in a directory and move them into a date-based directory structure like /YYYY/MM/DD/ based on the date the photo was taken, extracted from the exif metadata in the file. Well, apparently that was a huge waste of time, as I just discovered that &lt;code&gt;exiftool&lt;/code&gt;, an awesome perl utility I&amp;rsquo;ve used for years to edit/extract the metadata on the command line, can also do this natively. So my entire program can be replaced with this simple command:&lt;/p&gt;</description></item><item><title>Slow HTTP downloads through Cisco ASA 5500</title><link>https://evan.wtf/2012/02/28/slow-http-downloads-through-cisco-asa-5500/</link><pubDate>Tue, 28 Feb 2012 16:15:20 +0000</pubDate><guid>https://evan.wtf/2012/02/28/slow-http-downloads-through-cisco-asa-5500/</guid><description>&lt;p&gt;Recently we noticed weird behavior downloading files from certain sites. The transfer would start out fast (around 10 MB/s), then after a couple of seconds it would plummet to around 9 KB/s. It didn&amp;rsquo;t happen for every file or every site: downloads from S3 buckets were still particularly fast. But some files that I remember being particularly fast were now showing this weird fast/slow/fast/slow behavior, for example the &lt;a href="http://download.oracle.com/otn-pub/java/jdk/6u25-b06/jdk-6u25-linux-i586-rpm.bin"&gt;Sun JDK&lt;/a&gt; and ISOs from &lt;a href="http://mirrors.rit.edu/centos/6/isos/x86_64/"&gt;rit.edu&lt;/a&gt; that used to saturate our pipe were now getting all cRAzY.&lt;/p&gt;</description></item><item><title>Using rrdtool to generate server load &amp; bandwidth graphs</title><link>https://evan.wtf/2012/02/17/using-rrdtool-to-generate-server-load-bandwidth-graphs/</link><pubDate>Fri, 17 Feb 2012 15:32:25 +0000</pubDate><guid>https://evan.wtf/2012/02/17/using-rrdtool-to-generate-server-load-bandwidth-graphs/</guid><description>&lt;p&gt;I&amp;rsquo;ve been using MRTG and routers2.cgi for years to graph the various aspects of a server that warrant monitoring. I&amp;rsquo;ve long known that they used something called rrdtool to do&amp;hellip; well, something, but never had a need or desire to figure out exactly what that was.&lt;/p&gt;&#10;&lt;p&gt;But, having just moved my site to a new server, I was curious how the server would handle the load. Rather than setting up some behemoth like Nagios or Zabbix, which are full monitoring/alerting suites, I just wanted graphing. As I said, in the past I&amp;rsquo;ve used MRTG or routers2.cgi for this but both of them were overkill for me in this case. Since both of them used rrdtool, I figured that was a good place to look.&lt;/p&gt;</description></item><item><title>Load balancing in EC2 with Nginx and HAProxy</title><link>https://evan.wtf/2012/01/09/load-balancing-in-ec2-with-nginx-and-haproxy/</link><pubDate>Mon, 09 Jan 2012 17:00:22 +0000</pubDate><guid>https://evan.wtf/2012/01/09/load-balancing-in-ec2-with-nginx-and-haproxy/</guid><description>&lt;p&gt;We wanted to setup a loadbalanced web cluster in AWS for expansion. My first inclination was to use &lt;a href="http://aws.amazon.com/elasticloadbalancing/"&gt;ELB&lt;/a&gt; for this, but I soon learned that ELB doesn&amp;rsquo;t let you allocate a static IP, requiring you to refer to it only by DNS name. This would be OK except for the fact that our current DNS provider, &lt;a href="http://dyn.com/dns/dynect-managed-dns/"&gt;Dyn&lt;/a&gt;, requires IP addresses when using their GSLB (geo-based load balancer) service.&lt;/p&gt;&#10;&lt;p&gt;Rather than let this derail the whole project, I decided to look into the software options available for loadbalancing in EC2. I&amp;rsquo;ve been a fan of hardware load balancers for a while, sort of looking down at software-based solutions without any real rationale, but in this case I really had no choice so I figured I&amp;rsquo;d give it a try.&lt;/p&gt;</description></item><item><title>Installing Sun (Oracle) JDK 1.5 on an EC2 instance</title><link>https://evan.wtf/2011/11/16/installing-sun-oracle-jdk-1-5-on-an-ec2-instance/</link><pubDate>Wed, 16 Nov 2011 11:52:55 +0000</pubDate><guid>https://evan.wtf/2011/11/16/installing-sun-oracle-jdk-1-5-on-an-ec2-instance/</guid><description>&lt;p&gt;I&amp;rsquo;m currently working on moving a Tomcat-based application into EC2. The code was written for Java 5.0. While Java 6 would probably work, I&amp;rsquo;d like to keep everything as &amp;ldquo;same&amp;rdquo; as possible, since EC2 presents its own challenges. I spun up a couple of t1.micro instances and copied everything over, including the Java 5 JDK, &lt;a href="http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase5-419410.html#jdk-1.5.0_22-oth-JPR"&gt;jdk-1_5_0_22-linux-amd64.rpm&lt;/a&gt;. Installing from RPM was easy, but the EC2 instance defaults to using OpenJDK 1.6:&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;[root@ec2 ~]# java -version&#10;java version &amp;#34;1.6.0_20&amp;#34;&#10;OpenJDK Runtime Environment (IcedTea6 1.9.10) (amazon-52.1.9.10.40.amzn1-x86_64)&#10;OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)&#10;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;There were a couple of things I had to do to get the system to accept the Sun JDK as its &amp;ldquo;real&amp;rdquo; java.&lt;/p&gt;</description></item><item><title>Rescan SATA bus (aka hot-adding a SATA disk on a Linux guest in VMware without rebooting)</title><link>https://evan.wtf/2011/10/24/rescan-sata-bus-aka-hot-adding-a-sata-disk-on-a-linux-guest-in-vmware-without-rebooting/</link><pubDate>Mon, 24 Oct 2011 15:20:51 +0000</pubDate><guid>https://evan.wtf/2011/10/24/rescan-sata-bus-aka-hot-adding-a-sata-disk-on-a-linux-guest-in-vmware-without-rebooting/</guid><description>&lt;p&gt;Linux supports hot-adding disks but whenever I add a new vdisk in VMware the new disk doesn&amp;rsquo;t show up unless I reboot, which defeats the purpose of hot-add. This command forces a rescan of the bus:&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;echo &amp;#34;- - -&amp;#34; &amp;gt; /sys/class/scsi_host/host0/scan&#10;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;dmesg shows the new disk has been found:&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;Vendor: VMware Model: Virtual disk Rev: 1.0 &#10; Type: Direct-Access ANSI SCSI revision: 02&#10; target0:0:2: Beginning Domain Validation&#10; target0:0:2: Domain Validation skipping write tests&#10; target0:0:2: Ending Domain Validation&#10; target0:0:2: FAST-40 WIDE SCSI 80.0 MB/s ST (25 ns, offset 127)&#10;SCSI device sdd: 1048576000 512-byte hdwr sectors (536871 MB)&#10;sdd: Write Protect is off&#10;sdd: Mode Sense: 03 00 00 00&#10;sdd: cache data unavailable&#10;sdd: assuming drive cache: write through&#10;SCSI device sdd: 1048576000 512-byte hdwr sectors (536871 MB)&#10;sdd: Write Protect is off&#10;sdd: Mode Sense: 03 00 00 00&#10;sdd: cache data unavailable&#10;sdd: assuming drive cache: write through&#10; sdd: unknown partition table&#10;sd 0:0:2:0: Attached scsi disk sdd&#10;sd 0:0:2:0: Attached scsi generic sg3 type 0&#10;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now, why there&amp;rsquo;s no &amp;ldquo;rescan_sata&amp;rdquo; command is something I can&amp;rsquo;t fathom, but that&amp;rsquo;s Linux for you.&lt;/p&gt;</description></item><item><title>Fedora Core 15 &amp; Gnome 3</title><link>https://evan.wtf/2011/09/23/fedora-core-15-gnome-3/</link><pubDate>Fri, 23 Sep 2011 10:27:22 +0000</pubDate><guid>https://evan.wtf/2011/09/23/fedora-core-15-gnome-3/</guid><description>Shrinking partitions, installing/upgrading to FC15, and systemd/chkconfig.</description></item><item><title>Making sure SSLv2 is disabled in Apache (and Nginx)</title><link>https://evan.wtf/2011/09/20/making-sure-sslv2-is-disabled-in-apache/</link><pubDate>Tue, 20 Sep 2011 14:06:38 +0000</pubDate><guid>https://evan.wtf/2011/09/20/making-sure-sslv2-is-disabled-in-apache/</guid><description>&lt;p&gt;&lt;strong&gt;Edit Jan 24, 2012:&lt;/strong&gt; Deleted all the crap from this story and just left the recommended Apache and Nginx SSL cipher suites for maximum security without SSLv2 and without BEAST vulnerability (at least according to Qualys).&#10;&lt;strong&gt;Apache httpd&lt;/strong&gt;&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;SSLProtocol -ALL +SSLv3 +TLSv1&#10;SSLCipherSuite ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH:!AESGCM;&#10;SSLHonorCipherOrder on&#10;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;nginx&lt;/strong&gt;&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;ssl_protocols SSLv3 TLSv1;&#10; ssl_ciphers ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH:!AESGCM;&#10; ssl_prefer_server_ciphers on;&#10;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Source:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://community.qualys.com/blogs/securitylabs/2011/10/17/mitigating-the-beast-attack-on-tls"&gt;Qualys&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://www.ssllabs.com/ssldb/"&gt;SSL checker&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;&lt;a href="http://affiliate.godaddy.com/redirect/5F43C3ECBA841ACFC3859F4F4E6CA7DA64C271385B2D61A3AD6F3CCE83EB1DD8235E60DCD7D63BCD92E2429E79A75FAC"&gt;&lt;img src="http://affiliate.godaddy.com/ads/5F43C3ECBA841ACFC3859F4F4E6CA7DA64C271385B2D61A3AD6F3CCE83EB1DD8235E60DCD7D63BCD92E2429E79A75FAC" alt="Go Daddy $12.99 SSL Sale!"&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>64-bit Firefox 6 on CentOS 6 x86_64 (or Fedora) with Flash 11</title><link>https://evan.wtf/2011/08/31/64-bit-firefox-6-on-centos-6-x86_64-or-fedora-with-flash-11/</link><pubDate>Wed, 31 Aug 2011 16:15:14 +0000</pubDate><guid>https://evan.wtf/2011/08/31/64-bit-firefox-6-on-centos-6-x86_64-or-fedora-with-flash-11/</guid><description>&lt;p&gt;So I&amp;rsquo;ve gone back to Linux from Mac, due to the SSD issues I had with my Macbook Pro basically making VMware unusable. A Win7 VM would grind the guest and host to a halt on the 7200 RPM SATA OEM drive, and the SSD wouldn&amp;rsquo;t work, so I put the SSD back in my HP and installed CentOS 6 x86_64. Not really ideal, but at least it works.&lt;/p&gt;&#10;&lt;p&gt;CentOS 6 ships with Firefox 3.6.9, which is really old by now. Fine for a server, but I wanted FF6. I grabbed the Firefox 6.0.1 bz2 from &lt;a href="http://www.mozilla.org/community/mirrors.html"&gt;VoxCast&lt;/a&gt;, unzipped it and copied it to /usr/lib64/firefox-6. Then I ran yum remove firefox to remove 3.6.9 and avoid any issues. I tried the instructions from &lt;a href="https://evan.wtf/2010/06/09/flash-plugin-on-firefox-on-fedora-12-x86_64/"&gt;my older post&lt;/a&gt; on this subject but for whatever reason it didn&amp;rsquo;t work - I&amp;rsquo;m guessing because I&amp;rsquo;m not using the distro&amp;rsquo;s Firefox RPM.&lt;/p&gt;</description></item><item><title>33 hours to restore a Postgres DB</title><link>https://evan.wtf/2011/07/26/33-hours-2/</link><pubDate>Tue, 26 Jul 2011 18:10:01 +0000</pubDate><guid>https://evan.wtf/2011/07/26/33-hours-2/</guid><description>Restoring a huge DB takes a long time.</description></item><item><title>Benchmarking disk IO on ext3 vs ext4 vs xfs with fio</title><link>https://evan.wtf/2011/07/22/benchmarking-disk-io-on-ext3-vs-ext4-with-fio/</link><pubDate>Fri, 22 Jul 2011 07:15:05 +0000</pubDate><guid>https://evan.wtf/2011/07/22/benchmarking-disk-io-on-ext3-vs-ext4-with-fio/</guid><description>&lt;p&gt;With the old database phased out, I figured this was a good time to benchmark IO on it before either repurposing it or mothballing it. In &lt;a href="https://evan.wtf/2009/10/27/nilfs-a-file-system-to-make-ssds-scream-in-pain/"&gt;the past&lt;/a&gt; I&amp;rsquo;ve used &lt;code&gt;dd&lt;/code&gt; for elementary sequential read/write testing, but I recently found &lt;a href="http://freshmeat.net/projects/fio/"&gt;fio&lt;/a&gt; which is much more versatile. Apparently developed by FusionIO, fio lets you control concurrency, blocksize and many other parameters and reports lots more data, most notably &lt;a href="http://en.wikipedia.org/wiki/IOPS"&gt;IOPS&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;I created 4 fio config files, basically the same as the one below, for direct / buffered disk access and sequential / random writes. All have 8k blocksize since that&amp;rsquo;s what Postgres uses by default.&lt;/p&gt;</description></item><item><title>MongoDB logrotate script</title><link>https://evan.wtf/2011/07/21/mongodb-logrotate-script/</link><pubDate>Thu, 21 Jul 2011 10:10:26 +0000</pubDate><guid>https://evan.wtf/2011/07/21/mongodb-logrotate-script/</guid><description>Daily mongodb log rotation via &lt;code&gt;logrotate&lt;/code&gt;.</description></item><item><title>VMWare 5's new licensing model.</title><link>https://evan.wtf/2011/07/17/vmware-5s-new-licensing-model-2/</link><pubDate>Sun, 17 Jul 2011 10:20:56 +0000</pubDate><guid>https://evan.wtf/2011/07/17/vmware-5s-new-licensing-model-2/</guid><description>&lt;p&gt;After reading up on the new VMware licensing&amp;amp;pricing model I understand the uproar. Limiting vRAM is a reasonable constraint, but 32GB per socket for Enterprise? 48 GB for &amp;ldquo;Enterprise Plus&amp;rdquo;? If you have a dual CPU server with 144 GB (easily configurable last year), with 4.1 you&amp;rsquo;d only need 2 enterprise licenses to use all 144 GB, since in 4.1 an &amp;ldquo;Enterprise&amp;rdquo; license covered 1 CPU (up to 6 cores) and up to 256 GB memory on the host.&lt;/p&gt;</description></item><item><title>Using WAL archiving &amp; Compellent snapshots for PostgreSQL backups</title><link>https://evan.wtf/2011/07/13/using-wal-archiving-compellent-snapshots-for-postgresql-backups/</link><pubDate>Wed, 13 Jul 2011 13:46:40 +0000</pubDate><guid>https://evan.wtf/2011/07/13/using-wal-archiving-compellent-snapshots-for-postgresql-backups/</guid><description>Changing my Postgres DB backup strategy from nightly &lt;code&gt;pg_dump&lt;/code&gt;s to WAL archiving with SAN snapshots.</description></item></channel></rss>