<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Programming on yomimono - something to read</title>
    <link>http://localhost:1313/tags/programming/</link>
    <description>Recent content in Programming on yomimono - something to read</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Fri, 04 Mar 2022 18:00:00 +0000</lastBuildDate>
    <atom:link href="http://localhost:1313/tags/programming/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Chamelon: MVP persistent block storage for MirageOS</title>
      <link>http://localhost:1313/blog/2022/03/04/chamelon/</link>
      <pubDate>Fri, 04 Mar 2022 18:00:00 +0000</pubDate>
      <guid>http://localhost:1313/blog/2022/03/04/chamelon/</guid>
      <description>&lt;p&gt;TL;DR: I wrote a &lt;a href=&#34;https://github.com/mirage/mirage-kv&#34;&gt;key-value store&lt;/a&gt; for &lt;a href=&#34;https://mirage.io&#34;&gt;MirageOS&lt;/a&gt; backed by &lt;a href=&#34;https://github.com/mirage/mirage-block&#34;&gt;block storage&lt;/a&gt;. It&amp;rsquo;s called &lt;a href=&#34;https://github.com/yomimono/chamelon&#34;&gt;chamelon&lt;/a&gt;, it&amp;rsquo;s based off &lt;a href=&#34;https://github.com/littlefs-project/littlefs&#34;&gt;LittleFS&lt;/a&gt;, and if you&amp;rsquo;re brave, you can use it to store data.  Examples are available: &lt;a href=&#34;https://github.com/yomimono/url-shortener&#34;&gt;a URL shortener&lt;/a&gt; and an &lt;a href=&#34;https://github.com/yomimono/oauth2_server&#34;&gt;OAuth2 authorization server&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;In English: I couldn&amp;rsquo;t save or load files before, and now I could. Wowzers!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Faithful High Resolution Textures</title>
      <link>http://localhost:1313/blog/2022/02/25/faithful-high-resolution-textures/</link>
      <pubDate>Fri, 25 Feb 2022 18:00:00 +0000</pubDate>
      <guid>http://localhost:1313/blog/2022/02/25/faithful-high-resolution-textures/</guid>
      <description>&lt;p&gt;I discovered a while ago that some games companies charge extra for &amp;ldquo;high resolution textures&amp;rdquo; for their games. This phrase stuck with me until it finally found an outlet: it obviously needs to be rendered in glorious 4-color CGA as a puzzle solution to the 1987 DOS implementation of the popular American game show, &amp;ldquo;Wheel of Fortune&amp;rdquo;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Whacking the Bitcoin Piñata</title>
      <link>http://localhost:1313/blog/2018/04/17/whacking-the-bitcoin-pinata/</link>
      <pubDate>Tue, 17 Apr 2018 18:00:00 +0000</pubDate>
      <guid>http://localhost:1313/blog/2018/04/17/whacking-the-bitcoin-pinata/</guid>
      <description>&lt;blockquote&gt;&#xA;&lt;p&gt;@yomimono or @hannesm surely know if people have tried crowbar on the BTC Piñata.&#xA;&amp;ndash; &lt;a href=&#34;https://mastodon.social/@Kensan/99536958321475407/&#34;&gt;@kensan@mastodon.social&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;tl;dr - &lt;a href=&#34;https://github.com/yomimono/ocaml-test-x509&#34;&gt;yes&lt;/a&gt;, and it seems that ocaml-x509 is not trivially easy to trick.&lt;/p&gt;&#xA;&lt;h2 id=&#34;background&#34;&gt;Background&lt;/h2&gt;&#xA;&lt;h3 id=&#34;the-bitcoin-piñata&#34;&gt;The Bitcoin Piñata&lt;/h3&gt;&#xA;&lt;p&gt;In 2015 David Kaloper-Mersinjak and Hannes Mehnert released &lt;a href=&#34;https://github.com/mirleft/ocaml-tls&#34;&gt;ocaml-tls&lt;/a&gt;, an implementation of TLS (formerly known as SSL) written fully in OCaml.  A full writeup of the stack is available in their &lt;a href=&#34;https://usenix15.nqsb.io/&#34;&gt;Usenix Security 2015 paper&lt;/a&gt;, and as &lt;a href=&#34;https://mirage.io/blog/announcing-mirage-25-release&#34;&gt;a series of blog posts on mirage.io&lt;/a&gt;.  To accompany the release they also deployed a fully-automated bug bounty for the security stack &amp;ndash; the &lt;a href=&#34;https://ownme.ipredator.se&#34;&gt;bitcoin piñata&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The piñata will establish TLS connections only with endpoints presenting a certificate signed by its own, undisclosed certificate authority, but allows an attacker to easily listen to the encrypted traffic.  The piñata always sends the same plaintext in such a connection: the private key to a wallet containing approximately 10 bitcoin.  If the attacker can decrypt the ciphertext, or trick the piñata into negotiating a TLS connection with another host and disclosing the key, the information (and therefore the money) is theirs.&lt;/p&gt;&#xA;&lt;h3 id=&#34;crowbar&#34;&gt;Crowbar&lt;/h3&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://github.com/stedolan/crowbar&#34;&gt;Crowbar&lt;/a&gt; is a library for writing tests.  It combines a property-based API (like QuickCheck) with a coverage-driven generator of test cases (like the fuzzer American Fuzzy Lop).  Crowbar tries to find counterexamples to stated properties by prioritizing the generation of test cases which touch more code.  It is &lt;a href=&#34;https://github.com/stedolan/crowbar/issues/2&#34;&gt;very good at finding counterexamples&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;testing-ocaml-x509&#34;&gt;Testing ocaml-x509&lt;/h2&gt;&#xA;&lt;p&gt;TLS connections are usually authenticated via X509 certificates.  ocaml-tls uses &lt;a href=&#34;https://github.com/mirleft/ocaml-x509&#34;&gt;ocaml-x509&lt;/a&gt; for this purpose, which is written as a standalone library.  There is a clear separation of concerns between ocaml-x509 and ocaml-tls, and a straightforward API for certificate operations in ocaml-x509; both features help tremendously in writing tests for certificate handling.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Posts and Talks Elsewhere</title>
      <link>http://localhost:1313/blog/2017/12/23/posts-talks-2017/</link>
      <pubDate>Sat, 23 Dec 2017 18:00:00 +0000</pubDate>
      <guid>http://localhost:1313/blog/2017/12/23/posts-talks-2017/</guid>
      <description>&lt;p&gt;I&amp;rsquo;ve done a lot of stuff in the last half of 2017, but not much of it has made it here.  Here&amp;rsquo;s a roundup of things published/spoken/embroidered/etc in other places:&lt;/p&gt;</description>
    </item>
    <item>
      <title>NAT your own packets</title>
      <link>http://localhost:1313/post/2017-10-09-nat-your-own-packets/</link>
      <pubDate>Mon, 09 Oct 2017 00:03:00 +0000</pubDate>
      <guid>http://localhost:1313/post/2017-10-09-nat-your-own-packets/</guid>
      <description>&lt;p&gt;I&amp;rsquo;ve been talking about &lt;a href=&#34;http://localhost:1313/blog/2015/04/01/things-routers-do-network-address-translation/&#34;&gt;network address translation&lt;/a&gt; here for a while, including &lt;a href=&#34;http://localhost:1313/blog/2015/04/02/lets-play-network-address-translation/&#34;&gt;instructions on building your own NAT device&lt;/a&gt; with MirageOS. The library behind those posts, &lt;a href=&#34;https://github.com/mirage/mirage-nat&#34;&gt;mirage-nat&lt;/a&gt;, went on to back &lt;a href=&#34;https://github.com/talex5/qubes-mirage-firewall&#34;&gt;talex5&amp;rsquo;s unikernel firewall for QubesOS&lt;/a&gt;, but was unreleased and essentially unmaintained between late 2015 and early 2017.&lt;/p&gt;&#xA;&lt;p&gt;At the &lt;a href=&#34;https://mirage.io/blog/2017-march-hackathon-roundup&#34;&gt;March 2017 MirageOS hack retreat&lt;/a&gt; in Marrakesh, talex5 convinced me to do some much-needed maintenance on this library. After having let it age between March and October, I was persuaded to release &lt;a href=&#34;https://github.com/mirage/mirage-nat/releases/tag/v1.0.0&#34;&gt;a version with the hippest latest build system&lt;/a&gt; last week. It comes with &lt;a href=&#34;https://github.com/mirage/mirage-nat/tree/master/example&#34;&gt;an example of how you might use it&lt;/a&gt; in a MirageOS unikernel that does no additional firewalling. A more compelling example of how you might use mirage-nat (and MirageOS) is still available in &lt;a href=&#34;https://github.com/talex5/qubes-mirage-firewall&#34;&gt;qubes-mirage-firewall&lt;/a&gt;, which I recommend highly if you’re using QubesOS.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Crowbar Your Favorite Library for Fun and Bugfixes</title>
      <link>http://localhost:1313/blog/2017/04/26/crowbar-dhcp/</link>
      <pubDate>Wed, 26 Apr 2017 03:14:49 +0000</pubDate>
      <guid>http://localhost:1313/blog/2017/04/26/crowbar-dhcp/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://github.com/stedolan/crowbar&#34;&gt;Crowbar&lt;/a&gt; is a tool that combines &lt;a href=&#34;https://github.com/stedolan/ocaml-afl-persistent&#34;&gt;afl-persistent&lt;/a&gt;&amp;rsquo;s instrumentation with &lt;a href=&#34;https://github.com/c-cube/qcheck&#34;&gt;quickcheck&lt;/a&gt;-like property-based testing.  &lt;a href=&#34;http://lcamtuf.coredump.cx/afl&#34;&gt;afl-fuzz&lt;/a&gt; is a great tool for detecting crashes, but Crowbar helps us go a step farther and automatically discover inputs which cause our program to no longer have the properties we expect it to have.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://github.com/linuxkit/linuxkit/blob/master/projects/miragesdk/why-dhcp.md&#34;&gt;For reasons that don&amp;rsquo;t need exploring at this juncture&lt;/a&gt;, I first thought to apply Crowbar to &lt;a href=&#34;https://github.com/yomimono/charrua-client&#34;&gt;charrua-client&lt;/a&gt;, a library which implements &lt;a href=&#34;http://www.tcpipguide.com/free/t_TCPIPDynamicHostConfigurationProtocolDHCP.htm&#34;&gt;the DHCP state machine&lt;/a&gt; from a client perspective.  Code snippets below are taken from &lt;a href=&#34;https://github.com/yomimono/somerandompacket/tree/master/dhcp&#34;&gt;the dhcp directory in my somerandompacket repository on GitHub&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Fun with Opam: Advice to my Past Self</title>
      <link>http://localhost:1313/blog/2015/07/27/fun-with-opam-advice-to-my-past-self/</link>
      <pubDate>Mon, 27 Jul 2015 10:13:10 +0000</pubDate>
      <guid>http://localhost:1313/blog/2015/07/27/fun-with-opam-advice-to-my-past-self/</guid>
      <description>&lt;p&gt;Most instructions on how to get started with OCaml packages now advise the user to get started with &lt;a href=&#34;http://opam.ocaml.org/&#34;&gt;opam&lt;/a&gt;, which is excellent advice.  Getting up and running with opam is pretty easy, but I wasn&amp;rsquo;t sure where to go from there when I wanted to &lt;em&gt;modify&lt;/em&gt; other people&amp;rsquo;s packages and use the modifications in my environment.  I wish I&amp;rsquo;d realized that &lt;a href=&#34;http://opam.ocaml.org/doc/Packaging.html&#34;&gt;the documentation for making packages&lt;/a&gt; has a lot of applicable advice for that use case, as well as the apparent target (making your own packges from scratch).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Doing Nothing in Mirage</title>
      <link>http://localhost:1313/blog/2014/07/25/doing-nothing-in-mirage/</link>
      <pubDate>Fri, 25 Jul 2014 13:30:49 +0000</pubDate>
      <guid>http://localhost:1313/blog/2014/07/25/doing-nothing-in-mirage/</guid>
      <description>&lt;p&gt;It&amp;rsquo;s Northern Hemisphere summer right now, and in Wisconsin we&amp;rsquo;re having one of the loveliest ones I can remember.  Today the temperature is hovering right at pleasant, there are high clouds blowing across the sky, the breeze is soothing, and birds are singing all over the place.  It is not, in short, programming weather.  It is sit-outside, read-a-novel, do-nothing weather.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://flic.kr/p/jWqcS&#34;&gt;&lt;figure class=&#34;center&#34;&gt;&lt;img src=&#34;http://localhost:1313/images/bicycle_tree.jpg&#34;&#xA;    alt=&#34;Sunbeams stream through the leaves of a large tree, beneath which is a bicycle.&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;h4&gt;Yes, this sort of thing.&lt;/h4&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;We don&amp;rsquo;t often let our programs slack off, even when we let ourselves take a peaceful day.  I got to wondering (staring off into space, watching the shadows cast by sun-dappled leaves) what the most trivial, do-nothing Mirage project would look like, and how it could be constructed with a minimum of activity and a maximum of understanding.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[] dothraki@iBook:~$ mkdir trivial&#xA;[] dothraki@iBook:~$ cd trivial/&#xA;[] dothraki@iBook:~/trivial$ ls -alh&#xA;total 16K&#xA;drwxrwxr-x   2 dothraki dothraki 4.0K Jul 23 13:17 .&#xA;drwxr-xr-x 161 dothraki dothraki  12K Jul 23 13:17 ..&#xA;[] dothraki@iBook:~/trivial$ mirage configure --xen&#xA;[ERROR]      No configuration file config.ml found.&#xA;You&amp;#39;ll need to create one to let Mirage know what to do.&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Okay, we&amp;rsquo;ll have to do at least one thing to make this work.  Mirage uses &lt;code&gt;config.ml&lt;/code&gt; to programmatically generate a &lt;code&gt;Makefile&lt;/code&gt; and &lt;code&gt;main.ml&lt;/code&gt; when you invoke &lt;code&gt;mirage --configure&lt;/code&gt;.  &lt;code&gt;main.ml&lt;/code&gt; uses instructions from &lt;code&gt;config.ml&lt;/code&gt; to satisfy module types representing driver requirements for your application, then begins running the threads you requested that it run.  That all sounds an awful lot like work; maybe we can get away with not asking for anything.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[] dothraki@iBook:~/trivial$ touch config.ml&#xA;[] dothraki@iBook:~/trivial$ mirage configure --xen&#xA;Mirage      Using scanned config file: config.ml&#xA;Mirage      Processing: /home/dothraki/trivial/config.ml&#xA;Mirage      =&amp;gt; rm -rf /home/dothraki/trivial/_build/config.*&#xA;Mirage      =&amp;gt; cd /home/dothraki/trivial &amp;amp;&amp;amp; ocamlbuild -use-ocamlfind -tags annot,bin_annot -pkg mirage config.cmxs&#xA;empty       Using configuration: /home/dothraki/trivial/config.ml&#xA;empty       0 jobs []&#xA;empty       =&amp;gt; ocamlfind printconf path&#xA;empty       Generating: main.ml&#xA;empty       Now run &amp;#39;make depend&amp;#39; to install the package dependencies for this unikernel.&#xA;[] dothraki@iBook:~/trivial$ ls&#xA;_build  config.ml  empty.xl  log  main.ml  Makefile&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;That seems like a great start!  Maybe we can trivially achieve our dream of doing nothing.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[] dothraki@iBook:~/trivial$ make depend&#xA;opam install mirage-xen --verbose&#xA;[NOTE] Package mirage-xen is already installed (current version is 1.1.1).&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Resting on our laurels.  Excellent.  (In keeping with the lazy theme of this post, I&amp;rsquo;ll elide the &lt;code&gt;make depend&lt;/code&gt; step from future examples, but if you&amp;rsquo;re playing along at home you may discover that you need to run it when you introduce new complexity in pursuit of perfect non-action.)&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[] dothraki@iBook:~/trivial$ make&#xA;ocamlbuild -classic-display -use-ocamlfind -pkgs lwt.syntax,mirage-types.lwt -tags &amp;#34;syntax(camlp4o),annot,bin_annot,strict_sequence,principal&amp;#34; -cflag -g -lflags -g,-linkpkg,-dontlink,unix main.native.o&#xA;ocamlfind ocamldep -package mirage-types.lwt -package lwt.syntax -syntax camlp4o -modules main.ml &amp;gt; main.ml.depends&#xA;ocamlfind ocamlc -c -g -annot -bin-annot -principal -strict-sequence -package mirage-types.lwt -package lwt.syntax -syntax camlp4o -o main.cmo main.ml&#xA;+ ocamlfind ocamlc -c -g -annot -bin-annot -principal -strict-sequence -package mirage-types.lwt -package lwt.syntax -syntax camlp4o -o main.cmo main.ml&#xA;File &amp;#34;main.ml&amp;#34;, line 8, characters 2-13:&#xA;Error: Unbound module OS&#xA;Command exited with code 2.&#xA;make: *** [main.native.o] Error 10&#xA;[] dothraki@iBook:~/trivial$ &#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Oh, bother.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Set the Evil Bit</title>
      <link>http://localhost:1313/blog/2014/07/08/how-to-set-the-evil-bit/</link>
      <pubDate>Tue, 08 Jul 2014 15:23:55 +0000</pubDate>
      <guid>http://localhost:1313/blog/2014/07/08/how-to-set-the-evil-bit/</guid>
      <description>&lt;p&gt;Our mission: fuzzing &lt;a href=&#34;http://localhost:1313/blog/2014/07/07/parsers-optional/&#34;&gt;TCP options&lt;/a&gt; from &lt;code&gt;scapy&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Our target: the &lt;code&gt;echo&lt;/code&gt; service from &lt;code&gt;mirage-tcpip/examples/services.ml&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Outcome: a revision on a widely-used OCaml dependency, gleeful murder and resurrection of several EC2 instances, something to brag to my mom about, a look at a case worse than failure, and great justice.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Parsers Optional</title>
      <link>http://localhost:1313/blog/2014/07/07/parsers-optional/</link>
      <pubDate>Mon, 07 Jul 2014 12:49:38 +0000</pubDate>
      <guid>http://localhost:1313/blog/2014/07/07/parsers-optional/</guid>
      <description>&lt;p&gt;Friends, I have spoken to you of &lt;a href=&#34;http://localhost:1313/blog/2014/06/03/the-minnesota-goodbye/&#34;&gt;TCP&lt;/a&gt; and of &lt;a href=&#34;http://localhost:1313/blog/2014/05/22/throwing-some-fuzzy-dice/&#34;&gt;fuzzing&lt;/a&gt;.  Next I will speak to you of both, but today, I will speak to you of TCP options.  If you&amp;rsquo;re here for the pwnage, sit tight; it&amp;rsquo;s coming.&lt;/p&gt;&#xA;&lt;h3 id=&#34;what-even-is-tcp-anyway&#34;&gt;What Even Is TCP Anyway&lt;/h3&gt;&#xA;&lt;p&gt;Here&amp;rsquo;s the lazy way of explaining it: TCP is the abstraction layer that allows you to pretend that network communication works in a logical, orderly, reliable fashion when you&amp;rsquo;re writing an application.  Reading data and having it always be in the order it was sent?  TCP.  Being able to know whether a connection is open or closed?  TCP.  Knowing the difference between data coming from two separate processes on the same remote host?  TCP.  (There are other ways to get these guarantees, but the vast majority of Internet traffic that needs them gets them via TCP.)&lt;/p&gt;&#xA;&lt;p&gt;On a less abstract level, TCP is a header (one of several!) that your operating system slaps on your network traffic before shipping it over the wire, on the way to its final destination.  For damn near all the information on TCP you can shake a stick at, you can consult &lt;a href=&#34;http://www.rfc-editor.org/rfc/rfc793.txt&#34;&gt;RFC 793&lt;/a&gt; directly.  The header summary, most relevant for our exploration, is reproduced below:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;0                   1                   2                   3   &#xA;0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 &#xA;+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&#xA;|          Source Port          |       Destination Port        |&#xA;+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&#xA;|                        Sequence Number                        |&#xA;+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&#xA;|                    Acknowledgment Number                      |&#xA;+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&#xA;|  Data |           |U|A|P|R|S|F|                               |&#xA;| Offset| Reserved  |R|C|S|S|Y|I|            Window             |&#xA;|       |           |G|K|H|T|N|N|                               |&#xA;+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&#xA;|           Checksum            |         Urgent Pointer        |&#xA;+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&#xA;|                    Options                    |    Padding    |&#xA;+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&#xA;|                             data                              |&#xA;+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Everything here is a fixed-length field except for &lt;code&gt;Options&lt;/code&gt;, &lt;code&gt;Padding&lt;/code&gt;, and &lt;code&gt;data&lt;/code&gt;, all of which are optional.  &lt;code&gt;Data&lt;/code&gt; is up to the application, when it&amp;rsquo;s present (and is also frequently referred to as &lt;code&gt;payload&lt;/code&gt;).  When you loaded this web page, TCP packets were sent from my server at &lt;code&gt;somerandomidiot.com&lt;/code&gt; to your computer, and the contents of the &lt;code&gt;data&lt;/code&gt; field were these very words that you&amp;rsquo;re reading right now.  TCP is &lt;code&gt;data&lt;/code&gt;-agnostic; it only cares that your payload arrives intact, not what&amp;rsquo;s in it.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;Options&lt;/code&gt;, on the other hand, are very much TCP&amp;rsquo;s concern.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Tying the Knot</title>
      <link>http://localhost:1313/blog/2014/04/02/tying-the-knot/</link>
      <pubDate>Wed, 02 Apr 2014 14:58:53 +0000</pubDate>
      <guid>http://localhost:1313/blog/2014/04/02/tying-the-knot/</guid>
      <description>&lt;blockquote&gt;&#xA;&lt;p&gt;&amp;ldquo;This is a pretty strange piece of code,&#xA;and it may take a few moments of thought&#xA;to figure out what&amp;rsquo;s going on.&amp;rdquo;&lt;/p&gt;&#xA;&lt;p&gt;&amp;ndash; Real World OCaml&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;A few weeks ago, &lt;a href=&#34;http://chenlin.io&#34;&gt;fellow Hacker Schooler Chen Lin&lt;/a&gt; and I were trying to solve a simple graph problem in Haskell.  I was all ready to charge forward with something quite like &lt;a href=&#34;http://pages.cs.wisc.edu/~siff/CS367/Notes/graphs.html&#34;&gt;the Java implementation I learned back in undergrad&lt;/a&gt;, but my fellow Hacker Schooler had some hesitation around whether this kind of structure would work in Haskell.&lt;/p&gt;&#xA;&lt;p&gt;After a little bit of Googling, I found out that the canonical solution in Haskell involves something intriguingly dubbed &lt;a href=&#34;http://www.haskell.org/haskellwiki/Tying_the_Knot&#34;&gt;tying the knot&lt;/a&gt;.  I stared blankly at this HaskellWiki page with my fellow Hacker Schooler, trying to understand it quickly enough to have a useful conversation about it, and failed.  We threw a couple of other ideas around and then decided to both pursue other projects.  I moved on, Chen moved on, and I&amp;rsquo;m not sure either of us thought much about it&amp;hellip;&lt;/p&gt;&#xA;&lt;p&gt;&amp;hellip;until yesterday, when I ran into &lt;a href=&#34;https://realworldocaml.org/v1/en/html/imperative-programming-1.html#memoization-and-dynamic-programming&#34;&gt;tying the knot&lt;/a&gt; again.  This time, it was hiding deep within (of all things!) the chapter on imperative programming in &lt;a href=&#34;https://realworldocaml.org&#34;&gt;Real World OCaml&lt;/a&gt;, and I was unhurried and determined.  &amp;ldquo;Abstract concept, I am going to understand you &lt;em&gt;so hard&lt;/em&gt;,&amp;rdquo; I thought, jaw set.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Arriving At the Mirage</title>
      <link>http://localhost:1313/blog/2014/03/24/arriving-at-the-mirage/</link>
      <pubDate>Mon, 24 Mar 2014 17:57:37 +0000</pubDate>
      <guid>http://localhost:1313/blog/2014/03/24/arriving-at-the-mirage/</guid>
      <description>&lt;p&gt;When last we left our hero, I was strugging valiantly to get a &lt;a href=&#34;http://www.openmirage.org&#34;&gt;Mirage unikernel&lt;/a&gt; version of this blog running on Amazon EC2.  All unikernels built and shipped off to EC2 would begin booting, but never become pingable or reachable on TCP port 80.  &lt;code&gt;ec2-get-console-output&lt;/code&gt; on any instance running a Mirage unikernel would show the beginning stages of a &lt;a href=&#34;http://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol&#34;&gt;DHCP transaction&lt;/a&gt;, then the disappointing &lt;code&gt;RX exn Invalid_argument(&amp;quot;String.sub&amp;quot;)&lt;/code&gt;, then&amp;hellip; silence.&lt;/p&gt;&#xA;&lt;p&gt;When all you had for many years was a hammer, stuff is still going to look an awful lot like nails to you, even if it&amp;rsquo;s pretty distinctly screw-shaped.  I wanted to take a &lt;a href=&#34;http://www.tcpdump.org&#34;&gt;packet trace&lt;/a&gt; of this transaction pretty badly.  I could do three things that were &lt;em&gt;almost&lt;/em&gt; like this:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;get a packet trace of another machine getting a DHCP lease on EC2&lt;/li&gt;&#xA;&lt;li&gt;get a packet trace of a unikernel getting a DHCP lease on my local Xen server&lt;/li&gt;&#xA;&lt;li&gt;print out an awful lot of diagnostic data from the EC2 unikernel and read it from the console&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Trying to draw some conclusions from the first option above led me down the wrong path for about a day or so.  I did manage to cause the DHCP client to fail on my local Xen server by sending a DHCP reply packet with no &lt;code&gt;server-identifier&lt;/code&gt; set, using &lt;code&gt;scapy&lt;/code&gt; and some hackery to cause the &lt;code&gt;xid&lt;/code&gt; to always match:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Advancing Toward the Mirage</title>
      <link>http://localhost:1313/blog/2014/03/16/advancing-toward-the-mirage/</link>
      <pubDate>Sun, 16 Mar 2014 15:11:09 +0000</pubDate>
      <guid>http://localhost:1313/blog/2014/03/16/advancing-toward-the-mirage/</guid>
      <description>&lt;p&gt;I left off last time telling you about &lt;a href=&#34;http://localhost:1313/blog/2014/03/14/its-a-mirage/&#34;&gt;getting Mirage to not work&lt;/a&gt;.  I&amp;rsquo;m still working hard to get this blog &amp;ndash; yes, this one you&amp;rsquo;re reading now &amp;ndash; up and running as a unikernel on EC2.&lt;/p&gt;&#xA;&lt;p&gt;It became clear to me last week that I needed to fork my own instance of the &lt;code&gt;mirage-tcpip&lt;/code&gt; repository and compile my kernels with it, if I were to make any progress in debugging the DHCP problems I was having.  A few naive attempts to monkey with version of &lt;code&gt;mirage-tcpip&lt;/code&gt; downloaded by &lt;code&gt;opam&lt;/code&gt; weren&amp;rsquo;t successful, so I set about to figure out how actual OCaml developers develop in OCaml with &lt;code&gt;opam&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;First stop: &lt;a href=&#34;https://opam.ocaml.org/doc/Developing.html&#34;&gt;the opam documentation on doing tricky things.&lt;/a&gt;  This is a little short of a step-by-step &amp;ldquo;do this, dorp&amp;rdquo; guide, unfortunately; here&amp;rsquo;s what I end up doing, and it sorta seems to work.&lt;/p&gt;</description>
    </item>
    <item>
      <title>It&#39;s a mirage! (Or, how to shave a yak.)</title>
      <link>http://localhost:1313/blog/2014/03/14/its-a-mirage/</link>
      <pubDate>Fri, 14 Mar 2014 15:53:00 +0000</pubDate>
      <guid>http://localhost:1313/blog/2014/03/14/its-a-mirage/</guid>
      <description>&lt;p&gt;A week or so ago, I heard about the &lt;a href=&#34;http://www.openmirage.org&#34;&gt;Mirage project&lt;/a&gt;, a library OS project that makes tiny virtual machines running on top of Xen to run a given application, and do nothing else.  I was intrigued, and started working through &lt;a href=&#34;http://www.openmirage.org/wiki/hello-world&#34;&gt;the excellent intro documentation&lt;/a&gt;, and got to the point where I wanted to replace my ho-hum statically-compiled blog hosted from &lt;a href=&#34;https://wiki.ubuntu.com/LTS&#34;&gt;Ubuntu LTS&lt;/a&gt; with a unikernel that would serve my static site and do nothing else.&lt;/p&gt;&#xA;&lt;p&gt;There are excellent instructions on doing this with a Jekyll site on &lt;a href=&#34;http://amirchaudhry.com/from-jekyll-to-unikernel-in-fifty-lines/&#34;&gt;Amir Chaudhry&amp;rsquo;s blog&lt;/a&gt;.  Octopress, which I use to generate this site, is built on top of Jekyll, and I only had a few extra goodies to throw in before I was able to make a unikernel that would run my blog with a few &lt;code&gt;rake&lt;/code&gt; invocations.  After getting the first unikernel up and running via Xen on my laptop, I entertained myself by throwing a few &lt;code&gt;nmap&lt;/code&gt; commands at it; I was particularly curious to see whether my unikernel knew what to do with UDP packets:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo nmap -sO 192.168.2.13&#xA;&#xA;Starting Nmap 6.40 ( http://nmap.org ) at 2014-03-14 23:26 EDT&#xA;Nmap scan report for 192.168.2.13&#xA;Host is up (0.00037s latency).&#xA;Not shown: 254 open|filtered protocols&#xA;PROTOCOL STATE SERVICE&#xA;1        open  icmp&#xA;6        open  tcp&#xA;MAC Address: 00:16:3E:53:E0:1B (Xensource)&#xA;&#xA;Nmap done: 1 IP address (1 host up) scanned in 17.72 seconds&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Hee hee hee.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Finding Kitten</title>
      <link>http://localhost:1313/blog/2014/03/09/finding-kitten/</link>
      <pubDate>Sun, 09 Mar 2014 16:57:45 +0000</pubDate>
      <guid>http://localhost:1313/blog/2014/03/09/finding-kitten/</guid>
      <description>&lt;h2 id=&#34;robot-finds-kitten&#34;&gt;Robot Finds Kitten&lt;/h2&gt;&#xA;&lt;p&gt;&lt;figure class=&#34;right&#34;&gt;&lt;img src=&#34;http://localhost:1313/images/digital_clock.png&#34;&gt;&#xA;&lt;/figure&gt;&#xA; Sometime way back in the past, a human who wanted me to feel joy introduced me to &lt;a href=&#34;http://www.robotfindskitten.org&#34;&gt;Robot Finds Kitten&lt;/a&gt;, a Zen simulation which is pretty close to exactly what it says on the tin.  There are already &lt;a href=&#34;http://robotfindskitten.org/aw.cgi?main=software.rfk&#34;&gt;quite a lot of ports&lt;/a&gt; of the original POSIX implementation, but none of them were written in &lt;a href=&#34;http://elm-lang.org/&#34;&gt;Elm&lt;/a&gt;.  Obviously this is a problem that needs fixing.&lt;/p&gt;&#xA;&lt;p&gt;Before I get into the gory details of learning Elm via robots, I should tell you that my implementation is available for free play (edit: sorry, this has bitrotted too much to be included anymore), and &lt;a href=&#34;https://www.github.com/yomimono/elm-finds-kitten&#34;&gt;you can also go look at the source code&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;elm&#34;&gt;Elm&lt;/h2&gt;&#xA;&lt;p&gt;I got a really wonderful introduction to Elm when Evan Czaplicki came to &lt;a href=&#34;http://www.hackerschool.com&#34;&gt;Hacker School&lt;/a&gt; in our second week.  We got a slightly adapted version of &lt;a href=&#34;http://www.infoq.com/presentations/elm-reactive-programming&#34;&gt;this talk from StrangeLoop 2013&lt;/a&gt;, which moved me to make a browser game (something I&amp;rsquo;ve never wanted to do at any previous point in life).  The language seemed elegant and expressive, for lack of less cliched words, and I thought it might be relatively simple to make a succinct Robot Finds Kitten clone.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Sometimes it&#39;s no fun to be right.</title>
      <link>http://localhost:1313/blog/2014/02/25/sometimes-its-no-fun-to-be-right/</link>
      <pubDate>Tue, 25 Feb 2014 19:05:30 +0000</pubDate>
      <guid>http://localhost:1313/blog/2014/02/25/sometimes-its-no-fun-to-be-right/</guid>
      <description>&lt;p&gt;I promised a lot of people that I would let them know how Hacker School is.  It&amp;rsquo;s difficult for me to answer this question (&lt;a href=&#34;http://jvns.ca/blog/2014/02/15/how-was-hacker-school&#34;&gt;although Julia Evans, a previous batch process, has done a fantastic job&lt;/a&gt;), both because it feels so early in the batch and because Hacker School is a lot of things.  I also promised a lot of people that I would let them know how New York is, and that&amp;rsquo;s a little easier, so I&amp;rsquo;ll start there and then move on.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Early Thoughts on Hacker School</title>
      <link>http://localhost:1313/blog/2014/02/12/hacker-school/</link>
      <pubDate>Wed, 12 Feb 2014 03:47:52 +0000</pubDate>
      <guid>http://localhost:1313/blog/2014/02/12/hacker-school/</guid>
      <description>&lt;p&gt;I got my acceptance notification for the winter 2014 batch of &lt;!-- raw HTML omitted --&gt;Hacker School&lt;!-- raw HTML omitted --&gt; on January 3rd, six weeks ago.  Right after being accepted, I wrote a bit in the same directory where I&amp;rsquo;d saved my application answers:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
