<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mike Green on Medium]]></title>
        <description><![CDATA[Stories by Mike Green on Medium]]></description>
        <link>https://medium.com/@moqume?source=rss-a83111dd5f03------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*7iFhRQgDbqbyig4HbeEqJA.png</url>
            <title>Stories by Mike Green on Medium</title>
            <link>https://medium.com/@moqume?source=rss-a83111dd5f03------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 12:15:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@moqume/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Poor Man’s device discovery (DNS)]]></title>
            <link>https://medium.com/moqume/poor-mans-device-discovery-dns-492a95ea8c8b?source=rss-a83111dd5f03------2</link>
            <guid isPermaLink="false">https://medium.com/p/492a95ea8c8b</guid>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Mike Green]]></dc:creator>
            <pubDate>Thu, 04 Aug 2016 20:57:28 GMT</pubDate>
            <atom:updated>2018-10-07T11:45:47.832Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H0QGLbKWBrQi06hkePjBNA.jpeg" /><figcaption>CC <a href="https://www.flickr.com/photos/tekniskamuseet/"><strong>TEKNISKA MUSEET</strong></a></figcaption></figure><p>I have a home network that contains a mixture of devices, some of which that receive a static IP address such as the printer, and some of which receive a dynamic IP address such as mobile phones and tablets.</p><p>The home router is setup to give every device with a static IP address a host name, such as “printer.home” or “nas.home”, making it easy to access the device’s UI (if it has one). However, the router isn’t capable of assigning host names to devices with a dynamic IP address.</p><p>For the most part this isn’t an issue, but every once in a while I do need to access the mobile phone or tablet via the browser or similar. This means having to lookup the IP address of the device in the router, which in turns means I have to login to it and navigate through various screens.</p><p>So I thought: “why not give every device a host name / DNS entry?”. But with the router not capable of assigning them to dynamic IP addresses (based on MAC for example), or able to set the host name on some devices, how? Luckily I have a Raspberry Pi that’s sitting in a closet 24/7 doing very little, so I’ve put that to good use.</p><h4>Dnsmasq</h4><p>First things first, I wanted to keep DHCP services with the home router. DNS could be off-loaded with ease to <a href="http://www.thekelleys.org.uk/dnsmasq/doc.html">Dnsmasq</a>, a very lightweight DNS / DHCP / RA server, due to the option in the router that allowed me to specify which DNS server to advertise with DHCP requests. That is, whenever a device on my home network asks for an IP address via DHCP, it also receives details about which DNS server(s) to use.</p><p>Raspbian installation: sudo apt-get install dnsmasq</p><p>So after giving the Raspberry Pi (one of the early model B’s with 256 Mbytes of RAM) a static IP address, I’ve set the router to advertise that IP address for DNS lookups. So all devices in my home network will now use the Raspberry Pi for DNS lookups.</p><p>The DNS lookups are being handled by Dnsmasq, which I first configured to not use the /etc/resolv.conf file, because that file was auto-populated by the Raspberry Pi and self-referencing (so Dnsmasq wouldn&#39;t know what remote DNS servers to use for resolving external domains). I did this by removing the comment on the following line in the /etc/dnsmasq.conf file:</p><pre># If you don’t want dnsmasq to read /etc/resolv.conf or any other<br># file, getting its servers from this file instead (see below), then<br># uncomment this.<br>no-resolv</pre><p>Obviously I could have simply configured a static IP address in the Raspberry’s /etc/network/interfaces file, but I wanted to keep it at DHCP for sake of being able to move it around places (i.e., at a hotel or a friend&#39;s place).</p><p>The next step was to set what remote DNS servers Dnsmasq had to use for external domain lookups. One could use Google’s public DNS for example:</p><pre># Add other name servers here, with domain specs if they are for<br># non-public domains.<br>#server=/localnet/192.168.0.1<br>server=8.8.8.8<br>server=8.8.4.4</pre><p>The next step was to get Dnsmasq to somehow associate all my devices in the home network with a host name. Looking at the above bit of configuration, I could add something like:</p><pre>server=/home/192.168.1.1</pre><p>Where 192.168.1.1 is the IP address of the router. This means host names with the .home extension would be resolved by the router but, as mentioned, the router could only do so for devices with a static IP address, thus defeating the purpose.</p><h4>ARP-scan</h4><p>So I needed a way to 1) find all the devices on my home network and 2) assign a host name to known devices regardless of IP address and then 3) pass this information on to Dnsmasq. Lucky me, there’s a rather simple solution to this than might seem. Enter <a href="http://linux.die.net/man/1/arp-scan">arp-scan</a>, the tool that sends out <a href="https://en.wikipedia.org/wiki/Address_Resolution_Protocol">ARP packets</a> and outputs the responses received.</p><p>Raspbian installation: sudo apt-get install arp-scan</p><p>The beauty of an ARP scan, other than very quickly finding all the devices in your local network, is that it also returns the MAC address of the device, which remains pretty much constant regardless of the IP address assigned to it. This allows me to use the MAC address to associate it with a host name.</p><p>What’s even better, arp-scan uses a MAC vendor mapping file to figure out who made the device based on the MAC address’ prefix. By default it uses the files in the /usr/share/arp-scan/ directory, but you can also specify your own using the --macfile=&lt;m&gt; or -m &lt;m&gt; option. This vendor mapping file uses a very simple format, as explained in one of the files:</p><pre># mac-vendor.txt — Ethernet vendor file for arp-scan<br>#<br># This file contains Ethernet vendor mappings for arp-scan. These are used<br># to determine the vendor for a give Ethernet interface given the MAC address.<br>#<br># Each line of this file contains a MAC-vendor mapping in the form:<br>#<br># &lt;MAC-Prefix&gt;&lt;TAB&gt;&lt;Vendor&gt;<br>#<br># Where &lt;MAC-Prefix&gt; is the prefix of the MAC address in hex, and &lt;Vendor&gt;<br># is the name of the vendor. The prefix can be of any length from two hex<br># digits (one octet) to twelve hex digits (six octets, the entire Ethernet<br># hardware address).<br>#<br># For example:<br>#<br># 012345 would match 01:23:45:xx:xx:xx, where xx represents any value;<br># 0123456 would match 01:23:45:6x:xx:xx; and<br># 01234567 would match 01:23:45:67:xx:xx.<br>#<br># …truncated…<br>#<br># The alphabetic hex characters [A-F] must be entered in upper case.<br>#<br># The order of entries in this file are not important.<br>#<br># arp-scan will attempt to match larger prefixes before trying to match<br># smaller ones, and will stop at the first match.<br>#<br># Blank lines and lines beginning with “#” are ignored.<br>#<br># Additional information is available on the arp-scan wiki at<br># <a href="http://www.nta-monitor.com/wiki">http://www.nta-monitor.com/wiki</a><br></pre><p>This allowed me to create a file that contains the full MAC address and the host name it should have. I created a file /etc/mac-dns.txt that contains entries such as:</p><pre>B82734FAB128 raspberrypi.home</pre><p>where the first portion is the MAC address as shown with ifconfig:</p><pre>~# ifconfig eth0 | grep HWaddr<br>eth0 Link encap:Ethernet HWaddr b8:27:34:fa:b1:28</pre><p>I would then specify this file as the MAC vendor mapping file with arp-scan, which gives me output similar as following:</p><pre>~# arp-scan -l -m /etc/mac-dns.txt<br>Interface: eth0, datalink type: EN10MB (Ethernet)<br>Starting arp-scan 1.8.1 with 256 hosts (http://www.nta-monitor.com/tools/arp-scan/)<br>192.168.1.197 b8:27:34:fa:b1:28 raspberrypi.home</pre><pre>…(truncated output)…</pre><pre>14 packets received by filter, 0 packets dropped by kernel<br>Ending arp-scan 1.8.1: 256 hosts scanned in 2.584 seconds (99.07 hosts/sec). 11 responded</pre><p>Note I also use the -l option in arp-scan (equivalent to --localnet), so that arp-scan only performs a scan of the local network. That&#39;s #1 and #2 of the 3-point requirement done! Now to feed this into Dnsmasq...</p><h4>Putting it together</h4><p>Now that I could quickly gather information about the devices in my home network and the host name they should be using, I needed a way to feed this into Dnsmasq, so that DNS lookups for these devices would work. Once again luck was on my side, as Dnsmasq offers the option for providing additional host files. I edited the /etc/dnsmasq.conf file accordingly to read a file called /etc/hosts.home:</p><pre># or if you want it to read another file, as well as /etc/hosts, use<br># this.<br>#addn-hosts=/etc/banner_add_hosts<br>addn-hosts=/etc/hosts.home</pre><p>As you may know, the /etc/hosts file simply consists of an IP address followed by the host name. Coincidentally, arp-scan prints its output nearly as it should — I just needed to remove the 2nd column with the MAC addresses and the footer / headers. That’s easy:</p><pre>arp-scan -l -m /etc/mac-dns.txt | head -n-3 | tail -n+3 | cut -f1,3-</pre><p>Now I could use the output of arp-scan to send it to the /etc/hosts.home file, and signal Dnsmasq to reload the file once I&#39;ve done so. A cron entry for this looks like:</p><pre>*/15 * * * * arp-scan -l -m /etc/mac-dns.txt | head -n-3 | tail -n+3 | cut -f1,3- &gt; /etc/hosts.home &amp;&amp; pkill -SIGHUP dnsmasq</pre><p>So every 15 minutes the file is updated and, when successful, a <em>SIGHUP</em> signal is sent to the running Dnsmasq instance that forces it to reload (and also purge any cache, so to conserve resources try not to run the cron too often).</p><p>And then check if things actually work:</p><pre>~# dig raspberrypi.home</pre><pre>; &lt;&lt;&gt;&gt; DiG 9.9.5–9+deb8u6-Raspbian &lt;&lt;&gt;&gt; raspberrypi.home<br>;; global options: +cmd<br>;; Got answer:<br>;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 13944<br>;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1</pre><pre>;; OPT PSEUDOSECTION:<br>; EDNS: version: 0, flags:; udp: 4096<br>;; QUESTION SECTION:<br>;raspberrypi.home. IN A</pre><pre>;; ANSWER SECTION:<br>raspberrypi.home. 0 IN A 192.168.1.197</pre><pre>;; Query time: 8 msec<br>;; SERVER: 127.0.0.1#53(127.0.0.1)<br>;; WHEN: Thu Aug 04 22:25:23 CEST 2016<br>;; MSG SIZE rcvd: 61</pre><p>So it does! No more digging around for IP addresses on my home network!</p><h4>Thoughts</h4><p>There are more elegant options out there, of course. You have <em>mdns-scan</em> / DNS Service Discovery, but it only supports devices that actually advertise themselves. Similarly, there are also agent-based solutions, particularly enterprise solutions meant for <em>etcd</em> (think <em>Docker</em>) or similar. But for a simple 123 = abc.home solution, this would suffice, particularly as it is very low on resources and essentially requires 10 minutes of work to set it all up.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=492a95ea8c8b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/moqume/poor-mans-device-discovery-dns-492a95ea8c8b">Poor Man’s device discovery (DNS)</a> was originally published in <a href="https://medium.com/moqume">Moqume Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Quick note: FUSE inside Proxmox LXC container]]></title>
            <link>https://medium.com/moqume/quick-note-fuse-inside-proxmox-lxc-container-481706005a09?source=rss-a83111dd5f03------2</link>
            <guid isPermaLink="false">https://medium.com/p/481706005a09</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[proxmox]]></category>
            <dc:creator><![CDATA[Mike Green]]></dc:creator>
            <pubDate>Fri, 26 Feb 2016 00:02:17 GMT</pubDate>
            <atom:updated>2018-10-07T11:53:13.017Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*gkH0sXDoYkaCHVXQUhIJFQ.png" /><figcaption>FUSE structure CC-BY-SA 3.0 <a href="https://commons.wikimedia.org/wiki/File:FUSE_structure.svg">Wikimedia Commons</a></figcaption></figure><p>Proxmox’ LXC containers do not have the /dev/fuse device created automatically. A quick way of doing that is by adding the following two lines to the container&#39;s configuration on the host node (in /etc/pve/lxc/&lt;$container_id&gt;.conf):</p><pre>lxc.autodev: 1<br>lxc.hook.autodev: sh -c &quot;mknod -m 0666 ${LXC_ROOTFS_MOUNT}/dev/fuse c 10 229&quot;</pre><p>I’m using “sh -c” directly rather than a separate script, so that this configuration is migrated to other nodes in the cluster.</p><p>As a note, it should already be in the lxc.cgroup.devices.allow by default, so doesn&#39;t need to be added again.</p><p>Caveat as mentioned by <a href="https://forum.proxmox.com/threads/enable-fuse-in-lxc-container.27278/#post-137394">Fabian (Proxmox staff)</a>:</p><blockquote>If you absolutely have to, I would suggest establishing the FUSE mount on the Proxmox host and then using a bindmountpoint (e.g. “mp0: /path/on/host,mp=/path/in/container”) to make it available in the container. If you establish the FUSE mounts inside the container, you will run into problems (lxc-freeze is not compatible with FUSE which means no snapshots and no suspend backup, you need to change all sorts of containment settings which lessens security, ..).</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=481706005a09" width="1" height="1" alt=""><hr><p><a href="https://medium.com/moqume/quick-note-fuse-inside-proxmox-lxc-container-481706005a09">Quick note: FUSE inside Proxmox LXC container</a> was originally published in <a href="https://medium.com/moqume">Moqume Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Quick Note: Disable SSLv3 in OpenLDAP with GnuTLS]]></title>
            <link>https://medium.com/moqume/quick-note-disable-sslv3-in-openldap-with-gnutls-f86774048c51?source=rss-a83111dd5f03------2</link>
            <guid isPermaLink="false">https://medium.com/p/f86774048c51</guid>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Mike Green]]></dc:creator>
            <pubDate>Wed, 15 Oct 2014 20:47:54 GMT</pubDate>
            <atom:updated>2018-10-07T11:58:06.823Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/313/1*HLivrEpwzBi0O5T8N7jjHQ.png" /><figcaption>GnuTLS Logo by Claus Schrammel</figcaption></figure><p>Due to the SSL <a href="https://www.openssl.org/~bodo/ssl-poodle.pdf">POODLE vulnerability</a>, it is best to remove support for the outdated SSLv3 protocol. As OpenLDAP with GnuTLS is a beast of its own, here’s the quick change to remove SSLv3 support:</p><pre>cat &gt; nossl.ldif &lt;&lt;EOF<br>dn: cn=config<br>changetype: modify<br>add: olcTLSCipherSuite<br>olcTLSCipherSuite: SECURE256:-VERS-SSL3.0</pre><pre>EOF</pre><pre>ldapmodify -Y EXTERNAL -H ldapi:/// -f nossl.ldif</pre><p>And we’re done! Obviously, if you already have olcTLSCipgerSuite, then use “replace” instead of “add”.</p><p>A quick test:</p><pre>~# gnutls-cli-debug -p 636 127.0.0.1<br>Resolving &#39;127.0.0.1&#39;...<br>Connecting to &#39;127.0.0.1:636&#39;...<br>Checking for SSL 3.0 support... no<br>Checking whether %COMPAT is required... no<br>Checking for TLS 1.0 support... yes<br>Checking for TLS 1.1 support... yes<br>Checking fallback from TLS 1.1 to... N/A<br>Checking for TLS 1.2 support... yes</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f86774048c51" width="1" height="1" alt=""><hr><p><a href="https://medium.com/moqume/quick-note-disable-sslv3-in-openldap-with-gnutls-f86774048c51">Quick Note: Disable SSLv3 in OpenLDAP with GnuTLS</a> was originally published in <a href="https://medium.com/moqume">Moqume Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Postfix’s killed trivial-rewrite by signal 11]]></title>
            <link>https://medium.com/moqume/postfixs-killed-trivial-rewrite-by-signal-11-a82b3e3f0c4a?source=rss-a83111dd5f03------2</link>
            <guid isPermaLink="false">https://medium.com/p/a82b3e3f0c4a</guid>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Mike Green]]></dc:creator>
            <pubDate>Sun, 21 Sep 2014 21:15:10 GMT</pubDate>
            <atom:updated>2018-10-07T12:01:56.571Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_5_ndbuonSV7zsFwbR3WVA.jpeg" /></figure><p>I was setting up a small VPS as a backup e-mail server for the two already in place. What was supposed to be a 15 minute task, particularly as it was being installed using a proven recipe with <a href="http://puppetlabs.com/">Puppet</a>, turned into a diagnostic nightmare for hours. Looking back, it really shouldn’t have taken that long to diagnose either, but alas, Google led me astray.</p><p>See, everything was installed according to the other servers. Postfix started up fine, but as soon as it would perform a lookup in an LDAP directory, the following error occurred:</p><pre>Sep 21 00:34:02 server postfix/master[23426]: warning: process /usr/lib/postfix/trivial-rewrite pid 23460 killed by signal 11<br>Sep 21 00:34:03 server postfix/qmgr[23431]: warning: problem talking to service rewrite: Success<br>Sep 21 00:34:03 server postfix/master[23426]: warning: process /usr/lib/postfix/trivial-rewrite pid 23461 killed by signal 11<br>Sep 21 00:34:03 server postfix/master[23426]: warning: /usr/lib/postfix/trivial-rewrite: bad command startup -- throttling</pre><p>I have come accustomed to look things up on Google first, to see if someone else already figured out what the cause of this issue is. It almost all referenced issues from back in 2005–2008, where there was a missing /dev/(u?)random in Postfix’s chroot directory (/var/pool/postfix/). But, it was there like it supposed to be and with all the correct permissions.</p><p>With TLS disabled in the LDAP mappings for Postfix, there weren’t any errors. But the policies in place require that all communication should be done with TLS or SSL, even over a private network (which in this case wasn’t private — it is a backup server in Sweden). The regular LDAP utilites didn’t have any trouble communicating with the LDAP directory over TLS/SSL however, which led me to ignore it and its associated libraries.</p><p>Additionally, the articles I found via Google were mainly referring to signal 6 errors, not signal 11 errors, which is a segmentation fault. Given that, I went on to strace that “trivial rewrite”. The <a href="http://www.postfix.org/DEBUG_README.html#auto_trace">Postfix documentation</a> explains how to perform an auto trace well (instead of “truss” I use “strace”). From here I could see the following relevant part:</p><pre>Sep 21 01:10:48 server logger: socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 8<br>Sep 21 01:10:48 server logger: connect(8, {sa_family=AF_FILE, path=&quot;/var/run/nscd/socket&quot;}, 110) = 0<br>Sep 21 01:10:48 server logger: sendto(8, &quot;\2\0\0\0\17\0\0\0\10\0\0\0postfix\0&quot;, 20, MSG_NOSIGNAL, NULL, 0) = 20<br>Sep 21 01:10:48 server logger: poll([{fd=8, events=POLLIN|POLLERR|POLLHUP}], 1, 5000) = 1 ([{fd=8, revents=POLLIN|POLLHUP}])<br>Sep 21 01:10:48 server logger: read(8, &quot;\2\0\0\0\1\0\0\0\2\0\0\0&quot;, 12) = 12<br>Sep 21 01:10:48 server logger: read(8, &quot;m\0\0\0p\0\0\0&quot;, 8) = 8<br>Sep 21 01:10:48 server logger: close(8) = 0<br>Sep 21 01:10:48 server logger: setgroups(2, [109, 112]) = 0<br>Sep 21 01:10:48 server logger: chroot(&quot;/var/spool/postfix&quot;) = 0<br>Sep 21 01:10:48 server logger: chdir(&quot;/&quot;) = 0<br>Sep 21 01:10:48 server logger: setuid(104) = 0<br>Sep 21 01:10:48 server logger: getrlimit(RLIMIT_NOFILE, {rlim_cur=4*1024, rlim_max=4*1024}) = 0<br>Sep 21 01:10:48 server logger: setrlimit(RLIMIT_NOFILE, {rlim_cur=4*1024, rlim_max=4*1024}) = 0<br>Sep 21 01:10:48 server logger: epoll_create(10) = 8<br>Sep 21 01:10:48 server logger: fcntl(8, F_GETFD) = 0<br>Sep 21 01:10:48 server postfix/master[27591]: warning: process /usr/lib/postfix/trivial-rewrite pid 28079 killed by signal 11</pre><p>So, it opens up a unix socket on /var/run/nscd/socket, does a bit of back-and-forth, then switches to chroot after which a subsequent fcntl call goes kaplooey. So I’ve disabled the chroot to see if that would also cause the same issue, and it didn’t. But for the sake of security, I didn’t want it to run outside of a chroot — afterall, the other servers had no issues running it in chroot so why should this server? Moreso, it seemed to move the issue down to the other components of Postfix (to “flush” and “smtpd” among things).</p><p>It turns out, I was ignoring things I shouldn’t have. A quick peek in the chroot’s lib dir (/var/spool/postfix/lib/x86_64-linux-gnu/) I noticed that the libraries in use were version 2.19, ie:</p><pre>libnss_compat-2.19.so<br>libnss_compat.so.2 -&gt; libnss_compat-2.19.so</pre><p>That differed from the other servers, which were using version 2.13 instead. These libraries came from the libc6 package. And in this case, from Debian’s unstable “sid”:</p><pre># apt-cache madison libc6<br> libc6 | 2.19-11 | <a href="http://ftp.debian.org/debian/">http://ftp.debian.org/debian/</a> sid/main amd64 Packages<br> libc6 | 2.13-38+deb7u4 | <a href="http://security.debian.org/">http://security.debian.org/</a> wheezy/updates/main amd64 Packages<br> libc6 | 2.13-38+deb7u2 | <a href="http://ftp.debian.org/debian/">http://ftp.debian.org/debian/</a> wheezy/main amd64 Packages</pre><p>Using sid isn’t advisable, especially on production systems; there’s a reason it is called “unstable”. However, during the installation of the various components using Puppet, which also enables the sid repository, something had a dependency on the newer libc6 libary.</p><p>The problem is that libc6 is used for 99.9999% of the things you install (or seemingly so). Reverting it to an older version required carefully looking at what else would be removed, which in turn would have to be re-installed (for example, “upstart” and “mountall” would be removed, which are imperative for the server to work unless you don’t ever reboot the server again).</p><p>Luckily this was a small server with just a single purpose, so there weren’t that many things installed to begin with. So with that, I reverted to the older version of libc6 using:</p><pre>apt-get install libc6=2.13-38+deb7u4</pre><p>And re-installed the other important components it removed as part of that process. For good measure, Postfix was fully purged and re-installed as well. Lo and behold, Postfix worked like a charm!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a82b3e3f0c4a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/moqume/postfixs-killed-trivial-rewrite-by-signal-11-a82b3e3f0c4a">Postfix’s killed trivial-rewrite by signal 11</a> was originally published in <a href="https://medium.com/moqume">Moqume Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[High traffic WordPress hosting]]></title>
            <link>https://medium.com/moqume/high-traffic-wordpress-hosting-365d49142047?source=rss-a83111dd5f03------2</link>
            <guid isPermaLink="false">https://medium.com/p/365d49142047</guid>
            <category><![CDATA[wordpress]]></category>
            <dc:creator><![CDATA[Mike Green]]></dc:creator>
            <pubDate>Sun, 29 Jun 2014 01:18:39 GMT</pubDate>
            <atom:updated>2018-10-07T12:05:08.598Z</atom:updated>
            <content:encoded><![CDATA[<p>Although I have a rather large amount of servers at my disposal, for some time I’ve had my personal website hosted with <a href="http://www.5quidhost.co.uk/5340.html">5quidhost</a> on one of their Turbo pans. They’re an UK-based company with headquarters in Scotland, and have recently celebrated their 10th anniversary. They also rank quite high on <a href="https://www.trustpilot.co.uk/review/5quidhost.co.uk">TrustPilot</a>, usually 1st or 2nd place.</p><p>In March I snapped up a domain that I had been waiting for a long time to become available: myatu.com. In fact, it is the reason why the current domain name has an “s” in it. I was aware of the content the previous owner had hosted on that domain name, but I had no idea how popular it was. So when that domain was transferred into my ownership, its traffic followed.</p><p>Generally, my website generates just a few thousand page views per day with the occasional spike, mainly for the <a href="https://myatus.com/t/proxmox/">Proxmox</a> how-to guides (which I really should update one of these days!). Though around the end of March, this jumped to 24,000 page+ page views per day. Between March 27 and April 5th, more than 157,000 page views were generated, and is currently handling between 250,000 and 450,000 page views per week.</p><p>So, how did the website cope with this? Perfectly fine! It isn’t the first time the website has been hit with a large amount of page views, so I had already prepared the website for this. And the magic ingredient for that is: cache.</p><h4>Install, but don’t forget</h4><p>Because WordPress is pretty much a click-and-install solution, especially at 5quidhost, I have a feeling that many assume that this is the extent of what they need to do. Despite being riddled by uncommented spaghetti code, by default WordPress is fairly efficient. But as people start using it, they’ll also add themes to personalise it and plugins to perform certain tasks. More spaghetti! In the end, too much pasta has been fed to the website and now have a sluggish beast to tame.</p><h4>Plugins</h4><p>The first step to take here, is to ask yourself if you really need all the plugins that you have installed. Each active plugin is loaded during each WordPress page visit, and these are loaded consecutively meaning they all have to wait for their turn. Some plugins are smart enough to stop loading themselves any further beyond minimal requirements, but I have seen plugins that seem to load the entire contents of the British Library for no apparent reason.</p><p>To help weed out the slow plugins, you can use a plugin profiler. My personal favourite is <a href="https://wordpress.org/plugins/p3-profiler/">P3 (Plugin Performance Profiler)</a>, which has a simple interface giving a quick overview over how much time each plugin is spending during a page visit.</p><p>Also, <a href="http://wordpress.org/plugins/">WordPress.org</a> has a very large plugin repository, and it serves to read the reviews of the plugin you have installed or intend to install. You may want to keep an eye on the last time it has been updated as well, as older plugins tend to develop issues as WordPress and PHP is updated. Above all, spend some time looking at the less popular alternatives — very often a plugin developer creates a competitor to a popular plugin that does a much better job.</p><h4>Themes</h4><p>Themes are slightly different than plugins, but can still be a major cause for things to slow down. There are a number of themes out there that use “LESS” (or similar) to compile custom CSS stylesheets. This works well enough for a theme that does this once only, and then stores the result on disk until another change is made.</p><p>However, I have seen quite a large number of themes that re-generate the CSS on each request. The CSS request invokes WordPress, which in turn loads plugins, before it can finally get to generating the CSS. I’ve seen it take 3 seconds or more for these type of requests, which adds to the (already slow) load time of the page. And as most browsers won’t display the page until it has obtained the CSS stylesheet it needs to render that page, this means the visitor is just waiting for something to happen on their screen.</p><p>In one theme, I’ve noticed that in addition to the above, it also had the option to ‘minify’ its own JavaScript in a similar fashion, advertised as a method to improve page load times so users are likely enabling it. However, it too did so on each page request and eventually caused such a delay, the page took more than 10 seconds to finish loading.</p><p>It is fairly easy to see the above using a debugging console available for most browsers, such as the built in Developer Tools in Google Chrome (press F12, click the “Network” tab and reload the page), or <a href="https://getfirebug.com/">Firebug</a>. An online tool to diagnose this can be found at <a href="http://tools.pingdom.com/fpt/">Pingdom</a>, using the “Pingdom Website Speed Test” — when using that tool, you may wish to click the “Settings” underneath the field where you enter the domain of the site, and select the nearest location of the hosting provider to have a more accurate view of response times.</p><h4>(W3 Total) Cache</h4><p>Once you have sorted through your plugins and theme to find and resolve any issues they may have, the next step is to implement a cache. WordPress does very little caching of its own, so for this you will need to use a plugin. The one that I use and highly recommend is <a href="https://wordpress.org/plugins/w3-total-cache/">W3 Total Cache</a>, though I would recommend not to use its “Minify” option as I have found that it causes more trouble than solve them — For minify I’m using an alternative solution, which I’ll discuss later.</p><h4>Page Cache</h4><p>The “Page Cache” option caches the output of each WordPress page. It will serve this output on subsequent requests, so that WordPress (and its plugins / theme) does not need to go through all the motions again to generate the output. When a page has changed, such as when you update a post, the cache for that page is purged. You can also manually purge the cache, either for an individual post or all of it.</p><p>I have this enabled on this website, using the Basic disk storage option. The enhanced option bypasses WordPress entirely by a clever use of the .htaccess file, but at the same time can actually bypass a bit too much for my taste. The other options are not available at 5quidhost, as they do not have Memcache or use a PHP opcode cache. While those caches are in held in much faster RAM, it would also open a huge can of worms with regards to security on a shared hosting provider (and if a shared hosting provider has this enabled, I would seriously question why).</p><p>Additionally, I have also enabled the “Cache Preload” option for the Page Cache, updating 10 pages at a time. If this is disabled, a page is cached only when someone visits it. For the SEO conscious, they know that page load times may count towards the ranking of a page, so if a page hasn’t been visited until a crawler bot reaches it, then the page load time can be slow. Using this option, the cache is primed before anyone has actually visited it.</p><p>The only drawback of priming the cache, is that they generate many small files. While it isn’t so much an issue in general, a problem arises whenever you want to upgrade WordPress or any of its plugins / themes, as W3 Total Cache will empty the entire cache (so as not to cause any issues with the upgrade). Deleting the thousands of small cache files can take some time, to the point the browser may time out, giving the impression the website has crashed. It has not, however, so just retry loading again.</p><h4>Browser Cache</h4><p>An option in W3 Total Cache that complements the “Page Cache” is the “Browser Cache”. By default, WordPress / PHP sets an HTTP header that causes the browser to always fetch a page from the server, even if the contents can be cached. This is because the output of PHP is considered dynamic (always changing), whereas HTML pages are static of nature (hardly ever changes).</p><p>The “Browser Cache” option ensures that behaviour is changed more akin to static HTML pages, in which the visitor’s browser will try and load the page from its own cache first. Of course, the browser will still do some checks, such as checking how long it has been cached or if the page has been changed in meantime on the web server by making a very small, efficient request rather than a full page request.</p><p>Something that may not be immediately obvious, is that the cache times listed in the “Browser Cache” is the time the “Page Cache” will remain valid for, before W3 Total Cache considers it stale (at which point it will purge or generate a new cache for the page).</p><h4>Object and Database Cache</h4><p>Both the Object and Database cache can also help speed up the website’s response times. For example, AJAX calls are not cached by the “Page Cache” mentioned above. These are calls made by Javascript to update internal or small visible portions on a web page, such as for example a live Twitter feed on the page, and more often than not are always changing, hence they are not cached.</p><p>However, it is possible that a call to the MySQL database by the AJAX code results in the same result coming back from the database server , such as for example a configuration, which can be cached by W3 Total Cache. Even when cached to disk, this can be faster than querying the database server itself, especially if it is heavily loaded with other requests or the request itself is very complex (read: inefficient).</p><h4>CloudFlare</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*q5VRk9rPKbE7GVeqjOAjLQ.png" /><figcaption>CloudFlare stats June 23–29</figcaption></figure><p>With the above, WordPress should already be much snappier. However, as is the case with 5quidhost, shared hosting platforms usually limit the number of scripts that can run at the same time per website or hosting account. This is because a single script can take up a considerable amount of CPU and RAM, and when tallied up for all the websites on the server, this can add up to quite a significant number and affect the performance of the server.</p><p>The Turbo accounts at 5quidhost provide quite a bit more resources than their standard hosting accounts, and so have upped the number of scripts that can run at the same time as well. Though for 20,000+ page views per day, this may still not be enough, especially if these pages have not been cached locally (see the “Browser Cache” mentioned earlier) and there are many concurrent visitors at a time.</p><p>Enter <a href="http://cloudflare.com/">CloudFlare</a>. In their own words: “CloudFlare is a free global CDN and DNS provider that can speed up and protect any site online” — Well, their basic plan is free, however that plan is more than sufficient for many. Not only does CloudFlare help protect your website against unwanted traffic, such as the unscrupulous spammers for example, but they also provide a CDN, which is what will help a high traffic website tremendously.</p><p>CDN stands for “Content Delivery Network”. Essentially, it is a large number of servers spread across the world that serve content on behalf of your own website. The way it works with CloudFlare is that they sit in between your web site and the visitor. Instead of the visitor directly querying your website for content, it actually asks CloudFlare. In turn, CloudFlare will check if it has the content requested, and if not, asks your website’s server for it. It then delivers this back to the visitor.</p><p>If you have setup W3 Total Cache in WordPress to cache pages like I have, then this means CloudFlare can also cache them on their own servers. The net result is that the bulk of the requests are actually handled by CloudFlare, not by the server at 5quidhost. And because CloudFlare has many, many servers across the world handling each page view as opposed to just a single server, it can easily take a hit for 20, 30 or even 100,000 page views per day.</p><p>5quidhost actually offers very easy integration with CloudFlare directly from their control panel, which is described in one of their <a href="http://www.5quidsquidsaid.co.uk/guides/enable-cloudflare-four-clicks-to-a-faster-website/">blog posts</a>. However, it only accounts for a domain with a prefix such as “www.myatus.com&quot; or “blog.myatus.com”, not one without as is the case with my website (“myatus.com”). In such instances, you would need to sign up directly with CloudFlare and use CloudFlare’s DNS servers. Though the entire process of doing it that can be done within 15 minutes, and is well worth the time.</p><h4>Minify alternative</h4><p>As mentioned, I do not use the minify option in W3 Total Cache. The reason is that it can change the order in which Javascript is loaded, or corrupt some files, to the point it affects the website — be it the layout or things that stop working. There are options to tweak it in W3 Total Cache, but they are far from ideal and not for those with limited experience in that area.</p><p>Instead, I am using CloudFlare’s “<a href="https://support.cloudflare.com/hc/en-us/articles/200168196-How-do-I-minify-HTML-CSS-and-JavaScript-to-optimize-my-site-">Auto Minify</a>” option. It retains the order in which the Javascript is being loaded by the browser, and its minify is less aggressive resulting in files that are compatible across all browsers.</p><p>As an additional bonus, CloudFlare also offers a “<a href="https://support.cloudflare.com/hc/en-us/articles/200168056-What-does-Rocket-Loader-do-">Rocket loader</a>” option. This allows the Javascript used by the web page to be loaded asynchronous to the web page itself. This allows the browser to do more things at once, rather than having to wait on the Javascript to finish loading.</p><p>The end result is that my website has increased its speed significantly, where a page can load in under a second, whilst it can handle in excess of 20,000–100,000 page views per day.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=365d49142047" width="1" height="1" alt=""><hr><p><a href="https://medium.com/moqume/high-traffic-wordpress-hosting-365d49142047">High traffic WordPress hosting</a> was originally published in <a href="https://medium.com/moqume">Moqume Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Poor Man’s Proxmox Cluster]]></title>
            <link>https://medium.com/moqume/poor-mans-proxmox-cluster-d7bea2da550c?source=rss-a83111dd5f03------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7bea2da550c</guid>
            <category><![CDATA[proxmox]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[clustering]]></category>
            <dc:creator><![CDATA[Mike Green]]></dc:creator>
            <pubDate>Sat, 16 Nov 2013 15:21:06 GMT</pubDate>
            <atom:updated>2018-10-07T12:12:07.102Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yYBeg5RfZ2yfx1K8swxBlw.jpeg" /><figcaption>CC BY <a href="https://www.flickr.com/photos/ivanx/">IVANX</a></figcaption></figure><p>I had written this elsewhere before, but thought I would share it on my own site as well. The idea here is to create a <a href="http://www.proxmox.com/proxmox-ve/features">Proxmox VE</a> cluster with limited resources, in particular a lack of a private network / VLAN. We address this by creating a virtual private network using a lightweight VPN provider, namely <a href="http://tinc-vpn.org/">Tinc</a>.</p><p>You could use something else, like OpenVPN or IPSEC. The former is a bit on the heavy side for the task, whilst the latter may not have all the features we need. Specifically, Tinc allows us to create an auto-meshing network, packet switching and use multicast. Multicast will be needed to create a Proxmox VE cluster, whilst the virtual switching ensures packets will eventually be routed to the right server and VM.</p><h4>Create an additional vmbr</h4><p>By default there should already be a <em>vmbr0</em> bridge for Proxmox. We will need to create — or modify — an additional vmbr, which in this example we name <em>vmbr1</em>.</p><p><strong>Warning:</strong> on many systems, vmbr0 bridge is used to make your server accessible over the public network — so do not edit that unless absolutely required!</p><p>You also need to think of what private IP block you would like to use, and assign each Proxmox VE server an IP from within that private IP block. For example, I use the IP range 192.168.14.0/23 (which is 192.168.14.1–192.168.15.254 and a netmask of 255.255.254.0). The 192.168.15.x range I assign to the Proxmox VE servers, whereas the 192.168.14.x range I assign to containers / VMs. Using that IP range, you would change the file as following:</p><pre># for Routing<br>auto vmbr1<br>iface vmbr1 inet static<br>    address 192.168.15.20/23<br>    bridge_ports dummy0<br>    bridge_stp off<br>    bridge_fd 0</pre><p>You can force the changes using:</p><pre>ifdown vmbr1 &amp;&amp; ifup vmbr1</pre><p>You will need to do this on each server, taking care to select a different IP address. Keep it simple, start at 192.168.15.1, and increment the last number for each new server.</p><h4>Tinc</h4><p>The next step would be installing Tinc and configuring it in such a way that Proxmox VE can use multicast over that virtual private network.</p><p>So on the server, install Tinc with:</p><pre>apt-get install tinc -y</pre><p>Next, create a directory where the configuration for the VPN will reside (you can have multiple configurations as such):</p><pre>mkdir -p /etc/tinc/vpn/hosts</pre><p>Next, we create a basic configuration, which tells Tinc to use a “switch” mode and what this server’s “name” is. For sake of simplicity, use the hostname for the “name” (use <em>uname -n</em> to determine it):</p><pre>cat &gt; /etc/tinc/vpn/tinc.conf &lt;&lt;EOF<br>Name = server1<br>AddressFamily = ipv4<br>Device = /dev/net/tun<br>Mode = switch<br>ConnectTo = <br>EOF</pre><p>The “ConnectTo” is currently left blank, but will be important once you have setup the other servers. More on this later.</p><p>Then we create a server-specific configuration. Note that the filename is the same as specified in “Name =” above.</p><pre>cat &gt; /etc/tinc/vpn/hosts/server1 &lt;&lt;EOF<br>Address = 123.4.5.6<br>Port = 655<br>Compression = 0<br>EOF</pre><p>Obviously you should replace the “Address” line with the actual public IP address of your server.</p><p>Now we need to create a public/private key. The private key will remain exactly that: private. The public key will be appended to the file we just created (<em>/etc/tinc/vpn/hosts/server1</em>), which will eventually be distributed to the other servers.</p><pre>tincd -n vpn -K4096</pre><p>It will ask you to confirm two file locations. The default should be correct (with the last/2nd one the file as mentioned above).</p><p>Now we need an up/down script, to do some post configuration of the network when the VPN comes up (or goes away). This is a simple copy &amp; paste, provided you have setup <em>vmbr1</em> as outlined earlier:</p><pre>cat &gt; /etc/tinc/vpn/tinc-up &lt;&lt;EOF<br>#!/bin/bash</pre><pre># Attach the &#39;vpn&#39; interface to vmbr1<br>/sbin/ifconfig vpn up<br>/sbin/brctl addif vmbr1 vpn</pre><pre># Set a multicast route over vmbr1<br>/sbin/route add -net 224.0.0.0 netmask 240.0.0.0 dev vmbr1</pre><pre># To allow VMs on a private IP to access the Internet (via vmbr0):<br>/sbin/iptables -t nat -A POSTROUTING -o vmbr0 -j MASQUERADE</pre><pre># To allow IP forwarding:<br>echo 1 &gt; /proc/sys/net/ipv4/ip_forward</pre><pre># To limit the chance of Corosync Totem re-transmission issues:<br>echo 0 &gt; /sys/devices/virtual/net/vmbr1/bridge/multicast_snooping<br>EOF</pre><pre>cat &gt; /etc/tinc/vpn/tinc-down &lt;&lt;EOF<br>#!/bin/bash<br>/sbin/route del -net 224.0.0.0 netmask 240.0.0.0 dev vmbr1<br>/sbin/brctl delif vmbr1 vpn<br>/sbin/ifconfig vpn down<br>echo 0 &gt; /proc/sys/net/ipv4/ip_forward<br>EOF</pre><pre>chmod +x /etc/tinc/vpn/tinc-up<br>chmod +x /etc/tinc/vpn/tinc-down</pre><p>What the above does, is add the VPN tunnel to the vmbr1 bridge. Furthermore, it allows multicast messages over vmbr1. It also sets the use of masquerading, to allow a VM on a private IP to communicate successfully with the outside world — it will use the IP address of vmbr0 to do so.<br>Then, you need to tell Tinc that the contents in the “vpn” sub-directory should be started whenever it starts:</p><pre>echo &quot;vpn&quot; &gt;&gt; /etc/tinc/nets.boot</pre><p>You will need to do this on each server that needs to be part of the VPN. In addition, the files within the directory /etc/tinc/vpn/hosts/ needs to be distributed to all servers (so that all servers have the files from the other servers). Its simple enough to script this, if you want to go that route, but that’s beyond the scope here.</p><p>As mentioned earlier, you will need to edit the /etc/tinc/vpn/tinc.conf and provide the name of another server in the “ConnectTo” setting that was previously left blank. Which server you chose is entirely up to you, and you could chose a different one for each server — remember that Tinc is auto-meshing, so it will connect all servers over time.</p><p><strong>Note:</strong> without making that change to /etc/tinc/vpn/tinc.conf, Tinc will not know what to do so you will not have a working VPN as a result.</p><p>Once you have edited the configuration as outlined, (re)start Tinc using the following command:</p><pre>service tinc restart</pre><p>And test your network by pinging another node on its private IP, ie:</p><pre>ping -c3 192.168.15.32</pre><p>Note I use the “-c3” here, to limit the amount of pings. If the VPN was not configured correctly, or a firewall is interfering, you may otherwise end up with a large number of “Host or destination is unreachable” errors.</p><h4>Forcing the private IP address</h4><p>We need to force Proxmox VE, or more specifically Corosync, to use the private IP addresses rather than the public IP address. This because the multicast needs to be done over our virtual private network.</p><p>The easiest, but also the “dirtiest” method is to simply change the /etc/hosts, which I will outline here.</p><p>The first step is to ensure that the /etc/hosts file is read before attempting to do a full DNS lookup:</p><pre>cat &gt; /etc/host.conf &lt;&lt;EOF<br>order hosts, bind<br>multi on<br>EOF</pre><p>Next edit the /etc/hosts file, by commenting out the original line, and adding our own:</p><pre>…<br># Original:<br>#123.4.5.6 server1.myprovider.com server1<br># Ours:<br>192.168.15.20 server1.myprovider.com server1</pre><p>Make sure that the private IP address matches the one you assigned to vmbr1 (double check with ifconfig vmbr1).</p><p>Again, this is a “dirty” method and you may want to use your own DNS server instead that resolves IPs for a local network (say, “server1.servers.localnet”).</p><p>At this stage, reboot the server to ensure the changes get picked up and everything works as expected (that is, your server comes back up online — hmm!).</p><h4>Create the cluster</h4><p>If you do not yet have a cluster configured, you need to create one first. So pick a particular server that you would like to consider as a “main server” and perform the following:</p><pre>pvecm create &lt;arbitrary-name&gt;</pre><p>Where &lt;arbitrary-name&gt; is something of your own choosing. Keep the name short and simple, without spaces or other funny characters.</p><p>The “main server” is a loose term really, as any server within the cluster can manage other servers. But use it as a consistent starting point for adding other servers to the cluster.</p><p>You can check if things are working correctly with:</p><pre>~# pvecm status<br>…<br>Node name: server1<br>Node ID: 1<br>…<br>Node addresses: 192.168.15.20</pre><p>In particular, you’d want to make sure that the “Node addresses:” portion is the private IP address as on vmbr1.</p><h4>Adding servers to the cluster</h4><p>Adding a server (node) to the cluster will need a little preparation. Specifically, because we use private IP addresses for the cluster, we need to force other nodes to do the same when trying to contact another node. In other words, if server1 wants to contact server2, it should use the 192.x range instead of the public IP address.</p><p>So, based on the above example, on server1 we need to add a line to the /etc/hosts like this:</p><pre>cat &gt;&gt; /etc/hosts &lt;&lt;EOF<br>192.168.15.21 server2.myprovider.com server2<br>EOF</pre><p><em>Note the double “&gt;&gt;” brackets. If you use a single “&gt;” one, you overwrite the entire file with just that line. You’ve been warned.</em></p><p>And on server2, we need to make sure server1 can be contacted using its private IP as well, so on that server, we perform:</p><pre>cat &gt;&gt; /etc/hosts &lt;&lt;EOF<br>192.168.15.20 server1.myprovider.com server1<br>EOF</pre><p>All of this can be made much fancier with your own DNS server and bindings, but again, this is beyond the scope and goes on the assumption you don’t mind doing this for the 2, 5 or 10 servers or so you may have. If you have a few hundred, then I wouldn’t expect you to be looking at a “Poor Man’s” setup.</p><p>On the server that you will be adding to the cluster, make sure that you can successfully ping that private IP address of the “main server”.<br>If tested OK, then still on that server (thus the one that isn’t yet part of the cluster), type:</p><pre>pvecm add server1</pre><p>Where “server1” is the “main server” (the one on which you first created the cluster). It will ask you for the root password for SSH for server1, and then does its thing with configuration.</p><p><strong>Note:</strong> If you have disabled password-based root logins using SSH, you may have to temporarily enable it. Using SSH keys would be a preferred method over passwords.</p><p>After this has been done, the node should automatically on your web-based GUI and can be verified from the CLI using:</p><pre>pvecm nodes</pre><p>If the nodes show up in the “pvecm nodes” command and GUI, then you have successfully created the cluster.</p><p><strong>Note:</strong> A note about a 2-node cluster and quorum <a href="http://pve.proxmox.com/wiki/Proxmox_VE_2.0_Cluster#Two_nodes_cluster_and_quorum_issues">can be found here</a>.</p><h4>Containers and VMs</h4><p>You can now create containers and VMs that can be migrated between the nodes.</p><p>You can either assign the private IP address directly (venet, only on OpenVZ containers) or as a network device (veth) attached to vmbr1.</p><p>The private IP address should be within the range of your specified netmask on vmbr1. So going by the above example of using 192.168.14.0/23, that’s anything between 192.168.14.1 and 192.168.15.254. Make sure the IP isn’t already used by another VM or a node (see initial notes, re 192.168.14.x for VMs).</p><p>If you fire up the VM, its private IP address should be ping-able from any server, and from within the container / VM, you can ping any private as well as public IP address (the latter thanks to masquerading configured with the tinc-up script). If this is not the case, the network configuration was not done correctly.</p><h4>Final notes</h4><p>You should now have at least one container / VM with a private IP address. Its good and well if this VM doesn’t need to be accessed from the outside world, but if you want to give it such access, you will need to use NAT on the server. This will instruct the node that incoming traffic on a particular port will need to be forwarded to a particular VM/</p><p>For example, TCP port 25 on 123.4.5.6 is forwarded to VM on IP 192.168.14.1:</p><pre>iptables -A FORWARD -p tcp -i vmbr0 -d 192.168.14.1 — dport 25 -m state — state NEW,ESTABLISHED,RELATED -j ACCEPT</pre><pre>iptables -t nat -A PREROUTING -i vmbr0 -p tcp — dport 25 -j DNAT — to-destination 192.168.14.1:25</pre><p>Note that this is just a simple guide to help you get started. More importantly, it doesn’t include any basic security measures such as a firewall (there are other articles about a firewall for Proxmox on this site [<a href="https://myatus.com/p/guide-firewall-and-router-with-proxmox/">here</a> and <a href="https://myatus.com/p/guide-firewall-and-router-with-proxmox-extending-its-us/">here</a>], which I will update when I can).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7bea2da550c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/moqume/poor-mans-proxmox-cluster-d7bea2da550c">Poor Man’s Proxmox Cluster</a> was originally published in <a href="https://medium.com/moqume">Moqume Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Watching TV on your Android via a Raspberry Pi]]></title>
            <link>https://medium.com/moqume/watching-tv-on-your-android-via-a-raspberry-pi-4ea00cc32b61?source=rss-a83111dd5f03------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ea00cc32b61</guid>
            <category><![CDATA[tv]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <dc:creator><![CDATA[Mike Green]]></dc:creator>
            <pubDate>Tue, 02 Apr 2013 20:04:30 GMT</pubDate>
            <atom:updated>2018-10-07T12:15:47.892Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*EnFdZ1ik2ASQ5vxu_AuWbQ.png" /></figure><p>During the long Easter holiday I’ve kept myself busy with a little pet project for my Raspberry Pi. So far I’ve been using the RPI as a small intranet server, DNS server and Proxy server. But it had plenty of room, both in RAM and storage, to do other things. As I had recently acquired a (dirt-cheap!) Android-based tablet, I was wondering if it would be possible to stream live TV directly to it.</p><p>There are plenty of commercial solutions available, as well as some apps, that stream directly over the Internet. But, as I had mentioned, the tablet was dirt cheap and so it should be indicative of the amount of money I was willing to spend.</p><p>I already owned a USB TV stick, which I used on my laptop, and wanted to use this as the receiver. It’s a <a href="http://www.pctvsystems.com/Products/ProductsEuropeAsia/DVBTT2products/PCTVnanoStickT2/tabid/248/language/en-GB/Default.aspx">PCTV Nanostick T2</a>, based on the Sony CXD2820R demodulator, which is (or was?) the only device to support the UK’s DVB-T2 format for HD reception.</p><p>The USB TV stick is directly supported by the 3.x kernel (as an em28xx device), and naturally, the RPI did too. So it was a matter of finding what software would stream from the TV source over the network, and what software that would be able to accept and display this stream — particularly on an Android device.</p><p>This is where <a href="http://xbmc.org/">XBMC</a> comes into play. Since version 12 of XBMC (“Frodo”), it is now possible to watch live TV via a PVR back-end. What’s great too, is that XBMC runs on a plethora of operating systems and devices, including Android. The app is not yet available in the Google Play store, so you need to <a href="http://xbmc.org/download/">manually download</a> and install it. Just note, that before you install it on your Android, you may need to enable the <em>Unknown sources</em> option found under the Android’s system settings (under the <em>Security</em> tab).</p><p><strong>Note!</strong> While the Raspberry Pi will detect the USB TV stick that is directly connected to it, it cannot provide enough power to it. This means it will not be able to tune into any channels. So the USB TV stick <strong>must</strong> be attached to a self-powered USB hub (which in turn is connected to the RPI, of course).</p><h4>Tvheadend</h4><p>So with the “front-end” sorted, all I needed was the back-end for the Raspberry Pi. I settled on using <a href="https://tvheadend.org/projects/tvheadend">Tvheadend</a>, because it is very lightweight and runs on the ARM device just fine. However, I didn’t install it from binary as, well, there wasn’t one available — at least not in individual form. Compiling is a breeze though, and the developers already have everything available for a .DEB package. I skipped building a .DEB package, simply for sake of simplicity, but used their init script, config files, etc.</p><p>To compile Tvheadend, you start by getting the necessary packages. Some I will list here are optional, but I prefer to cram as much “optional” stuff into a build, so I won’t need to recompile everything it when I do need it at one point.</p><pre>sudo apt-get install git build-essential \<br>  libavcodec-dev libavformat-dev libssl-dev \<br>  libavutil-dev libavahi-client-dev libcurl3 \<br>  w-scan</pre><p>After the packages have been installed, proceed to clone the source code of Tvheadend using git. This will create a directory called <em>tvheadend</em> based on the location where you are, generally <em>/home/pi/</em> if you’ve logged in via SSH.</p><pre>git clone git://github.com/tvheadend/tvheadend.git</pre><p>Now proceed to the directory and run the initial configuration. Running the configuration will check if you have the required packages installed, and fetch DVB scan data from a remote server.</p><pre>cd tvheadend<br>./configure</pre><p>If everything went well, you should not have received any fatal errors. You may see a few “fail” messages, but these are benign.</p><p>As I live in the London area, the Freeview transmitter is Crystal Palace. However, the source from which the configuration obtains the DVB scan data appears to be slightly outdated and may cause some hiccups. In my case, I’ve simply provided my own scan data using the previously installed <em>w_scan</em> application. You may skip this, if it doesn’t apply to you.</p><pre>w_scan -cGB -x &gt; ./data/dvb-scan/dvb-t/uk-CrystalPalace</pre><p>This will directly replace the file in <em>tvheadend/data/dvb-scan/dvb-t/uk-CrystalPalace</em>, so if you’re concerned, you may wish to make a copy first.</p><p>Then proceed to compile Tvheadend, which for obvious reasons will take a little longer on a Raspberry Pi than a conventional computer:</p><pre>make clean &amp;&amp; make</pre><h4>Installation</h4><p>Once it has been completed, you’re ready to install it. As mentioned earlier, Tvheadend already contains everything needed to build a .DEB package from which you could install it. However, I chose not to, and simply used some of the existing files to install it manually:</p><pre>sudo su<br>make install<br>ln -s /usr/local/bin/tvheadend /usr/bin/tvheadend</pre><pre>cp ./debian/tvheadend.init /etc/init.d/tvheadend<br>chmod +x /etc/init.d/tvheadend<br>update-rc.d tvheadend defaults</pre><pre>cp ./debian/tvheadend.default /etc/default/tvheadend<br>adduser --quiet --system --group --shell /bin/bash hts</pre><pre>mkdir -p &quot;/home/hts/.hts/tvheadend&quot;</pre><pre>cat &gt; /home/hts/.hts/tvheadend/superuser &lt;&lt;EOF<br>{<br>&quot;username&quot;: &quot;superadmin&quot;,<br>&quot;password&quot;: &quot;MySuperSecretPassword&quot;<br>}<br>EOF</pre><pre>chmod 600 /home/hts/.hts/tvheadend/superuser<br>chown -R hts:hts &quot;/home/hts/.hts&quot;</pre><pre>exit</pre><p>The one thing that you should pay attention to, is the portion here it creates the /home/hts/.hts/tvheadend/superuser file. The username and password provided here are only for sample purposes, and you should change this to something you’ve thought up yourself.</p><p>If you have a firewall setup on your RPI (and you should!), remember to open up the TCP ports 9981 and 9982 for the appropriate network. UDP is not required.</p><h4>Configuration</h4><p>Now that you have installed it, fire up Tvheadend:</p><pre>sudo service tvheadend start</pre><p>And configure it further at <a href="http://(ip/">http://(ip</a> address or domain name of your PI):9981. You will be prompted for a username and password, which was provided earlier in the superuser file.</p><p>Some guidance for configuration can be found in XBMC’s Wiki — it does not mention that after you’ve selected DVB input, you should tick the box Enabled found in the Adapter Configuration box, and then save the settings before it will perform an initial scan. You can follow its progress by expanding the window at the bottom (click the chevrons pointing upwards in the bottom-right corner).</p><p>Additionally, you need to setup the Access Control list, also found in the Configuration area, to allow/restrict access from devices. This is explained in more detail in the Tvheadend Wiki.</p><p>After this, you can configure XBMC, by going into its system settings, and enabling the Tvheadend HTSP Client add-on. Once that has been enabled, click Configure for it, and provide the necessary details, which at minimum is the IP or domain name for the Raspberry Pi. Finally, still within XBMC’s system settings, enable Live TV. You are now able to watch live TV! Unless …</p><h4>Bugs!</h4><p>There’s a bug with the Raspberry Pi firmware related to its USB. Or, there’s a problem with the USB itself. Either way, it affects many video streaming devices, such as webcams and TV USB sticks (like the em28xx devices). The result is that you may find yourself rather annoyed by the fact that live TV is barely “live”, and mostly consists of black screens or what appears to be a very bad signal. Looking at the logs for Tvheadend, you may notice many lines similar to this:</p><pre>Apr 1 21:45:02 raspberrypi tvheadend[13259]: TS: Sony CXD2820R/London: 490,000 kHz/BBC ONE: MPEG2AUDIO @ #102: Continuity counter error, 533 duplicate log lines suppressed<br>Apr 1 21:45:03 raspberrypi tvheadend[13259]: TS: Sony CXD2820R/London: 490,000 kHz/BBC ONE: MPEG2VIDEO @ #101: Continuity counter error, 5777 duplicate log lines suppressed<br>Apr 1 21:45:03 raspberrypi tvheadend[13259]: TS: Sony CXD2820R/London: 490,000 kHz/BBC ONE: MPEG2AUDIO @ #106: Continuity counter error, 121 duplicate log lines suppressed<br>Apr 1 21:45:03 raspberrypi tvheadend[13259]: TS: Sony CXD2820R/London: 490,000 kHz/BBC ONE: MPEG2AUDIO @ #102: Continuity counter error, 534 duplicate log lines suppressed</pre><p>Thankfully, this problem has been addressed by the Raspbian teams, and requires that you update your kernel (firmware). You can double-check the current version, which will likely produce something similar to this:</p><pre># uname -a<br>Linux raspberrypi 3.6.11+ #371 PREEMPT Thu Feb 7 16:31:35 GMT 2013 armv6l GNU/Linux</pre><p>The important bit is the #371 part here, which is the one that has the above described issue. Updating the kernel/firmware is slightly different than what you’d expect from most Debian distributions (which is simply apt-get a linux image), but Liam McLoughlin has created a simple script to help you with that. Here’s a quick how-to:</p><pre>sudo wget <a href="http://goo.gl/1BOfJ">http://goo.gl/1BOfJ</a> -O /usr/bin/rpi-update &amp;&amp; sudo chmod +x /usr/bin/rpi-update<br>sudo rpi-update</pre><p>Just let it run its course, which involves updating itself and then obtaining the latest firmware. If this is the first time you’ve run it, it will download about 42 Megabytes worth of files. After it has successfully completed downloading and installing, you need to reboot the Raspberry Pi. Once back up, the kernel/firmware version should have been updated to at least the following:</p><pre># uname -a<br>Linux raspberrypi 3.6.11+ #401 PREEMPT Fri Mar 29 22:59:09 GMT 2013 armv6l GNU/Linux</pre><p>Again, the important part here is the #401, changed from the previous #371.</p><p><strong>NOTE:</strong> If you still have all the original Raspbian bells and whistles installed, such as X-server/Gnome, then before you reboot the RPI, double check your available disk space.</p><h4>Crystal Palace scan file</h4><p>By request, the following is the scan file for Crystal Palace with which I receive the HD channels:</p><pre># — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — <br># file automatically generated by w_scan<br># (<a href="http://wirbel.htpc-forum.de/w_scan/index2.html">http://wirbel.htpc-forum.de/w_scan/index2.html</a>)<br>#! &lt;w_scan&gt; 20120605 1 0 TERRESTRIAL GB &lt;/w_scan&gt;<br># — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — <br># location and provider: &lt;add description here&gt;<br># date (yyyy-mm-dd) : 2013–06–15<br># provided by (opt) : &lt;your name or email here&gt;<br>#<br># T[2] [plp_id] [system_id] &lt;freq&gt; &lt;bw&gt; &lt;fec_hi&gt; &lt;fec_lo&gt; &lt;mod&gt; &lt;tm&gt; &lt;guard&gt; &lt;hi&gt; [# comment]<br># — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — <br>T 482000000 8MHz 3/4 NONE QAM64 8k 1/32 NONE # London<br>T 490000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE # London<br>T 514000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE # London<br>T 506000000 8MHz 3/4 NONE QAM64 8k 1/32 NONE # London<br>T 529833000 8MHz 3/4 NONE QAM64 8k 1/32 NONE # London<br>T2 0 16435 546000000 8MHz AUTO AUTO AUTO AUTO AUTO AUTO # London<br>T2 0 16435 746000000 8MHz AUTO AUTO AUTO AUTO AUTO AUTO # London</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ea00cc32b61" width="1" height="1" alt=""><hr><p><a href="https://medium.com/moqume/watching-tv-on-your-android-via-a-raspberry-pi-4ea00cc32b61">Watching TV on your Android via a Raspberry Pi</a> was originally published in <a href="https://medium.com/moqume">Moqume Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cookie law: To opt in or to opt out]]></title>
            <link>https://medium.com/moqume/cookie-law-to-opt-in-or-to-opt-out-4f186e82899f?source=rss-a83111dd5f03------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f186e82899f</guid>
            <category><![CDATA[personal]]></category>
            <category><![CDATA[cookies]]></category>
            <dc:creator><![CDATA[Mike Green]]></dc:creator>
            <pubDate>Sun, 08 Jul 2012 17:23:14 GMT</pubDate>
            <atom:updated>2018-10-07T12:21:12.527Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/883/1*jJcB09pteLHBaaSvkmeY4g.jpeg" /><figcaption>CC-BY <a href="https://commons.wikimedia.org/wiki/File:Cookie_jar.jpg">Wikimedia Commons</a></figcaption></figure><p>Since May 26 of 2012, the infamous “<a href="http://www.ico.gov.uk/for_organisations/privacy_and_electronic_communications/the_guide/cookies.aspx">cookie law</a>” has been in effect in the United Kingdom. While there have been many questions regarding its implementation on websites, most have settled on the “implied consent” method, as it was easiest to implement and had the least amount of impact on the visitors.</p><p>Using <a href="https://myatus.com/projects/cookillian/">Cookillian</a> on my own website, I had initially decided on using the strict method. It barred cookies outright and required the visitor to make an explicit decision about cookies. With this method, the average between opt in and out was nearly 50:50 down the middle. For June, I decided to change from explicit to implied consent, and as seen in the statistics below this changed the numbers significantly:</p><p>These numbers were taken from Cookillian’s statistics for the specified month, and takes into account those that ignored the alert. As you can see, at most 20% of the visitors (for the Czech Republic) had decided not to receive cookies. A combined average of 15.92% visitors decided not to receive cookies, which is certainly a significant difference between the near 50:50 split when using explicit consent.</p><p>I’m wondering whether this is simply a matter of convenience outweighing matters of e-privacy (as the EC has nicely named it). And while I do think it is important to let a visitor decide about cookies, was the law in itself really worth the effort — and aggravation? Time will tell.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f186e82899f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/moqume/cookie-law-to-opt-in-or-to-opt-out-4f186e82899f">Cookie law: To opt in or to opt out</a> was originally published in <a href="https://medium.com/moqume">Moqume Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WordPress caching and nonce lifespan]]></title>
            <link>https://medium.com/moqume/wordpress-caching-and-nonce-lifespan-bb357d984da9?source=rss-a83111dd5f03------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb357d984da9</guid>
            <category><![CDATA[caching]]></category>
            <category><![CDATA[nonce]]></category>
            <category><![CDATA[wordpress]]></category>
            <dc:creator><![CDATA[Mike Green]]></dc:creator>
            <pubDate>Mon, 18 Jun 2012 19:43:49 GMT</pubDate>
            <atom:updated>2018-10-07T12:28:00.732Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oO-htT4cTepJMiBUEZwQNQ.png" /></figure><p>A <a href="http://codex.wordpress.org/WordPress_Nonces">security feature available in WordPress</a> is a “nonce”. Generally, a “nonce” is a token that can only be used once and are often used to prevent unauthorised people from submitting data on behalf of another person. Let’s simplify that:</p><ul><li>Person A is given nonce “A”</li><li>Person B is given nonce “B”</li><li>Person B attempts to submit data to the server on behalf of person A</li><li>The server reads the submitted data from person B as “Person A with nonce ‘B’ is submitting data”. Knowing that Person A does not have nonce ‘B’, it ignores/denies the submitted data.</li></ul><p>WordPress differs by giving it a lifespan and allowing the nonce to be used more than once within that lifespan by the same person. And by the ‘same person’ it is meant a logged in WordPress user, or an anonymous user (visitor not logged in).</p><p>The benefit is that the server does not need to keep track what nonce it has given to any particular user. It just needs to know the user returning the nonce and the current time; based on that information, it creates another nonce and checks if it matches the one returned.</p><h4>Using time as part of a nonce</h4><p>As time varies, WordPress needs to allow for a nonce generated at 10:01 AM to be valid at 10:02 AM. It does this by using a time “tick” instead of the actual time, which is generated in two steps:</p><ol><li>First divide the lifespan of a nonce, in seconds, by two</li><li>Divide the <a href="http://en.wikipedia.org/wiki/Unix_timestamp">Unix timestamp</a> by the above value, and round it up using <em>ceil()</em></li></ol><p>By default, the lifespan is 86400 seconds, or 24 hours (and can be adjusted with the <em>nonce_life</em> filter). Half this, 12 hours, is 43200.</p><p>So at 10:01 AM on 18/06/2012, the Unix timestamp is 1340031660. Dividing that by 43200, rounded we get 31019. A minute later (10:02 AM), the timestamp is 1340031720. Dividing and rounding, we also end up with 31019. In fact, for the first 12 hours of the day this value will be the resulting “tick”.</p><p>The reason WordPress divides the timespan in two, is that it can determine if a nonce was created in the first or second half of its full lifespan, simply by incrementing a “tick” by one.</p><h4>Nonce time caveat</h4><p>Based on a 24-hour lifespan, a “tick” as calculated above is the same for each 12-hour span of a day. At 07:45 AM the “tick” is the same as 9:30 AM and 11:59 AM. But it will be one less than a “tick” created at 12:01 PM (a new 12-hour span within the day) or 15:30 PM.</p><p>Because of this, a WordPress nonce is not valid for <em>exactly</em> 24-hours from the moment that it was created, but <em>up to</em> 24 hours, depending how far into a 12-hour period a nonce was created.</p><h4>Nonces and WordPress Cache</h4><p>Nonces can also be used on the “public” side of WordPress, and can help reduce abuse of data submissions. My WordPress plugins use this, as do some others like <a href="http://wordpress.org/extend/plugins/contact-form-7/">Contact Form 7</a>.</p><p>As a nonce is often added as a (hidden) form element or using JavaScript, this means that it will also end up being cached by a WordPress plugin such as <a href="http://wordpress.org/extend/plugins/wp-super-cache/">WP Super Cache</a> or <a href="http://wordpress.org/extend/plugins/w3-total-cache/">W3 Total Cache</a>. This can cause some issues with nonce verification.</p><p>The main issue is how long a page is cached and <em>how</em> most caching plugins determine the age of a cached page. As mentioned earlier, a nonce “tick” is not valid for exactly 24 hours. On the other hand, the age of a cached page is determined from when it was first cached. So if a page is cached for 24 hours (or more), it allows the possibility for a nonce to expire and thus become invalid.</p><p>For example: a page is cached at 10:01 AM on 18/06/2012. The “tick” of used for the nonce at this time was 31019. 24 hours from that time, at 10:01 AM on 19/06/2012, the server calculates a “tick” to be 31021. But as the cached nonce was based on a “tick” of 31019, any attempt to use it for data submission would fail.</p><p>To avoid this, a page should be cached for at most 12 hours, provided the life-span for a nonce has not been changed from its default 24 hours. The author of WP Super Cache also provides <a href="http://wordpress.org/support/topic/plugin-contact-form-7-forms-not-sending-with-super-cache-enabled">an alternative solution</a>, though that may not be a suitable solution in all cases (ie., in AJAX that uses nonce on all pages).</p><h4>Cache garbage collection</h4><p>In WP Super Cache’s case, by default a cached page becomes stale after an hour, which is well less than the 12 hours. But for the stale page to be refreshed using its <em>Garbage Collection</em> feature (see the <em>Advanced</em> tab), the collection has to be done in time as well. For instance, if the cached page has become stale after an hour, but garbage collection is done every 24 hours, the stale page will still be used for up to 23 hours.</p><p>This is further complicated because the WordPress Cron (the scheduler for performing tasks) usually checks its schedule whenever a visitor accesses the website. On low-traffic websites, this could give large variations between the scheduled time versus actual time a task is performed (such as the garbage collection). In these instances, it would make better sense to use a UNIX Cron Job to call <em>wp-cron.php</em>, or to reduce the garbage collection time as much as possible.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb357d984da9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/moqume/wordpress-caching-and-nonce-lifespan-bb357d984da9">WordPress caching and nonce lifespan</a> was originally published in <a href="https://medium.com/moqume">Moqume Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[World IPv6 Launch — Success!]]></title>
            <link>https://medium.com/moqume/world-ipv6-launch-success-7ecd004f4ae9?source=rss-a83111dd5f03------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ecd004f4ae9</guid>
            <category><![CDATA[projects]]></category>
            <category><![CDATA[ipv6]]></category>
            <dc:creator><![CDATA[Mike Green]]></dc:creator>
            <pubDate>Thu, 07 Jun 2012 02:34:41 GMT</pubDate>
            <atom:updated>2018-10-07T12:32:01.689Z</atom:updated>
            <content:encoded><![CDATA[<h3>World IPv6 Launch — Success!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*eFC_SRDkfW-XNtIefMg2yA.png" /></figure><p>Did you notice a near-total collapse of the Internet today? Couldn’t Google if <a href="http://www.telegraph.co.uk/technology/google/6161567/The-20-funniest-suggestions-from-Google-Suggest.html">Gordon Brown owes you money</a>? The stream of Facebook pokes suddenly stopped? No? That’s because the Internet kept working just fine, despite that today marks an important event in its history: 06/06/2012 was <a href="http://www.worldipv6launch.org/">World IPv6 Launch day</a>.</p><h4>What?</h4><p>So what’s this all about, and why is it important? Well, it’s a bit of geek talk, so let’s try to simplify things a little:</p><p>Everything on the Internet needs to be reachable one way or another. This is where an IP address comes into play. Think of it as a telephone number.</p><p>When you type in a website’s URL in the browser, the browser asks a DNS server (and think of that as a giant phone book/contact list) what the IP address is. Once it has an answer, it starts dialing, er, connecting.</p><h4>So?</h4><p>This has worked fine since the Internet’s inception. And with a little more than 4 billion IP addresses available, that should keep everyone happy. And until February 2011, that was so. On the 3rd of that month, <a href="http://www.iana.org/">IANA</a> gave out its very last set of IP addresses, which are now in the hands of various organisations authorised to distribute them to ISPs and others.</p><p>And these organisations, despite some very strict rules, are handing them out like hot cakes as, well, the Internet is growing rapidly and needs to be fed. The Asia/Pacific region ran out of its allotment shortly after IANA handed them their last set of IP addresses, in April 2011 to be exact. Europe is about to run out too, <a href="http://www.potaroo.net/tools/ipv4/">currently estimated</a> to be in August 2012.</p><h4>Now what!</h4><p>So how does one solve this problem? Just how telephone numbers have grown from being just four, five digits long to a dozen or so digits, you make the IP address longer so it will fit more. Easy, right?</p><p>Well, putting it that way, yes it is. In practice, it’s a different story. In 1998, they started working on the Next Generation Internet Protocol (IPng), which they have subsequently renamed IPv6. They increased the length of the current IP address from 32 bits (think of them as digits) to 128 bits. That is quite a jump. In fact, it’s such a large jump that you could give each dust particle floating around in your office or house its own IPv6 address and still have plenty left.</p><p>Equipment, and software, built around IPv4 weren’t designed for this. Upgrading them was a painfully slow — and expensive — task. But now we’ve hit a critical point where we must start using IPv6, or risk the future of the Internet. And so, World IPv6 Launch day came to be.</p><h4>Who’s taking part?</h4><p>Some of the Internet’s largest companies, such as <a href="http://google.com/">Google</a>, <a href="http://www.facebook.com/">Facebook</a>, Microsoft <a href="http://bing.com/">Bing</a> and <a href="http://www.yahoo.com/">Yahoo</a>, as well as ISPs like the Dutch <a href="http://xs4all.nl/">XS4ALL</a>, well known for its long participation in IPv6 projects. Equipment manufacturers like <a href="http://www.cisco.com/">Cisco</a> and <a href="http://www.dlink.com/">D-Link</a> are also participating, which is not only important for ISPs but home users alike.</p><p>There are roughly <a href="http://www.worldipv6launch.org/participants/?q=1">3000 website operators</a> that are participating, including, you’ve guessed it, Myatu’s. In fact, this website has been accessible via IPv6 since 2009, but that was through a separate address (and now through its main address — you could be using IPv6 right now!).</p><h4>And how does one get IPv6?</h4><p>Most browsers are now ready for IPv6, and so are most operating systems (Windows, Linux). But your ISP needs to support IPv6 as well, and you can perform a quick test at <a href="http://test-ipv6.com/">Test IPv6</a>, if you’d like to find out if your browser and ISP are using IPv6.</p><p>If you are a website owner, there are various methods of getting IPv6 connectivity. If you are not that technically minded, I can highly recommend <a href="http://www.cloudflare.com/">CloudFlare</a>, which this website is using as well. Not only does this add an extra layer of security and help speed up your wesbite, they also provide a <a href="https://www.cloudflare.com/ipv6-challenge">1-click setting</a> to enable IPv6.</p><p>For those with a bit more technical know-how, I’ve mentioned in <a href="https://myatus.com/p/quick-debianubuntu-networking-tips/">other posts</a> how to enable 6-to-4 tunneling, which can be used in conjunction with <a href="http://he.com/">Hurricane Electric</a>’s or <a href="http://www.sixxs.net/">SixXS</a>’ free tunnel broker services. This is particularly of interest to those who’s hosting provider does not have native IPv6 support.</p><p>If you prefer to use native IPv6 instead, you need to find a hosting provider that provides it. I currently use two providers for my servers, both of which support native IPv6: <a href="http://www.ovh.co.uk/">OVH</a> and <a href="http://edis.at/">Edis</a>.</p><h4>Thus…</h4><p>The fact that today went without any serious incidents that impacted the Internet, IPv6 will be a definitive replacement for IPv4. If you haven’t already, now is the time to start upgrading your equipment and software.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ecd004f4ae9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/moqume/world-ipv6-launch-success-7ecd004f4ae9">World IPv6 Launch — Success!</a> was originally published in <a href="https://medium.com/moqume">Moqume Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>