{"@attributes":{"version":"2.0"},"channel":{"title":"Roger's Blog","link":"https:\/\/blog.differentpla.net\/","description":"Recent content on Roger's Blog","generator":"Hugo","language":"en","lastBuildDate":"Tue, 10 Nov 2026 12:00:00 +0000","item":[{"title":"Reinstalling macOS: Android Development","link":"https:\/\/blog.differentpla.net\/blog\/2026\/11\/10\/reinstalling-macos-android-development\/","pubDate":"Tue, 10 Nov 2026 12:00:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2026\/11\/10\/reinstalling-macos-android-development\/","description":"<p>I&rsquo;ve been noodling around with Android development using Flutter. To install that, I&rsquo;m using Homebrew.<\/p>"},{"title":"Reinstalling macOS: dotfiles","link":"https:\/\/blog.differentpla.net\/blog\/2026\/11\/04\/reinstalling-macos-dotfiles\/","pubDate":"Wed, 04 Nov 2026 16:00:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2026\/11\/04\/reinstalling-macos-dotfiles\/","description":"<p>Previously, I&rsquo;ve used GNU stow for managing my dotfiles. This time, I&rsquo;m going to use <a href=\"https:\/\/yadm.io\/\">yadm<\/a> (Yet Another Dotfiles Manager) instead.<\/p>"},{"title":"Reinstalling macOS: Various Utilities","link":"https:\/\/blog.differentpla.net\/blog\/2026\/11\/04\/reinstalling-macos-various-utilities\/","pubDate":"Wed, 04 Nov 2026 13:50:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2026\/11\/04\/reinstalling-macos-various-utilities\/","description":"<h2 id=\"contexts\">Contexts<a href=\"#contexts\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>Homepage: <a href=\"https:\/\/contexts.co\/\">https:\/\/contexts.co\/<\/a><\/p>\n<p>I don&rsquo;t like the default Alt+Tab behaviour in macOS, so I install <a href=\"https:\/\/contexts.co\/\">Contexts<\/a>, for which I&rsquo;ve got a\nlicense. The license file is in my email archive.<\/p>"},{"title":"Reinstalling macOS: Ghostty","link":"https:\/\/blog.differentpla.net\/blog\/2026\/11\/04\/reinstalling-macos-ghostty\/","pubDate":"Wed, 04 Nov 2026 13:40:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2026\/11\/04\/reinstalling-macos-ghostty\/","description":"<p>I prefer <a href=\"https:\/\/ghostty.org\/\">Ghostty<\/a> to the default macOS Terminal, so I&rsquo;ll install that next.<\/p>"},{"title":"Reinstalling macOS: Keyboard Settings","link":"https:\/\/blog.differentpla.net\/blog\/2026\/11\/04\/reinstalling-macos-keyboard-settings\/","pubDate":"Wed, 04 Nov 2026 10:55:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2026\/11\/04\/reinstalling-macos-keyboard-settings\/","description":"<h2 id=\"keyboard-settings\">Keyboard Settings<a href=\"#keyboard-settings\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>Open &ldquo;System Settings&rdquo; and go to the &ldquo;Keyboard&rdquo; page (it&rsquo;s at the bottom).<\/p>"},{"title":"Reinstalling macOS","link":"https:\/\/blog.differentpla.net\/blog\/2026\/11\/04\/reinstalling-macos\/","pubDate":"Wed, 04 Nov 2026 10:30:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2026\/11\/04\/reinstalling-macos\/","description":"<p>I reinstalled macOS on my MacBook Pro M1 at the start of the summer. I was hoping to use nix-darwin to manage it, but\njust couldn&rsquo;t get on with it, so I&rsquo;m going back to using Homebrew. This series of blog posts is an aide-memoire, in case\nI have to reinstall everything again.<\/p>"},{"title":"Callouts in Hugo","link":"https:\/\/blog.differentpla.net\/blog\/2026\/10\/17\/hugo-callouts\/","pubDate":"Sat, 17 Oct 2026 16:45:00 +0100","guid":"https:\/\/blog.differentpla.net\/blog\/2026\/10\/17\/hugo-callouts\/","description":"<p>In replacing Jekyll with Astro, and then with Hugo, I&rsquo;ve had to re-implement\ncallouts and alerts a number of times. For Hugo, I&rsquo;m using\n<a href=\"https:\/\/gohugo.io\/content-management\/shortcodes\/\">shortcodes<\/a>. Here&rsquo;s what the\ncallouts look like.<\/p>"},{"title":"Alerts in Hugo","link":"https:\/\/blog.differentpla.net\/blog\/2026\/10\/17\/hugo-alerts\/","pubDate":"Sat, 17 Oct 2026 16:41:00 +0100","guid":"https:\/\/blog.differentpla.net\/blog\/2026\/10\/17\/hugo-alerts\/","description":"<p>In replacing Jekyll with Astro, and then with Hugo, I&rsquo;ve had to re-implement\ncallouts and alerts a number of times. For Hugo, I&rsquo;m using\n<a href=\"https:\/\/gohugo.io\/content-management\/shortcodes\/\">shortcodes<\/a>. Here&rsquo;s what the\nalerts look like.<\/p>"},{"title":"Admonitions in Hugo","link":"https:\/\/blog.differentpla.net\/blog\/2026\/10\/17\/hugo-admonitions\/","pubDate":"Sat, 17 Oct 2026 15:41:00 +0100","guid":"https:\/\/blog.differentpla.net\/blog\/2026\/10\/17\/hugo-admonitions\/","description":"<p>Hugo supports <a href=\"https:\/\/docs.github.com\/en\/get-started\/writing-on-github\/getting-started-with-writing-and-formatting-on-github\/basic-writing-and-formatting-syntax#alerts\">GitHub-format\nalerts<\/a>,\nwhich are commonly called &ldquo;admonitions&rdquo;. Since I already have alerts, I&rsquo;m using\nthe latter term. They&rsquo;re specified like this:<\/p>"},{"title":"Making some shelves for the shed","link":"https:\/\/blog.differentpla.net\/blog\/2026\/08\/05\/shed-shelves\/","pubDate":"Wed, 05 Aug 2026 10:14:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2026\/08\/05\/shed-shelves\/","description":"<p>I was feeling kinda burnt out at work, and I&rsquo;m fortunate enough to have some savings, so I&rsquo;m taking a career break, and\ntrying not to computer too much. I decided to try my hand at woodworking.<\/p>"},{"title":"Crafting Interpreters in Rust: Parsing variable declarations","link":"https:\/\/blog.differentpla.net\/blog\/2026\/01\/01\/crafting-interpreters-rust-grammar-var-decl\/","pubDate":"Thu, 01 Jan 2026 17:13:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2026\/01\/01\/crafting-interpreters-rust-grammar-var-decl\/","description":"<p>In the previous post, we started on Chapter 8: <a href=\"https:\/\/craftinginterpreters.com\/statements-and-state.html\">&ldquo;Statements and\nState&rdquo;<\/a> from the book. We implemented some simple\nstatements, primarily <code>print<\/code>.<\/p>"},{"title":"Crafting Interpreters in Rust: Parsing statements","link":"https:\/\/blog.differentpla.net\/blog\/2025\/12\/28\/crafting-interpreters-rust-grammar-statements\/","pubDate":"Sun, 28 Dec 2025 12:50:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/12\/28\/crafting-interpreters-rust-grammar-statements\/","description":"<p>It&rsquo;s time to move on to Chapter 8: <a href=\"https:\/\/craftinginterpreters.com\/statements-and-state.html\">&ldquo;Statements and State&rdquo;<\/a>\nfrom the book. To do this, we&rsquo;ll implement parsing (and executing) some simple statements.<\/p>"},{"title":"Crafting Interpreters in Rust: Parsing groups","link":"https:\/\/blog.differentpla.net\/blog\/2025\/12\/10\/crafting-interpreters-rust-grammar-grouping\/","pubDate":"Wed, 10 Dec 2025 12:50:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/12\/10\/crafting-interpreters-rust-grammar-grouping\/","description":"<p>We&rsquo;re almost done with expressions. Next we add grouping with parentheses.<\/p>"},{"title":"Crafting Interpreters in Rust: Parsing Binary Operators, part 3","link":"https:\/\/blog.differentpla.net\/blog\/2025\/12\/10\/crafting-interpreters-rust-grammar-binary-operators-3\/","pubDate":"Wed, 10 Dec 2025 10:00:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/12\/10\/crafting-interpreters-rust-grammar-binary-operators-3\/","description":"<p>So far, we implemented parsing for numbers, strings, booleans, nil, unary operators <code>!<\/code> and <code>-<\/code>, multiplication and\ndivision, and addition and subtraction. Next on the list are comparison operators (greater-than, less-than, etc.) and\nequality operators.<\/p>"},{"title":"Crafting Interpreters in Rust: Parsing Binary Operators, part 2","link":"https:\/\/blog.differentpla.net\/blog\/2025\/12\/09\/crafting-interpreters-rust-grammar-binary-operators-2\/","pubDate":"Tue, 09 Dec 2025 18:27:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/12\/09\/crafting-interpreters-rust-grammar-binary-operators-2\/","description":"<p>At the end of the previous post, we could parse division and multiplication operators. Because we used an LALRPOP macro,\nit should be relatively simple to add addition and subtraction operators.<\/p>"},{"title":"Crafting Interpreters in Rust: Parsing Binary Operators, part 1","link":"https:\/\/blog.differentpla.net\/blog\/2025\/12\/09\/crafting-interpreters-rust-grammar-binary-operators-1\/","pubDate":"Tue, 09 Dec 2025 17:09:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/12\/09\/crafting-interpreters-rust-grammar-binary-operators-1\/","description":"<p>In the previous post, we finished implementing parsing of unary operators. In this post, we&rsquo;ll take a look at the first\nof the binary operators: division and multiplication.<\/p>"},{"title":"Crafting Interpreters in Rust: Parsing Unary Negation","link":"https:\/\/blog.differentpla.net\/blog\/2025\/12\/07\/crafting-interpreters-rust-grammar-unary-negation\/","pubDate":"Sun, 07 Dec 2025 15:00:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/12\/07\/crafting-interpreters-rust-grammar-unary-negation\/","description":"<p>In the last post, we implemented unary-not. In this one, we&rsquo;ll implement the other unary operator: negation.<\/p>"},{"title":"Crafting Interpreters in Rust: Parsing Unary-NOT","link":"https:\/\/blog.differentpla.net\/blog\/2025\/12\/07\/crafting-interpreters-rust-grammar-unary-not\/","pubDate":"Sun, 07 Dec 2025 12:00:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/12\/07\/crafting-interpreters-rust-grammar-unary-not\/","description":"<p>We&rsquo;re implementing Lox&rsquo;s <code>primary<\/code> rule. So far, we&rsquo;ve done booleans, <code>nil<\/code>, numbers and strings. Let&rsquo;s move on to some\nbasic expressions. In this post, we&rsquo;ll deal with unary-NOT &ndash; <code>!x<\/code>.<\/p>"},{"title":"Crafting Interpreters in Rust: Adding strings to the grammar","link":"https:\/\/blog.differentpla.net\/blog\/2025\/12\/04\/crafting-interpreters-rust-grammar-strings\/","pubDate":"Thu, 04 Dec 2025 08:23:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/12\/04\/crafting-interpreters-rust-grammar-strings\/","description":"<p>We&rsquo;re implementing Lox&rsquo;s <code>primary<\/code> rule. So far, we&rsquo;ve done booleans, <code>nil<\/code> and numbers. Let&rsquo;s move on to strings.<\/p>"},{"title":"Crafting Interpreters in Rust: Adding numbers to the grammar","link":"https:\/\/blog.differentpla.net\/blog\/2025\/12\/02\/crafting-interpreters-rust-grammar-numbers\/","pubDate":"Tue, 02 Dec 2025 17:23:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/12\/02\/crafting-interpreters-rust-grammar-numbers\/","description":"<p>So far, we&rsquo;ve got a grammar that can parse <code>true<\/code>, <code>false<\/code> and <code>nil<\/code> literals. In this post, we&rsquo;ll add the ability to\nparse numbers.<\/p>"},{"title":"Crafting Interpreters in Rust: Adding nil to the grammar","link":"https:\/\/blog.differentpla.net\/blog\/2025\/12\/01\/crafting-interpreters-rust-grammar-nil\/","pubDate":"Mon, 01 Dec 2025 20:07:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/12\/01\/crafting-interpreters-rust-grammar-nil\/","description":"<p>In the previous post, we wrote a simple grammar that parses <code>true<\/code> or <code>false<\/code> as a boolean:<\/p>"},{"title":"Crafting Interpreters in Rust: Starting with LALRPOP","link":"https:\/\/blog.differentpla.net\/blog\/2025\/12\/01\/crafting-interpreters-rust-add-lalrpop\/","pubDate":"Mon, 01 Dec 2025 19:25:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/12\/01\/crafting-interpreters-rust-add-lalrpop\/","description":"<p>For the parser, I&rsquo;m going to use <a href=\"https:\/\/crates.io\/crates\/lalrpop\">LALRPOP<\/a>. I used it in my previous attempt at this,\nand I liked it.<\/p>"},{"title":"Crafting Interpreters in Rust: Introduction","link":"https:\/\/blog.differentpla.net\/blog\/2025\/12\/01\/crafting-interpreters-rust-intro\/","pubDate":"Mon, 01 Dec 2025 19:14:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/12\/01\/crafting-interpreters-rust-intro\/","description":"<p>For my <code>#DecemberAdventure<\/code>, I&rsquo;m going to have another go at working through <a href=\"https:\/\/craftinginterpreters.com\/\">&ldquo;Crafting\nInterpreters&rdquo;<\/a> in Rust. The last time I tried this, I got to the end of Chapter 10.<\/p>"},{"title":"EUnit examples: 'with'","link":"https:\/\/blog.differentpla.net\/blog\/2025\/10\/16\/eunit-with\/","pubDate":"Thu, 16 Oct 2025 07:25:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/10\/16\/eunit-with\/","description":"<p>In earlier posts, <a href=\"https:\/\/blog.differentpla.net\/blog\/2023\/04\/02\/eunit-examples-foreach-result\/\">Passing the result from &lsquo;foreach&rsquo;<\/a> and\n<a href=\"https:\/\/blog.differentpla.net\/blog\/2023\/04\/02\/eunit-examples-setup-result\/\">Passing the result from &lsquo;setup&rsquo;<\/a>, I showed how to\n(awkwardly) pass the result from the setup function to the test functions.<\/p>"},{"title":"jq: array contains array containing key with value?","link":"https:\/\/blog.differentpla.net\/blog\/2025\/09\/26\/jq-contains-array-containing-value\/","pubDate":"Fri, 26 Sep 2025 13:55:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/09\/26\/jq-contains-array-containing-value\/","description":"<p>In one of our Kubernetes clusters, there are a number of pods failing with &ldquo;ImagePullBackOff&rdquo;. I want to find the nodes on which these pods are running.<\/p>"},{"title":"erlang.mk: running multiple eunit tests","link":"https:\/\/blog.differentpla.net\/blog\/2025\/09\/05\/erlang-mk-eunit-test-spec\/","pubDate":"Fri, 05 Sep 2025 13:35:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/09\/05\/erlang-mk-eunit-test-spec\/","description":"<p>If you&rsquo;re using <code>erlang.mk<\/code>, you can run a single unit test suite with <code>make eunit t=whatever<\/code>. That&rsquo;s no good if you\nwant to run multiple test suites. Here&rsquo;s a nasty hack that makes it possible.<\/p>"},{"title":"Timelapse Lego Builds","link":"https:\/\/blog.differentpla.net\/blog\/2025\/08\/09\/timelapse-lego\/","pubDate":"Sat, 09 Aug 2025 09:36:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/08\/09\/timelapse-lego\/","description":"<p>I have a few timelapse Lego build videos on my YouTube channel. This post explains how that&rsquo;s set up. It&rsquo;s mostly to\nremind myself for next time.<\/p>"},{"title":"synowebapi: Stopping Container Manager projects","link":"https:\/\/blog.differentpla.net\/blog\/2025\/07\/12\/synowebapi-container-manager-projects\/","pubDate":"Sat, 12 Jul 2025 15:38:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/07\/12\/synowebapi-container-manager-projects\/","description":"<p>Here&rsquo;s how to use <code>synowebapi<\/code> for stopping (and starting) projects in Container Manager on a Synology NAS.<\/p>"},{"title":"Docker (and podman), macOS, localhost","link":"https:\/\/blog.differentpla.net\/blog\/2025\/05\/12\/docker-macos-localhost\/","pubDate":"Mon, 12 May 2025 16:35:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/05\/12\/docker-macos-localhost\/","description":"<p>On macOS, both Docker and Podman run a Linux VM. This has some weird effects when running (or writing) your own\ncontainer registry.<\/p>"},{"title":"GitHub Actions containing files","link":"https:\/\/blog.differentpla.net\/blog\/2025\/05\/07\/github-actions-containing-files\/","pubDate":"Wed, 07 May 2025 07:31:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/05\/07\/github-actions-containing-files\/","description":"<p>I want to write a GitHub action that I can call from other GitHub workflows, and I want it to contain one or more files\nthat I can use from the action, specifically a <code>Dockerfile<\/code> (not that it matters). Here&rsquo;s how.<\/p>"},{"title":"Synology Router .dss file: What is it?","link":"https:\/\/blog.differentpla.net\/blog\/2025\/05\/04\/synology-dss-file\/","pubDate":"Sun, 04 May 2025 14:19:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/05\/04\/synology-dss-file\/","description":"<p>I&rsquo;m considering monkeying around with the firewall rules on my Synology router. If I mess that up, I&rsquo;ll need to\nfactory-reset the router. So I should probably back up the current configuration first. The <em>Back Up Configuration<\/em>\nbutton downloads a <code>SynologyRouter_YYYYMMDD.dss<\/code> file. What&rsquo;s in it?<\/p>"},{"title":"Using Kubernetes Secrets for External DNS TSIG Keys","link":"https:\/\/blog.differentpla.net\/blog\/2025\/05\/04\/k8s-external-dns-secrets\/","pubDate":"Sun, 04 May 2025 13:16:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/05\/04\/k8s-external-dns-secrets\/","description":"<p>Yesterday, I published a post about using <a href=\"https:\/\/blog.differentpla.net\/blog\/2025\/05\/03\/k8s-external-dns-synology\/\">Kubernetes External DNS with Synology&rsquo;s DNS Server<\/a>. This morning, I realised that putting the TSIG key directly in the\ndeployment manifest was probably a bad idea. Here&rsquo;s how to put it in a Kubernetes Secret object.<\/p>"},{"title":"Using Kubernetes External DNS with Synology DNS Server","link":"https:\/\/blog.differentpla.net\/blog\/2025\/05\/03\/k8s-external-dns-synology\/","pubDate":"Sat, 03 May 2025 08:49:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/05\/03\/k8s-external-dns-synology\/","description":"<p>My router is a Synology RT2600ac; by default it runs <code>dnsmasq<\/code>. I recently replaced it with Synology&rsquo;s full-fat DNS\nService (it&rsquo;s BIND); this broke <a href=\"https:\/\/blog.differentpla.net\/blog\/2021\/12\/29\/coredns\/\">DNS for my K3s cluster<\/a>; here&rsquo;s how I replaced\nthat with <code>ExternalDNS<\/code>, making everything work again.<\/p>"},{"title":"FROM --platform=$TARGETPLATFORM in Podman and Docker","link":"https:\/\/blog.differentpla.net\/blog\/2025\/05\/01\/multiarch-containers-podman-docker-3\/","pubDate":"Thu, 01 May 2025 07:34:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/05\/01\/multiarch-containers-podman-docker-3\/","description":"<p>While building my <a href=\"https:\/\/github.com\/rlipscombe\/erlang-cluster\">erlang-cluster<\/a> demonstration project for\nmulti-architecture, using podman, I noticed some weirdness about using <code>FROM --platform=$TARGETPLATFORM<\/code>.<\/p>"},{"title":"Building multi-architecture containers in Podman and Docker","link":"https:\/\/blog.differentpla.net\/blog\/2025\/04\/30\/multiarch-containers-podman-docker-2\/","pubDate":"Wed, 30 Apr 2025 17:15:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/04\/30\/multiarch-containers-podman-docker-2\/","description":"<p>When I was investigating how to build multi-architecture containers in Podman, I noticed some &hellip; oddities. So I wrote\nthem down. I&rsquo;ll also compare podman&rsquo;s behaviour to docker&rsquo;s behaviour.<\/p>"},{"title":"Running multi-architecture containers in Podman and Docker","link":"https:\/\/blog.differentpla.net\/blog\/2025\/04\/30\/multiarch-containers-podman-docker-1\/","pubDate":"Wed, 30 Apr 2025 14:58:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/04\/30\/multiarch-containers-podman-docker-1\/","description":"<p>I noticed some differences between podman on WSL2 and podman on macOS recently. I spent some time investigating.<\/p>"},{"title":"Kubernetes Taints and Tolerations","link":"https:\/\/blog.differentpla.net\/blog\/2025\/04\/30\/k8s-taints-tolerations\/","pubDate":"Wed, 30 Apr 2025 13:02:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/04\/30\/k8s-taints-tolerations\/","description":"<p>Today I learned, in a way that&rsquo;s going to stick, the difference between Kubernetes <a href=\"https:\/\/kubernetes.io\/docs\/concepts\/scheduling-eviction\/taint-and-toleration\/\">Taints and\nTolerations<\/a> and <a href=\"https:\/\/kubernetes.io\/docs\/concepts\/scheduling-eviction\/assign-pod-node\/#affinity-and-anti-affinity\">Node\nAffinity<\/a>.<\/p>"},{"title":"Sending (some) functions between OTP versions fails with 'badfun'","link":"https:\/\/blog.differentpla.net\/blog\/2025\/04\/29\/erlang-badfun-otp-versions\/","pubDate":"Tue, 29 Apr 2025 11:58:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/04\/29\/erlang-badfun-otp-versions\/","description":"<p>Did you know that you can send Erlang functions between Erlang nodes? You can. Did you know that the OTP versions need\nto match?<\/p>"},{"title":"Running a CoreDNS container on a Synology NAS","link":"https:\/\/blog.differentpla.net\/blog\/2025\/03\/30\/coredns-synology\/","pubDate":"Sun, 30 Mar 2025 17:38:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/03\/30\/coredns-synology\/","description":"<p>My home DNS is a bit of a mess, so I want to install CoreDNS on my Synology NAS to tidy it all up. I&rsquo;ll run it in a\ncontainer.<\/p>"},{"title":"Sharing networks between multiple docker compose projects","link":"https:\/\/blog.differentpla.net\/blog\/2025\/03\/30\/docker-compose-shared-networks\/","pubDate":"Sun, 30 Mar 2025 11:20:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/03\/30\/docker-compose-shared-networks\/","description":"<p>I run a number of docker containers on my Synology NAS, and I want to is put a reverse proxy in front of them. Since\nthey&rsquo;re defined in separate docker compose projects, I need to attach the reverse proxy to the network defined by each\nproject.<\/p>"},{"title":"docker build without a Dockerfile","link":"https:\/\/blog.differentpla.net\/blog\/2025\/03\/27\/docker-build-without-dockerfile\/","pubDate":"Thu, 27 Mar 2025 17:21:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/03\/27\/docker-build-without-dockerfile\/","description":"<p>I recently wanted to create an Ubuntu container image with some extra stuff installed, but I couldn&rsquo;t be bothered to\ncreate a <code>Dockerfile<\/code>. It turns out that docker has a <code>docker container commit<\/code> command, so I used that. Here&rsquo;s how.<\/p>"},{"title":"Recognising base64-encoded Certificates","link":"https:\/\/blog.differentpla.net\/blog\/2025\/03\/25\/certificate-base64-recognition\/","pubDate":"Tue, 25 Mar 2025 08:52:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/03\/25\/certificate-base64-recognition\/","description":"<p>If you see a chunk of text beginning with <code>LS0t<\/code>, it&rsquo;s probably a base64-encoded certificate or key. Here&rsquo;s a demonstration.<\/p>"},{"title":"Bitwarden Auto-fill and simple hosts","link":"https:\/\/blog.differentpla.net\/blog\/2025\/03\/23\/bitwarden-autofill-host\/","pubDate":"Sun, 23 Mar 2025 13:33:47 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/03\/23\/bitwarden-autofill-host\/","description":"<p>I use Bitwarden for managing my passwords. When using the Firefox browser extension, it refused to autofill the\ncredentials for my Synology NAS. Here&rsquo;s how I fixed it.<\/p>"},{"title":"Forgejo on Synology NAS, part 3: Backup and Restore","link":"https:\/\/blog.differentpla.net\/blog\/2025\/03\/22\/forgejo-synology-3\/","pubDate":"Sat, 22 Mar 2025 16:42:47 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/03\/22\/forgejo-synology-3\/","description":"<p>In <a href=\"https:\/\/blog.differentpla.net\/blog\/2025\/03\/09\/forgejo-synology-1\/\">part 1<\/a>, and <a href=\"https:\/\/blog.differentpla.net\/blog\/2025\/03\/09\/forgejo-synology-2\/\">part 2<\/a>, I&rsquo;d got Forgejo running on my Synology NAS, with HTTPS and SSH access. It&rsquo;s not\nbeing backed up (or restored); let&rsquo;s fix that.<\/p>"},{"title":"Forgejo on Synology NAS, part 2: Fixing SSH","link":"https:\/\/blog.differentpla.net\/blog\/2025\/03\/09\/forgejo-synology-2\/","pubDate":"Sun, 09 Mar 2025 14:32:47 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/03\/09\/forgejo-synology-2\/","description":"<p>In <a href=\"https:\/\/blog.differentpla.net\/blog\/2025\/03\/09\/forgejo-synology-1\/\">part 1<\/a>, I&rsquo;d got Forgejo running on my Synology NAS, but SSH\naccess wasn&rsquo;t working properly. In this part, I&rsquo;m going to fix that by using HAProxy.<\/p>"},{"title":"Forgejo on Synology NAS, part 1: Installation","link":"https:\/\/blog.differentpla.net\/blog\/2025\/03\/09\/forgejo-synology-1\/","pubDate":"Sun, 09 Mar 2025 10:06:47 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/03\/09\/forgejo-synology-1\/","description":"<p>I want to install Forgejo on my Synology NAS. I&rsquo;m going to attach it to the macvlan network I createed yesterday. I&rsquo;m\nnot going to use Synology&rsquo;s built-in Web Portal (reverse proxy thing). Here&rsquo;s how I did it.<\/p>"},{"title":"Using docker with macvlan on Synology NAS","link":"https:\/\/blog.differentpla.net\/blog\/2025\/03\/08\/docker-macvlan-synology\/","pubDate":"Sat, 08 Mar 2025 12:14:47 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/03\/08\/docker-macvlan-synology\/","description":"<p>In the previous post, I investigated using Docker with the macvlan network driver, to allow containers to have unique\nexternal IP addresses. This is the follow-up post where I apply the changes to my Synology NAS.<\/p>"},{"title":"Using docker with macvlan","link":"https:\/\/blog.differentpla.net\/blog\/2025\/03\/08\/docker-macvlan\/","pubDate":"Sat, 08 Mar 2025 12:04:47 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/03\/08\/docker-macvlan\/","description":"<p>If you use the <code>bridge<\/code> or <code>host<\/code> network drivers in Docker, containers must use different port numbers to be accessible\non the host network. Here&rsquo;s how to use the <code>macvlan<\/code> driver to assign a unique IP address to each container, allowing\ncontainers (and the host) to use the same port numbers.<\/p>"},{"title":"Installing Linux on the Chuwi Minibook X","link":"https:\/\/blog.differentpla.net\/blog\/2025\/01\/19\/chuwi-minibook-x-linux\/","pubDate":"Sun, 19 Jan 2025 12:09:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2025\/01\/19\/chuwi-minibook-x-linux\/","description":"<p>Inspired by <a href=\"https:\/\/wandering.shop\/@cstross\/113279670998603629\">this Mastodon\npost<\/a> by Charlie Stross, I\nrecently bought a Chuwi Minibook X N100. I do love me a tiny laptop, and I miss\nmy Samsung NC10 Netbook. I decided to install Linux on it. Here&rsquo;s how that went.<\/p>"},{"title":"How does logging into AWS ECR with podman work?","link":"https:\/\/blog.differentpla.net\/blog\/2024\/11\/27\/aws-ecr-podman-login\/","pubDate":"Wed, 27 Nov 2024 09:44:47 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2024\/11\/27\/aws-ecr-podman-login\/","description":"<p>If you want to use Amazon Elastic Container Registry (ECR) with podman, you&rsquo;ll do something like this: <code>aws ecr get-login-password ... | podman login ...<\/code>. How does that work?<\/p>"},{"title":"Recognising base64-encoded JSON","link":"https:\/\/blog.differentpla.net\/blog\/2024\/11\/27\/json-base64-recognition\/","pubDate":"Wed, 27 Nov 2024 09:12:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2024\/11\/27\/json-base64-recognition\/","description":"<p>If you see a chunk of text beginning with <code>eyJ<\/code>, it&rsquo;s probably base64-encoded JSON. Here&rsquo;s a demonstration.<\/p>"},{"title":"Removing comments from JSON","link":"https:\/\/blog.differentpla.net\/blog\/2024\/09\/12\/removing-json-comments\/","pubDate":"Thu, 12 Sep 2024 08:36:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2024\/09\/12\/removing-json-comments\/","description":"<p>Yes, I know that JSON files don&rsquo;t have comments. I&rsquo;ve got some JSON files with comments in them. Here&rsquo;s a quick way to strip the comments.<\/p>"},{"title":"Moving a PR to a different branch","link":"https:\/\/blog.differentpla.net\/blog\/2024\/06\/17\/git-rebase-onto\/","pubDate":"Mon, 17 Jun 2024 08:00:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2024\/06\/17\/git-rebase-onto\/","description":"<p>Because I mess it up every time, here&rsquo;s how to move a Github pull request from one branch to another.<\/p>"},{"title":"gen_server\/gen_statem: redirecting tracing to logger","link":"https:\/\/blog.differentpla.net\/blog\/2024\/05\/20\/erlang-gen-server-redirect-debug-trace-to-logger\/","pubDate":"Mon, 20 May 2024 11:05:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2024\/05\/20\/erlang-gen-server-redirect-debug-trace-to-logger\/","description":"<p>In an <a href=\"https:\/\/blog.differentpla.net\/blog\/2023\/05\/10\/erlang-gen-server-debug\/\">earlier post<\/a>, I talked about how you can turn on <code>gen_server<\/code> and <code>gen_statem<\/code> debug tracing by adding (e.g.) <code>[{debug, trace}]<\/code> to the start options. I recently discovered a way to integrate this with Erlang&rsquo;s default <code>logger<\/code>.<\/p>"},{"title":"Triggering GitHub Actions from a different repository","link":"https:\/\/blog.differentpla.net\/blog\/2024\/02\/14\/github-actions-trigger\/","pubDate":"Wed, 14 Feb 2024 15:26:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2024\/02\/14\/github-actions-trigger\/","description":"<p>At work right now, I&rsquo;m working on something that spans multiple GitHub repositories, and I need to trigger a job in one\nrepository from a different repository.<\/p>"},{"title":"Helpers for fold accumulators, part 2","link":"https:\/\/blog.differentpla.net\/blog\/2024\/02\/13\/erlang-fold-accumulator-helpers-part-2\/","pubDate":"Tue, 13 Feb 2024 15:08:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2024\/02\/13\/erlang-fold-accumulator-helpers-part-2\/","description":"<p>A follow up to <a href=\"https:\/\/blog.differentpla.net\/blog\/2024\/02\/09\/erlang-fold-accumulator-helpers\/\">On whether &ldquo;fold accumulator helpers&rdquo; are a good idea<\/a>.<\/p>"},{"title":"Helpers for fold accumulators","link":"https:\/\/blog.differentpla.net\/blog\/2024\/02\/09\/erlang-fold-accumulator-helpers\/","pubDate":"Fri, 09 Feb 2024 10:41:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2024\/02\/09\/erlang-fold-accumulator-helpers\/","description":"<p>On whether &ldquo;fold accumulator helpers&rdquo; are a good idea.<\/p>\n<p>I&rsquo;m currently writing some code that recursively folds over a multi-level data structure, and I found myself wondering\nwhether introducing helper functions specifically to abstract over the accumulator are a good idea.<\/p>"},{"title":"Using the correct identity when SSH forwarding in Docker","link":"https:\/\/blog.differentpla.net\/blog\/2024\/01\/16\/docker-ssh-multiple-identities\/","pubDate":"Tue, 16 Jan 2024 14:16:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2024\/01\/16\/docker-ssh-multiple-identities\/","description":"<p>Back in October, I wrote a post explaining <a href=\"https:\/\/blog.differentpla.net\/blog\/2023\/10\/02\/docker-ssh\/\">how to do SSH forwarding<\/a> with\n<code>docker build<\/code>. In November, I wrote about <a href=\"https:\/\/blog.differentpla.net\/blog\/2023\/11\/17\/multiple-git-identities\/\">how to use multiple SSH identities with git<\/a>. Unfortunately, these don&rsquo;t always mix: using SSH in the docker build uses\nthe <em>first<\/em> SSH identity held by <code>ssh-agent<\/code>, which might not be the one you wanted. Here&rsquo;s how I got around this\nproblem.<\/p>"},{"title":"Using Erlang's logger from escript","link":"https:\/\/blog.differentpla.net\/blog\/2024\/01\/05\/erlang-logger-escript\/","pubDate":"Fri, 05 Jan 2024 16:05:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2024\/01\/05\/erlang-logger-escript\/","description":"<p>If you&rsquo;re writing an Erlang <code>escript<\/code>, you might want to configure logging. Here&rsquo;s how.<\/p>"},{"title":"gen_statem: Asynchronous Initialization","link":"https:\/\/blog.differentpla.net\/blog\/2024\/01\/03\/gen-statem-async-init\/","pubDate":"Wed, 03 Jan 2024 14:11:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2024\/01\/03\/gen-statem-async-init\/","description":"<p>When you use <code>gen_statem:start\/3,4<\/code> or <code>gen_statem:start_link\/3,4<\/code>, the call blocks until the server process has finished running <code>Module:init\/1<\/code>.<\/p>"},{"title":"Using Elliptic Curve keys for signing in Erlang","link":"https:\/\/blog.differentpla.net\/blog\/2023\/12\/08\/elliptic-curve-signing-erlang\/","pubDate":"Fri, 08 Dec 2023 14:10:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/12\/08\/elliptic-curve-signing-erlang\/","description":"<p>How do I sign (and verify) things in Erlang, using an ECDSA key?<\/p>"},{"title":"Using git with multiple identities","link":"https:\/\/blog.differentpla.net\/blog\/2023\/11\/17\/multiple-git-identities\/","pubDate":"Fri, 17 Nov 2023 10:23:37 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/11\/17\/multiple-git-identities\/","description":"<p>I want to keep my work and personal Github accounts separate. Here&rsquo;s how I set that up:<\/p>"},{"title":"Partial Network Outage: Incident Review","link":"https:\/\/blog.differentpla.net\/blog\/2023\/11\/10\/partial-network-outage-incident-report\/","pubDate":"Fri, 10 Nov 2023 10:42:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/11\/10\/partial-network-outage-incident-report\/","description":"<p>At approximately 08:45 on November 10th, 2023, there were network connectivity issues on my home network. This is the\nincident review.<\/p>"},{"title":"Upgrading Longhorn: Incident Review","link":"https:\/\/blog.differentpla.net\/blog\/2023\/11\/05\/longhorn-upgrade-incident-report\/","pubDate":"Sun, 05 Nov 2023 21:04:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/11\/05\/longhorn-upgrade-incident-report\/","description":"<p>A new release of Longhorn came out a few days ago. I tried upgrading. It did not go well. This is the incident review.<\/p>"},{"title":"Restricting Longhorn to specific nodes","link":"https:\/\/blog.differentpla.net\/blog\/2023\/11\/04\/restricting-longhorn-storage-nodes\/","pubDate":"Sat, 04 Nov 2023 13:03:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/11\/04\/restricting-longhorn-storage-nodes\/","description":"<p>I&rsquo;ve added a Raspberry Pi node to my K3s cluster, and I don&rsquo;t want it to take part in Longhorn replication.<\/p>"},{"title":"Daemonset not running on new node","link":"https:\/\/blog.differentpla.net\/blog\/2023\/11\/04\/daemonset-not-running-on-new-node\/","pubDate":"Sat, 04 Nov 2023 12:47:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/11\/04\/daemonset-not-running-on-new-node\/","description":"<p>As part of my over-engineered doorbell project, I&rsquo;ve added a new Raspberry Pi node to my K3s cluster, but none of the\ndaemonsets are being scheduled onto it.<\/p>"},{"title":"Exporting SNMP metrics to Prometheus","link":"https:\/\/blog.differentpla.net\/blog\/2023\/10\/29\/snmp-node-exporter\/","pubDate":"Sun, 29 Oct 2023 14:31:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/10\/29\/snmp-node-exporter\/","description":"<p>My DS416play keeps falling off the network, requiring a hard reset. I wondered whether it was possible to monitor it\nsomehow. It turns out that it responds to SNMP queries, so here&rsquo;s my attempt to export all of that into Grafana.<\/p>"},{"title":"K3s: You must be logged in to the server (Unauthorized)","link":"https:\/\/blog.differentpla.net\/blog\/2023\/10\/29\/k3s-unauthorized\/","pubDate":"Sun, 29 Oct 2023 13:53:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/10\/29\/k3s-unauthorized\/","description":"<p>This afternoon, I couldn&rsquo;t run <code>kubectl get namespaces<\/code> against my K3s cluster. Instead, I got an <code>Unauthorized<\/code> error.<\/p>"},{"title":"Improving your quality of life as a developer","link":"https:\/\/blog.differentpla.net\/blog\/2023\/10\/27\/developer-quality-of-life\/","pubDate":"Fri, 27 Oct 2023 12:53:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/10\/27\/developer-quality-of-life\/","description":"<p>I&rsquo;ve just come off a call with a colleague and while he was sharing his screen and we were walking through some things,\nI noticed that his setup is missing all of the little &ldquo;quality of life&rdquo; tweaks that I&rsquo;ve made over the years.<\/p>"},{"title":"httpc:request hangs with an HTTPS URL","link":"https:\/\/blog.differentpla.net\/blog\/2023\/10\/16\/erlang-httpc-hangs-https\/","pubDate":"Mon, 16 Oct 2023 13:53:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/10\/16\/erlang-httpc-hangs-https\/","description":"<p>If you use Erlang\/OTP&rsquo;s provided HTTP client as follows, it hangs:<\/p>"},{"title":"SSH Forwarding in Docker","link":"https:\/\/blog.differentpla.net\/blog\/2023\/10\/02\/docker-ssh\/","pubDate":"Mon, 02 Oct 2023 09:38:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/10\/02\/docker-ssh\/","description":"<p>If you&rsquo;re building your application inside a Docker container, and you need to pull dependencies from a git server (e.g.\nGithub or Gitlab) using SSH, you need to forward your SSH session to the container.<\/p>"},{"title":"How I make presentations","link":"https:\/\/blog.differentpla.net\/blog\/2023\/09\/14\/how-i-make-presentations\/","pubDate":"Thu, 14 Sep 2023 13:22:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/09\/14\/how-i-make-presentations\/","description":"<p>I dislike Powerpoint and I can&rsquo;t get on with Visio. Here&rsquo;s how I make my presentations.<\/p>"},{"title":"Using the GitLab API with 'glab'","link":"https:\/\/blog.differentpla.net\/blog\/2023\/08\/25\/gitlab-api-glab\/","pubDate":"Fri, 25 Aug 2023 13:19:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/08\/25\/gitlab-api-glab\/","description":"<p>I wanted to get a list of all of the GitLab projects of which I&rsquo;m a member. Here&rsquo;s how I used <code>glab<\/code> &ndash; GitLab&rsquo;s CLI\ntool &ndash; to do that.<\/p>"},{"title":"Remotely loading Erlang modules by copy-pasting","link":"https:\/\/blog.differentpla.net\/blog\/2023\/07\/13\/remote-load-erlang-module-paste\/","pubDate":"Thu, 13 Jul 2023 13:59:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/07\/13\/remote-load-erlang-module-paste\/","description":"<p>If you want to replace an Erlang module on a remote node, but you&rsquo;re unable to copy files to it, and you&rsquo;re unable to\nmake RPC calls to it, but you <em>can<\/em> get a remote console, here&rsquo;s what you do:<\/p>"},{"title":"gen_server debug options","link":"https:\/\/blog.differentpla.net\/blog\/2023\/05\/10\/erlang-gen-server-debug\/","pubDate":"Wed, 10 May 2023 10:22:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/05\/10\/erlang-gen-server-debug\/","description":"<p>Erlang&rsquo;s <code>gen_server<\/code> (and <code>gen_statem<\/code>, etc.) allow for you to pass <code>{debug, DebugOptions}<\/code> in\n<code>gen_server:start_link\/4<\/code> (et al.). The documentation for it is spread over several pages, making it hard to understand\nat first. How should we use it?<\/p>"},{"title":"Erlang on Kubernetes: Using Kustomize to manage a ConfigMap for sys.config","link":"https:\/\/blog.differentpla.net\/blog\/2023\/05\/01\/erlang-k8s-configmap-kustomize\/","pubDate":"Mon, 01 May 2023 13:35:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/05\/01\/erlang-k8s-configmap-kustomize\/","description":"<p>In a <a href=\"https:\/\/blog.differentpla.net\/blog\/2023\/04\/13\/erlang-k8s-configmap\/\">previous post<\/a>, I showed how to store <code>sys.config<\/code> and\n<code>vm.args<\/code> in a ConfigMap. There are some problems with that approach, so I&rsquo;m going to use Kustomize to fix that.<\/p>"},{"title":"Installing Tempo","link":"https:\/\/blog.differentpla.net\/blog\/2023\/04\/28\/installing-tempo\/","pubDate":"Fri, 28 Apr 2023 13:54:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/04\/28\/installing-tempo\/","description":"<p>I want to play with OpenTelemetry, so I figured I&rsquo;d install Grafana&rsquo;s Tempo in my cluster. I&rsquo;m going to use ArgoCD to\ninstall the Helm chart.<\/p>"},{"title":"Erlang: via","link":"https:\/\/blog.differentpla.net\/blog\/2023\/04\/20\/erlang-via-registry\/","pubDate":"Thu, 20 Apr 2023 13:02:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/04\/20\/erlang-via-registry\/","description":"<p>Here&rsquo;s how you can use <code>via<\/code> in a name specification when starting a <code>gen_server<\/code> (or <code>gen_statem<\/code>, etc.) to register\nyour process with a process registry.<\/p>"},{"title":"Erlang: ways to specify the server in gen_server:call","link":"https:\/\/blog.differentpla.net\/blog\/2023\/04\/19\/erlang-gen-server-call\/","pubDate":"Wed, 19 Apr 2023 15:40:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/04\/19\/erlang-gen-server-call\/","description":"<p>You can <code>gen_server:call<\/code> in a bunch of different ways.<\/p>\n<p>If you have a process ID:<\/p>"},{"title":"Kubernetes Networking","link":"https:\/\/blog.differentpla.net\/blog\/2023\/04\/18\/k8s-networking\/","pubDate":"Tue, 18 Apr 2023 13:10:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/04\/18\/k8s-networking\/","description":"<p>My K3s cluster uses MetalLB as a bare-metal &ldquo;load-balancer&rdquo;, and I wondered how it worked. Here&rsquo;s what I found.<\/p>"},{"title":"Upgrading MetalLB","link":"https:\/\/blog.differentpla.net\/blog\/2023\/04\/16\/upgrading-metaldb\/","pubDate":"Sun, 16 Apr 2023 16:26:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/04\/16\/upgrading-metaldb\/","description":"<p>I installed MetalLB using helm. Upgrading is a one-liner.<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-bash\" data-lang=\"bash\"><span class=\"line\"><span class=\"cl\">helm --namespace metallb-system upgrade metallb metallb\/metallb<\/span><\/span><\/code><\/pre><\/div>"},{"title":"Erlang on Kubernetes: Using a ConfigMap for sys.config","link":"https:\/\/blog.differentpla.net\/blog\/2023\/04\/13\/erlang-k8s-configmap\/","pubDate":"Thu, 13 Apr 2023 16:27:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/04\/13\/erlang-k8s-configmap\/","description":"<p>Erlang configuration is typically stored in the <code>sys.config<\/code> file. What options do we have if we want to have different\nsettings in this file when deploying using Kubernetes?<\/p>"},{"title":"Erlang cluster on Kubernetes: Rotating CA certificates","link":"https:\/\/blog.differentpla.net\/blog\/2023\/04\/07\/erlang-cluster-k8s-rotating-ca\/","pubDate":"Fri, 07 Apr 2023 10:31:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/04\/07\/erlang-cluster-k8s-rotating-ca\/","description":"<p>About 3 months ago, the Erlang nodes in my <a href=\"https:\/\/blog.differentpla.net\/blog\/2022\/12\/21\/erlang-cluster-k8s-intro\/\">cluster<\/a> stopped\ntalking to each other. This was caused by the <a href=\"https:\/\/blog.differentpla.net\/blog\/2023\/01\/07\/erlang-cluster-k8s-certificate-expired\/\">CA certificate expiring<\/a>. In that post, I asked &ldquo;How <em>do<\/em> we roll the CA certificate\nwithout downtime?&rdquo;. This post explores some options.<\/p>"},{"title":"EUnit examples: Cleaning up server processes","link":"https:\/\/blog.differentpla.net\/blog\/2023\/04\/03\/eunit-examples-cleanup-server\/","pubDate":"Mon, 03 Apr 2023 16:33:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/04\/03\/eunit-examples-cleanup-server\/","description":"<p>In several of the previous posts, for example <a href=\"https:\/\/blog.differentpla.net\/blog\/2023\/03\/31\/eunit-examples-setup\/\">Using &lsquo;setup&rsquo;<\/a>, I&rsquo;ve\nstarted a server in <code>suite_setup\/0<\/code> and needed to kill it in <code>suite_cleanup\/1<\/code>. I showed a simple way to do that, but\nit&rsquo;s not the best. Here&rsquo;s a better way to do it.<\/p>"},{"title":"Upgrading gitea","link":"https:\/\/blog.differentpla.net\/blog\/2023\/04\/03\/upgrading-gitea\/","pubDate":"Mon, 03 Apr 2023 15:53:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/04\/03\/upgrading-gitea\/","description":"<p>I&rsquo;m running Gitea and ArgoCD on my K3s cluster, for some GitOps goodness. I noticed that Gitea 1.19.0 recently came out,\nwith some features I want to try, such as Gitea Actions. Since I&rsquo;m running 1.17.4, it&rsquo;s time to upgrade.<\/p>"},{"title":"Using MetalLB CRDs","link":"https:\/\/blog.differentpla.net\/blog\/2023\/04\/03\/metallb-crds\/","pubDate":"Mon, 03 Apr 2023 15:33:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/04\/03\/metallb-crds\/","description":"<p>When I originally <a href=\"https:\/\/blog.differentpla.net\/blog\/2021\/12\/20\/installing-metallb\/\">installed MetalLB<\/a>, it used a <code>ConfigMap<\/code> for\nsetting up address ranges. Since 0.13.2, it supports configuration using Custom Resource Definitions (CRDs). I forgot to\nwrite a blog post about that when I upgraded.<\/p>"},{"title":"EUnit examples: Passing the result from 'foreach'","link":"https:\/\/blog.differentpla.net\/blog\/2023\/04\/02\/eunit-examples-foreach-result\/","pubDate":"Sun, 02 Apr 2023 11:23:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/04\/02\/eunit-examples-foreach-result\/","description":"<p>Similar to passing the result from <code>{setup, Setup, ...<\/code> to each test, you can also pass the result from <code>{foreach, Setup, ...<\/code> to each test, but there are some differences.<\/p>"},{"title":"EUnit examples: Passing the result from 'setup'","link":"https:\/\/blog.differentpla.net\/blog\/2023\/04\/02\/eunit-examples-setup-result\/","pubDate":"Sun, 02 Apr 2023 08:20:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/04\/02\/eunit-examples-setup-result\/","description":"<p>The result from <code>setup<\/code> is passed to <code>cleanup<\/code> already. What if we want to pass it to each of our tests? It&rsquo;s a bit\nawkward, but it looks like the following:<\/p>"},{"title":"EUnit examples: Nested 'setup' and 'foreach'","link":"https:\/\/blog.differentpla.net\/blog\/2023\/04\/02\/eunit-examples-nested-setup-foreach\/","pubDate":"Sun, 02 Apr 2023 08:14:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/04\/02\/eunit-examples-nested-setup-foreach\/","description":"<p>If you want to run some setup before (and cleanup after) a list of tests, and <em>also<\/em> some setup and cleanup for each\ntest, you can nest <code>setup<\/code> and <code>foreach<\/code>:<\/p>"},{"title":"Restricting Erlang distribution to localhost","link":"https:\/\/blog.differentpla.net\/blog\/2023\/04\/01\/inet-tcp-dist-localhost\/","pubDate":"Sat, 01 Apr 2023 15:04:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/04\/01\/inet-tcp-dist-localhost\/","description":"<p>By default, Erlang distribution listens on all available network interfaces. Sometimes you don&rsquo;t want this. How can we\nfix it?<\/p>"},{"title":"EUnit examples: Using 'foreach'","link":"https:\/\/blog.differentpla.net\/blog\/2023\/03\/31\/eunit-examples-foreach\/","pubDate":"Fri, 31 Mar 2023 08:30:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/03\/31\/eunit-examples-foreach\/","description":"<p>We saw that <code>setup<\/code> runs setup\/cleanup before <em>all<\/em> tests in a list. If you want to run some setup\/cleanup before <em>each<\/em>\ntest in a list, you can use <code>foreach<\/code>:<\/p>"},{"title":"EUnit examples: Using 'setup'","link":"https:\/\/blog.differentpla.net\/blog\/2023\/03\/31\/eunit-examples-setup\/","pubDate":"Fri, 31 Mar 2023 08:20:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/03\/31\/eunit-examples-setup\/","description":"<p>What if we want to run some setup before a set of tests (and cleanup afterwards)?<\/p>"},{"title":"EUnit examples: a test list","link":"https:\/\/blog.differentpla.net\/blog\/2023\/03\/31\/eunit-examples-list\/","pubDate":"Fri, 31 Mar 2023 08:15:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/03\/31\/eunit-examples-list\/","description":"<p>While you could specify each test with a single function, you can also use a test &ldquo;instantiator&rdquo; (or generator) and have\nit return a list.<\/p>"},{"title":"EUnit examples: a simple test","link":"https:\/\/blog.differentpla.net\/blog\/2023\/03\/31\/eunit-examples-simple\/","pubDate":"Fri, 31 Mar 2023 08:10:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/03\/31\/eunit-examples-simple\/","description":"<p>A simple EUnit test might look like this:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-erlang\" data-lang=\"erlang\"><span class=\"line\"><span class=\"cl\"><span class=\"c\">% in test\/meaning_test.erl\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">-<\/span><span class=\"ni\">module<\/span><span class=\"p\">(<\/span><span class=\"n\">meaning_test<\/span><span class=\"p\">).<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">-<\/span><span class=\"ni\">include_lib<\/span><span class=\"p\">(<\/span><span class=\"s\">&#34;eunit\/include\/eunit.hrl&#34;<\/span><span class=\"p\">).<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"nf\">the_test<\/span><span class=\"p\">()<\/span> <span class=\"o\">-&gt;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"o\">?<\/span><span class=\"n\">assertEqual<\/span><span class=\"p\">(<\/span><span class=\"mi\">42<\/span><span class=\"p\">,<\/span> <span class=\"nn\">meaning<\/span><span class=\"p\">:<\/span><span class=\"nf\">meaning_of<\/span><span class=\"p\">([<\/span><span class=\"n\">life<\/span><span class=\"p\">,<\/span> <span class=\"n\">universe<\/span><span class=\"p\">,<\/span> <span class=\"n\">everything<\/span><span class=\"p\">])).<\/span><\/span><\/span><\/code><\/pre><\/div>\n<p>Of note:<\/p>"},{"title":"EUnit examples: Introduction","link":"https:\/\/blog.differentpla.net\/blog\/2023\/03\/31\/eunit-examples-intro\/","pubDate":"Fri, 31 Mar 2023 08:00:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/03\/31\/eunit-examples-intro\/","description":"<p>Some examples of how to use Erlang&rsquo;s unit-testing framework, EUnit. Starting with simple examples and getting more\nadvanced.<\/p>"},{"title":"Remotely loading Erlang modules","link":"https:\/\/blog.differentpla.net\/blog\/2023\/03\/21\/remote-load-erlang-modules\/","pubDate":"Tue, 21 Mar 2023 18:44:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/03\/21\/remote-load-erlang-modules\/","description":"<p>Sometimes, you&rsquo;re connected to another node in an Erlang cluster, and you need to inject a new or replacement module.\nHere&rsquo;s how.<\/p>"},{"title":"Cert-Manager Audit","link":"https:\/\/blog.differentpla.net\/blog\/2023\/03\/20\/k8s-cert-manager-audit\/","pubDate":"Mon, 20 Mar 2023 13:15:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/03\/20\/k8s-cert-manager-audit\/","description":"<p>In <a href=\"https:\/\/blog.differentpla.net\/blog\/2023\/03\/19\/expired-certificates-incident-review\/\">Expired Certificates: Incident Review<\/a>, I\nlisted a future action: <em>&ldquo;Audit the cluster to see if there are any other TLS secrets that aren&rsquo;t using cert-manager.&rdquo;<\/em>\nHere&rsquo;s how I did it using Elixir Livebook.<\/p>"},{"title":"Expired Certificates: Incident Review","link":"https:\/\/blog.differentpla.net\/blog\/2023\/03\/19\/expired-certificates-incident-review\/","pubDate":"Sun, 19 Mar 2023 20:07:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/03\/19\/expired-certificates-incident-review\/","description":"<p>During the morning of March 18th, 2023, while investigating <a href=\"https:\/\/blog.differentpla.net\/blog\/2023\/03\/18\/metallb-incident-review\/\">this incident<\/a>, Firefox reported a &ldquo;your connection is not secure&rdquo; error when connecting to\nmy gitea server. This is the incident review.<\/p>"},{"title":"MetalLB ARP failure: Incident Review","link":"https:\/\/blog.differentpla.net\/blog\/2023\/03\/18\/metallb-incident-review\/","pubDate":"Sat, 18 Mar 2023 11:54:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/03\/18\/metallb-incident-review\/","description":"<p>On the morning of March 18th, 2023, accessing any sites hosted by my Kubernetes cluster would fail with a &ldquo;Connection\nTimed Out&rdquo; error. This is the incident review.<\/p>"},{"title":"Exporting variables from scripts","link":"https:\/\/blog.differentpla.net\/blog\/2023\/03\/17\/exporting-variables-from-scripts\/","pubDate":"Fri, 17 Mar 2023 10:08:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/03\/17\/exporting-variables-from-scripts\/","description":"<p>Often, when you&rsquo;re doing something in an interactive shell, you&rsquo;d like to set an environment variable from a script. But\nyou can&rsquo;t, because scripts run as their own process, which means that they can&rsquo;t set environment variables in their\nparent (the shell). How do we get around that?<\/p>"},{"title":"Using socat to strip HTTPS","link":"https:\/\/blog.differentpla.net\/blog\/2023\/03\/11\/socat-strip-https\/","pubDate":"Sat, 11 Mar 2023 11:54:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/03\/11\/socat-strip-https\/","description":"<p>I&rsquo;m trying to figure out how <code>kubectl<\/code> does its thing. Because it uses HTTPS to talk to the API server, I can&rsquo;t use\nWireshark to look at the traffic. Here&rsquo;s how I used <code>socat<\/code> to snoop on the traffic.<\/p>"},{"title":"Resetting the terminal after running rebar3","link":"https:\/\/blog.differentpla.net\/blog\/2023\/03\/08\/rebar3-stty-sane\/","pubDate":"Wed, 08 Mar 2023 10:12:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/03\/08\/rebar3-stty-sane\/","description":"<p>Sometimes, when you run <code>rebar3 shell<\/code> and you press Ctrl+C twice to quit, your terminal is messed up. This is how I\nfixed it in zsh.<\/p>"},{"title":"Loading .erlang from the working directory","link":"https:\/\/blog.differentpla.net\/blog\/2023\/03\/07\/erlangrc-working-dir\/","pubDate":"Tue, 07 Mar 2023 16:04:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/03\/07\/erlangrc-working-dir\/","description":"<p>In the <a href=\"https:\/\/blog.differentpla.net\/blog\/2023\/03\/04\/erlang-shell-prompt\/\">previous post<\/a>, I wrote about customizing the Erlang shell\nprompt by using the <code>.erlang<\/code> file. Erlang looks for this file in <code>$HOME<\/code> (I&rsquo;m simplifying here); it doesn&rsquo;t look in the\ncurrent working directory. How can we fix that?<\/p>"},{"title":"Changing the Erlang shell prompt","link":"https:\/\/blog.differentpla.net\/blog\/2023\/03\/04\/erlang-shell-prompt\/","pubDate":"Sat, 04 Mar 2023 16:38:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/03\/04\/erlang-shell-prompt\/","description":"<p>Did you know that you can change the Erlang shell prompt?<\/p>"},{"title":"Writing a kubectl ssh plugin","link":"https:\/\/blog.differentpla.net\/blog\/2023\/02\/28\/kubectl-ssh-plugin\/","pubDate":"Tue, 28 Feb 2023 12:54:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/02\/28\/kubectl-ssh-plugin\/","description":"<p>In <a href=\"https:\/\/blog.differentpla.net\/blog\/2022\/12\/22\/erlang-cluster-k8s-ssh\/\">this post<\/a>, I showed how to access the Erlang console via SSH\nusing <code>kubectl port-forward<\/code>.<\/p>"},{"title":"Setting the window title from Erlang","link":"https:\/\/blog.differentpla.net\/blog\/2023\/02\/22\/erlang-window-title\/","pubDate":"Wed, 22 Feb 2023 17:21:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/02\/22\/erlang-window-title\/","description":"<p>How do I change the title of my terminal window from Erlang?<\/p>"},{"title":"Using RSA keys for encryption and decryption in Erlang","link":"https:\/\/blog.differentpla.net\/blog\/2023\/02\/14\/rsa-encryption-erlang\/","pubDate":"Tue, 14 Feb 2023 09:39:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/02\/14\/rsa-encryption-erlang\/","description":"<p>How do I encrypt (and decrypt) things in Erlang, using an RSA key?<\/p>"},{"title":"Encrypting a JSON Web Token in Erlang, using JOSE","link":"https:\/\/blog.differentpla.net\/blog\/2023\/02\/13\/jwt-encryption-jose\/","pubDate":"Mon, 13 Feb 2023 17:46:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/02\/13\/jwt-encryption-jose\/","description":"<p>In an earlier post, I showed how to <a href=\"https:\/\/blog.differentpla.net\/blog\/2023\/02\/13\/jwt-encryption-erlang\/\">encrypt a JSON Web Token in Erlang<\/a>. I used plain-ol&rsquo; Erlang. Here&rsquo;s how to use the\n<a href=\"https:\/\/hex.pm\/packages\/jose\">jose<\/a> package to do the same thing.<\/p>"},{"title":"Encrypting a JSON Web Token in Erlang","link":"https:\/\/blog.differentpla.net\/blog\/2023\/02\/13\/jwt-encryption-erlang\/","pubDate":"Mon, 13 Feb 2023 15:37:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/02\/13\/jwt-encryption-erlang\/","description":"<p>Following on from <a href=\"https:\/\/blog.differentpla.net\/blog\/2023\/02\/09\/jwt-signing-erlang\/\">signing a web token in Erlang<\/a>, here&rsquo;s how to\nencrypt one.<\/p>"},{"title":"Signing a JSON Web Token in Erlang, using JOSE","link":"https:\/\/blog.differentpla.net\/blog\/2023\/02\/11\/jwt-signing-erlang-jose\/","pubDate":"Sat, 11 Feb 2023 14:45:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/02\/11\/jwt-signing-erlang-jose\/","description":"<p>In an earlier post, I showed how to <a href=\"https:\/\/blog.differentpla.net\/blog\/2023\/02\/09\/jwt-signing-erlang\/\">sign a JSON Web Token in Erlang<\/a>. I used plain-ol&rsquo; Erlang. Here&rsquo;s how to use the <a href=\"https:\/\/hex.pm\/packages\/jose\">jose<\/a> package to do the same thing.<\/p>"},{"title":"Signing a JSON Web Token in Erlang","link":"https:\/\/blog.differentpla.net\/blog\/2023\/02\/09\/jwt-signing-erlang\/","pubDate":"Thu, 09 Feb 2023 16:52:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/02\/09\/jwt-signing-erlang\/","description":"<p>About 8 years ago, I wrote a post about <a href=\"https:\/\/blog.differentpla.net\/blog\/2015\/04\/19\/jwt-rs256-erlang\/\">verifying JSON Web Tokens (JWT) in Erlang<\/a>.\n3 years later, I wrote another post about <a href=\"https:\/\/blog.differentpla.net\/blog\/2017\/10\/05\/google-pub-sub-bash\/\">signing a JWT in bash<\/a>.\nThis is a post combining the two: here&rsquo;s how you sign a JWT using Erlang.<\/p>"},{"title":"Using RSA keys for signing in Erlang","link":"https:\/\/blog.differentpla.net\/blog\/2023\/02\/08\/rsa-signing-erlang\/","pubDate":"Wed, 08 Feb 2023 14:06:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/02\/08\/rsa-signing-erlang\/","description":"<p>How do I sign (and verify) things in Erlang, using an RSA key?<\/p>"},{"title":"Wrapping an RSA private key with Erlang","link":"https:\/\/blog.differentpla.net\/blog\/2023\/02\/08\/wrap-rsa-private-key-erlang\/","pubDate":"Wed, 08 Feb 2023 11:13:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/02\/08\/wrap-rsa-private-key-erlang\/","description":"<p>The previous post finished up by writing an RSA public key in &ldquo;wrapped&rdquo; (PKCS#8) PEM-format. It occurred to me that I should probably show how to do the same with the <em>private<\/em> key as well.<\/p>"},{"title":"Generating an RSA key with Erlang","link":"https:\/\/blog.differentpla.net\/blog\/2023\/02\/07\/generate-rsa-key-erlang\/","pubDate":"Tue, 07 Feb 2023 18:39:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/02\/07\/generate-rsa-key-erlang\/","description":"<p>I&rsquo;m currently doing something that needs RSA keys, so here are some Erlang snippets showing how to create one.<\/p>"},{"title":"Unit testing in Elixir Livebook","link":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/25\/livebook-unit-testing\/","pubDate":"Wed, 25 Jan 2023 11:19:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/25\/livebook-unit-testing\/","description":"<p>I&rsquo;ve written some code in Elixir Livebook, and I&rsquo;d like to write some unit tests for it. Here&rsquo;s how I did it.<\/p>"},{"title":"Using node-exporter with VictoriaMetrics","link":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/24\/victoria-metrics-node-exporter\/","pubDate":"Tue, 24 Jan 2023 18:37:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/24\/victoria-metrics-node-exporter\/","description":"<p>I&rsquo;d like to get some CPU temperature metrics from the nodes in my K3s cluster. That&rsquo;s the job of Prometheus'\n<code>node-exporter<\/code>. I&rsquo;m not using Prometheus; I&rsquo;m using VictoriaMetrics. Here&rsquo;s how to get it working.<\/p>"},{"title":"Erlang Clustering: a survey","link":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/22\/erlang-clustering-survey\/","pubDate":"Sun, 22 Jan 2023 12:10:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/22\/erlang-clustering-survey\/","description":"<p>A <a href=\"https:\/\/hachyderm.io\/@alter_kaker\/109713602011411781\">question<\/a> on Mastodon asks <em>&ldquo;What are people using [for cluster\nmanagement] in 2023?&rdquo;<\/em>. I thought I&rsquo;d address a couple of hidden assumptions in the question and do a quick survey of\nwhat&rsquo;s available.<\/p>"},{"title":"Simple log colouring in Erlang","link":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/21\/erlang-simple-log-colouring\/","pubDate":"Sat, 21 Jan 2023 20:40:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/21\/erlang-simple-log-colouring\/","description":"<p>By default, the improved logger originally introduced in Erlang\/OTP-21 doesn&rsquo;t support per-level colours. This is\nsomething that I miss from <a href=\"https:\/\/github.com\/erlang-lager\/lager\"><code>lager<\/code><\/a> and from Elixir&rsquo;s <code>Logger<\/code>. Here&rsquo;s a simple\nway to implement something like <code>lager<\/code>.<\/p>"},{"title":"BEAM Telemetry: Prometheus","link":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/19\/beam-telemetry-prometheus\/","pubDate":"Thu, 19 Jan 2023 17:58:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/19\/beam-telemetry-prometheus\/","description":"<p>In the previous posts, we gathered metrics from <a href=\"https:\/\/blog.differentpla.net\/blog\/2023\/01\/15\/beam-telemetry-cowboy-metrics\/\">Cowboy<\/a>\nand <a href=\"https:\/\/blog.differentpla.net\/blog\/2023\/01\/18\/beam-telemetry-hackney\/\">Hackney<\/a>. I&rsquo;d like to publish the metrics to Prometheus.<\/p>"},{"title":"BEAM Telemetry: Hackney Metrics","link":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/18\/beam-telemetry-hackney\/","pubDate":"Wed, 18 Jan 2023 20:10:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/18\/beam-telemetry-hackney\/","description":"<p>In the <a href=\"https:\/\/blog.differentpla.net\/blog\/2023\/01\/15\/beam-telemetry-cowboy-metrics\/\">previous post<\/a> of the series, I added basic\nmetrics reporting to Cowboy, and simply wrote them to the logger. In this post, I&rsquo;m going to do the same for the HTTP client, Hackney,.<\/p>"},{"title":"Router Upgrade Outage: Incident Review","link":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/16\/router-upgrade-incident-review\/","pubDate":"Mon, 16 Jan 2023 17:38:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/16\/router-upgrade-incident-review\/","description":"<p>On January 16th, 2023 between approximately 03:15 and 08:00, the router on my home network froze. This is the incident review.<\/p>"},{"title":"BEAM Telemetry: Cowboy Metrics","link":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/15\/beam-telemetry-cowboy-metrics\/","pubDate":"Sun, 15 Jan 2023 12:55:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/15\/beam-telemetry-cowboy-metrics\/","description":"<p>Cowboy is probably the most popular HTTP server for the Erlang and Elixir ecosystem. Here&rsquo;s how to get metrics from it.<\/p>"},{"title":"Building Erlang from source and using it with direnv","link":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/10\/erlang-source-with-direnv\/","pubDate":"Tue, 10 Jan 2023 11:25:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/10\/erlang-source-with-direnv\/","description":"<p>Building and installing Erlang is <em>almost<\/em> compatible with my <code>use erlang<\/code> <a href=\"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/integrating-kerl-direnv\/\">rule for direnv<\/a>. Here&rsquo;s how to bodge it.<\/p>"},{"title":"Building Erlang\/OTP","link":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/09\/building-erlang\/","pubDate":"Mon, 09 Jan 2023 18:06:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/09\/building-erlang\/","description":"<p>There&rsquo;s more comprehensive information in various files in the <code>HOWTO<\/code> directory, but ain&rsquo;t nobody got time for that. This works for me.<\/p>"},{"title":"Forking Erlang\/OTP","link":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/09\/forking-erlang\/","pubDate":"Mon, 09 Jan 2023 17:49:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/09\/forking-erlang\/","description":"<p>Some notes about hacking on and contributing to Erlang, because I don&rsquo;t do it frequently enough to have all of this in muscle memory.<\/p>"},{"title":"Erlang SSH - No host key available","link":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/08\/erlang-ssh-debugging\/","pubDate":"Sun, 08 Jan 2023 16:31:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/08\/erlang-ssh-debugging\/","description":"<p>You&rsquo;re experimenting with Erlang&rsquo;s <a href=\"https:\/\/www.erlang.org\/doc\/man\/ssh.html\">built-in SSH daemon<\/a>, and it fails with &ldquo;No\nhost key available&rdquo;. What&rsquo;s up with that?<\/p>"},{"title":"Erlang cluster on Kubernetes: Fatal - Certificate Expired","link":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/07\/erlang-cluster-k8s-certificate-expired\/","pubDate":"Sat, 07 Jan 2023 17:11:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/07\/erlang-cluster-k8s-certificate-expired\/","description":"<p>The nodes in the <a href=\"https:\/\/blog.differentpla.net\/blog\/2022\/12\/21\/erlang-cluster-k8s-intro\/\">cluster<\/a> stopped talking to each other at\nsome point. I only noticed this afternoon after investigating <a href=\"https:\/\/blog.differentpla.net\/blog\/2023\/01\/07\/network-connectivity-incident-review\/\">some other problem<\/a>.<\/p>"},{"title":"Network Connectivity: Incident Review","link":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/07\/network-connectivity-incident-review\/","pubDate":"Sat, 07 Jan 2023 16:08:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/07\/network-connectivity-incident-review\/","description":"<p>On January 7th, 2023 between approximately 10:50 and 13:50, there were network connectivity issues on my home network.\nThis is the incident review.<\/p>"},{"title":"Synology VPN compatibility","link":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/07\/synology-vpn-compatibility\/","pubDate":"Sat, 07 Jan 2023 14:52:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/07\/synology-vpn-compatibility\/","description":"<p>I recently experimented with using <a href=\"https:\/\/blog.differentpla.net\/blog\/2022\/11\/25\/tailscale-subnet-router\/\">Tailscale Subnet Router<\/a> as\na VPN, to allow me to connect to my home network from the pub. It sorta works, but it&rsquo;s been unreliable recently. I&rsquo;m\ngoing to look at the VPN options that my Synology router gives me.<\/p>"},{"title":"apt upgrade on K3s node","link":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/07\/k3s-apt-upgrade\/","pubDate":"Sat, 07 Jan 2023 09:19:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/07\/k3s-apt-upgrade\/","description":"<p>Given <a href=\"https:\/\/blog.differentpla.net\/blog\/2022\/12\/15\/k3s-pv-loss-incident-review\/\">the problems<\/a> I had when I last upgraded everything\non my K3s cluster, I&rsquo;m going to put a runbook together for doing it &ldquo;properly&rdquo;.<\/p>"},{"title":"Compiling Ruby 2.7.7 on Ubuntu 22.04","link":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/06\/compiling-ruby-fails-openssl\/","pubDate":"Fri, 06 Jan 2023 20:24:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/06\/compiling-ruby-fails-openssl\/","description":"<p>Compiling Ruby 2.7.7 fails with the following error about openssl:<\/p>"},{"title":"Traefik dashboard on K3s","link":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/06\/traefik-dashboard\/","pubDate":"Fri, 06 Jan 2023 17:24:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/06\/traefik-dashboard\/","description":"<p>It turns out that Traefik has a dashboard. Here&rsquo;s how to access it via <code>kubectl port-forward<\/code>.<\/p>"},{"title":"Redirecting HTTP to HTTPS with Traefik on K3s","link":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/06\/traefik-https-redirect\/","pubDate":"Fri, 06 Jan 2023 16:57:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/06\/traefik-https-redirect\/","description":"<p>I want visitors to <code>http:\/\/home.k3s.differentpla.net<\/code> to be redirected to <code>https:\/\/home.k3s.differentpla.net<\/code>. Here&rsquo;s\nhow to set that up on K3s, using Traefik middlewares.<\/p>"},{"title":"Using setup and foreach in eunit tests","link":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/03\/eunit-setup-foreach\/","pubDate":"Tue, 03 Jan 2023 13:18:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2023\/01\/03\/eunit-setup-foreach\/","description":"<p>For when you want to run both per-suite and per-test setup and cleanup in eunit tests.<\/p>"},{"title":"Erlang cluster on Kubernetes: Conclusion","link":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/23\/erlang-cluster-k8s-conclusion\/","pubDate":"Fri, 23 Dec 2022 18:09:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/23\/erlang-cluster-k8s-conclusion\/","description":"<p>This started as a quick experiment to spin up an Erlang cluster on Kubernetes, using TLS distribution, and to validate\nusing <em>cert-manager<\/em> to issue the pod certificates.<\/p>"},{"title":"Erlang cluster on Kubernetes: CertificateRequest cleanup","link":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/23\/erlang-cluster-k8s-certreq-cleanup\/","pubDate":"Fri, 23 Dec 2022 17:36:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/23\/erlang-cluster-k8s-certreq-cleanup\/","description":"<p>In <a href=\"https:\/\/blog.differentpla.net\/blog\/2022\/12\/22\/erlang-cluster-k8s-certificate-requests-cert-manager\/\">this post<\/a>, I showed how to use\nan init container to create <code>CertificateRequest<\/code> objects, which <em>cert-manager<\/em> signs, returning the certificates. A new\nrequest is created every time a pod starts. This eventually leaves a lot of stale <code>CertificateRequest<\/code> objects. We\nshould clean those up.<\/p>"},{"title":"Erlang cluster on Kubernetes: Polling the CertificateRequest","link":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/23\/erlang-cluster-k8s-poll-certreq\/","pubDate":"Fri, 23 Dec 2022 17:19:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/23\/erlang-cluster-k8s-poll-certreq\/","description":"<p>In a <a href=\"https:\/\/blog.differentpla.net\/blog\/2022\/12\/22\/erlang-cluster-k8s-certificate-requests-cert-manager\/\">previous post<\/a>, I used <code>sleep 5s<\/code> to wait for <em>cert-manager<\/em> to complete the <code>CertificateRequest<\/code>. Instead, we should poll the <code>status<\/code> field.<\/p>"},{"title":"Erlang cluster on Kubernetes: Using a namespace-scoped issuer","link":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/23\/erlang-cluster-k8s-namespace-issuer\/","pubDate":"Fri, 23 Dec 2022 17:06:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/23\/erlang-cluster-k8s-namespace-issuer\/","description":"<p>In <a href=\"https:\/\/blog.differentpla.net\/blog\/2022\/12\/22\/erlang-cluster-k8s-certificate-requests-cert-manager\/\">an earlier post<\/a>, I used a\n<code>ClusterIssuer<\/code> that I originally created when <a href=\"https:\/\/blog.differentpla.net\/blog\/2022\/02\/06\/cert-manager\/\">first setting up cert-manager<\/a>. That needs fixing.<\/p>"},{"title":"Erlang cluster on Kubernetes: pid zero","link":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/22\/erlang-cluster-k8s-pid-zero\/","pubDate":"Thu, 22 Dec 2022 18:13:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/22\/erlang-cluster-k8s-pid-zero\/","description":"<p>Erlang doesn&rsquo;t like running as pid 0 (usually the init process). I used <code>tini<\/code> to fix it.<\/p>"},{"title":"Erlang cluster on Kubernetes: Non-root user","link":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/22\/erlang-cluster-k8s-non-root-user\/","pubDate":"Thu, 22 Dec 2022 18:08:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/22\/erlang-cluster-k8s-non-root-user\/","description":"<p>The Erlang daemon that I&rsquo;ve been using to demonstrate Erlang distribution on K8s is running as the root user. I&rsquo;m going\nto fix that.<\/p>"},{"title":"Erlang cluster on Kubernetes: Readiness Probe","link":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/22\/erlang-cluster-k8s-readiness-probe\/","pubDate":"Thu, 22 Dec 2022 17:50:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/22\/erlang-cluster-k8s-readiness-probe\/","description":"<p>While scaling up\/down the deployment for my Erlang cluster, I regularly refresh the web page that displays cluster\nmembers. Occasionally, I get a &ldquo;502 Bad Gateway&rdquo; error from Traefik. What&rsquo;s with that?<\/p>"},{"title":"Erlang cluster on Kubernetes: Is it mutual?","link":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/22\/erlang-cluster-k8s-inspect-sslsocket\/","pubDate":"Thu, 22 Dec 2022 16:45:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/22\/erlang-cluster-k8s-inspect-sslsocket\/","description":"<p>In theory, we&rsquo;ve <a href=\"https:\/\/blog.differentpla.net\/blog\/2022\/12\/22\/erlang-cluster-k8s-tls-distribution\/\">got TLS working<\/a> for our Erlang\ncluster, with <a href=\"https:\/\/blog.differentpla.net\/blog\/2022\/12\/22\/erlang-cluster-k8s-use-certs\/\">mutual authentication<\/a>. How do we prove\nthat?<\/p>"},{"title":"Erlang cluster on Kubernetes: SSH public key authentication","link":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/22\/erlang-cluster-k8s-ssh-pubkey\/","pubDate":"Thu, 22 Dec 2022 15:25:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/22\/erlang-cluster-k8s-ssh-pubkey\/","description":"<p>In the <a href=\"https:\/\/blog.differentpla.net\/blog\/2022\/12\/22\/erlang-cluster-k8s-ssh\/\">previous post<\/a>, I showed how to enable SSH access to the\nErlang remote console on a pod. When we left it, it had no authentication. Let&rsquo;s fix that.<\/p>"},{"title":"Erlang cluster on Kubernetes: SSH daemon","link":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/22\/erlang-cluster-k8s-ssh\/","pubDate":"Thu, 22 Dec 2022 14:35:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/22\/erlang-cluster-k8s-ssh\/","description":"<p>As mentioned <a href=\"https:\/\/blog.differentpla.net\/blog\/2022\/12\/22\/erlang-cluster-k8s-tls-distribution\/\">earlier<\/a>, using TLS for Erlang\ndistribution breaks <code>erlclu remote_console<\/code> (because it breaks <code>erl_call<\/code>). At the time, I worked around the problem by\nusing <code>nodetool<\/code>. This post shows how to use Erlang&rsquo;s SSH daemon instead.<\/p>"},{"title":"Erlang application versioning","link":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/22\/erlang-versioning\/","pubDate":"Thu, 22 Dec 2022 13:53:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/22\/erlang-versioning\/","description":"<p>When you&rsquo;re investigating a problem with a deployed application, it&rsquo;s useful to know precisely which version you&rsquo;re\nlooking at. Here&rsquo;s how to automatically set the version number in an Erlang project.<\/p>"},{"title":"Erlang cluster on Kubernetes: Using the generated certificates","link":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/22\/erlang-cluster-k8s-use-certs\/","pubDate":"Thu, 22 Dec 2022 10:04:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/22\/erlang-cluster-k8s-use-certs\/","description":"<p>In the previous two posts, we <a href=\"https:\/\/blog.differentpla.net\/blog\/2022\/12\/22\/erlang-cluster-k8s-certificate-requests-openssl\/\">generated signing requests with OpenSSL<\/a> and <a href=\"https:\/\/blog.differentpla.net\/blog\/2022\/12\/22\/erlang-cluster-k8s-certificate-requests-cert-manager\/\">submitted them to <em>cert-manager<\/em><\/a>. In this post, we&rsquo;ll actually <em>use<\/em> the\ngenerated certificates for mutual TLS.<\/p>"},{"title":"Erlang cluster on Kubernetes: Submitting certificate requests to cert-manager","link":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/22\/erlang-cluster-k8s-certificate-requests-cert-manager\/","pubDate":"Thu, 22 Dec 2022 10:01:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/22\/erlang-cluster-k8s-certificate-requests-cert-manager\/","description":"<p>In the <a href=\"https:\/\/blog.differentpla.net\/blog\/2022\/12\/22\/erlang-cluster-k8s-certificate-requests-openssl\/\">previous post<\/a> we used OpenSSL\nto create a certificate signing request. In this post, we&rsquo;ll submit it to <em>cert-manager<\/em> and get the certificate back.<\/p>"},{"title":"Erlang cluster on Kubernetes: Creating Certificate signing requests with OpenSSL","link":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/22\/erlang-cluster-k8s-certificate-requests-openssl\/","pubDate":"Thu, 22 Dec 2022 09:58:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/22\/erlang-cluster-k8s-certificate-requests-openssl\/","description":"<p>Erlang TLS distribution is picky about how its certificates are created. OpenSSL is a pain to use. Here&rsquo;s how to\nawkwardly wedge the two together. This took me several hours and a lot of my sanity. You&rsquo;re welcome.<\/p>"},{"title":"Erlang cluster on Kubernetes: Basic init container","link":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/22\/erlang-cluster-k8s-init-container\/","pubDate":"Thu, 22 Dec 2022 09:56:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/22\/erlang-cluster-k8s-init-container\/","description":"<p>As explained <a href=\"https:\/\/blog.differentpla.net\/blog\/2022\/11\/13\/cert-signing-options\/\">here<\/a>, I&rsquo;m going to use an <a href=\"https:\/\/kubernetes.io\/docs\/concepts\/workloads\/pods\/init-containers\/\">init\ncontainer<\/a> to issue the pod certificates.<\/p>"},{"title":"Erlang cluster on Kubernetes: TLS distribution","link":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/22\/erlang-cluster-k8s-tls-distribution\/","pubDate":"Thu, 22 Dec 2022 09:52:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/22\/erlang-cluster-k8s-tls-distribution\/","description":"<p>In the <a href=\"https:\/\/blog.differentpla.net\/blog\/2022\/12\/21\/erlang-cluster-k8s-erlang-clustering\/\">previous post<\/a>, we got clustering working\n<em>without TLS<\/em>. Lifting from the investigation that I wrote up <a href=\"https:\/\/blog.differentpla.net\/blog\/2022\/11\/12\/erlang-tls-distribution\/\">here<\/a>,\nI&rsquo;ll add TLS distribution to my Erlang cluster, but only with server certificates and with no verification (for now).<\/p>"},{"title":"Erlang cluster on Kubernetes: Erlang Clustering","link":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/21\/erlang-cluster-k8s-erlang-clustering\/","pubDate":"Wed, 21 Dec 2022 19:52:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/21\/erlang-cluster-k8s-erlang-clustering\/","description":"<p>Based on my <a href=\"https:\/\/blog.differentpla.net\/blog\/2022\/01\/08\/libcluster-kubernetes\/\">investigation with libcluster<\/a> in Elixir, I&rsquo;ve\ndecided to use DNS-based discovery for finding the other Erlang nodes in the cluster. To do this, we&rsquo;ll need a headless\nservice.<\/p>"},{"title":"Erlang cluster on Kubernetes: Erlang Cookie","link":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/21\/erlang-cluster-k8s-erlang-cookie\/","pubDate":"Wed, 21 Dec 2022 19:51:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/21\/erlang-cluster-k8s-erlang-cookie\/","description":"<p>I&rsquo;ve covered this previously; see <a href=\"https:\/\/blog.differentpla.net\/blog\/2022\/01\/09\/erlang-cookies-and-kubernetes\/\">&ldquo;Erlang\/Elixir Cookies and Kubernetes&rdquo;<\/a>. Here&rsquo;s the quick version.<\/p>"},{"title":"Erlang cluster on Kubernetes: Speeding up the container build","link":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/21\/erlang-cluster-k8s-speeding-container-build\/","pubDate":"Wed, 21 Dec 2022 19:49:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/21\/erlang-cluster-k8s-speeding-container-build\/","description":"<p>I noticed that whenever I made any change to the application, it caused the <del>docker<\/del>podman build to re-fetch and\nrecompile all of the dependencies. On the tiny laptop I was using at the time, this was taking several extra minutes for\nevery build.<\/p>"},{"title":"Erlang cluster on Kubernetes: HTTP Service","link":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/21\/erlang-cluster-k8s-http-service\/","pubDate":"Wed, 21 Dec 2022 19:47:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/21\/erlang-cluster-k8s-http-service\/","description":"<p>Because this is going to be a cluster of Erlang nodes, there&rsquo;s (obviously) going to be more than one instance. It makes\nsense to add some kind of way to have some kind of &ldquo;whoami&rdquo; page, so that we can clearly see which node we&rsquo;re talking\nto.<\/p>"},{"title":"Erlang cluster on Kubernetes: Initial Deployment","link":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/21\/erlang-cluster-k8s-initial-deployment\/","pubDate":"Wed, 21 Dec 2022 19:45:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/21\/erlang-cluster-k8s-initial-deployment\/","description":"<p>For simplicity&rsquo;s sake, I created a new application with <code>rebar3 new app name=erlclu<\/code>. I very soon regretted this\ndecision, because I actually needed a release, so I ran <code>rebar3 new release name=whoops<\/code> and manually merged the relevant\npieces together.<\/p>"},{"title":"Erlang cluster on Kubernetes: Introduction","link":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/21\/erlang-cluster-k8s-intro\/","pubDate":"Wed, 21 Dec 2022 19:40:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/21\/erlang-cluster-k8s-intro\/","description":"<p>A few weeks ago, I decided to write a blog post about using mutual TLS to secure Erlang distribution (clustering), with\nauto-provisioning of certificates when running in Kubernetes. It took a little longer to write up than I expected, and\nturned into a series of blog posts.<\/p>"},{"title":"Rebar3 Umbrella Projects","link":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/21\/rebar3-umbrella\/","pubDate":"Wed, 21 Dec 2022 14:29:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/21\/rebar3-umbrella\/","description":"<p>Some notes about using <a href=\"https:\/\/rebar3.org\/\">rebar3<\/a> with an umbrella project.<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-bash\" data-lang=\"bash\"><span class=\"line\"><span class=\"cl\">rebar3 new umbrella <span class=\"nv\">name<\/span><span class=\"o\">=<\/span>foo      <span class=\"c1\"># umbrella and release are aliases<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"nb\">cd<\/span> umbrella\/<\/span><\/span><\/code><\/pre><\/div>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-bash\" data-lang=\"bash\"><span class=\"line\"><span class=\"cl\"><span class=\"nb\">cd<\/span> apps\/\n<\/span><\/span><span class=\"line\"><span class=\"cl\">rebar3 new app <span class=\"nv\">name<\/span><span class=\"o\">=<\/span>bar\n<\/span><\/span><span class=\"line\"><span class=\"cl\">rebar3 new lib <span class=\"nv\">name<\/span><span class=\"o\">=<\/span>baz<\/span><\/span><\/code><\/pre><\/div>\n<p>It doesn&rsquo;t set up the application dependencies (because it can&rsquo;t <em>know<\/em> what you mean to do), so you&rsquo;ll need to do that\nyourself. Edit <code>apps\/foo\/src\/foo.app.src<\/code>:<\/p>"},{"title":"K3s PV loss: Incident Review","link":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/15\/k3s-pv-loss-incident-review\/","pubDate":"Thu, 15 Dec 2022 10:37:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/15\/k3s-pv-loss-incident-review\/","description":"<p>On December 14th, 2022 at approximately 10:15, Kubernetes wiped the persistent volumes of a number of applications in\nthe K3s cluster in my homelab. This is the incident review.<\/p>"},{"title":"Failed to allocate directory watch","link":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/14\/failed-allocate-directory-watch\/","pubDate":"Wed, 14 Dec 2022 10:00:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/14\/failed-allocate-directory-watch\/","description":"<p>While running <code>apt-get upgrade<\/code>, I was getting a <code>Failed to allocate directory watch: Too many open files<\/code> error.<\/p>"},{"title":"What is kubectl doing?","link":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/05\/what-is-kubectl-doing\/","pubDate":"Mon, 05 Dec 2022 10:49:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/12\/05\/what-is-kubectl-doing\/","description":"<p>You&rsquo;re using <code>kubectl<\/code> to do something; you want to do the same using the Kubernetes API (e.g. with <code>curl<\/code>). How do you\nfigure out what <code>kubectl<\/code> is doing?<\/p>"},{"title":"Tailscale Subnet Router","link":"https:\/\/blog.differentpla.net\/blog\/2022\/11\/25\/tailscale-subnet-router\/","pubDate":"Fri, 25 Nov 2022 19:27:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/11\/25\/tailscale-subnet-router\/","description":"<p>I&rsquo;ve been looking for a VPN solution for my home network for a while now, and I recently started using Tailscale.<\/p>"},{"title":"Replacing RabbitMQ with nginx for inbound request routing","link":"https:\/\/blog.differentpla.net\/blog\/2022\/11\/22\/replacing-rabbitmq-with-nginx\/","pubDate":"Tue, 22 Nov 2022 18:45:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/11\/22\/replacing-rabbitmq-with-nginx\/","description":"<p>In a conversation on Twitter about most satisfying code cleanup, I mentioned the time that I completely replaced the\nagent-inbound HTTP routing at Electric Imp.<\/p>"},{"title":"Options for automatically creating certificates for mutual pod authentication","link":"https:\/\/blog.differentpla.net\/blog\/2022\/11\/13\/cert-signing-options\/","pubDate":"Sun, 13 Nov 2022 15:04:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/11\/13\/cert-signing-options\/","description":"<p>I want to set up an Erlang cluster in Kubernetes, using TLS with mutual authentication. This post discusses some of the\npotential options for doing that. It&rsquo;s also applicable to general mutual TLS between pods.<\/p>"},{"title":"Erlang TLS Distribution","link":"https:\/\/blog.differentpla.net\/blog\/2022\/11\/12\/erlang-tls-distribution\/","pubDate":"Sat, 12 Nov 2022 14:29:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/11\/12\/erlang-tls-distribution\/","description":"<p>In the previous post, I <a href=\"https:\/\/blog.differentpla.net\/blog\/2022\/11\/11\/erlang-clustering-recap\/\">recapped Erlang distribution (clustering)<\/a>.\nIn this post, we&rsquo;ll secure it by using TLS.<\/p>"},{"title":"Erlang clustering recap","link":"https:\/\/blog.differentpla.net\/blog\/2022\/11\/11\/erlang-clustering-recap\/","pubDate":"Fri, 11 Nov 2022 19:24:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/11\/11\/erlang-clustering-recap\/","description":"<p>I want to write a post about using mutual TLS to secure Erlang distribution (clustering), with auto-provisioning of\ncertificates when running in Kubernetes. This is not that post. This is a recap of basic Erlang clustering, to refresh\nmy memory and lay some groundwork.<\/p>"},{"title":"Generating a version number from your git repo -- follow up","link":"https:\/\/blog.differentpla.net\/blog\/2022\/11\/09\/more-git-vsn\/","pubDate":"Wed, 09 Nov 2022 18:46:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/11\/09\/more-git-vsn\/","description":"<p>I wrote about <a href=\"https:\/\/blog.differentpla.net\/blog\/2022\/11\/05\/git-vsn\/\">Generating a version number from your git repo<\/a> at the weekend. This post contains some follow-up notes and thoughts.<\/p>"},{"title":"Homebrew: Permission denied @ rb_sysopen","link":"https:\/\/blog.differentpla.net\/blog\/2022\/11\/08\/homebrew-tmp\/","pubDate":"Tue, 08 Nov 2022 10:15:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/11\/08\/homebrew-tmp\/","description":"<p>I&rsquo;m getting a permission denied error when running <code>brew search<\/code>:<\/p>"},{"title":"zsh: can't create temp file for here document: permission denied","link":"https:\/\/blog.differentpla.net\/blog\/2022\/11\/07\/zsh-tmp\/","pubDate":"Mon, 07 Nov 2022 19:58:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/11\/07\/zsh-tmp\/","description":"<p>Problems with zsh on macOS.<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-text\" data-lang=\"text\"><span class=\"line\"><span class=\"cl\">zsh: can&#39;t create temp file for here document: permission denied<\/span><\/span><\/code><\/pre><\/div>\n<p>The permissions on <code>\/tmp<\/code>, which is a symlink to <code>\/tmp\/private<\/code> are kinda screwy on my macOS installation:<\/p>"},{"title":"Generating a version number from your git repo","link":"https:\/\/blog.differentpla.net\/blog\/2022\/11\/05\/git-vsn\/","pubDate":"Sat, 05 Nov 2022 10:08:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/11\/05\/git-vsn\/","description":"<p>I&rsquo;d like my application to display some kind of version number, ideally derived from the git tag.<\/p>"},{"title":"Erlang SSH","link":"https:\/\/blog.differentpla.net\/blog\/2022\/11\/01\/erlang-ssh\/","pubDate":"Tue, 01 Nov 2022 10:25:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/11\/01\/erlang-ssh\/","description":"<p>Erlang\/OTP provides a built-in SSH client and daemon. You can use this to expose the console directly over SSH.<\/p>"},{"title":"Using eunit to test private functions","link":"https:\/\/blog.differentpla.net\/blog\/2022\/10\/25\/eunit-private-functions\/","pubDate":"Tue, 25 Oct 2022 17:33:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/10\/25\/eunit-private-functions\/","description":"<p>You&rsquo;ve got an Erlang module with a private (not-exported) function, and you want to add some unit tests for that\nfunction? How should you do that?<\/p>"},{"title":"Using alternate loopback addresses","link":"https:\/\/blog.differentpla.net\/blog\/2022\/10\/19\/alternate-loopback-addresses\/","pubDate":"Wed, 19 Oct 2022 10:33:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/10\/19\/alternate-loopback-addresses\/","description":"<p>Usually, when you use <code>localhost<\/code>, it&rsquo;ll use the <code>127.0.0.1<\/code> loopback address. Did you know that the <em>entire<\/em>\n<code>127.x.y.z<\/code> range is reserved for loopback? See <a href=\"https:\/\/www.ietf.org\/rfc\/rfc990.html#page-6\">RFC 990<\/a> and <a href=\"https:\/\/www.ietf.org\/rfc\/rfc3330.html#section-2\">RFC 3330<\/a>. This can be useful sometimes.<\/p>"},{"title":"VictoriaMetrics static scraper","link":"https:\/\/blog.differentpla.net\/blog\/2022\/10\/16\/victoria-metrics-static-scraper\/","pubDate":"Sun, 16 Oct 2022 15:07:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/10\/16\/victoria-metrics-static-scraper\/","description":"<p>I&rsquo;ve got an Electric Imp Environment Tail in my office. It monitors the temperature, humidity and pressure. Currently,\nto display a graph, it&rsquo;s using flot.js and some shonky Javascript that I wrote. It remembers samples from the last 48\nhours.<\/p>"},{"title":"VictoriaMetrics","link":"https:\/\/blog.differentpla.net\/blog\/2022\/10\/16\/victoria-metrics\/","pubDate":"Sun, 16 Oct 2022 12:07:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/10\/16\/victoria-metrics\/","description":"<p>The documentation for VictoriaMetrics is a bit of a mess, so here&rsquo;s what worked for me.<\/p>"},{"title":"Installing Grafana","link":"https:\/\/blog.differentpla.net\/blog\/2022\/10\/16\/grafana\/","pubDate":"Sun, 16 Oct 2022 10:37:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/10\/16\/grafana\/","description":"<p>Using ArgoCD CLI:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-text\" data-lang=\"text\"><span class=\"line\"><span class=\"cl\">% argocd app create grafana --repo https:\/\/git.k3s.differentpla.net\/roger\/grafana.git --path . --dest-server https:\/\/kubernetes.default.svc --dest-namespace grafana\n<\/span><\/span><span class=\"line\"><span class=\"cl\">application &#39;grafana&#39; created<\/span><\/span><\/code><\/pre><\/div>\n<p>The rest of this is taken from <a href=\"https:\/\/grafana.com\/docs\/grafana\/latest\/setup-grafana\/installation\/kubernetes\/\">https:\/\/grafana.com\/docs\/grafana\/latest\/setup-grafana\/installation\/kubernetes\/<\/a>, except that I&rsquo;ll use an Ingress, rather than a LoadBalancer.<\/p>"},{"title":"Installing ArgoCD Command Line Interface","link":"https:\/\/blog.differentpla.net\/blog\/2022\/10\/16\/installing-argocd-cli\/","pubDate":"Sun, 16 Oct 2022 09:37:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/10\/16\/installing-argocd-cli\/","description":"<p>ArgoCD provides a web interface and a command line interface. Let&rsquo;s install the CLI.<\/p>"},{"title":"Using kustomize to configure nginx to serve static HTML","link":"https:\/\/blog.differentpla.net\/blog\/2022\/10\/15\/kustomize-nginx\/","pubDate":"Sat, 15 Oct 2022 14:37:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/10\/15\/kustomize-nginx\/","description":"<p>As I add more things to my k3s cluster, I find myself wishing that I had a handy index of their home pages. For example,\nI&rsquo;ve got ArgoCD and Gitea installed. I probably want to expose the Longhorn console, and the Kubernetes console. I think\nTraefik has a console, too. I&rsquo;ll also be adding Grafana at some point soon.<\/p>"},{"title":"Multiple Laptops, Multiple Monitors, Redux","link":"https:\/\/blog.differentpla.net\/blog\/2022\/10\/11\/laptops-and-monitors-redux\/","pubDate":"Tue, 11 Oct 2022 13:03:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/10\/11\/laptops-and-monitors-redux\/","description":"<p>This is a follow-up to <a href=\"https:\/\/blog.differentpla.net\/blog\/2021\/09\/11\/laptops-and-monitors\/\">Multiple Laptops, Multiple Monitors<\/a>; I&rsquo;ve\nchanged jobs (meaning a new work laptop) and I bought a Surface Dock 2 to go with my Surface Book 3.<\/p>"},{"title":"Formatting Erlang code in Visual Studio Code","link":"https:\/\/blog.differentpla.net\/blog\/2022\/10\/05\/vscode-erlang-formatting\/","pubDate":"Wed, 05 Oct 2022 10:23:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/10\/05\/vscode-erlang-formatting\/","description":"<p>The ErlangLS extension for VS Code includes formatting, using <code>rebar3_format<\/code>. I&rsquo;d prefer to use <code>erlfmt<\/code>, so here&rsquo;s how I set it up.<\/p>"},{"title":"Upgrading to Ubuntu 22.04 on my k3s cluster","link":"https:\/\/blog.differentpla.net\/blog\/2022\/09\/24\/raspi-ubuntu-upgrade\/","pubDate":"Sat, 24 Sep 2022 13:58:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/09\/24\/raspi-ubuntu-upgrade\/","description":"<p>This afternoon, I fired up my k3s cluster for the first time in a while. When I ran <code>apt update<\/code>, I got an error message\nabout a missing Release file.<\/p>"},{"title":"Monitoring temperatures with telegraf","link":"https:\/\/blog.differentpla.net\/blog\/2022\/08\/29\/telegraf\/","pubDate":"Mon, 29 Aug 2022 15:04:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/08\/29\/telegraf\/","description":"<p>One of my NUCs keeps hanging, and I suspect temperature. I wanted to use collectd to gather the temperature sensor\nvalues, but it was removed from Ubuntu 22.04. Instead, I&rsquo;m going to see if I can get telegraf to do it instead.<\/p>"},{"title":"AWS Glacier with PowerShell","link":"https:\/\/blog.differentpla.net\/blog\/2022\/08\/22\/aws-glacier-powershell\/","pubDate":"Mon, 22 Aug 2022 08:10:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/08\/22\/aws-glacier-powershell\/","description":"<p>I needed to delete a Glacier vault, which (because it&rsquo;s not empty) needs the use of an SDK or the CLI. Since I&rsquo;m using\nWindows, I figured that I might as well take the opportunity to play with the AWS Tools for PowerShell.<\/p>"},{"title":"Installing Debian packages on the empeg","link":"https:\/\/blog.differentpla.net\/blog\/2022\/06\/17\/installing-debian-packages-on-empeg\/","pubDate":"Fri, 17 Jun 2022 06:53:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/06\/17\/installing-debian-packages-on-empeg\/","description":"<p>Sometimes you need to install a binary on your empeg. In my case, I wanted <code>strace<\/code>.<\/p>"},{"title":"Using minicom with an empeg","link":"https:\/\/blog.differentpla.net\/blog\/2022\/06\/13\/empeg-minicom\/","pubDate":"Mon, 13 Jun 2022 13:38:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/06\/13\/empeg-minicom\/","description":"<p>It&rsquo;s been many years since I last connected my empeg player to a Linux PC, and the muscle memory&rsquo;s gone. Here&rsquo;s how to\nmake it work with Ubuntu 20.04.<\/p>"},{"title":"Flutter ListView selection on nVidia Shield","link":"https:\/\/blog.differentpla.net\/blog\/2022\/05\/10\/nvidia-shield-d-pad\/","pubDate":"Tue, 10 May 2022 09:55:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/05\/10\/nvidia-shield-d-pad\/","description":"<p>I&rsquo;m messing around with Flutter on my nVidia Shield, and I needed to make &ldquo;tapping&rdquo; on ListView items work.<\/p>"},{"title":"Enable Network Debugging on nVidia Shield","link":"https:\/\/blog.differentpla.net\/blog\/2022\/05\/10\/nvidia-shield-adb\/","pubDate":"Tue, 10 May 2022 09:43:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/05\/10\/nvidia-shield-adb\/","description":"<p>Here&rsquo;s how to debug your apps over the network on an nVidia Shield device.<\/p>"},{"title":"MusicBrainz tags: MUSICBRAINZ_ALBUMID or MusicBrainz Album Id","link":"https:\/\/blog.differentpla.net\/blog\/2022\/04\/25\/musicbrainz-tags\/","pubDate":"Mon, 25 Apr 2022 14:13:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/04\/25\/musicbrainz-tags\/","description":"<p>I noticed that some of my music collection doesn&rsquo;t have the correct album art. While investigating, I discovered an\nunrelated problem with the MusicBrainz tags.<\/p>"},{"title":"Kotlin unresolved references in VS Code","link":"https:\/\/blog.differentpla.net\/blog\/2022\/04\/05\/kotlin-unresolved-references\/","pubDate":"Tue, 05 Apr 2022 11:15:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/04\/05\/kotlin-unresolved-references\/","description":"<p>I&rsquo;m attempting to write a Flutter plugin (written in Kotlin). If I open it in VS Code, I get a bunch of &ldquo;unresolved reference&rdquo; errors.<\/p>"},{"title":"Flutter\/Kotlin\/Gradle Unsupported class file in VS Code","link":"https:\/\/blog.differentpla.net\/blog\/2022\/04\/05\/gradle-unsupported-class-file\/","pubDate":"Tue, 05 Apr 2022 09:17:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/04\/05\/gradle-unsupported-class-file\/","description":"<p>Opening a Flutter\/Dart\/Kotlin project in VS Code on Windows, and a bunch of stuff is broken.<\/p>"},{"title":"Programming Languages I Have Known","link":"https:\/\/blog.differentpla.net\/blog\/2022\/03\/25\/programming-languages-i-have-known\/","pubDate":"Fri, 25 Mar 2022 16:13:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/03\/25\/programming-languages-i-have-known\/","description":"<p>I&rsquo;m learning Dart and it got me wondering: &ldquo;Just how many programming languages have you used, Roger?&rdquo;.<\/p>"},{"title":"Livebook as K8s Cluster Admin","link":"https:\/\/blog.differentpla.net\/blog\/2022\/03\/09\/livebook-k8s-cluster-admin\/","pubDate":"Wed, 09 Mar 2022 12:29:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/03\/09\/livebook-k8s-cluster-admin\/","description":"<p>Because I like experimenting with Kubernetes from Elixir Livebook, I made the service account into a cluster admin.<\/p>"},{"title":"CoreDNS Customization","link":"https:\/\/blog.differentpla.net\/blog\/2022\/02\/25\/coredns-custom\/","pubDate":"Fri, 25 Feb 2022 08:47:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/02\/25\/coredns-custom\/","description":"<p>While <a href=\"https:\/\/blog.differentpla.net\/blog\/2022\/02\/25\/pod-dns-problems\/\">debugging pod DNS problems<\/a>, I discovered that CoreDNS allows\ncustomization by importing extra zone files from a config map. I&rsquo;m going to use that to forward queries for <code>k3s.differentpla.net<\/code> to my <a href=\"https:\/\/blog.differentpla.net\/blog\/2021\/12\/29\/coredns\/\">custom CoreDNS instance<\/a>.<\/p>"},{"title":"Pod DNS Problems","link":"https:\/\/blog.differentpla.net\/blog\/2022\/02\/25\/pod-dns-problems\/","pubDate":"Fri, 25 Feb 2022 08:42:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/02\/25\/pod-dns-problems\/","description":"<p>I&rsquo;ve got an <a href=\"https:\/\/blog.differentpla.net\/blog\/2021\/12\/29\/coredns\/\">extra instance<\/a> of CoreDNS running in my cluster, serving\n<code>*.k3s.differentpla.net<\/code>, with LoadBalancer and Ingress names registered in it, and it&rsquo;s working fine for queries <em>to<\/em>\nthe cluster. It&rsquo;s <em>not<\/em> working fine for queries <em>inside<\/em> the cluster. What&rsquo;s up with that?<\/p>"},{"title":"Elixir Livebook on k3s","link":"https:\/\/blog.differentpla.net\/blog\/2022\/02\/23\/livebook-k3s\/","pubDate":"Wed, 23 Feb 2022 20:42:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/02\/23\/livebook-k3s\/","description":"<p>I&rsquo;d like to run Livebook on my cluster. Here&rsquo;s how I went about doing that.<\/p>"},{"title":"Installing cert-manager","link":"https:\/\/blog.differentpla.net\/blog\/2022\/02\/06\/cert-manager\/","pubDate":"Sun, 06 Feb 2022 15:18:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/02\/06\/cert-manager\/","description":"<p>Up to this point, I&rsquo;ve been creating and installing certificates manually. Let&rsquo;s see if\n<a href=\"https:\/\/cert-manager.io\/\">cert-manager<\/a> will make that easier.<\/p>"},{"title":"(Not) Upgrading ArgoCD","link":"https:\/\/blog.differentpla.net\/blog\/2022\/02\/05\/not-upgrading-argocd\/","pubDate":"Sat, 05 Feb 2022 11:47:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/02\/05\/not-upgrading-argocd\/","description":"<p>There&rsquo;s a <a href=\"https:\/\/www.theregister.com\/2022\/02\/04\/argo_cd_0day_kubernetes\/\">security fix<\/a> that needs to be applied;\nthere&rsquo;s an <a href=\"https:\/\/github.com\/argoproj\/argo-cd\/releases\/tag\/v2.3.0-rc5\">arm64 release candidate<\/a>. Time to upgrade\nArgoCD.<\/p>"},{"title":"Securing Gitea with HTTPS","link":"https:\/\/blog.differentpla.net\/blog\/2022\/02\/04\/gitea-https\/","pubDate":"Fri, 04 Feb 2022 17:46:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/02\/04\/gitea-https\/","description":"<p>I&rsquo;ve got Gitea installed on my cluster, but it&rsquo;s currently accessed via HTTP (i.e. no TLS; it&rsquo;s not secure).<\/p>"},{"title":"arm64 support","link":"https:\/\/blog.differentpla.net\/blog\/2022\/02\/03\/arm64-support\/","pubDate":"Thu, 03 Feb 2022 08:46:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/02\/03\/arm64-support\/","description":"<p>Because I&rsquo;m running my k3s cluster on Raspberry Pi 4 nodes, and they&rsquo;re\n<a href=\"https:\/\/blog.differentpla.net\/blog\/2021\/12\/20\/raspi-ubuntu\/\">ARM-64 (aarch64)<\/a>, I keep running into problems where applications\nare compiled for x86_64 (amd64) and don&rsquo;t run.<\/p>"},{"title":"Installing ArgoCD on k3s","link":"https:\/\/blog.differentpla.net\/blog\/2022\/02\/02\/argocd\/","pubDate":"Wed, 02 Feb 2022 17:57:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/02\/02\/argocd\/","description":"<p>We&rsquo;re using ArgoCD at work; time to play with it.<\/p>"},{"title":"Securing an Ingress with TLS","link":"https:\/\/blog.differentpla.net\/blog\/2022\/01\/31\/securing-ingress-tls\/","pubDate":"Mon, 31 Jan 2022 18:35:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/01\/31\/securing-ingress-tls\/","description":"<p>My <a href=\"https:\/\/blog.differentpla.net\/blog\/2022\/01\/30\/gitea\/\">Gitea instance<\/a> isn&rsquo;t using TLS, so I&rsquo;m going to replace the LoadBalancer with an Ingress, which will allow TLS termination.<\/p>"},{"title":"Traefik Ingress","link":"https:\/\/blog.differentpla.net\/blog\/2022\/01\/31\/traefik-ingress\/","pubDate":"Mon, 31 Jan 2022 08:46:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/01\/31\/traefik-ingress\/","description":"<p>I&rsquo;m in the middle of installing ArgoCD (blog post will appear later). Rather than use up another LoadBalancer IP address\nfor it (and mess around with TLS), let&rsquo;s talk about using an Ingress. It&rsquo;s entirely possible that I can convert the\npreviously-installed docker registry and Gitea to use one as well.<\/p>"},{"title":"Jekyll Callouts","link":"https:\/\/blog.differentpla.net\/blog\/2022\/01\/30\/jekyll-callouts\/","pubDate":"Sun, 30 Jan 2022 18:04:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/01\/30\/jekyll-callouts\/","description":"<p>Sometimes <a href=\"https:\/\/blog.differentpla.net\/blog\/2021\/12\/17\/jekyll-alerts\/\">alerts<\/a> are a bit, well, alert-y. Here are some callouts instead.<\/p>"},{"title":"Installing Gitea on k3s","link":"https:\/\/blog.differentpla.net\/blog\/2022\/01\/30\/gitea\/","pubDate":"Sun, 30 Jan 2022 14:46:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/01\/30\/gitea\/","description":"<p>I want to play with <a href=\"https:\/\/www.gitops.tech\/\">GitOps<\/a> on my k3s cluster (specifically ArgoCD). To do that, I&rsquo;m going to\nneed a local git server. I decided to use <a href=\"https:\/\/docs.gitea.io\/en-us\/\">Gitea<\/a>.<\/p>"},{"title":"Accessing the Kubernetes API from an Elixir container","link":"https:\/\/blog.differentpla.net\/blog\/2022\/01\/16\/k8s-api-elixir-container\/","pubDate":"Sun, 16 Jan 2022 13:04:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/01\/16\/k8s-api-elixir-container\/","description":"<p>If you want to access the Kubernetes API from Elixir, you should probably just use the\n<a href=\"https:\/\/hex.pm\/packages\/k8s\">k8s package<\/a>, but here&rsquo;s how to do it without taking that dependency.<\/p>"},{"title":"Custom CoreDNS Runbook","link":"https:\/\/blog.differentpla.net\/blog\/2022\/01\/16\/k3s-dns-runbook\/","pubDate":"Sun, 16 Jan 2022 10:08:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/01\/16\/k3s-dns-runbook\/","description":"<p>I recently left my k3s cluster turned off for a week or so. When I turned it back on, the <a href=\"https:\/\/blog.differentpla.net\/blog\/2021\/12\/29\/coredns\/\"><code>k3s.differentpla.net<\/code> DNS<\/a> wasn&rsquo;t working. Let&rsquo;s figure it out and maybe write a runbook for the next time.<\/p>"},{"title":"Colouring the 'iex' prompt","link":"https:\/\/blog.differentpla.net\/blog\/2022\/01\/09\/iex-prompt-colours\/","pubDate":"Sun, 09 Jan 2022 12:17:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/01\/09\/iex-prompt-colours\/","description":"<p>If you&rsquo;ve got separate dev, test and prod environments, it can help to use colour to tell you which one you&rsquo;re logged\ninto. Here&rsquo;s how to colour the <code>iex<\/code> prompt appropriately.<\/p>"},{"title":"Erlang\/Elixir Cookies and Kubernetes","link":"https:\/\/blog.differentpla.net\/blog\/2022\/01\/09\/erlang-cookies-and-kubernetes\/","pubDate":"Sun, 09 Jan 2022 10:27:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/01\/09\/erlang-cookies-and-kubernetes\/","description":"<p>Distributed Erlang and Elixir applications use a shared secret called a &ldquo;cookie&rdquo;.  It&rsquo;s just a string of alphanumeric\ncharacters. All nodes in the cluster must use the same cookie. Let&rsquo;s take a look at what that means in a Kubernetes\ncontext.<\/p>"},{"title":"CoreDNS: endpoint_pod_names","link":"https:\/\/blog.differentpla.net\/blog\/2022\/01\/08\/coredns-endpoint-pod-names\/","pubDate":"Sat, 08 Jan 2022 19:34:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/01\/08\/coredns-endpoint-pod-names\/","description":"<p>I&rsquo;m still on the hunt for a way to connect Erlang nodes in a Kubernetes cluster by using pod names.<\/p>"},{"title":"libcluster and Kubernetes","link":"https:\/\/blog.differentpla.net\/blog\/2022\/01\/08\/libcluster-kubernetes\/","pubDate":"Sat, 08 Jan 2022 14:07:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/01\/08\/libcluster-kubernetes\/","description":"<p>I&rsquo;m looking at setting up an Erlang\/Elixir cluster in my Kubernetes cluster, using\n<a href=\"https:\/\/github.com\/bitwalker\/libcluster\">libcluster<\/a>, and I&rsquo;m trying to get my head around some of the implied\nconstraints.<\/p>"},{"title":"Kubernetes API from inside a container","link":"https:\/\/blog.differentpla.net\/blog\/2022\/01\/07\/k8s-api-in-container\/","pubDate":"Fri, 07 Jan 2022 18:15:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/01\/07\/k8s-api-in-container\/","description":"<p>Messing around with the kubernetes API from inside a container.<\/p>"},{"title":"kubectl proxy and curl","link":"https:\/\/blog.differentpla.net\/blog\/2022\/01\/07\/kubectl-proxy-curl\/","pubDate":"Fri, 07 Jan 2022 10:23:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/01\/07\/kubectl-proxy-curl\/","description":"<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-text\" data-lang=\"text\"><span class=\"line\"><span class=\"cl\">$ kubectl proxy\n<\/span><\/span><span class=\"line\"><span class=\"cl\">Starting to serve on 127.0.0.1:8001<\/span><\/span><\/code><\/pre><\/div>\n<p>Now we can use curl without needing any auth:<\/p>"},{"title":"Upgrading k3s","link":"https:\/\/blog.differentpla.net\/blog\/2022\/01\/03\/upgrading-k3s\/","pubDate":"Mon, 03 Jan 2022 14:38:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/01\/03\/upgrading-k3s\/","description":"<div class=\"callout callout-info\">\n  <div class=\"callout-content\">\n    The Rancher docs say that you should update the server first, then the workers.\n  <\/div>\n<\/div>\n\n<h2 id=\"control-plane\">Control Plane<a href=\"#control-plane\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>This is a non-HA cluster (I&rsquo;ve only got one server node), and <code>kubectl drain rpi401<\/code> (the server) doesn&rsquo;t want to evict\npods with local storage. So I guess I just apply the upgrade and hope that it recovers after a restart:<\/p>"},{"title":"IP-based pod A records","link":"https:\/\/blog.differentpla.net\/blog\/2022\/01\/03\/ip-based-pod-dns\/","pubDate":"Mon, 03 Jan 2022 11:11:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2022\/01\/03\/ip-based-pod-dns\/","description":"<p>A while ago, I asked <a href=\"https:\/\/stackoverflow.com\/questions\/60741801\/why-arent-pod-names-registered-in-kubernetes-dns\">why pod names don&rsquo;t resolve in\nDNS<\/a>, and never really\ngot a satisfactory answer. One way you can connect to a pod (rather than with a service), is to use the dashed-IP form\nof the pod address, e.g. <code>10-42-2-46.default.pod.cluster.local<\/code>. Here&rsquo;s how it works.<\/p>"},{"title":"k3s on Raspberry Pi: NodePort with multiple replicas","link":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/30\/k3s-nodeport-with-multiple-replicas\/","pubDate":"Thu, 30 Dec 2021 12:10:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/30\/k3s-nodeport-with-multiple-replicas\/","description":"<p>If you&rsquo;re using a <a href=\"https:\/\/blog.differentpla.net\/blog\/2021\/12\/17\/k3s-nodeport\/\">NodePort<\/a> service, and it has multiple replicas, how does it know which replica to use?<\/p>"},{"title":"Using CoreDNS for LoadBalancer addresses","link":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/29\/coredns\/","pubDate":"Wed, 29 Dec 2021 20:15:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/29\/coredns\/","description":"<p>I&rsquo;d like to be able to access my <a href=\"https:\/\/blog.differentpla.net\/blog\/2021\/12\/20\/installing-metallb\/\">load-balanced services<\/a> by name\n(<code>docker.k3s.differentpla.net<\/code>, for example) from outside my k3s cluster. I&rsquo;m\nusing <code>--addn-hosts<\/code> on <a href=\"https:\/\/blog.differentpla.net\/blog\/2021\/12\/21\/docker-registry-redux\/#configuring-dns\">dnsmasq on my router<\/a>.\nThis is fragile. Every time I want to add a load-balanced service, I need to edit\nthe additional hosts file on my router, and I need to restart dnsmasq.<\/p>"},{"title":"Disabling Klipper","link":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/21\/disabling-klipper\/","pubDate":"Tue, 21 Dec 2021 20:55:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/21\/disabling-klipper\/","description":"<p>I forgot to <a href=\"https:\/\/rancher.com\/docs\/k3s\/latest\/en\/networking\/#disabling-the-service-lb\">disable Klipper<\/a>, the K3s-provided load balancer.<\/p>\n<p>Edit the <code>\/etc\/systemd\/system\/k3s.service<\/code> file. It looks like this:<\/p>"},{"title":"Docker Registry Redux","link":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/21\/docker-registry-redux\/","pubDate":"Tue, 21 Dec 2021 11:57:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/21\/docker-registry-redux\/","description":"<p>Wherein I finally bring together all we&rsquo;ve learned so far and stand this thing up properly.<\/p>"},{"title":"elixir-certs","link":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/21\/elixir-certs\/","pubDate":"Tue, 21 Dec 2021 11:50:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/21\/elixir-certs\/","description":"<p>I need to secure my Docker registry. Because OpenSSL sucks, I&rsquo;m using\n<a href=\"https:\/\/github.com\/rlipscombe\/elixir-certs\">an Elixir script<\/a> that uses the &lsquo;x509&rsquo; library.<\/p>"},{"title":"Installing Longhorn","link":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/21\/installing-longhorn\/","pubDate":"Tue, 21 Dec 2021 11:28:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/21\/installing-longhorn\/","description":"<p>Installation with Helm, per <a href=\"https:\/\/longhorn.io\/docs\/1.2.3\/deploy\/install\/install-with-helm\/\">https:\/\/longhorn.io\/docs\/1.2.3\/deploy\/install\/install-with-helm\/<\/a>.<\/p>\n<h2 id=\"add-the-repo\">Add the repo<a href=\"#add-the-repo\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-text\" data-lang=\"text\"><span class=\"line\"><span class=\"cl\">helm repo add longhorn https:\/\/charts.longhorn.io\n<\/span><\/span><span class=\"line\"><span class=\"cl\">helm repo update<\/span><\/span><\/code><\/pre><\/div>\n<h2 id=\"run-the-installation\">Run the installation<a href=\"#run-the-installation\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-bash\" data-lang=\"bash\"><span class=\"line\"><span class=\"cl\">helm install longhorn longhorn\/longhorn --namespace longhorn-system --create-namespace<\/span><\/span><\/code><\/pre><\/div>\n<h2 id=\"make-longhorn-the-default-storage-class\">Make Longhorn the default storage class<a href=\"#make-longhorn-the-default-storage-class\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>Per <a href=\"https:\/\/rpi4cluster.com\/k3s\/k3s-storage-setting\/#make-longhorn-the-default-storageclass\">https:\/\/rpi4cluster.com\/k3s\/k3s-storage-setting\/#make-longhorn-the-default-storageclass<\/a>:<\/p>"},{"title":"Installing MetalLB","link":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/20\/installing-metallb\/","pubDate":"Mon, 20 Dec 2021 20:55:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/20\/installing-metallb\/","description":"<p>Installation with Helm, per <a href=\"https:\/\/metallb.universe.tf\/installation\/#installation-with-helm\">https:\/\/metallb.universe.tf\/installation\/#installation-with-helm<\/a>.<\/p>\n<h2 id=\"add-the-repo\">Add the repo<a href=\"#add-the-repo\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-text\" data-lang=\"text\"><span class=\"line\"><span class=\"cl\">helm repo add metallb https:\/\/metallb.github.io\/metallb<\/span><\/span><\/code><\/pre><\/div>\n<h2 id=\"create-the-values-file\">Create the values file<a href=\"#create-the-values-file\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>My home network is <code>192.168.28.x<\/code>, my DHCP server allocates <code>.100<\/code> and up, so we&rsquo;ll use a pool of addresses outside that range.<\/p>"},{"title":"Installing Helm","link":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/20\/installing-helm\/","pubDate":"Mon, 20 Dec 2021 20:45:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/20\/installing-helm\/","description":"<p>To install other things, we&rsquo;re going to want to use Helm. So let&rsquo;s install that first.<\/p>"},{"title":"Installing k3s on Ubuntu on Raspberry Pi","link":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/20\/k3s-ubuntu-reinstall\/","pubDate":"Mon, 20 Dec 2021 19:16:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/20\/k3s-ubuntu-reinstall\/","description":"<p>Having reinstalled all of my nodes with Ubuntu, I need to go back and install k3s. Joy.<\/p>"},{"title":"Installing Ubuntu on Raspberry Pi","link":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/20\/raspi-ubuntu\/","pubDate":"Mon, 20 Dec 2021 12:17:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/20\/raspi-ubuntu\/","description":"<p>My <a href=\"https:\/\/blog.differentpla.net\/blog\/2021\/07\/04\/k3s-raspi-updates\/\">Raspberry Pi 4 cluster<\/a> is currently 32-bit. It&rsquo;s got a 32-bit\nkernel with a 32-bit userland. But I need to run 64-bit software on it. I looked into <a href=\"https:\/\/blog.differentpla.net\/blog\/2021\/12\/20\/upgrading-raspios-to-arm64\/\">upgrading it in place<\/a>, but that&rsquo;s infeasible. So I need to reinstall it.<\/p>"},{"title":"Upgrading RaspiOS to arm64","link":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/20\/upgrading-raspios-to-arm64\/","pubDate":"Mon, 20 Dec 2021 10:26:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/20\/upgrading-raspios-to-arm64\/","description":"<p>Can I upgrade my Raspberry Pi 4-powered k3s cluster to arm64? Without rebuilding everything? tl;dr: no.<\/p>"},{"title":"Synology SRM DNS Server problems","link":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/19\/srm-dns\/","pubDate":"Sun, 19 Dec 2021 12:11:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/19\/srm-dns\/","description":"<p>While messing around with my <a href=\"https:\/\/blog.differentpla.net\/tags\/k3s\/\">k3s cluster<\/a>, I decided that I needed a DNS server. I tried the Synology DNS Server.<\/p>"},{"title":"k3s on Raspberry Pi: Persistent Volume Namespaces","link":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/18\/k3s-pv-namespace\/","pubDate":"Sat, 18 Dec 2021 20:11:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/18\/k3s-pv-namespace\/","description":"<p>Persistent Volume Claims are namespace-scoped. Persistent Volumes are not:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-text\" data-lang=\"text\"><span class=\"line\"><span class=\"cl\">$ kubectl get pvc\n<\/span><\/span><span class=\"line\"><span class=\"cl\">NAME              STATUS   VOLUME           CAPACITY   ACCESS MODES   STORAGECLASS   AGE\n<\/span><\/span><span class=\"line\"><span class=\"cl\">testing-vol-pvc   Bound    testing-vol-pv   1Gi        RWO            iscsi          27h\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">$ kubectl --namespace docker-registry  get pvc\n<\/span><\/span><span class=\"line\"><span class=\"cl\">NAME                  STATUS   VOLUME               CAPACITY   ACCESS MODES   STORAGECLASS   AGE\n<\/span><\/span><span class=\"line\"><span class=\"cl\">docker-registry-pvc   Bound    docker-registry-pv   1Gi        RWO            iscsi          23h\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">$ kubectl get pv\n<\/span><\/span><span class=\"line\"><span class=\"cl\">NAME                 CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                                 STORAGECLASS   REASON   AGE\n<\/span><\/span><span class=\"line\"><span class=\"cl\">testing-vol-pv       1Gi        RWO            Retain           Bound    default\/testing-vol-pvc               iscsi                   27h\n<\/span><\/span><span class=\"line\"><span class=\"cl\">docker-registry-pv   1Gi        RWO            Retain           Bound    docker-registry\/docker-registry-pvc   iscsi                   23h<\/span><\/span><\/code><\/pre><\/div>"},{"title":"k3s on Raspberry Pi: Docker push fails","link":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/18\/k3s-raspi-docker-push-fails\/","pubDate":"Sat, 18 Dec 2021 16:08:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/18\/k3s-raspi-docker-push-fails\/","description":"<p>Pushing a simple node.js-based image to my private docker registry failed.<\/p>"},{"title":"Do docker registry names matter?","link":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/17\/do-docker-registry-names-matter\/","pubDate":"Fri, 17 Dec 2021 21:29:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/17\/do-docker-registry-names-matter\/","description":"<p>When you want to push an image to a docker registry, you need to tag it with the registry name. Does the name matter?<\/p>"},{"title":"k3s on Raspberry Pi: NodePort Services","link":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/17\/k3s-nodeport\/","pubDate":"Fri, 17 Dec 2021 20:58:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/17\/k3s-nodeport\/","description":"<p>Until just now, I didn&rsquo;t <em>get<\/em> <code>NodePort<\/code> services.<\/p>\n<p>The <a href=\"https:\/\/kubernetes.io\/docs\/concepts\/services-networking\/service\/#publishing-services-service-types\">Kubernetes documentation<\/a> says the following:<\/p>"},{"title":"k3s on Raspberry Pi: Static Persistent Volumes","link":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/17\/k3s-static-pv\/","pubDate":"Fri, 17 Dec 2021 15:09:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/17\/k3s-static-pv\/","description":"<p>In <a href=\"https:\/\/blog.differentpla.net\/blog\/2021\/12\/17\/k3s-dynamic-pv\/\">the previous post<\/a>, we succeeded in giving our docker registry some\npersistent storage. However, it used (the default) dynamic provisioning, which means we don&rsquo;t have as much control over\n<em>where<\/em> the storage is provisioned.<\/p>"},{"title":"Jekyll Alerts","link":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/17\/jekyll-alerts\/","pubDate":"Fri, 17 Dec 2021 09:25:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/17\/jekyll-alerts\/","description":"<p>I wanted to display an <a href=\"https:\/\/getbootstrap.com\/docs\/5.1\/components\/alerts\/\">alert<\/a> on one of my pages, like this:<\/p>"},{"title":"k3s on Raspberry Pi: Dynamic Persistent Volumes","link":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/17\/k3s-dynamic-pv\/","pubDate":"Fri, 17 Dec 2021 09:06:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/17\/k3s-dynamic-pv\/","description":"<p>We need to give our Docker registry some persistent storage. Currently,\nif we restart it, it loses its stored data.<\/p>"},{"title":"k3s on Raspberry Pi: Persistent Storage using hostPath","link":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/16\/k3s-hostpath-storage\/","pubDate":"Thu, 16 Dec 2021 18:20:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/16\/k3s-hostpath-storage\/","description":"<p>We need to give our Docker registry some persistent storage. Currently,\nif we restart it, it loses its stored data.<\/p>"},{"title":"k3s on Raspberry Pi: Using an Insecure Docker Registry","link":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/16\/k3s-docker-registry-insecure\/","pubDate":"Thu, 16 Dec 2021 16:16:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/16\/k3s-docker-registry-insecure\/","description":"<p>Let&rsquo;s see if we can push an image to our new Docker Registry.<\/p>"},{"title":"New Theme","link":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/16\/new-theme\/","pubDate":"Thu, 16 Dec 2021 09:32:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/16\/new-theme\/","description":"<p>Yes, it&rsquo;s a barely-modified Bootstrap 5. I like it, OK?<\/p>"},{"title":"git start","link":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/10\/git-start\/","pubDate":"Fri, 10 Dec 2021 11:16:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/10\/git-start\/","description":"<p>When I create a new git repository, I prefer for there to be an empty commit at the beginning of history.<\/p>"},{"title":"k3s on Raspberry Pi: Private Docker Registry","link":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/10\/k3s-docker-registry\/","pubDate":"Fri, 10 Dec 2021 09:49:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/10\/k3s-docker-registry\/","description":"<div class=\"alert alert-light d-flex\">\n  <i class=\"bi bi-info-circle\"><\/i>\n  <div class=\"alert-content\">\n    <strong>Updated:<\/strong> See <a href=\"https:\/\/blog.differentpla.net\/blog\/2021\/12\/21\/docker-registry-redux\/\">Docker Registry Redux<\/a>.\n  <\/div>\n<\/div>\n\n<p>In order to deploy our own applications, we&rsquo;re going to need a private docker repository.\nWhen I <a href=\"https:\/\/blog.differentpla.net\/blog\/2020\/02\/06\/k3s-raspi-private-docker\/\">first did this<\/a>, I used a standalone container.<\/p>"},{"title":"k3s on Raspberry Pi: iSCSI","link":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/09\/k3s-raspi-iscsi\/","pubDate":"Thu, 09 Dec 2021 19:42:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/09\/k3s-raspi-iscsi\/","description":"<p>The default option for persistent volumes on k3s is <code>local-path<\/code>,\nwhich provisions (on-demand) the storage on the node&rsquo;s local disk. This\nhas the unfortunate side-effect that the container is now tied to that\nparticular node.<\/p>"},{"title":"k3s on Raspberry Pi: SchedulingDisabled","link":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/08\/k3s-raspi-scheduling-disabled\/","pubDate":"Wed, 08 Dec 2021 09:42:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2021\/12\/08\/k3s-raspi-scheduling-disabled\/","description":"<p>This morning, I grabbed <a href=\"https:\/\/blog.differentpla.net\/blog\/2021\/07\/04\/k3s-raspi-updates\/\">my Raspberry Pi cluster<\/a> out of the box and fired it up again.<\/p>"},{"title":"Which Erlang compiler was used?","link":"https:\/\/blog.differentpla.net\/blog\/2021\/11\/02\/erlang-compiler-used\/","pubDate":"Tue, 02 Nov 2021 09:04:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2021\/11\/02\/erlang-compiler-used\/","description":"<p>To get the version of the compiler used to compile a particular <code>.beam<\/code> file:<\/p>"},{"title":"Multiple Laptops, Multiple Monitors","link":"https:\/\/blog.differentpla.net\/blog\/2021\/09\/11\/laptops-and-monitors\/","pubDate":"Sat, 11 Sep 2021 19:04:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2021\/09\/11\/laptops-and-monitors\/","description":"<p>At home, I&rsquo;ve got a rather nice setup with two Dell U2520D monitors on my desk, which I&rsquo;m currently using from my (work)\nLinux desktop. However, more recently, I&rsquo;m trying to strike a better work\/life balance, so I&rsquo;ve decided to start making\nmore use of my (personal) Microsoft Surface Book 3 laptop, but I&rsquo;d like to continue using the two monitors (which are\nalso mine; I never bothered filing the expense claim).<\/p>"},{"title":"k3s on Raspberry Pi: Rebuilding with Pi 4","link":"https:\/\/blog.differentpla.net\/blog\/2021\/07\/04\/k3s-raspi-updates\/","pubDate":"Sun, 04 Jul 2021 15:39:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2021\/07\/04\/k3s-raspi-updates\/","description":"<p>About 2 years ago, I spent some time messing around with k3s on a cluster made\nfrom <a href=\"https:\/\/blog.differentpla.net\/blog\/2020\/02\/06\/k3s-raspi-hardware\/\">5x Raspberry Pi 2 Model B<\/a> nodes.<\/p>"},{"title":"Erlang and ed25519","link":"https:\/\/blog.differentpla.net\/blog\/2021\/06\/10\/erlang-ed25519\/","pubDate":"Thu, 10 Jun 2021 13:18:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2021\/06\/10\/erlang-ed25519\/","description":"<p>Erlang\/OTP 24.0 added support for ed25519 curves. Here&rsquo;s some example snippets:<\/p>"},{"title":"failed to start child: :ranch_server_proxy","link":"https:\/\/blog.differentpla.net\/blog\/2021\/06\/08\/ranch-server-proxy-error\/","pubDate":"Tue, 08 Jun 2021 14:02:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2021\/06\/08\/ranch-server-proxy-error\/","description":"<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-text\" data-lang=\"text\"><span class=\"line\"><span class=\"cl\">** (Mix) Could not start application example_server: ExampleServer.Application.start(:normal, []) returned an error: shutdown: failed to start child: {:ranch_embedded_sup, :example_server}\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    ** (EXIT) shutdown: failed to start child: :ranch_server_proxy\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        ** (EXIT) no process: the process is not alive or there&#39;s no process currently associated with the given name, possibly because its application isn&#39;t started<\/span><\/span><\/code><\/pre><\/div>\n<p>Did you start the <code>ranch<\/code> application? If you&rsquo;re using <code>rebar3<\/code> (Erlang) or <code>mix<\/code> (Elixir), it ought to start automatically as part of your application.<\/p>"},{"title":"ErlangLS version?","link":"https:\/\/blog.differentpla.net\/blog\/2021\/06\/02\/erlang_ls-version\/","pubDate":"Wed, 02 Jun 2021 09:16:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2021\/06\/02\/erlang_ls-version\/","description":"<p>I recently had to report a bug against ErlangLS (the Erlang Language Server). Here&rsquo;s how I discovered the version number:<\/p>"},{"title":"ALPN in Erlang","link":"https:\/\/blog.differentpla.net\/blog\/2021\/03\/01\/erlang-alpn\/","pubDate":"Mon, 01 Mar 2021 11:16:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2021\/03\/01\/erlang-alpn\/","description":"<p>Per <a href=\"https:\/\/en.wikipedia.org\/wiki\/Application-Layer_Protocol_Negotiation\">Wikipedia<\/a>:<\/p>\n\n\n\n\n  <blockquote>\n    <p>Application-Layer Protocol Negotiation (ALPN) is a Transport Layer Security (TLS)\nextension that allows the application layer to negotiate which protocol should be\nperformed over a secure connection in a manner that avoids additional round trips\nand which is independent of the application-layer protocols.<\/p>\n\n  <\/blockquote>"},{"title":"Using 'cert' and 'key' with Erlang\/OTP 'ssl'","link":"https:\/\/blog.differentpla.net\/blog\/2021\/02\/26\/otp-ssl-cert-key-example\/","pubDate":"Fri, 26 Feb 2021 16:16:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2021\/02\/26\/otp-ssl-cert-key-example\/","description":"<p>Ordinarily when writing an SSL\/TLS server or client using Erlang\/OTP, you&rsquo;ll use the <code>certfile<\/code> and <code>keyfile<\/code> options, as follows:<\/p>"},{"title":"{error, closed}; nothing logged","link":"https:\/\/blog.differentpla.net\/blog\/2021\/02\/25\/ranch-error-closed\/","pubDate":"Thu, 25 Feb 2021 16:04:07 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2021\/02\/25\/ranch-error-closed\/","description":"<p>I&rsquo;ve just spent about a day poking around in the guts of Erlang\/OTP and <a href=\"https:\/\/github.com\/ninenines\/ranch\">Ranch<\/a>, and I thought I&rsquo;d write some of it down.<\/p>"},{"title":"How many bits for timestamps?","link":"https:\/\/blog.differentpla.net\/blog\/2020\/12\/11\/bits-for-timestamps\/","pubDate":"Fri, 11 Dec 2020 13:43:07 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2020\/12\/11\/bits-for-timestamps\/","description":"<p>Signed 32-bit <code>time_t<\/code>, which counts seconds since 1970 runs out after 2^31 seconds; i.e. in 2038.<\/p>"},{"title":"Package python was not found in the pkg-config search path when using scons","link":"https:\/\/blog.differentpla.net\/blog\/2020\/09\/28\/scons-pkg-config\/","pubDate":"Mon, 28 Sep 2020 17:49:52 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2020\/09\/28\/scons-pkg-config\/","description":"<p>After upgrading to Ubuntu 20.04 at the weekend (this is not strictly relevant),\none of my builds started failing with the following error:<\/p>"},{"title":"Using Erlang's Common Test for System Testing","link":"https:\/\/blog.differentpla.net\/blog\/2020\/09\/14\/erlang-common-test\/","pubDate":"Mon, 14 Sep 2020 18:21:52 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2020\/09\/14\/erlang-common-test\/","description":"<p>At Electric Imp (now part of Twilio), my team uses Erlang&rsquo;s Common Test for driving our system tests. These are (almost-)end-to-end tests that exercise (almost) the whole platform.<\/p>"},{"title":"Connecting ChromeOS to a printer via CUPS","link":"https:\/\/blog.differentpla.net\/blog\/2020\/06\/29\/chromeos-cups\/","pubDate":"Mon, 29 Jun 2020 08:28:09 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2020\/06\/29\/chromeos-cups\/","description":"<p>I&rsquo;ve got my printer connected to a Raspberry Pi print server, and printer discovery only occasionally works from ChromeOS. Here&rsquo;s an aide-memoire for configuring it.<\/p>"},{"title":"Connecting to an Erlang node in a Docker container","link":"https:\/\/blog.differentpla.net\/blog\/2020\/06\/19\/epmd-docker\/","pubDate":"Fri, 19 Jun 2020 15:41:48 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2020\/06\/19\/epmd-docker\/","description":"<p>I&rsquo;ve got a bunch of Erlang nodes running in Docker containers, and I&rsquo;d\nlike to connect a remote shell, running on the host, to one of them.<\/p>"},{"title":"Integrating direnv with python 3","link":"https:\/\/blog.differentpla.net\/blog\/2020\/06\/12\/python3-direnv\/","pubDate":"Fri, 12 Jun 2020 18:15:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2020\/06\/12\/python3-direnv\/","description":"<p>By now you should be using Python 3.x. You can integrate it with direnv (2.21 or newer)\nby putting the following in your <code>.envrc<\/code><\/p>"},{"title":"k3s on Raspberry Pi: Phoenix Server","link":"https:\/\/blog.differentpla.net\/blog\/2020\/02\/07\/k3s-raspi-phoenix-server\/","pubDate":"Fri, 07 Feb 2020 11:17:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2020\/02\/07\/k3s-raspi-phoenix-server\/","description":"<p>Note: This is basically the same as <a href=\"https:\/\/blog.differentpla.net\/blog\/2020\/02\/06\/k3s-raspi-node-server\/\">the node.js server<\/a>.<\/p>\n<h2 id=\"creating-the-phoenix-app\">Creating the Phoenix app<a href=\"#creating-the-phoenix-app\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>It&rsquo;s entirely possible to create the app inside the docker container, or on a completely different machine, but I&rsquo;m going to do it locally, which means <a href=\"https:\/\/blog.differentpla.net\/blog\/2020\/02\/07\/rpi-elixir\/\">installing Erlang, Elixir and Phoenix first<\/a>.<\/p>"},{"title":"Installing Erlang and Elixir on Raspberry Pi","link":"https:\/\/blog.differentpla.net\/blog\/2020\/02\/07\/rpi-elixir\/","pubDate":"Fri, 07 Feb 2020 10:49:06 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2020\/02\/07\/rpi-elixir\/","description":"<p>Quick reference for installing Erlang and Elixir on a Raspberry Pi, using the Erlang Solutions packages.<\/p>"},{"title":"k3s on Raspberry Pi: node.js Server","link":"https:\/\/blog.differentpla.net\/blog\/2020\/02\/06\/k3s-raspi-node-server\/","pubDate":"Thu, 06 Feb 2020 19:03:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2020\/02\/06\/k3s-raspi-node-server\/","description":"<p>Now that I&rsquo;ve successfully run <code>nginx<\/code> on my cluster, I&rsquo;m going to do the same with a simple <code>node.js<\/code> server.<\/p>"},{"title":"k3s on Raspberry Pi: Private Docker","link":"https:\/\/blog.differentpla.net\/blog\/2020\/02\/06\/k3s-raspi-private-docker\/","pubDate":"Thu, 06 Feb 2020 17:52:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2020\/02\/06\/k3s-raspi-private-docker\/","description":"<div class=\"alert alert-info d-flex\">\n  <i class=\"bi bi-info-circle\"><\/i>\n  <div class=\"alert-content\">\n    <strong>Updated:<\/strong> See <a href=\"https:\/\/blog.differentpla.net\/blog\/2021\/12\/21\/docker-registry-redux\/\">Docker Registry Redux<\/a>.\n  <\/div>\n<\/div>\n\n<p>In order to run our own apps on the cluster, we&rsquo;re going to need a private docker repository.<\/p>"},{"title":"k3s on Raspberry Pi: Installing nginx","link":"https:\/\/blog.differentpla.net\/blog\/2020\/02\/06\/k3s-raspi-nginx\/","pubDate":"Thu, 06 Feb 2020 17:44:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2020\/02\/06\/k3s-raspi-nginx\/","description":"<p>Start nginx, with 3 replicas:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-text\" data-lang=\"text\"><span class=\"line\"><span class=\"cl\">$ sudo kubectl run nginx-1 --image=nginx --replicas=3 --port=80<\/span><\/span><\/code><\/pre><\/div>\n<p>You can see that 3 &ldquo;pods&rdquo; have been started:<\/p>"},{"title":"k3s on Raspberry Pi: Installing k3s","link":"https:\/\/blog.differentpla.net\/blog\/2020\/02\/06\/k3s-raspi-install-k3s\/","pubDate":"Thu, 06 Feb 2020 17:04:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2020\/02\/06\/k3s-raspi-install-k3s\/","description":"<p>It&rsquo;s at this point that I diverge from Scott&rsquo;s blog post; he installs full-fat Kubernetes. I&rsquo;m going to use <a href=\"https:\/\/k3s.io\/\">k3s<\/a>.<\/p>"},{"title":"k3s on Raspberry Pi: Installing Raspbian","link":"https:\/\/blog.differentpla.net\/blog\/2020\/02\/06\/k3s-raspi-raspbian\/","pubDate":"Thu, 06 Feb 2020 16:54:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2020\/02\/06\/k3s-raspi-raspbian\/","description":"<p>I downloaded <a href=\"https:\/\/www.raspberrypi.org\/downloads\/raspbian\/\">Raspbian Buster Lite<\/a> from the official site and wrote it to the SD cards (using <code>dd<\/code>).<\/p>"},{"title":"k3s on Raspberry Pi: Hardware","link":"https:\/\/blog.differentpla.net\/blog\/2020\/02\/06\/k3s-raspi-hardware\/","pubDate":"Thu, 06 Feb 2020 16:44:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2020\/02\/06\/k3s-raspi-hardware\/","description":"<p>I had a bunch of hardware lying around from an earlier abandoned side project:<\/p>"},{"title":"k3s on Raspberry Pi: Introduction","link":"https:\/\/blog.differentpla.net\/blog\/2020\/02\/06\/k3s-raspi-intro\/","pubDate":"Thu, 06 Feb 2020 16:34:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2020\/02\/06\/k3s-raspi-intro\/","description":"<h2 id=\"background\">Background<a href=\"#background\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>I&rsquo;m taking a few days to play with Kubernetes. Since I have a stack of Raspberry Pi 2s otherwise doing nothing, I decided to use them. I started with Scott Hanselman&rsquo;s <a href=\"https:\/\/www.hanselman.com\/blog\/HowToBuildAKubernetesClusterWithARMRaspberryPiThenRunNETCoreOnOpenFaas.aspx\">How to Build a Kubernetes Cluster with ARM Raspberry Pi then run .NET Core on OpenFaas<\/a> blog post.<\/p>"},{"title":"Integrating direnv with ghc","link":"https:\/\/blog.differentpla.net\/blog\/2020\/02\/02\/ghc-direnv\/","pubDate":"Sun, 02 Feb 2020 15:32:31 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2020\/02\/02\/ghc-direnv\/","description":"<p>I&rsquo;m reading &ldquo;Practical Haskell&rdquo;, which requires a different version of Haskell than\nUbuntu installs so I figured I&rsquo;d add another entry to my direnv series.<\/p>"},{"title":"Using git with multiple emails","link":"https:\/\/blog.differentpla.net\/blog\/2020\/01\/24\/git-emails\/","pubDate":"Fri, 24 Jan 2020 10:13:37 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2020\/01\/24\/git-emails\/","description":"<p>Recently I noticed that I&rsquo;d made some commits to the git repository at work with my personal email address.<\/p>"},{"title":"Gnome Extensions","link":"https:\/\/blog.differentpla.net\/blog\/2020\/01\/10\/gnome-extensions\/","pubDate":"Fri, 10 Jan 2020 20:07:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2020\/01\/10\/gnome-extensions\/","description":"<p>I installed the following extensions:<\/p>\n<h2 id=\"windows-style-taskbar\">Windows-style taskbar<a href=\"#windows-style-taskbar\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<ul>\n<li>Hide top bar. This extension didn&rsquo;t seem to do anything.<\/li>\n<li>Dash to panel. This replaces the top bar with a Windows-style task bar. I haven&rsquo;t figured out to stop it from hiding under maximised windows, though. This is annoying.<\/li>\n<li>Dash to dock. This allows me to have a taskbar on my second monitor. I configured it to &ldquo;Show the dock on: Secondary monitor 1&rdquo;, at the bottom. Turn off &ldquo;Show favourite applications&rdquo;. Turn on &ldquo;Isolate monitors&rdquo;. Turn off &ldquo;Show Applications icon&rdquo;.<\/li>\n<\/ul>\n<p>&ldquo;Dash to panel&rdquo; and &ldquo;Dash to dock&rdquo; aren&rsquo;t quite the same size, but I&rsquo;ll live with it.<\/p>"},{"title":"max_user_watches","link":"https:\/\/blog.differentpla.net\/blog\/2020\/01\/10\/max-user-watches\/","pubDate":"Fri, 10 Jan 2020 20:07:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2020\/01\/10\/max-user-watches\/","description":"<blockquote>\n    <p>Visual Studio Code is unable to watch for file changes in this large workspace<\/p>\n\n  <\/blockquote>"},{"title":"Firefox Containers","link":"https:\/\/blog.differentpla.net\/blog\/2020\/01\/07\/firefox-containers\/","pubDate":"Tue, 07 Jan 2020 21:01:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2020\/01\/07\/firefox-containers\/","description":"<p>I have more than one Google account, and this confuses Google apps.<\/p>"},{"title":"Elixir's use functionality","link":"https:\/\/blog.differentpla.net\/blog\/2020\/01\/02\/elixir-use\/","pubDate":"Thu, 02 Jan 2020 15:54:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2020\/01\/02\/elixir-use\/","description":"<p><code>use<\/code> is a way that you can inject code into your module. Elixir uses this for boilerplate in <code>GenServer<\/code>, and Phoenix uses it for metaprogramming.<\/p>"},{"title":"Debugging gen_server timeouts","link":"https:\/\/blog.differentpla.net\/blog\/2019\/09\/21\/gen_server-timeout\/","pubDate":"Sat, 21 Sep 2019 15:01:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2019\/09\/21\/gen_server-timeout\/","description":"<p>When an error occurs in the <a href=\"https:\/\/electricimp.com\">Electric Imp<\/a> backend, it&rsquo;s logged and collated, and we regularly\nreview error reports to see if there&rsquo;s anything that needs looking at.<\/p>"},{"title":"Installing an mSATA disk in an empeg","link":"https:\/\/blog.differentpla.net\/blog\/2019\/03\/29\/empeg-msata\/","pubDate":"Fri, 29 Mar 2019 15:25:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2019\/03\/29\/empeg-msata\/","description":"<h2 id=\"background\">Background<a href=\"#background\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>The hard disk in my spare empeg player (&ldquo;toothgnip&rdquo;) died at some point. I&rsquo;m using a 64GiB Transcend 2.5&quot; PATA SSDs in\nmy main empeg player (&ldquo;crowley&rdquo;), but they&rsquo;re getting harder and harder to find, so I opted for a Kingston mSATA disk\n(240G) and a JMicron-based mSATA to PATA adapter.<\/p>"},{"title":"A UPS post-mortem","link":"https:\/\/blog.differentpla.net\/blog\/2019\/02\/21\/ups-post-mortem\/","pubDate":"Thu, 21 Feb 2019 10:48:07 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2019\/02\/21\/ups-post-mortem\/","description":"<p>This morning, something electrical went wrong in my &ldquo;network cabinet&rdquo; (hall\ncupboard), which knocked me offline for about an hour. Here&rsquo;s the post-mortem.<\/p>"},{"title":"Integrating direnv with ruby-install","link":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/ruby-direnv\/","pubDate":"Wed, 30 Jan 2019 17:45:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/ruby-direnv\/","description":"<p>To integrate <code>direnv<\/code> with <code>ruby-install<\/code> &ndash; installation instructions <a href=\"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/ruby-install\/\">here<\/a> &ndash; add the following to <code>~\/.direnvrc<\/code>:<\/p>"},{"title":"Installing Ruby with ruby-install","link":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/ruby-install\/","pubDate":"Wed, 30 Jan 2019 17:40:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/ruby-install\/","description":"<div class=\"callout callout-info\">\n  <div class=\"callout-content\">\n    On recent versions of Ubuntu, with older versions of Ruby, you&rsquo;ll get an error about missing openssl. See <a href=\"https:\/\/blog.differentpla.net\/blog\/2023\/01\/06\/compiling-ruby-fails-openssl\/\">this post<\/a> for a solution.\n  <\/div>\n<\/div>\n\n<p>Install <code>ruby-install<\/code>:<\/p>"},{"title":"Integrating direnv with python-build","link":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/python-direnv\/","pubDate":"Wed, 30 Jan 2019 17:25:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/python-direnv\/","description":"<p>To integrate <code>direnv<\/code> with <code>python-build<\/code> &ndash; installation instructions <a href=\"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/python-build\/\">here<\/a> &ndash; add the following to <code>~\/.direnvrc<\/code>:<\/p>"},{"title":"Installing Python with python-build","link":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/python-build\/","pubDate":"Wed, 30 Jan 2019 17:20:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/python-build\/","description":"<p>Install <code>pyenv<\/code>. We&rsquo;re not going to use it as-is, but it includes the <code>python-build<\/code> script that we will use:<\/p>"},{"title":"Installing Elixir with kiex","link":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/installing-elixir-with-kiex\/","pubDate":"Wed, 30 Jan 2019 17:12:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/installing-elixir-with-kiex\/","description":"<p>At Electric Imp, we manage our Elixir versions with kiex.<\/p>"},{"title":"Integrating direnv with nvm","link":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/nvm-direnv\/","pubDate":"Wed, 30 Jan 2019 17:12:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/nvm-direnv\/","description":"<p>To integrate <code>direnv<\/code> with <code>nvm<\/code>, add the following to <code>~\/.direnvrc<\/code>:<\/p>"},{"title":"Installing kiex","link":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/installing-kiex\/","pubDate":"Wed, 30 Jan 2019 17:10:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/installing-kiex\/","description":"<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-text\" data-lang=\"text\"><span class=\"line\"><span class=\"cl\">\\curl -sSL https:\/\/raw.githubusercontent.com\/taylor\/kiex\/master\/install | bash -s<\/span><\/span><\/code><\/pre><\/div>\n<p>Then ensure it&rsquo;s in your path. I copied it to <code>\/usr\/local\/bin<\/code>:<\/p>"},{"title":"Integrating direnv with kiex","link":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/integrating-kiex-direnv\/","pubDate":"Wed, 30 Jan 2019 17:07:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/integrating-kiex-direnv\/","description":"<p>To integrate <code>direnv<\/code> with <code>kiex<\/code>, add the following to <code>~\/.direnvrc<\/code>:<\/p>"},{"title":"Getting Erlang version","link":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/erlang-version\/","pubDate":"Wed, 30 Jan 2019 17:05:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/erlang-version\/","description":"<p>Use this helper function:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-text\" data-lang=\"text\"><span class=\"line\"><span class=\"cl\">erlang_version() {\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    erl -eval &#39;\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        {ok, Version} = file:read_file(\n<\/span><\/span><span class=\"line\"><span class=\"cl\">                            filename:join(\n<\/span><\/span><span class=\"line\"><span class=\"cl\">                                [code:root_dir(),\n<\/span><\/span><span class=\"line\"><span class=\"cl\">                                 &#34;releases&#34;,\n<\/span><\/span><span class=\"line\"><span class=\"cl\">                                 erlang:system_info(otp_release),\n<\/span><\/span><span class=\"line\"><span class=\"cl\">                                 &#34;OTP_VERSION&#34;])),\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        io:format(&#34;Erlang\/OTP ~s&#34;, [Version]),\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        halt().&#39; -noshell\n<\/span><\/span><span class=\"line\"><span class=\"cl\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n<div class=\"callout callout-warning\">\n  <div class=\"callout-content\">\n    Note that this only works when you run <code>erl<\/code>; it doesn&rsquo;t work in a released application.\n  <\/div>\n<\/div>"},{"title":"Installing Erlang with kerl","link":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/installing-erlang-with-kerl\/","pubDate":"Wed, 30 Jan 2019 17:04:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/installing-erlang-with-kerl\/","description":"<p>At Electric Imp, on developer PCs, we manage our Erlang versions with <a href=\"https:\/\/github.com\/yrashk\/kerl\">kerl<\/a>.<\/p>"},{"title":"Installing kerl","link":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/installing-kerl\/","pubDate":"Wed, 30 Jan 2019 17:03:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/installing-kerl\/","description":"<h2 id=\"ubuntu\">Ubuntu<a href=\"#ubuntu\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<pre><code>curl -O https:\/\/raw.githubusercontent.com\/kerl\/kerl\/master\/kerl\nchmod +x kerl\nsudo mv kerl \/usr\/local\/bin\n<\/code><\/pre>\n<h2 id=\"macos\">macOS<a href=\"#macos\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<pre><code>brew install kerl\n<\/code><\/pre>"},{"title":"Integrating direnv with kerl","link":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/integrating-kerl-direnv\/","pubDate":"Wed, 30 Jan 2019 17:03:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/integrating-kerl-direnv\/","description":"<p>To integrate <code>direnv<\/code> with <code>kerl<\/code>, add the following to <code>~\/.direnvrc<\/code>:<\/p>"},{"title":"Building Erlang: Prerequisites (Ubuntu)","link":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/erlang-build-prerequisites\/","pubDate":"Wed, 30 Jan 2019 17:02:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/erlang-build-prerequisites\/","description":"<p>If you want to use <code>kerl<\/code> to build your Erlang installation, you&rsquo;re going to\nneed some packages installed first.<\/p>"},{"title":"Installing direnv","link":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/installing-direnv\/","pubDate":"Wed, 30 Jan 2019 17:01:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/installing-direnv\/","description":"<p>From <a href=\"https:\/\/direnv.net\/\">direnv.net<\/a>:<\/p>\n\n\n\n\n  <blockquote>\n    <p><code>direnv<\/code> is an environment switcher for the shell.<\/p>\n\n  <\/blockquote>\n\n<h1 id=\"installing-direnv\">Installing direnv<a href=\"#installing-direnv\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h1>\n<h2 id=\"ubuntu\">Ubuntu<a href=\"#ubuntu\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p><code>direnv<\/code> is available as an <a href=\"https:\/\/packages.ubuntu.com\/search?keywords=direnv&amp;searchon=names&amp;suite=all&amp;section=all\">Ubuntu package<\/a>, but unless you&rsquo;re on a really recent Ubuntu, it&rsquo;ll be outdated.<\/p>"},{"title":"Using direnv to manage tool versions","link":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/direnv-tool-versions\/","pubDate":"Wed, 30 Jan 2019 17:00:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/direnv-tool-versions\/","description":"<p>At Electric Imp, we use a <a href=\"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/electricimp-languages\/\">variety of different languages<\/a>, and each project might be using a different mix of versions.<\/p>"},{"title":"Rebuilding kerl Installations","link":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/rebuild-kerl-installations\/","pubDate":"Wed, 30 Jan 2019 16:50:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/rebuild-kerl-installations\/","description":"<p>If <code>kerl list installations<\/code> is displaying Erlang installations that you\ndeleted ages ago, and you&rsquo;ve got all of your installations in\n<code>~\/.kerl\/erlangs\/<\/code>, you can rebuild the list by running the following command:<\/p>"},{"title":"Which programming languages do we use at Electric Imp?","link":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/electricimp-languages\/","pubDate":"Wed, 30 Jan 2019 14:53:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/30\/electricimp-languages\/","description":"<p>I last posted on this topic about <a href=\"https:\/\/blog.differentpla.net\/blog\/2014\/10\/21\/electricimp-languages\/\">4 years ago<\/a>. It&rsquo;s time for an update.<\/p>"},{"title":"jq reduce","link":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/11\/jq-reduce\/","pubDate":"Fri, 11 Jan 2019 19:38:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2019\/01\/11\/jq-reduce\/","description":"<p>I found myself having to process a large JSON file using <code>jq --slurp<\/code>, and it was using up a lot of memory, so I thought it was time to learn about <code>jq<\/code>&rsquo;s <code>reduce<\/code> function.<\/p>"},{"title":"gen_server:enter_loop","link":"https:\/\/blog.differentpla.net\/blog\/2018\/06\/12\/gen-server-enter-loop\/","pubDate":"Tue, 12 Jun 2018 14:52:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2018\/06\/12\/gen-server-enter-loop\/","description":"<p>When you use <code>gen_server:start\/3,4<\/code> or <code>gen_server:start_link\/3,4<\/code>, the call\nblocks until the other process has finished running <code>init\/1<\/code>.<\/p>"},{"title":"Installing 'robot-detect'","link":"https:\/\/blog.differentpla.net\/blog\/2017\/12\/13\/robot-detect\/","pubDate":"Wed, 13 Dec 2017 11:44:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2017\/12\/13\/robot-detect\/","description":"<p>Installing the <a href=\"https:\/\/github.com\/robotattackorg\/robot-detect\">script<\/a> to check for <a href=\"https:\/\/www.robotattack.org\/\">The ROBOT Attack<\/a>. On Linux Mint 18.3. Yak shaving.<\/p>"},{"title":"git rebase tips","link":"https:\/\/blog.differentpla.net\/blog\/2017\/10\/27\/git-rebase-tips\/","pubDate":"Fri, 27 Oct 2017 13:10:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2017\/10\/27\/git-rebase-tips\/","description":"<p><em>This is an internal email I wrote almost exactly 2 years ago. I had to refer\nto it today, and I figured that it bears sharing publicly.<\/em><\/p>"},{"title":"Updating libgnutls28 on Ubuntu trusty","link":"https:\/\/blog.differentpla.net\/blog\/2017\/10\/27\/libgnutls-patch\/","pubDate":"Fri, 27 Oct 2017 09:10:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2017\/10\/27\/libgnutls-patch\/","description":"<p>Previously, I <a href=\"https:\/\/blog.differentpla.net\/blog\/2017\/10\/27\/libgnutls-bug\/\">posted about a bug<\/a> we&rsquo;d fallen foul of in libgnutls28 on Ubuntu 14.04. There&rsquo;s a <a href=\"https:\/\/bugs.launchpad.net\/ubuntu\/+source\/gnutls28\/+bug\/1722411\">patch<\/a>.<\/p>"},{"title":"A bug in libgnutls","link":"https:\/\/blog.differentpla.net\/blog\/2017\/10\/27\/libgnutls-bug\/","pubDate":"Fri, 27 Oct 2017 09:06:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2017\/10\/27\/libgnutls-bug\/","description":"<h2 id=\"background\">Background<a href=\"#background\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>An <a href=\"https:\/\/electricimp.com\/\">Electric Imp<\/a> customer reported that, after a recent server deploy, their agent could no longer connect to a Google API.<\/p>"},{"title":"Using Google Pub\/Sub from bash","link":"https:\/\/blog.differentpla.net\/blog\/2017\/10\/05\/google-pub-sub-bash\/","pubDate":"Thu, 05 Oct 2017 14:35:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2017\/10\/05\/google-pub-sub-bash\/","description":"<h2 id=\"background\">Background<a href=\"#background\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>Several of our customers want their <a href=\"https:\/\/electricimp.com\/\">Electric Imp<\/a> agents to be able to talk to Google&rsquo;s APIs, in particular Google Pub\/Sub.<\/p>"},{"title":"Simple job control in bash","link":"https:\/\/blog.differentpla.net\/blog\/2017\/08\/23\/bash-job-control\/","pubDate":"Wed, 23 Aug 2017 09:03:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2017\/08\/23\/bash-job-control\/","description":"<h2 id=\"what\">What?<a href=\"#what\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>As part of our system test suite, I need to run a bunch of programs at the same\ntime, and have them restart if they crash.<\/p>"},{"title":"How does rebar escriptize work?","link":"https:\/\/blog.differentpla.net\/blog\/2015\/10\/21\/rebar-escriptize\/","pubDate":"Wed, 21 Oct 2015 08:29:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2015\/10\/21\/rebar-escriptize\/","description":"<h2 id=\"hello-world\">Hello World<a href=\"#hello-world\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>You can create Erlang scripts quite simply. Just create a file something like the following:<\/p>"},{"title":"Running rsync over an SSH port forward","link":"https:\/\/blog.differentpla.net\/blog\/2015\/10\/21\/rsync-port-forward\/","pubDate":"Wed, 21 Oct 2015 08:26:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2015\/10\/21\/rsync-port-forward\/","description":"<h2 id=\"why\">Why?<a href=\"#why\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>I&rsquo;m using bastion, and it&rsquo;s slow to establish connections.<\/p>"},{"title":"Compiling Erlang for Synology DS211, DSM 5.1","link":"https:\/\/blog.differentpla.net\/blog\/2015\/07\/05\/erlang-ds211\/","pubDate":"Sun, 05 Jul 2015 20:16:00 +0100","guid":"https:\/\/blog.differentpla.net\/blog\/2015\/07\/05\/erlang-ds211\/","description":"<p>I wanted to get Erlang running on my Synology NAS, for various reasons, and was\nstruggling with the cross compiler.<\/p>"},{"title":"Enabling remote SSH access on OpenWRT 12.09","link":"https:\/\/blog.differentpla.net\/blog\/2015\/05\/27\/openwrt-ssh-wan\/","pubDate":"Wed, 27 May 2015 20:15:00 +0100","guid":"https:\/\/blog.differentpla.net\/blog\/2015\/05\/27\/openwrt-ssh-wan\/","description":"<p>I don&rsquo;t recommend enabling remote SSH access to your router, but if you need\nto, here&rsquo;s how to do it via the web interface (LuCI):<\/p>"},{"title":"Validating RS256-signed JSON Web Tokens in Erlang","link":"https:\/\/blog.differentpla.net\/blog\/2015\/04\/19\/jwt-rs256-erlang\/","pubDate":"Sun, 19 Apr 2015 14:29:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2015\/04\/19\/jwt-rs256-erlang\/","description":"<p>I&rsquo;m currently playing with OpenID Connect (OAuth 2.0 for Login), to allow people to log into a web site using their\nGoogle account. The web site is built using Erlang.<\/p>"},{"title":"Configuring Mailgun DNS entries on eNom","link":"https:\/\/blog.differentpla.net\/blog\/2015\/02\/22\/mailgun-enom\/","pubDate":"Sun, 22 Feb 2015 09:14:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2015\/02\/22\/mailgun-enom\/","description":"<p>When setting up a Mailgun domain, you need to configure some DNS entries, shown\nas follows in the Mailgun console:<\/p>"},{"title":"Running Chromium as a Dashboard","link":"https:\/\/blog.differentpla.net\/blog\/2015\/01\/28\/chromium-dashboard\/","pubDate":"Wed, 28 Jan 2015 08:26:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2015\/01\/28\/chromium-dashboard\/","description":"<p>On my desk I have a dashboard (an &ldquo;information radiator&rdquo;) that displays various\nuseful things, such as the build status of various Jenkins jobs, clocks showing\nimportant timezones (Electric Imp is a distributed company), and so on.<\/p>"},{"title":"sudo: unable to resolve host","link":"https:\/\/blog.differentpla.net\/blog\/2014\/11\/30\/sudo-unable-to-resolve-host\/","pubDate":"Sun, 30 Nov 2014 11:58:18 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2014\/11\/30\/sudo-unable-to-resolve-host\/","description":"<p>Attempting to <code>sudo bash<\/code>, I was confronted with:<\/p>\n<pre><code>ubuntu@ip-172-30-0-195:~$ sudo bash\nsudo: unable to resolve host ip-172-30-0-195\n<\/code><\/pre>\n<p>This is because the <a href=\"http:\/\/askubuntu.com\/questions\/59458\/error-message-when-i-run-sudo-unable-to-resolve-host-none\">hostname doesn&rsquo;t\nappear<\/a>\nin <code>\/etc\/hosts<\/code>, so edit it as follows:<\/p>"},{"title":"Getting lager handler info","link":"https:\/\/blog.differentpla.net\/blog\/2014\/11\/28\/lager-handler-info\/","pubDate":"Fri, 28 Nov 2014 11:08:49 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2014\/11\/28\/lager-handler-info\/","description":"<p>We use <a href=\"https:\/\/github.com\/basho\/lager\">lager<\/a> for our logging at <a href=\"http:\/\/www.electricimp.com\">Electric Imp<\/a>.\nThis morning I had cause to <a href=\"http:\/\/blog.differentpla.net\/blog\/2014\/05\/10\/adding-lager-handlers-at-runtime\/\">tweak the\nconfiguration<\/a>\nat runtime on one of our staging boxes, but first I needed to figure out which\nhandlers were already installed.<\/p>"},{"title":"When does terminate get called?","link":"https:\/\/blog.differentpla.net\/blog\/2014\/11\/13\/erlang-terminate\/","pubDate":"Thu, 13 Nov 2014 13:22:12 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2014\/11\/13\/erlang-terminate\/","description":"<p>In Erlang, in a <code>gen_server<\/code>, when <em>does<\/em> terminate get called? Also, some\nmessing around with <code>dbg<\/code> for tracing.<\/p>"},{"title":"Supervised event handlers in Erlang","link":"https:\/\/blog.differentpla.net\/blog\/2014\/11\/07\/erlang-sup-event\/","pubDate":"Fri, 07 Nov 2014 10:11:33 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2014\/11\/07\/erlang-sup-event\/","description":"<p>I find Erlang&rsquo;s <code>gen_event<\/code> behaviour to be fairly tricky to understand,\ndespite the copious documentation on the subject:<\/p>"},{"title":"Which programming languages do we use at Electric Imp?","link":"https:\/\/blog.differentpla.net\/blog\/2014\/10\/21\/electricimp-languages\/","pubDate":"Tue, 21 Oct 2014 10:57:12 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2014\/10\/21\/electricimp-languages\/","description":"<p>This question just came up on Twitter:<\/p>\n\n\n\n\n  <blockquote>\n    <p><a href=\"https:\/\/twitter.com\/electricimp\">@electricimp<\/a> i am looking to do an\ninternship with you, i was just wondering what would be the best programming\nlanguages for me to develop?<\/p>\n\n  <\/blockquote>"},{"title":"Library module name 'foo_nif' does not match calling module 'erl_eval'","link":"https:\/\/blog.differentpla.net\/blog\/2014\/10\/09\/library-module-does-not-match-calling-module\/","pubDate":"Thu, 09 Oct 2014 13:43:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2014\/10\/09\/library-module-does-not-match-calling-module\/","description":"<p>It turns out that you can&rsquo;t load Erlang NIF libraries from the shell.<\/p>"},{"title":"Reverting Erlang 17","link":"https:\/\/blog.differentpla.net\/blog\/2014\/10\/09\/reverting-erlang-17\/","pubDate":"Thu, 09 Oct 2014 12:22:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2014\/10\/09\/reverting-erlang-17\/","description":"<p>We&rsquo;ve found a couple of problems with Erlang R16 that mean that one of our\nprojects requires Erlang 17. Conversely, we&rsquo;ve found a couple of problems with\nErlang 17 that mean that one of our <em>other<\/em> projects should stick with Erlang\nR16.<\/p>"},{"title":"Using kerl with direnv","link":"https:\/\/blog.differentpla.net\/blog\/2014\/09\/30\/kerl-and-direnv\/","pubDate":"Tue, 30 Sep 2014 00:00:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2014\/09\/30\/kerl-and-direnv\/","description":"<p><code>kerl<\/code> allows you to easily build and install multiple Erlang\/OTP releases.\nIt&rsquo;s kinda like <code>nvm<\/code> or <code>rvm<\/code>, but for Erlang. It doesn&rsquo;t do everything, and\nthat&rsquo;s what <code>direnv<\/code> is for. <code>direnv<\/code> allows you to run commands upon entering\nor leaving a particular directory.<\/p>"},{"title":"Dependency my_app is specified as a dependency but is not reachable by the system","link":"https:\/\/blog.differentpla.net\/blog\/2014\/07\/07\/dependency-my-app-is-specified-as-a-dependency-but-is-not-reachable-by-the-system\/","pubDate":"Mon, 07 Jul 2014 13:26:04 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2014\/07\/07\/dependency-my-app-is-specified-as-a-dependency-but-is-not-reachable-by-the-system\/","description":"<p>While using <code>erlang.mk<\/code> and <code>relx<\/code> to build a newly-created Erlang application, I got the following error:<\/p>"},{"title":"Electric Imp Moves to Erlang Programming Language","link":"https:\/\/blog.differentpla.net\/blog\/2014\/05\/16\/electricimp-erlang\/","pubDate":"Fri, 16 May 2014 00:00:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2014\/05\/16\/electricimp-erlang\/","description":"<div class=\"callout callout-info\">\n  <div class=\"callout-content\">\n    <p>Originally posted to the Electric Imp blog, 16 June 2014.<\/p>\n<p>This post is no longer available on the Electric Imp blog, so to preserve it, I took a copy from the\n<a href=\"https:\/\/web.archive.org\/web\/20140702010121\/http:\/\/blog.electricimp.com\/post\/85932940180\/electric-imp-moves-to-erlang-programming-language\">Internet Archive Wayback Machine<\/a>.<\/p>\n\n  <\/div>\n<\/div>"},{"title":"lager formatters","link":"https:\/\/blog.differentpla.net\/blog\/2014\/05\/13\/lager-formatters\/","pubDate":"Tue, 13 May 2014 12:49:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2014\/05\/13\/lager-formatters\/","description":"<h2 id=\"overview\">Overview<a href=\"#overview\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>If you&rsquo;re using <a href=\"https:\/\/github.com\/basho\/lager\/\">lager<\/a> for your Erlang logging,\nyou&rsquo;ve probably left the default formatter well alone, by doing something like\nthis in your configuration file:<\/p>"},{"title":"Adding lager handlers at runtime","link":"https:\/\/blog.differentpla.net\/blog\/2014\/05\/10\/adding-lager-handlers-at-runtime\/","pubDate":"Sat, 10 May 2014 08:49:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2014\/05\/10\/adding-lager-handlers-at-runtime\/","description":"<p>You&rsquo;re using lager for logging in your Erlang program, and you discover that\nyour configuration isn&rsquo;t logging anything more verbose than <code>info<\/code>-level\nmessages. How do you bump that up to <code>debug<\/code>?<\/p>"},{"title":"Debugging Erlang with a remote shell","link":"https:\/\/blog.differentpla.net\/blog\/2014\/05\/08\/debugging-erlang-with-a-remote-shell\/","pubDate":"Thu, 08 May 2014 15:54:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2014\/05\/08\/debugging-erlang-with-a-remote-shell\/","description":"<p>If you&rsquo;re connected to an Erlang node via a remote shell, and you don&rsquo;t have\naccess to stdout on the original node, you&rsquo;ll need to redirect the trace output\nto your current shell.<\/p>"},{"title":"Creating ZIP files in Erlang","link":"https:\/\/blog.differentpla.net\/blog\/2014\/03\/05\/zip-files-in-erlang\/","pubDate":"Wed, 05 Mar 2014 16:30:57 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2014\/03\/05\/zip-files-in-erlang\/","description":"<p>It&rsquo;s pretty simple to create a ZIP file on disk.<\/p>"},{"title":"epgsql: invalid_password","link":"https:\/\/blog.differentpla.net\/blog\/2013\/12\/31\/epgsql-invalid-password\/","pubDate":"Tue, 31 Dec 2013 14:55:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/12\/31\/epgsql-invalid-password\/","description":"<p>I&rsquo;m writing a simple web application in Erlang that uses\n<a href=\"https:\/\/github.com\/wg\/epgsql\">epgsql<\/a> to talk to a PostgreSQL database. I keep\ngetting <code>invalid_password<\/code>, despite the fact that the user doesn&rsquo;t have a\npassword (and I&rsquo;m passing &ldquo;&rdquo;). I can also log in by using <code>psql -U foo<\/code>.<\/p>"},{"title":"On caching","link":"https:\/\/blog.differentpla.net\/blog\/2013\/12\/29\/on-caching\/","pubDate":"Sun, 29 Dec 2013 09:12:01 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/12\/29\/on-caching\/","description":"<h2 id=\"background\">Background<a href=\"#background\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>There&rsquo;s a quote:<\/p>\n\n\n\n\n  <blockquote>\n    <p>&ldquo;There are only two hard problems in Computer Science: cache invalidation and\nnaming things.&rdquo;<\/p>\n<p>&ndash; Phil Karlton<\/p>\n\n  <\/blockquote>"},{"title":"vim, syntastic, .jshintrc","link":"https:\/\/blog.differentpla.net\/blog\/2013\/12\/10\/vim-syntastic-jshintrc\/","pubDate":"Tue, 10 Dec 2013 14:21:18 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/12\/10\/vim-syntastic-jshintrc\/","description":"<p>I&rsquo;ve been using <a href=\"https:\/\/github.com\/scrooloose\/syntastic\">Syntastic<\/a> for a while now.\nIt&rsquo;s awesome.<\/p>\n<p>One thing it&rsquo;s missing, however, is the ability to automatically find an appropriate\n<code>.jshintrc<\/code> file for the file you&rsquo;re editing.<\/p>"},{"title":"vim plugins","link":"https:\/\/blog.differentpla.net\/blog\/2013\/11\/22\/vim-plugins\/","pubDate":"Fri, 22 Nov 2013 12:22:29 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/11\/22\/vim-plugins\/","description":"<p>This, for no particular reason, is the list of vim plugins that I&rsquo;m currently using:<\/p>"},{"title":"Labels for Aprils","link":"https:\/\/blog.differentpla.net\/blog\/2013\/11\/22\/labels-for-aprils\/","pubDate":"Fri, 22 Nov 2013 08:57:22 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/11\/22\/labels-for-aprils\/","description":"<p>If you don&rsquo;t know what <a href=\"http:\/\/electricimp.com\">electric imp<\/a> is, what an\n<a href=\"http:\/\/electricimp.com\/docs\/hardware\/resources\/reference-designs\/april\/\">April Development\nBoard<\/a>\nis, and you don&rsquo;t have a <a href=\"http:\/\/global.dymo.com\/enGB\/Products\/LetraTag_LT-100H.html\">Dymo LetraTag\nLT-100H<\/a> label\nprinter, then this isn&rsquo;t going to be of much use to you.<\/p>"},{"title":"OpenWRT: Cannot find termcap entry for 'xterm-256color'","link":"https:\/\/blog.differentpla.net\/blog\/2013\/11\/16\/openwrt-cannot-find-termcap-entry-for-xterm-256color\/","pubDate":"Sat, 16 Nov 2013 10:50:35 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/11\/16\/openwrt-cannot-find-termcap-entry-for-xterm-256color\/","description":"<p>I&rsquo;ve got my <code>TERM<\/code> environment variable set to <code>xterm-256color<\/code>\n(even though I&rsquo;m using <strong>gnome-terminal<\/strong>, but that&rsquo;s a different story).\nWhen I ssh into my OpenWRT router, I get presented with the error message:<\/p>"},{"title":"Capturing network traces with OpenWRT","link":"https:\/\/blog.differentpla.net\/blog\/2013\/11\/13\/capturing-network-traces-with-openwrt\/","pubDate":"Wed, 13 Nov 2013 09:42:22 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/11\/13\/capturing-network-traces-with-openwrt\/","description":"<p>This is mostly a reminder to myself.<\/p>\n<h2 id=\"install-tcpdump\">Install tcpdump<a href=\"#install-tcpdump\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<pre><code>opkg update\nopkg install tcpdump\n<\/code><\/pre>\n<h2 id=\"external-usb-modules\">External USB Modules<a href=\"#external-usb-modules\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>I don&rsquo;t want to waste internal storage on the capture files, so install the USB\nstorage modules:<\/p>"},{"title":"gen_fsm learnings, part 3","link":"https:\/\/blog.differentpla.net\/blog\/2013\/11\/12\/gen-fsm-learnings-part-3\/","pubDate":"Tue, 12 Nov 2013 13:51:52 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/11\/12\/gen-fsm-learnings-part-3\/","description":"<p>Some odds and ends.<\/p>\n<h2 id=\"handle_info-information\"><code>handle_info<\/code> information<a href=\"#handle_info-information\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>The last of the &ldquo;I don&rsquo;t know what this is for&rdquo; functions is <code>handle_info<\/code>. This\nis documented as being called for messages that aren&rsquo;t events or system\nmessages.<\/p>"},{"title":"gen_fsm learnings, part 2","link":"https:\/\/blog.differentpla.net\/blog\/2013\/11\/11\/gen-fsm-learnings-part-2\/","pubDate":"Mon, 11 Nov 2013 16:12:36 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/11\/11\/gen-fsm-learnings-part-2\/","description":"<h2 id=\"handle_event-and-handle_sync_event\"><code>handle_event<\/code> and <code>handle_sync_event<\/code><a href=\"#handle_event-and-handle_sync_event\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>OK. So, looping back round, just what <em>are<\/em> <code>handle_event<\/code> and\n<code>handle_sync_event<\/code> for?<\/p>"},{"title":"gen_fsm learnings, part 1","link":"https:\/\/blog.differentpla.net\/blog\/2013\/11\/11\/gen-fsm-learnings-part-1\/","pubDate":"Mon, 11 Nov 2013 15:31:10 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/11\/11\/gen-fsm-learnings-part-1\/","description":"<h2 id=\"background\">Background<a href=\"#background\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>All of the <code>gen_fsm<\/code> examples I&rsquo;ve found on the Internet are way too\ncomplicated. For example, the one in <a href=\"http:\/\/learnyousomeerlang.com\/finite-state-machines\">learn you some\nErlang<\/a> jumps from a\nsimple, hand-written FSM to one that seems to handle a full trading floor\nsimulation. That&rsquo;s a steep learning curve in my book.<\/p>"},{"title":"Failed to enumerate SSL bindings","link":"https:\/\/blog.differentpla.net\/blog\/2013\/11\/11\/failed-to-enumerate-ssl-bindings\/","pubDate":"Mon, 11 Nov 2013 14:53:04 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/11\/11\/failed-to-enumerate-ssl-bindings\/","description":"<p>In PowerShell, when I attempted to enumerate SSL bindings, I was getting the\nerror message:<\/p>"},{"title":"MSBuild - where is everything?","link":"https:\/\/blog.differentpla.net\/blog\/2013\/11\/11\/msbuild-where-is-everything\/","pubDate":"Mon, 11 Nov 2013 14:47:09 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/11\/11\/msbuild-where-is-everything\/","description":"<p>MSBuild (and Visual Studio) scatter <code>.targets<\/code> and <code>.tasks<\/code> files all over the shop. Try looking in:<\/p>"},{"title":"net_kernel:connect_node\/1 returns ignored","link":"https:\/\/blog.differentpla.net\/blog\/2013\/11\/07\/net-kernel-connect-node-1-returns-ignored\/","pubDate":"Thu, 07 Nov 2013 16:31:34 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/11\/07\/net-kernel-connect-node-1-returns-ignored\/","description":"<p>Just some random thing I learnt today while playing with Erlang:<\/p>"},{"title":"Lego Storage","link":"https:\/\/blog.differentpla.net\/blog\/2013\/11\/03\/lego-storage\/","pubDate":"Sun, 03 Nov 2013 19:59:11 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/11\/03\/lego-storage\/","description":"<p>My son has quite a lot of Lego, but he stopped playing with it. It turns out\nthat he gets frustrated when he can&rsquo;t find a particular piece. So we started\nexploring storage options.<\/p>"},{"title":"Cowboy - Request Timeouts","link":"https:\/\/blog.differentpla.net\/blog\/2013\/11\/03\/cowboy-request-timeouts\/","pubDate":"Sun, 03 Nov 2013 19:56:38 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/11\/03\/cowboy-request-timeouts\/","description":"<p>Cowboy protects itself against slow requests by doing the following:<\/p>"},{"title":"channel_setup_fwd_listener: cannot listen to port","link":"https:\/\/blog.differentpla.net\/blog\/2013\/11\/01\/channel-setup-fwd-listener-cannot-listen-to-port\/","pubDate":"Fri, 01 Nov 2013 12:24:29 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/11\/01\/channel-setup-fwd-listener-cannot-listen-to-port\/","description":"<p>I was attempting to use SSH to set up a tunnel (to our build server) this morning,\nso I typed the following:<\/p>"},{"title":"On getting out of my technical comfort zone","link":"https:\/\/blog.differentpla.net\/blog\/2013\/10\/31\/on-getting-out-of-my-technical-comfort-zone\/","pubDate":"Thu, 31 Oct 2013 09:56:17 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/10\/31\/on-getting-out-of-my-technical-comfort-zone\/","description":"<p>I&rsquo;ve been working for <a href=\"http:\/\/electricimp.com\/\">electric imp<\/a> for about three\nmonths now, and I&rsquo;ve been planning to articulate why I made the change, or more\nspecifically, how it meant getting way out of my technical and working comfort\nzone.<\/p>"},{"title":"Replacing dnsmasq on OpenWRT","link":"https:\/\/blog.differentpla.net\/blog\/2013\/10\/30\/replacing-dnsmasq-on-openwrt\/","pubDate":"Wed, 30 Oct 2013 11:34:11 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/10\/30\/replacing-dnsmasq-on-openwrt\/","description":"<h2 id=\"overview\">Overview<a href=\"#overview\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>My home router runs <a href=\"https:\/\/openwrt.org\/\">OpenWRT<\/a>, which uses <strong>dnsmasq<\/strong> by\ndefault. However, I want to enable <a href=\"http:\/\/en.wikipedia.org\/wiki\/Split-horizon_DNS\">split-horizon\nDNS<\/a>, so that different clients\nget different IP addresses for particular names.<\/p>"},{"title":"Dependency Injection in node.js","link":"https:\/\/blog.differentpla.net\/blog\/2013\/10\/05\/dependency-injection-in-node-js\/","pubDate":"Sat, 05 Oct 2013 19:26:44 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/10\/05\/dependency-injection-in-node-js\/","description":"<p>node.js modules are singletons. If you <code>require('foo')<\/code> from one module, and\nthen <code>require('foo')<\/code> from a different module, you&rsquo;ll get the same instance.<\/p>"},{"title":"Creating a Certificate Request in PowerShell","link":"https:\/\/blog.differentpla.net\/blog\/2013\/06\/25\/creating-a-certificate-request-in-powershell\/","pubDate":"Tue, 25 Jun 2013 18:56:28 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/06\/25\/creating-a-certificate-request-in-powershell\/","description":"<p>The <a href=\"http:\/\/www.bouncycastle.org\/wiki\/display\/JA1\/X.509+Public+Key+Certificate+and+Certification+Request+Generation#X.509PublicKeyCertificateandCertificationRequestGeneration-CreatingCertificationRequests\">documentation<\/a> is for Java, and mentions the <code>PKCS10CertificationRequest<\/code> class.<\/p>\n<p>The equivalent in the .NET libraries is <code>Org.BouncyCastle.Pkcs.Pkcs10CertificationRequest<\/code>.<\/p>"},{"title":"Using Reflection to get constructor details in PowerShell","link":"https:\/\/blog.differentpla.net\/blog\/2013\/06\/25\/using-reflection-to-get-constructor-details-in-powershell\/","pubDate":"Tue, 25 Jun 2013 18:54:25 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/06\/25\/using-reflection-to-get-constructor-details-in-powershell\/","description":"<p>I was attempting to convert some Java code that uses Bouncy Castle into the\nequivalent PowerShell. The Java code was using the <code>PKCS10CertificationRequest<\/code> class,\nand I needed to see if there was an equivalent in the .NET libraries:<\/p>"},{"title":"Phones I have owned","link":"https:\/\/blog.differentpla.net\/blog\/2013\/06\/18\/phones-i-have-owned\/","pubDate":"Tue, 18 Jun 2013 10:37:38 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/06\/18\/phones-i-have-owned\/","description":"<p>Apropos of a discussion on Facebook earlier today:<\/p>\n<ul>\n<li>Motorola MR20<\/li>\n<li>Motorola Startac<\/li>\n<li>Motorola (blue thing)<\/li>\n<li>Nokia 8310<\/li>\n<li>Nokia 6230<\/li>\n<li>HTC Desire<\/li>\n<li>Samsung Galaxy S3<\/li>\n<\/ul>"},{"title":"Failed to load data access DLL","link":"https:\/\/blog.differentpla.net\/blog\/2013\/06\/03\/failed-to-load-data-access-dll\/","pubDate":"Mon, 03 Jun 2013 10:55:33 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/06\/03\/failed-to-load-data-access-dll\/","description":"<p>While attempting to debug a crash dump from a .NET 4.0 RTM process on my (.NET 4.5), I got the dreaded\n<code>Failed to load data access DLL, 0x80004005<\/code> error message.<\/p>"},{"title":"Using IIS Express in vs-welcome-page","link":"https:\/\/blog.differentpla.net\/blog\/2013\/05\/29\/using-iis-express-in-vs-welcome-page\/","pubDate":"Wed, 29 May 2013 17:35:18 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/05\/29\/using-iis-express-in-vs-welcome-page\/","description":"<p>So, why did I use <em>IIS Express<\/em> to implement my <em>vs-welcome-page<\/em> extension? I&rsquo;m using Nancy, so why didn&rsquo;t I just use\nthe self-hosting support and host it inside Visual Studio instead?<\/p>"},{"title":"Packaging vs-welcome-page","link":"https:\/\/blog.differentpla.net\/blog\/2013\/05\/29\/packaging-vs-welcome-page\/","pubDate":"Wed, 29 May 2013 17:25:57 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/05\/29\/packaging-vs-welcome-page\/","description":"<p>Next problem: packaging the <code>vs-welcome-page<\/code> extension.<\/p>\n<p>How to get the web application installed with the VS package? There doesn&rsquo;t appear to be an easy way to add arbitrary\nfiles to a VSIX package. You can do it by adding references to dependencies, but that doesn&rsquo;t help with the content\n(CSS, HTML files, etc).<\/p>"},{"title":"Killing IIS Express","link":"https:\/\/blog.differentpla.net\/blog\/2013\/05\/29\/killing-iis-express\/","pubDate":"Wed, 29 May 2013 17:23:35 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/05\/29\/killing-iis-express\/","description":"<p>A brief aside: I&rsquo;ve got to the point where I&rsquo;m about to fire up IIS Express from Visual Studio. In order to be a good\ncitizen, our extension should probably shut it down again later.<\/p>"},{"title":"Creating a Visual Studio Extension","link":"https:\/\/blog.differentpla.net\/blog\/2013\/05\/29\/creating-a-visual-studio-extension\/","pubDate":"Wed, 29 May 2013 17:21:36 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/05\/29\/creating-a-visual-studio-extension\/","description":"<p>The next major piece is the Visual Studio extension, so let&rsquo;s get on with that. Assuming that you&rsquo;ve installed the\nVisual Studio 2012 SDK, it&rsquo;s as simple as creating a new &ldquo;Visual Studio Package&rdquo; (it&rsquo;s under &ldquo;Visual C#&rdquo; \/\n&ldquo;Extensibility&rdquo;):<\/p>"},{"title":"Rendering Markdown in .NET","link":"https:\/\/blog.differentpla.net\/blog\/2013\/05\/29\/rendering-markdown-in-net\/","pubDate":"Wed, 29 May 2013 17:19:58 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/05\/29\/rendering-markdown-in-net\/","description":"<p>There are several options for rendering Markdown to HTML in .NET. If you bring\nup the NuGet Package Manager dialog and search for &ldquo;markdown&rdquo;, you get three\npages of results, including <code>MarkdownSharp<\/code>, which is the renderer used by\nStack Overflow, so it must be good.<\/p>"},{"title":"Displaying a web page in Visual Studio","link":"https:\/\/blog.differentpla.net\/blog\/2013\/05\/29\/displaying-a-web-page-in-visual-studio\/","pubDate":"Wed, 29 May 2013 15:35:04 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/05\/29\/displaying-a-web-page-in-visual-studio\/","description":"<p>Using the web browser that&rsquo;s built into Visual Studio is dead simple:<\/p>"},{"title":"Spike: Providing parameters to IIS Express-hosted applications","link":"https:\/\/blog.differentpla.net\/blog\/2013\/05\/29\/spike-providing-parameters-to-iis-express-hosted-applications\/","pubDate":"Wed, 29 May 2013 15:32:53 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/05\/29\/spike-providing-parameters-to-iis-express-hosted-applications\/","description":"<p>An aside: We need to be able to support multiple instances of our small web application (because you might have more\nthan one instance of Visual Studio open). If we host our application in IIS Express (and remember that we&rsquo;re doing this\nto avoid messing around with URL ACLs), we either need to duplicate the whole thing for each site, or figure out a way\nto provide it with parameters.<\/p>"},{"title":"Running IIS Express","link":"https:\/\/blog.differentpla.net\/blog\/2013\/05\/29\/running-iis-express\/","pubDate":"Wed, 29 May 2013 15:07:25 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/05\/29\/running-iis-express\/","description":"<p>When you create a web application in Visual Studio, you can configure it (on the properties page) to run in <strong>IIS\nExpress<\/strong>.<\/p>"},{"title":"A Visual Studio Extension in a Weekend","link":"https:\/\/blog.differentpla.net\/blog\/2013\/05\/29\/a-visual-studio-extension-in-a-weekend\/","pubDate":"Wed, 29 May 2013 15:05:42 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/05\/29\/a-visual-studio-extension-in-a-weekend\/","description":"<p>I wanted to write a Visual Studio extension (for VS2012) that, when you open a solution, renders and displays Markdown\ndocumentation in Visual Studio.<\/p>"},{"title":"IIS Application Pools and Auto-Started Web Applications","link":"https:\/\/blog.differentpla.net\/blog\/2013\/05\/13\/iis-application-pools-and-auto-started-web-applications\/","pubDate":"Mon, 13 May 2013 13:38:19 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/05\/13\/iis-application-pools-and-auto-started-web-applications\/","description":"<p>We had an issue at work last week where a web application was taking a little bit too long to start up, which was causing intermittent failures. We&rsquo;d like the application to be always-running, so that this doesn&rsquo;t happen.<\/p>"},{"title":"Finding IIS Worker Processes","link":"https:\/\/blog.differentpla.net\/blog\/2013\/05\/13\/finding-iis-worker-processes\/","pubDate":"Mon, 13 May 2013 13:37:46 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/05\/13\/finding-iis-worker-processes\/","description":"<p>How do we find out if there&rsquo;s a worker process for an application pool? Note that there can be more than one worker process for each application pool. Note also that a worker process can host multiple web applications.<\/p>"},{"title":"The case of the missing print jobs","link":"https:\/\/blog.differentpla.net\/blog\/2013\/04\/27\/the-case-of-the-missing-print-jobs\/","pubDate":"Sat, 27 Apr 2013 08:02:22 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/04\/27\/the-case-of-the-missing-print-jobs\/","description":"<p>Having recently moved my home server (Windows 2012) from the hall cupboard to the corner of my study, I decided to connect it to my printer. This means that I can print from my laptop over wireless without needing to turn on the desktop PC that the printer was originally connected to.<\/p>"},{"title":"MessageSecurityException","link":"https:\/\/blog.differentpla.net\/blog\/2013\/04\/18\/messagesecurityexception\/","pubDate":"Thu, 18 Apr 2013 14:59:49 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/04\/18\/messagesecurityexception\/","description":"<p>As I run across them, I&rsquo;m going to update this page with various causes of the WCF <code>MessageSecurityException<\/code>.<\/p>"},{"title":"PowerShell, Bouncy Castle and Subject Alternative Names","link":"https:\/\/blog.differentpla.net\/blog\/2013\/04\/17\/powershell-bouncy-castle-and-subject-alternative-names\/","pubDate":"Wed, 17 Apr 2013 15:21:13 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/04\/17\/powershell-bouncy-castle-and-subject-alternative-names\/","description":"<p>Again, this is more-or-less a direct port from <a href=\"http:\/\/blog.differentpla.net\/b\/2013\/21\/24\/bouncy-castle---subject-alternative-names\">the C# post<\/a>.<\/p>"},{"title":"PowerShell, Bouncy Castle and Extended Key Usage","link":"https:\/\/blog.differentpla.net\/blog\/2013\/04\/17\/powershell-bouncy-castle-and-extended-key-usage\/","pubDate":"Wed, 17 Apr 2013 12:46:44 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/04\/17\/powershell-bouncy-castle-and-extended-key-usage\/","description":"<p><em>Note: This is a bit long, because I want to take a moment to show some of the problems you might have using PowerShell to call .NET code that&rsquo;s written in a certain style.<\/em><\/p>"},{"title":"PowerShell and enums","link":"https:\/\/blog.differentpla.net\/blog\/2013\/04\/17\/powershell-and-enums\/","pubDate":"Wed, 17 Apr 2013 11:29:55 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/04\/17\/powershell-and-enums\/","description":"<p>PowerShell has a really cool feature where it&rsquo;ll coerce a string into an <code>enum<\/code> value. I&rsquo;ll demonstrate by exporting a certificate from the Windows certificate store:<\/p>"},{"title":"How to do .NET Reflection in PowerShell","link":"https:\/\/blog.differentpla.net\/blog\/2013\/04\/17\/how-to-do-net-reflection-in-powershell\/","pubDate":"Wed, 17 Apr 2013 11:29:29 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/04\/17\/how-to-do-net-reflection-in-powershell\/","description":"<p>This is all just .NET reflection code, converted from C# to PowerShell, but it can be useful&hellip;<\/p>"},{"title":"How do I use Bouncy Castle from PowerShell?","link":"https:\/\/blog.differentpla.net\/blog\/2013\/04\/17\/how-do-i-use-bouncy-castle-from-powershell\/","pubDate":"Wed, 17 Apr 2013 09:54:27 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/04\/17\/how-do-i-use-bouncy-castle-from-powershell\/","description":"<p>I recently wrote a <a href=\"http:\/\/blog.differentpla.net\/b\/2013\/21\/18\/how-do-i-create-a-self-signed-certificate-using-bouncy-castle-\">series of blog posts<\/a>\non how to use the cryptography libraries from the <a href=\"http:\/\/www.bouncycastle.org\/\">Legion of the BouncyCastle<\/a> in C#.<\/p>"},{"title":"Acer Aspire S7 and Secure Boot","link":"https:\/\/blog.differentpla.net\/blog\/2013\/03\/29\/acer-aspire-s7-and-secure-boot\/","pubDate":"Fri, 29 Mar 2013 13:59:28 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/03\/29\/acer-aspire-s7-and-secure-boot\/","description":"<p>I just bought myself a shiny new Acer Aspire S7-391, with a view towards nuking Windows 8 and to install Linux Mint on it. Stupidly, I didn&rsquo;t consider that Windows 8 logo certification now requires a UEFI BIOS and Secure Boot.<\/p>"},{"title":"Installing Windows 8 Pro on Acer Aspire S7","link":"https:\/\/blog.differentpla.net\/blog\/2013\/03\/27\/installing-windows-8-pro-on-acer-aspire-s7\/","pubDate":"Wed, 27 Mar 2013 16:47:34 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/03\/27\/installing-windows-8-pro-on-acer-aspire-s7\/","description":"<ol>\n<li>Make sure that the ISO file you&rsquo;ve downloaded is not corrupt &ndash; this caused me a bunch of grief.<\/li>\n<li>Format a bootable USB stick as FAT32.<\/li>\n<li>Mount the ISO.<\/li>\n<li>Copy the files from the ISO to the USB stick.<\/li>\n<li>In the Acer&rsquo;s BIOS, select UEFI; enable F12 boot menu.<\/li>\n<li>Restart the Acer.<\/li>\n<li>Press Fn-= (F12).<\/li>\n<li>Select the USB stick.<\/li>\n<li>Add the Intel drivers.<\/li>\n<li>Continue with the installation.<\/li>\n<\/ol>\n<p>Note that the 128GB SDD is two 64GB SSD drives configured as RAID0. You&rsquo;ll need the Intel RAID drivers.<\/p>"},{"title":"Bouncy Castle - Being a Certificate Authority","link":"https:\/\/blog.differentpla.net\/blog\/2013\/03\/24\/bouncy-castle-being-a-certificate-authority\/","pubDate":"Sun, 24 Mar 2013 16:14:15 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/03\/24\/bouncy-castle-being-a-certificate-authority\/","description":"<p>Over the last few posts, we&rsquo;ve seen how to create a self-signed server certificate in C#, by using the Bouncy Castle library. How do we create a CA certificate, and how do we issue certificates from that authority?<\/p>"},{"title":"Bouncy Castle - Subject Alternative Names","link":"https:\/\/blog.differentpla.net\/blog\/2013\/03\/24\/bouncy-castle-subject-alternative-names\/","pubDate":"Sun, 24 Mar 2013 14:20:58 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/03\/24\/bouncy-castle-subject-alternative-names\/","description":"<p>When you connect to a server using HTTPS, the server provides a certificate that identifies it. Your browser will then typically check that the name in the server certificate matches the address that you&rsquo;ve gone to. In this way, you can be sure that you&rsquo;re connecting to the correct server.<\/p>"},{"title":"Bouncy Castle - Extended Key Usage","link":"https:\/\/blog.differentpla.net\/blog\/2013\/03\/23\/bouncy-castle-extended-key-usage\/","pubDate":"Sat, 23 Mar 2013 13:13:35 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/03\/23\/bouncy-castle-extended-key-usage\/","description":"<p>If you look at a certificate, you will see something like one of the following:<\/p>"},{"title":"Bouncy Castle - Missing Certificate Attributes","link":"https:\/\/blog.differentpla.net\/blog\/2013\/03\/20\/bouncy-castle-missing-certificate-attributes\/","pubDate":"Wed, 20 Mar 2013 14:52:15 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/03\/20\/bouncy-castle-missing-certificate-attributes\/","description":"<p>Over the last couple of days, we&rsquo;ve seen how to use Bouncy Castle to generate certificates from C#. However, if you compare the certificates we&rsquo;ve been generating with those generated by (e.g.) <code>makecert<\/code>, you&rsquo;ll see that we&rsquo;re missing a few things.<\/p>"},{"title":"How do I convert a Bouncy Castle Certificate to a .NET Certificate?","link":"https:\/\/blog.differentpla.net\/blog\/2013\/03\/18\/how-do-i-convert-a-bouncy-castle-certificate-to-a-net-certificate\/","pubDate":"Mon, 18 Mar 2013 19:57:54 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/03\/18\/how-do-i-convert-a-bouncy-castle-certificate-to-a-net-certificate\/","description":"<p>In the last installment, we created a <em>Bouncy Castle<\/em> certificate. How do we now create a .NET <code>X509Certificate2<\/code> object?<\/p>"},{"title":"How do I create a self-signed certificate using Bouncy Castle?","link":"https:\/\/blog.differentpla.net\/blog\/2013\/03\/18\/how-do-i-create-a-self-signed-certificate-using-bouncy-castle\/","pubDate":"Mon, 18 Mar 2013 18:57:35 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/03\/18\/how-do-i-create-a-self-signed-certificate-using-bouncy-castle\/","description":"<p>Occasionally, you might find that you need to create a self-signed server certificate. If you&rsquo;re on Windows, your options are basically:<\/p>"},{"title":"Using Bouncy Castle from .NET","link":"https:\/\/blog.differentpla.net\/blog\/2013\/03\/18\/using-bouncy-castle-from-net\/","pubDate":"Mon, 18 Mar 2013 18:50:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/03\/18\/using-bouncy-castle-from-net\/","description":"<div class=\"series-index\">\n  <ul>\n    \n      \n      <li>\n        \n          Using Bouncy Castle from .NET\n        \n\n        (this page;&nbsp;<time\n  class=\"created_at timeago\"\n  data-bs-toggle=\"tooltip\"\n  data-bs-placement=\"top\"\n  datetime=\"2013-03-18T18:50:00&#43;0000\"\n>\n18 Mar 2013 18:50\n<\/time>)\n      <\/li>\n    \n      \n      <li>\n        \n          <a href=\"https:\/\/blog.differentpla.net\/blog\/2013\/03\/18\/how-do-i-create-a-self-signed-certificate-using-bouncy-castle\/\">Creating a self-signed certificate<\/a>\n        \n\n        (<time\n  class=\"created_at timeago\"\n  data-bs-toggle=\"tooltip\"\n  data-bs-placement=\"top\"\n  datetime=\"2013-03-18T18:57:35&#43;0000\"\n>\n18 Mar 2013 18:57\n<\/time>)\n      <\/li>\n    \n      \n      <li>\n        \n          <a href=\"https:\/\/blog.differentpla.net\/blog\/2013\/03\/18\/how-do-i-convert-a-bouncy-castle-certificate-to-a-net-certificate\/\">Converting to a .NET Certificate<\/a>\n        \n\n        (<time\n  class=\"created_at timeago\"\n  data-bs-toggle=\"tooltip\"\n  data-bs-placement=\"top\"\n  datetime=\"2013-03-18T19:57:54&#43;0000\"\n>\n18 Mar 2013 19:57\n<\/time>)\n      <\/li>\n    \n      \n      <li>\n        \n          <a href=\"https:\/\/blog.differentpla.net\/blog\/2013\/03\/20\/bouncy-castle-missing-certificate-attributes\/\">Missing Certificate Attributes<\/a>\n        \n\n        (<time\n  class=\"created_at timeago\"\n  data-bs-toggle=\"tooltip\"\n  data-bs-placement=\"top\"\n  datetime=\"2013-03-20T14:52:15&#43;0000\"\n>\n20 Mar 2013 14:52\n<\/time>)\n      <\/li>\n    \n      \n      <li>\n        \n          <a href=\"https:\/\/blog.differentpla.net\/blog\/2013\/03\/23\/bouncy-castle-extended-key-usage\/\">Extended Key Usage<\/a>\n        \n\n        (<time\n  class=\"created_at timeago\"\n  data-bs-toggle=\"tooltip\"\n  data-bs-placement=\"top\"\n  datetime=\"2013-03-23T13:13:35&#43;0000\"\n>\n23 Mar 2013 13:13\n<\/time>)\n      <\/li>\n    \n      \n      <li>\n        \n          <a href=\"https:\/\/blog.differentpla.net\/blog\/2013\/03\/24\/bouncy-castle-subject-alternative-names\/\">Subject Alternative Names<\/a>\n        \n\n        (<time\n  class=\"created_at timeago\"\n  data-bs-toggle=\"tooltip\"\n  data-bs-placement=\"top\"\n  datetime=\"2013-03-24T14:20:58&#43;0000\"\n>\n24 Mar 2013 14:20\n<\/time>)\n      <\/li>\n    \n      \n      <li>\n        \n          <a href=\"https:\/\/blog.differentpla.net\/blog\/2013\/03\/24\/bouncy-castle-being-a-certificate-authority\/\">Being a Certificate Authority<\/a>\n        \n\n        (<time\n  class=\"created_at timeago\"\n  data-bs-toggle=\"tooltip\"\n  data-bs-placement=\"top\"\n  datetime=\"2013-03-24T16:14:15&#43;0000\"\n>\n24 Mar 2013 16:14\n<\/time>)\n      <\/li>\n    \n  <\/ul>\n<\/div>"},{"title":"Logging Learnings","link":"https:\/\/blog.differentpla.net\/blog\/2013\/03\/16\/logging-learnings\/","pubDate":"Sat, 16 Mar 2013 11:16:58 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/03\/16\/logging-learnings\/","description":"<p>I&rsquo;ve just spent the bulk of the morning attempting to understand a bug by\nreading through some fairly large log files. Because of that, I&rsquo;ve come to\nsome realisations about log files and logging.<\/p>"},{"title":"Reliable Sessions and HTTPS don't mix","link":"https:\/\/blog.differentpla.net\/blog\/2013\/03\/15\/reliable-sessions-and-https\/","pubDate":"Fri, 15 Mar 2013 12:33:56 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/03\/15\/reliable-sessions-and-https\/","description":"<blockquote>\n    <p>System.InvalidOperationException: Binding validation failed because the WSHttpBinding does not support reliable sessions over transport security (HTTPS). The channel factory or service host could not be opened. Use message security for secure reliable messaging over HTTP.<\/p>\n\n  <\/blockquote>"},{"title":"PROCESSOR_ARCHITEW6432","link":"https:\/\/blog.differentpla.net\/blog\/2013\/03\/10\/processor-architew6432\/","pubDate":"Sun, 10 Mar 2013 17:45:44 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/03\/10\/processor-architew6432\/","description":"<p>What&rsquo;s the <code>PROCESSOR_ARCHITEW6432<\/code> environment variable for?<\/p>\n<p>If you&rsquo;re on 64-bit Windows, you&rsquo;ll see that you have a <code>PROCESSOR_ARCHITECTURE<\/code> environment variable:<\/p>"},{"title":"Migrating www.differentpla.net to a virtual machine, part 3","link":"https:\/\/blog.differentpla.net\/blog\/2013\/02\/26\/migrating-www-differentpla-net-to-a-virtual-machine-part-3\/","pubDate":"Tue, 26 Feb 2013 06:20:31 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/02\/26\/migrating-www-differentpla-net-to-a-virtual-machine-part-3\/","description":"<p>Last night, I kicked off an upgrade from Ubuntu 10.10 (Lucid Lynx) to 12.04\n(Precise Pangolin). I am distinctly unimpressed by the upgrade process.<\/p>"},{"title":"Migrating www.differentpla.net to a virtual machine, part 2","link":"https:\/\/blog.differentpla.net\/blog\/2013\/02\/26\/migrating-www-differentpla-net-to-a-virtual-machine-part-2\/","pubDate":"Tue, 26 Feb 2013 06:12:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/02\/26\/migrating-www-differentpla-net-to-a-virtual-machine-part-2\/","description":"<p>Yesterday, I said that I&rsquo;d be migrating my website to a virtual machine;\noriginally, I&rsquo;d planned to mess around with Linux Live CDs.<\/p>"},{"title":"Migrating www.differentpla.net to a virtual machine","link":"https:\/\/blog.differentpla.net\/blog\/2013\/02\/24\/migrating-www-differentpla-net-to-a-virtual-machine\/","pubDate":"Sun, 24 Feb 2013 16:56:39 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/02\/24\/migrating-www-differentpla-net-to-a-virtual-machine\/","description":"<p>As part of implementing my <em>new<\/em> blog engine, I want to decommission the box that&rsquo;s hosting my <em>existing<\/em> blog. It&rsquo;s taking up space in the cupboard, and I&rsquo;ve got a better use in mind for the hardware.<\/p>"},{"title":"Hyper-V Remote Management","link":"https:\/\/blog.differentpla.net\/blog\/2013\/02\/20\/hyper-v-remote-management\/","pubDate":"Wed, 20 Feb 2013 18:59:55 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/02\/20\/hyper-v-remote-management\/","description":"<p>It turns out that you cannot manage a Windows 2008 R2 Hyper-V installation from\na Windows 8 desktop (even with the Remote Server Administration Tools for\nWindows 8 installed) or from Windows 2012 Server.<\/p>"},{"title":"MSBuild Tasks, Input Parameters and ItemGroups","link":"https:\/\/blog.differentpla.net\/blog\/2013\/02\/01\/msbuild-tasks-input-parameters-and-itemgroups\/","pubDate":"Fri, 01 Feb 2013 16:20:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2013\/02\/01\/msbuild-tasks-input-parameters-and-itemgroups\/","description":"<p>While looking through some MSBuild scripts recently at work, I came across some stuff to do with Task output parameters\nthat I thought might be worth blogging about. First, however, I need to talk about Task input parameters.<\/p>"},{"title":"Tips for making it easier to consume .NET APIs from PowerShell","link":"https:\/\/blog.differentpla.net\/blog\/2012\/10\/02\/tips-for-making-it-easier-to-consume-net-apis-from-powershell\/","pubDate":"Tue, 02 Oct 2012 12:45:26 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2012\/10\/02\/tips-for-making-it-easier-to-consume-net-apis-from-powershell\/","description":"<h3 id=\"prefer-enum-types-over-constants-or-properties\">Prefer <code>enum<\/code> types over constants or properties<a href=\"#prefer-enum-types-over-constants-or-properties\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h3>\n<p>If you use an enum, PowerShell can implicitly convert the value:<\/p>"},{"title":"Running PowerShell on .NET 4.0","link":"https:\/\/blog.differentpla.net\/blog\/2012\/10\/02\/running-powershell-on-net-40\/","pubDate":"Tue, 02 Oct 2012 12:39:18 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2012\/10\/02\/running-powershell-on-net-40\/","description":"<p>Attempting to use <strong>Add-Type<\/strong> to load a .NET assembly in PowerShell this afternoon, I got the following error:<\/p>"},{"title":"Running PowerShell 2.0 on .NET 4.0","link":"https:\/\/blog.differentpla.net\/blog\/2012\/10\/02\/running-powershell-2-0-on-net-4-0\/","pubDate":"Tue, 02 Oct 2012 12:39:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2012\/10\/02\/running-powershell-2-0-on-net-4-0\/","description":"<p>Attempting to use <code>Add-Type<\/code> to load a .NET assembly in PowerShell this afternoon, I got the following error:<\/p>"},{"title":"PowerShell tip: Deleting certificates","link":"https:\/\/blog.differentpla.net\/blog\/2012\/07\/31\/powershell-tip-deleting-certificates\/","pubDate":"Tue, 31 Jul 2012 10:20:48 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2012\/07\/31\/powershell-tip-deleting-certificates\/","description":"<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-powershell\" data-lang=\"powershell\"><span class=\"line\"><span class=\"cl\"><span class=\"nv\">$certs<\/span> <span class=\"p\">=<\/span> <span class=\"nb\">Get-ChildItem<\/span> <span class=\"n\">cert<\/span><span class=\"err\">:<\/span><span class=\"p\">\\<\/span><span class=\"n\">LocalMachine<\/span><span class=\"p\">\\<\/span><span class=\"n\">My<\/span> <span class=\"p\">|<\/span> <span class=\"nb\">where <\/span><span class=\"p\">{<\/span> <span class=\"nv\">$_<\/span><span class=\"p\">.<\/span><span class=\"py\">Subject<\/span> <span class=\"err\">\u2013<\/span><span class=\"n\">like<\/span> <span class=\"s1\">&#39;CN=Victim*&#39;<\/span> <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"k\">foreach<\/span> <span class=\"p\">(<\/span><span class=\"nv\">$cert<\/span> <span class=\"k\">in<\/span> <span class=\"nv\">$certs<\/span><span class=\"p\">)<\/span> <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"nv\">$store<\/span> <span class=\"p\">=<\/span> <span class=\"nb\">Get-Item<\/span> <span class=\"nv\">$cert<\/span><span class=\"p\">.<\/span><span class=\"py\">PSParentPath<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"nv\">$store<\/span><span class=\"p\">.<\/span><span class=\"py\">Open<\/span><span class=\"p\">(<\/span><span class=\"s1\">&#39;ReadWrite&#39;<\/span><span class=\"p\">)<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"nv\">$store<\/span><span class=\"p\">.<\/span><span class=\"py\">Remove<\/span><span class=\"p\">(<\/span><span class=\"nv\">$cert<\/span><span class=\"p\">)<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"nv\">$store<\/span><span class=\"p\">.<\/span><span class=\"py\">Close<\/span><span class=\"p\">()<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">}<\/span><\/span><\/span><\/code><\/pre><\/div>\n<p>The first line finds certificates with the matching subject. The loop goes through those certificates, using .NET class library methods to delete them.<\/p>"},{"title":"Streaming HTTP responses in .NET","link":"https:\/\/blog.differentpla.net\/blog\/2012\/07\/14\/streaming-http-responses-in-net\/","pubDate":"Sat, 14 Jul 2012 19:11:10 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2012\/07\/14\/streaming-http-responses-in-net\/","description":"<p>Sometimes you have a web service or web application, and, for one request, you need to transfer an unknown (and\npotentially unbounded) amount of data in the response.<\/p>"},{"title":"PowerShell Closures","link":"https:\/\/blog.differentpla.net\/blog\/2012\/05\/25\/powershell-closures\/","pubDate":"Fri, 25 May 2012 12:07:04 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2012\/05\/25\/powershell-closures\/","description":"<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-powershell\" data-lang=\"powershell\"><span class=\"line\"><span class=\"cl\"><span class=\"c\"># Create a script block. It doesn&#39;t capture $x.<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"nv\">$x<\/span> <span class=\"p\">=<\/span> <span class=\"s1\">&#39;A&#39;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"nv\">$sb<\/span> <span class=\"p\">=<\/span> <span class=\"p\">{<\/span> <span class=\"nb\">Write-Host<\/span> <span class=\"nv\">$x<\/span> <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"c\"># Change the value of $x and run the script block. Note that it displays the current value.<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"nv\">$x<\/span> <span class=\"p\">=<\/span> <span class=\"s1\">&#39;B&#39;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">&amp;<\/span> <span class=\"nv\">$sb<\/span>                  <span class=\"c\"># ... B<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"c\"># Create a closure.<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"nv\">$closure<\/span> <span class=\"p\">=<\/span> <span class=\"nv\">$sb<\/span><span class=\"p\">.<\/span><span class=\"py\">GetNewClosure<\/span><span class=\"p\">()<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"c\"># Change the value of $x.<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"nv\">$x<\/span> <span class=\"p\">=<\/span> <span class=\"s1\">&#39;C&#39;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"c\"># Run the closure. It displays the original value. Success.<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">&amp;<\/span> <span class=\"nv\">$closure<\/span>             <span class=\"c\"># ... B<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"c\"># For comparison, run the script block. Nope. Still tracking the current value.<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">&amp;<\/span> <span class=\"nv\">$sb<\/span>                  <span class=\"c\"># ... C<\/span><\/span><\/span><\/code><\/pre><\/div>"},{"title":"SQL Server Management Studio: Unable to read the list of previously registered servers on this system","link":"https:\/\/blog.differentpla.net\/blog\/2012\/04\/03\/sql-server-management-studio-unable-to-read-the-list-of-previously-registered-servers-on-this-system\/","pubDate":"Tue, 03 Apr 2012 13:28:41 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2012\/04\/03\/sql-server-management-studio-unable-to-read-the-list-of-previously-registered-servers-on-this-system\/","description":"<p>I recently started having odd problems with SQL Server Management Studio on my work PC.<\/p>"},{"title":"Resetting PowerShell console colour after running badly-behaved programs","link":"https:\/\/blog.differentpla.net\/blog\/2012\/01\/20\/resetting-powershell-console-colour-after-running-badly-behaved-programs\/","pubDate":"Fri, 20 Jan 2012 09:30:57 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2012\/01\/20\/resetting-powershell-console-colour-after-running-badly-behaved-programs\/","description":"<p>Some programs write their output in different colours. If they&rsquo;re badly-behaved and don&rsquo;t reset the colours when they&rsquo;ve finished, your PowerShell console might be left with the wrong background or foreground colours.<\/p>"},{"title":"Installing node.js, iisnode and npm on Windows","link":"https:\/\/blog.differentpla.net\/blog\/2012\/01\/19\/installing-nodejs-iisnode-and-npm-on-windows\/","pubDate":"Thu, 19 Jan 2012 14:21:51 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2012\/01\/19\/installing-nodejs-iisnode-and-npm-on-windows\/","description":"<p>I thought I might have a quick play with node.js on Windows. There&rsquo;s a bunch of conflicting information out there about how to install it. Here&rsquo;s what works for me.<\/p>"},{"title":"New Theme","link":"https:\/\/blog.differentpla.net\/blog\/2012\/01\/05\/new-theme\/","pubDate":"Thu, 05 Jan 2012 16:55:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2012\/01\/05\/new-theme\/","description":"<p>New theme: <a href=\"http:\/\/fusiondrupalthemes.com\/theme\/acquia-slate\">Acquia Slate<\/a>. It&rsquo;s maybe a little dark for my taste, but I&rsquo;m going to leave it for a couple of weeks and see if it grows on me.<\/p>"},{"title":"PowerShell: ImportSystemModules","link":"https:\/\/blog.differentpla.net\/blog\/2012\/01\/05\/powershell-importsystemmodules\/","pubDate":"Thu, 05 Jan 2012 13:58:41 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2012\/01\/05\/powershell-importsystemmodules\/","description":"<p>I&rsquo;ve been using PowerShell as a better Command Prompt for a while now. Increasingly, however, it&rsquo;s one of the first\ntools I reach for when I come across a problem, rather than being an afterthought.<\/p>"},{"title":"FTTC FTW","link":"https:\/\/blog.differentpla.net\/blog\/2011\/12\/21\/fttc-ftw\/","pubDate":"Wed, 21 Dec 2011 11:10:45 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2011\/12\/21\/fttc-ftw\/","description":"<p>I&rsquo;ve not posted this until today, because my blog&rsquo;s been poorly, but the BT engineer came round last week and upgraded me to FTTC.<\/p>"},{"title":"Did you know that .NET already had an IoC container?","link":"https:\/\/blog.differentpla.net\/blog\/2011\/12\/20\/did-you-know-that-net-already-had-an-ioc-container\/","pubDate":"Tue, 20 Dec 2011 16:30:49 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2011\/12\/20\/did-you-know-that-net-already-had-an-ioc-container\/","description":"<p>Talking to <a href=\"https:\/\/twitter.com\/#!\/ptrelford\">@ptrelford<\/a> at the <a href=\"http:\/\/www.codemanship.co.uk\/\">TDD &amp; Refactoring workshop<\/a> run by <a href=\"https:\/\/twitter.com\/#!\/jasongorman\">Jason Gorman<\/a>, Phil mentioned that he&rsquo;d implemented a really simple IoC container in F#. &ldquo;But there&rsquo;s a really simple one already built into .NET&rdquo; says I&hellip;<\/p>"},{"title":"Repairing image links in drupal","link":"https:\/\/blog.differentpla.net\/blog\/2011\/12\/20\/repairing-image-links-in-drupal\/","pubDate":"Tue, 20 Dec 2011 15:52:56 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2011\/12\/20\/repairing-image-links-in-drupal\/","description":"<p>Somehow &ndash; I&rsquo;m not sure how, and I&rsquo;m not exactly sure when &ndash; my website (powered by drupal) lost all of its images. They were still there in the filesystem, and the rows were still in the <code>node<\/code> table, but they&rsquo;d vanished from the actual pages.<\/p>"},{"title":"Converting IEnumerable<T> to IDataReader","link":"https:\/\/blog.differentpla.net\/blog\/2011\/01\/30\/converting-ienumerablelesstgreater-to-idatareader\/","pubDate":"Sun, 30 Jan 2011 15:09:06 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2011\/01\/30\/converting-ienumerablelesstgreater-to-idatareader\/","description":"<p>If you\u2019ve got an enumerable, and you want to pass it to SqlBulkCopy, you can turn it into an IDataReader. Something like the following might be useful:<\/p>"},{"title":"Reactive Extensions: Elapsed Time","link":"https:\/\/blog.differentpla.net\/blog\/2011\/01\/30\/reactive-extensions-elapsed-time\/","pubDate":"Sun, 30 Jan 2011 15:05:53 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2011\/01\/30\/reactive-extensions-elapsed-time\/","description":"<p>I\u2019m using <code>SqlBulkCopy<\/code> to insert a large number of rows into a database table.\nI used <code>Observable.FromEvent<\/code> to hook the <code>SqlRowsCopied<\/code> event. Rx provides\nthe <code>.TimeStamp()<\/code> method, but I wanted to know the elapsed time, so I did the\nfollowing:<\/p>"},{"title":"SqlException: Login failed for user 'IIS APPPOOL\\ASP.NET v4.0'","link":"https:\/\/blog.differentpla.net\/blog\/2011\/01\/30\/sqlexception-login-failed-for-user-iis-apppoolaspnet-v40\/","pubDate":"Sun, 30 Jan 2011 13:55:19 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2011\/01\/30\/sqlexception-login-failed-for-user-iis-apppoolaspnet-v40\/","description":"<p>I\u2019m spiking a WCF service hosted in IIS this weekend. It uses SQL Server, and I was getting the following error in WCF Tracing:<\/p>"},{"title":"F# Coding Kata: Fizz Buzz","link":"https:\/\/blog.differentpla.net\/blog\/2010\/10\/26\/f-coding-kata-fizz-buzz\/","pubDate":"Tue, 26 Oct 2010 10:53:55 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2010\/10\/26\/f-coding-kata-fizz-buzz\/","description":"<p>Described <a href=\"http:\/\/codingkata.org\/katas\/unit\/fizz-buzz\">here<\/a>.<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-fsharp\" data-lang=\"fsharp\"><span class=\"line\"><span class=\"cl\"><span class=\"k\">let<\/span> <span class=\"nv\">IsDivisible<\/span> <span class=\"n\">n<\/span> <span class=\"n\">d<\/span> <span class=\"o\">=<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"o\">((<\/span><span class=\"n\">n<\/span> <span class=\"o\">%<\/span> <span class=\"n\">d<\/span><span class=\"o\">)<\/span> <span class=\"o\">=<\/span> <span class=\"n\">0<\/span><span class=\"o\">)<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"k\">let<\/span> <span class=\"nv\">FizzBuzz<\/span> <span class=\"n\">n<\/span> <span class=\"o\">=<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"k\">match<\/span> <span class=\"n\">n<\/span> <span class=\"k\">with<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"o\">|<\/span> <span class=\"n\">n<\/span> <span class=\"k\">when<\/span> <span class=\"n\">IsDivisible<\/span> <span class=\"n\">n<\/span> <span class=\"n\">3<\/span> <span class=\"o\">&amp;&amp;<\/span> <span class=\"n\">IsDivisible<\/span> <span class=\"n\">n<\/span> <span class=\"n\">5<\/span> <span class=\"o\">-&gt;<\/span> <span class=\"s\">&#34;fizzbuzz&#34;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"o\">|<\/span> <span class=\"n\">n<\/span> <span class=\"k\">when<\/span> <span class=\"n\">IsDivisible<\/span> <span class=\"n\">n<\/span> <span class=\"n\">3<\/span> <span class=\"o\">-&gt;<\/span> <span class=\"s\">&#34;fizz&#34;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"o\">|<\/span> <span class=\"n\">n<\/span> <span class=\"k\">when<\/span> <span class=\"n\">IsDivisible<\/span> <span class=\"n\">n<\/span> <span class=\"n\">5<\/span> <span class=\"o\">-&gt;<\/span> <span class=\"s\">&#34;buzz&#34;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"o\">|<\/span> <span class=\"o\">_<\/span> <span class=\"o\">-&gt;<\/span> <span class=\"n\">n<\/span><span class=\"o\">.<\/span><span class=\"n\">ToString<\/span><span class=\"bp\">()<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"k\">let<\/span> <span class=\"nv\">FizzBuzz_WithSequence_ShouldReturnExpectedSequence<\/span><span class=\"bp\">()<\/span> <span class=\"o\">=<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"k\">let<\/span> <span class=\"nv\">actual<\/span> <span class=\"o\">=<\/span> <span class=\"nn\">List<\/span><span class=\"p\">.<\/span><span class=\"n\">map<\/span> <span class=\"n\">FizzBuzz<\/span> <span class=\"o\">[<\/span><span class=\"n\">4<\/span><span class=\"o\">;<\/span> <span class=\"n\">5<\/span><span class=\"o\">;<\/span> <span class=\"n\">6<\/span><span class=\"o\">;<\/span> <span class=\"n\">7<\/span><span class=\"o\">;<\/span> <span class=\"n\">8<\/span><span class=\"o\">;<\/span> <span class=\"n\">9<\/span><span class=\"o\">;<\/span> <span class=\"n\">10<\/span><span class=\"o\">;<\/span> <span class=\"n\">11<\/span><span class=\"o\">;<\/span> <span class=\"n\">12<\/span><span class=\"o\">;<\/span> <span class=\"n\">13<\/span><span class=\"o\">;<\/span> <span class=\"n\">14<\/span><span class=\"o\">;<\/span> <span class=\"n\">15<\/span><span class=\"o\">]<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"k\">let<\/span> <span class=\"nv\">expected<\/span> <span class=\"o\">=<\/span> <span class=\"o\">[<\/span><span class=\"s\">&#34;4&#34;<\/span><span class=\"o\">;<\/span> <span class=\"s\">&#34;buzz&#34;<\/span><span class=\"o\">;<\/span> <span class=\"s\">&#34;fizz&#34;<\/span><span class=\"o\">;<\/span> <span class=\"s\">&#34;7&#34;<\/span><span class=\"o\">;<\/span> <span class=\"s\">&#34;8&#34;<\/span><span class=\"o\">;<\/span> <span class=\"s\">&#34;fizz&#34;<\/span><span class=\"o\">;<\/span> <span class=\"s\">&#34;buzz&#34;<\/span><span class=\"o\">;<\/span> <span class=\"s\">&#34;11&#34;<\/span><span class=\"o\">;<\/span> <span class=\"s\">&#34;fizz&#34;<\/span><span class=\"o\">;<\/span> <span class=\"s\">&#34;13&#34;<\/span><span class=\"o\">;<\/span> <span class=\"s\">&#34;14&#34;<\/span><span class=\"o\">;<\/span> <span class=\"s\">&#34;fizzbuzz&#34;<\/span><span class=\"o\">]<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"nn\">Assert<\/span><span class=\"p\">.<\/span><span class=\"n\">Equal<\/span><span class=\"o\">(<\/span><span class=\"n\">expected<\/span><span class=\"o\">,<\/span> <span class=\"n\">actual<\/span><span class=\"o\">)<\/span><\/span><\/span><\/code><\/pre><\/div>"},{"title":"F# Coding Kata: Hello World","link":"https:\/\/blog.differentpla.net\/blog\/2010\/10\/26\/f-coding-kata-hello-world\/","pubDate":"Tue, 26 Oct 2010 10:34:34 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2010\/10\/26\/f-coding-kata-hello-world\/","description":"<p>So, I thought I might learn F# by doing some <a href=\"http:\/\/codekata.pragprog.com\/\">Code Kata<\/a>. I&rsquo;ll start by doing the exercises from <a href=\"http:\/\/codingkata.org\/\">codekata.org<\/a>. Unfortunately, they don&rsquo;t have any F# templates, which means I&rsquo;ll have to improvise at points.<\/p>"},{"title":"MSBuild Target Batching (For Each) Simplified","link":"https:\/\/blog.differentpla.net\/blog\/2010\/08\/19\/msbuild-target-batching-for-each-simplified\/","pubDate":"Thu, 19 Aug 2010 09:44:53 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2010\/08\/19\/msbuild-target-batching-for-each-simplified\/","description":"<p>It&rsquo;s actually quite simple:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-xml\" data-lang=\"xml\"><span class=\"line\"><span class=\"cl\"><span class=\"cp\">&lt;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&gt;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"nt\">&lt;Project<\/span> <span class=\"na\">xmlns=<\/span><span class=\"s\">&#34;http:\/\/schemas.microsoft.com\/developer\/msbuild\/2003&#34;<\/span> <span class=\"na\">ToolsVersion=<\/span><span class=\"s\">&#34;4.0&#34;<\/span> <span class=\"na\">DefaultTargets=<\/span><span class=\"s\">&#34;Default&#34;<\/span><span class=\"nt\">&gt;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">   <span class=\"nt\">&lt;ItemGroup&gt;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">      <span class=\"nt\">&lt;ProjectsToPublish<\/span> <span class=\"na\">Include=<\/span><span class=\"s\">&#34;AdminConsole\\AdminConsole.csproj&#34;<\/span> <span class=\"nt\">\/&gt;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">      <span class=\"nt\">&lt;ProjectsToPublish<\/span> <span class=\"na\">Include=<\/span><span class=\"s\">&#34;AdminService\\AdminService.csproj&#34;<\/span> <span class=\"nt\">\/&gt;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">   <span class=\"nt\">&lt;\/ItemGroup&gt;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">   <span class=\"nt\">&lt;Target<\/span> <span class=\"na\">Name=<\/span><span class=\"s\">&#34;Default&#34;<\/span><span class=\"nt\">&gt;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">      <span class=\"nt\">&lt;CallTarget<\/span> <span class=\"na\">Targets=<\/span><span class=\"s\">&#34;PublishProjectOutput&#34;<\/span> <span class=\"nt\">\/&gt;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">   <span class=\"nt\">&lt;\/Target&gt;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">   <span class=\"nt\">&lt;Target<\/span> <span class=\"na\">Name=<\/span><span class=\"s\">&#34;PublishProjectOutput&#34;<\/span> <span class=\"na\">Inputs=<\/span><span class=\"s\">&#34;@(ProjectsToPublish)&#34;<\/span> <span class=\"na\">Outputs=<\/span><span class=\"s\">&#34;%(Identity).Dummy&#34;<\/span><span class=\"nt\">&gt;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">      <span class=\"nt\">&lt;Message<\/span> <span class=\"na\">Text=<\/span><span class=\"s\">&#34;@(ProjectsToPublish)&#34;<\/span> <span class=\"nt\">\/&gt;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">   <span class=\"nt\">&lt;\/Target&gt;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"nt\">&lt;\/Project&gt;<\/span><\/span><\/span><\/code><\/pre><\/div>\n<p>We set up an item group containing the items that we&rsquo;d like to process. Our &ldquo;Default&rdquo; target is just to demonstrate that\nwe don&rsquo;t need to do anything clever with <code>CallTarget<\/code>.<\/p>"},{"title":"Release Process: New Developer","link":"https:\/\/blog.differentpla.net\/blog\/2010\/07\/14\/release-process-new-developer\/","pubDate":"Wed, 14 Jul 2010 13:52:24 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2010\/07\/14\/release-process-new-developer\/","description":"<p>This is related to \u201cCan you make a build in one step?\u201d on The Joel Test. But it\u2019s not the same.<\/p>"},{"title":"Release Process: Software Publisher Certificates","link":"https:\/\/blog.differentpla.net\/blog\/2010\/07\/14\/release-process-software-publisher-certificates\/","pubDate":"Wed, 14 Jul 2010 13:35:11 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2010\/07\/14\/release-process-software-publisher-certificates\/","description":"<p>Since your code signing certificate probably lasts for two years, you\u2019ll have forgotten what to do with it when you receive your new one.<\/p>"},{"title":"Release Process: Using Source Server","link":"https:\/\/blog.differentpla.net\/blog\/2010\/07\/14\/release-process-using-source-server\/","pubDate":"Wed, 14 Jul 2010 13:33:54 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2010\/07\/14\/release-process-using-source-server\/","description":"<p>One of the cool things you can do with the Microsoft Debugging Tools is set up a source server. This works by embedding source control details in your PDB files. Once you&rsquo;ve published these to a symbol server, and set that up properly, you should be able to load a minidump file in Visual Studio (or WinDbg) and be taken to the correct line of the correct revision of the source file where the crash happened.<\/p>"},{"title":"Release Process: Goals","link":"https:\/\/blog.differentpla.net\/blog\/2010\/07\/14\/release-process-goals\/","pubDate":"Wed, 14 Jul 2010 13:33:06 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2010\/07\/14\/release-process-goals\/","description":"<p>One of the many things that my former company, 1E, does well is its build and release process. That got me thinking:\nwhat makes a good build process?<\/p>"},{"title":"Returning HTML from a WCF service","link":"https:\/\/blog.differentpla.net\/blog\/2010\/06\/20\/returning-html-from-a-wcf-service\/","pubDate":"Sun, 20 Jun 2010 13:05:10 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2010\/06\/20\/returning-html-from-a-wcf-service\/","description":"<p>I\u2019m messing around with writing yet another a blog engine, as a way to learn ASP.NET MVC. One of the things that I\u2019d like to do is have it support uploading from Windows Live Writer. This means that it needs to support XML-RPC and <a href=\"http:\/\/cyber.law.harvard.edu\/blogs\/gems\/tech\/rsd.html\">Really Simple Discovery<\/a> (RSD). More on the XML-RPC stuff later.<\/p>"},{"title":"Release Process: Source Indexing using P4INDEX reports \"zero source files found\"","link":"https:\/\/blog.differentpla.net\/blog\/2010\/05\/28\/release-process-source-indexing-using-p4index-reports-zero-source-files-found\/","pubDate":"Fri, 28 May 2010 09:03:33 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2010\/05\/28\/release-process-source-indexing-using-p4index-reports-zero-source-files-found\/","description":"<p>When you use P4INDEX (or SSINDEX -System=P4), you might see &ldquo;zero source files found&rdquo;. Check that your workspace doesn&rsquo;t have forward slashes in the name (e.g. D:\/Source\/depot\/).<\/p>"},{"title":"Release Process: Code Signing - Key Security","link":"https:\/\/blog.differentpla.net\/blog\/2010\/05\/26\/release-process-code-signing-key-security\/","pubDate":"Wed, 26 May 2010 10:10:41 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2010\/05\/26\/release-process-code-signing-key-security\/","description":"<p>The key used for signing your releases should be kept secure. It should be impossible for a rogue developer or 3rd party to use this key unofficially.<\/p>"},{"title":"Coding Standards: Non-const reference parameters in C++ are evil","link":"https:\/\/blog.differentpla.net\/blog\/2010\/05\/25\/coding-standards-non-const-reference-parameters-in-c-are-evil\/","pubDate":"Tue, 25 May 2010 14:08:46 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2010\/05\/25\/coding-standards-non-const-reference-parameters-in-c-are-evil\/","description":"<p>This is just a minor rant:<\/p>\n<p>In C++, const references are useful for parameters, because they avoid copying the arguments to a method. Non-const references, on the other hand, are pure evil, because there\u2019s no way (at the call site) to immediately see that a method might change a variable:<\/p>"},{"title":"Essential Google Chrome Extensions","link":"https:\/\/blog.differentpla.net\/blog\/2010\/05\/21\/essential-google-chrome-extensions\/","pubDate":"Fri, 21 May 2010 09:56:01 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2010\/05\/21\/essential-google-chrome-extensions\/","description":"<p>These are the extensions that I have to install whenever I set up a new copy of Google Chrome.<\/p>"},{"title":"Getting NBehave to work with NUnit 2.5.5","link":"https:\/\/blog.differentpla.net\/blog\/2010\/05\/20\/getting-nbehave-to-work-with-nunit-255\/","pubDate":"Thu, 20 May 2010 14:37:51 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2010\/05\/20\/getting-nbehave-to-work-with-nunit-255\/","description":"<p>NBehave depends on NUnit 2.5.2. To get it to work with NUnit 2.5.5, you can create an NBehave-Console.exe.config file containing the following:<\/p>"},{"title":"Gallio and ReSharper 5.0","link":"https:\/\/blog.differentpla.net\/blog\/2010\/05\/20\/gallio-and-resharper-50\/","pubDate":"Thu, 20 May 2010 12:53:54 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2010\/05\/20\/gallio-and-resharper-50\/","description":"<p>In attempting to see if I could get my <a href=\"https:\/\/blog.differentpla.net\/blog\/2010\/05\/20\/nbehave-notes\/\">NBehave tests<\/a> working inside Visual Studio 2010, I stumbled across <a href=\"http:\/\/www.gallio.org\/\">Gallio<\/a>, which, as far as I can tell, claims support for ReSharper and NBehave.<\/p>"},{"title":"HTC Desire and Exchange Calendar","link":"https:\/\/blog.differentpla.net\/blog\/2010\/05\/20\/htc-desire-and-exchange-calendar\/","pubDate":"Thu, 20 May 2010 10:22:09 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2010\/05\/20\/htc-desire-and-exchange-calendar\/","description":"<p>At the weekend, I picked up a shiny new <a href=\"http:\/\/www.htc.com\/www\/product\/desire\/overview.html\">HTC Desire<\/a>, which has first-class support for GMail, including Google Apps. It also has support for Exchange ActiveSync.<\/p>"},{"title":"NBehave Notes","link":"https:\/\/blog.differentpla.net\/blog\/2010\/05\/20\/nbehave-notes\/","pubDate":"Thu, 20 May 2010 08:55:37 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2010\/05\/20\/nbehave-notes\/","description":"<p>We\u2019ve just started using NBehave, so this is a random selection of notes:<\/p>"},{"title":"Visual Studio 2010 Splash Screen","link":"https:\/\/blog.differentpla.net\/blog\/2010\/04\/15\/visual-studio-2010-splash-screen\/","pubDate":"Thu, 15 Apr 2010 09:57:37 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2010\/04\/15\/visual-studio-2010-splash-screen\/","description":"<p>The <a href=\"http:\/\/blogs.msdn.com\/visualstudio\/archive\/2009\/11\/11\/behind-the-scenes-splash-screen.aspx\">Visual Studio 2010 splash screen<\/a> is stored in <code>C:\\ProgramData\\Microsoft\\VisualStudio\\10.0\\vs000223.dat<\/code>. It&rsquo;s a hidden file. It&rsquo;s a PNG file.<\/p>"},{"title":"Visual Studio Splash Screen","link":"https:\/\/blog.differentpla.net\/blog\/2010\/04\/15\/visual-studio-splash-screen\/","pubDate":"Thu, 15 Apr 2010 09:57:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2010\/04\/15\/visual-studio-splash-screen\/","description":"<p>The Visual Studio 2010 <a href=\"http:\/\/blogs.msdn.com\/visualstudio\/archive\/2009\/11\/11\/behind-the-scenes-splash-screen.aspx\">splash screen<\/a>\nis stored in <code>C:\\ProgramData\\Microsoft\\VisualStudio\\10.0\\vs000223.dat<\/code>. It&rsquo;s a hidden file in PNG format.<\/p>"},{"title":"SQL Server: INSERT WHERE NOT EXISTS","link":"https:\/\/blog.differentpla.net\/blog\/2010\/02\/03\/sql-server-insert-where-not-exists\/","pubDate":"Wed, 03 Feb 2010 16:32:08 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2010\/02\/03\/sql-server-insert-where-not-exists\/","description":"<p>Because whenever I&rsquo;ve been away from SQL Server for more than a couple of weeks, I forget.<\/p>"},{"title":"Tip: Use the LINQ methods that take a predicate","link":"https:\/\/blog.differentpla.net\/blog\/2010\/02\/03\/tip-use-the-linq-methods-that-take-a-predicate\/","pubDate":"Wed, 03 Feb 2010 09:33:09 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2010\/02\/03\/tip-use-the-linq-methods-that-take-a-predicate\/","description":"<p>Instead of this:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-c#\" data-lang=\"c#\"><span class=\"line\"><span class=\"cl\"><span class=\"kt\">var<\/span> <span class=\"n\">author<\/span> <span class=\"p\">=<\/span> <span class=\"p\">(<\/span><span class=\"k\">from<\/span> <span class=\"n\">a<\/span> <span class=\"k\">in<\/span> <span class=\"n\">dataContext<\/span><span class=\"p\">.<\/span><span class=\"n\">Authors<\/span> <span class=\"k\">where<\/span> <span class=\"n\">a<\/span><span class=\"p\">.<\/span><span class=\"n\">Id<\/span> <span class=\"p\">==<\/span> <span class=\"n\">authorId<\/span> <span class=\"k\">select<\/span> <span class=\"n\">a<\/span><span class=\"p\">).<\/span><span class=\"n\">Single<\/span><span class=\"p\">();<\/span><\/span><\/span><\/code><\/pre><\/div>\n<p>&hellip;use this:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-c#\" data-lang=\"c#\"><span class=\"line\"><span class=\"cl\"><span class=\"kt\">var<\/span> <span class=\"n\">author<\/span> <span class=\"p\">=<\/span> <span class=\"n\">dataContext<\/span><span class=\"p\">.<\/span><span class=\"n\">Authors<\/span><span class=\"p\">.<\/span><span class=\"n\">Single<\/span><span class=\"p\">(<\/span><span class=\"n\">a<\/span> <span class=\"p\">=&gt;<\/span> <span class=\"n\">a<\/span><span class=\"p\">.<\/span><span class=\"n\">Id<\/span> <span class=\"p\">==<\/span> <span class=\"n\">authorId<\/span><span class=\"p\">);<\/span><\/span><\/span><\/code><\/pre><\/div>\n<p>Also consider whether you wanted <code>SingleOrDefault<\/code>.<\/p>"},{"title":"Publish to Photo Frame - my first CodePlex project","link":"https:\/\/blog.differentpla.net\/blog\/2009\/11\/29\/publish-to-photo-frame-my-first-codeplex-project\/","pubDate":"Sun, 29 Nov 2009 13:15:52 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2009\/11\/29\/publish-to-photo-frame-my-first-codeplex-project\/","description":"<p>Publish to Digital Photo Frame is a plug-in for Windows Live Photo Gallery that makes it easy to upload your photos to a digital photo frame.<\/p>"},{"title":"Hyper-V: creating a new Virtual Hard Disk fails with \"Cannot create a file when that file already exists\"","link":"https:\/\/blog.differentpla.net\/blog\/2009\/10\/21\/hyper-v-creating-a-new-virtual-hard-disk-fails-with-cannot-create-a-file-when-that-file-already-exists\/","pubDate":"Wed, 21 Oct 2009 08:12:36 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2009\/10\/21\/hyper-v-creating-a-new-virtual-hard-disk-fails-with-cannot-create-a-file-when-that-file-already-exists\/","description":"<p>My desktop PC is Windows 2008, with Hyper-V disabled. I&rsquo;ve got a Windows 2008 R2 box to act as a Hyper-V server. I created an administrator user account with my name on the R2 box, and used <a href=\"http:\/\/code.msdn.microsoft.com\/HVRemote\">HVRemote<\/a> to allow remote access.<\/p>"},{"title":"Setting Internet Explorer and Windows Update to use Squid","link":"https:\/\/blog.differentpla.net\/blog\/2009\/09\/16\/setting-internet-explorer-and-windows-update-to-use-squid\/","pubDate":"Wed, 16 Sep 2009 08:48:05 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2009\/09\/16\/setting-internet-explorer-and-windows-update-to-use-squid\/","description":"<p>If you&rsquo;ve <a href=\"https:\/\/blog.differentpla.net\/blog\/2009\/09\/16\/setting-up-squid-on-windows\/\">installed squid<\/a> on a box, you&rsquo;ll probably want to use it.<\/p>"},{"title":"Setting up Squid on Windows","link":"https:\/\/blog.differentpla.net\/blog\/2009\/09\/16\/setting-up-squid-on-windows\/","pubDate":"Wed, 16 Sep 2009 08:38:27 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2009\/09\/16\/setting-up-squid-on-windows\/","description":"<p>At work, we do a lot of our testing and debugging with virtual machines (using Microsoft Virtual Server or Hyper-V,\nmostly). The virtual guests are generally not allowed any access to our live network, which makes accessing the Internet\ndifficult. To get around this, I usually set up Squid on the host machine. This allows the guests to access (e.g.)\nWindows Update and Microsoft Symbol Server, which makes things a bit easier.<\/p>"},{"title":"Using Expression<T> as a Compiler, to avoid writing conversion code","link":"https:\/\/blog.differentpla.net\/blog\/2009\/09\/03\/using-expressionlesstgreater-as-a-compiler-to-avoid-writing-conversion-code\/","pubDate":"Thu, 03 Sep 2009 15:22:33 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2009\/09\/03\/using-expressionlesstgreater-as-a-compiler-to-avoid-writing-conversion-code\/","description":"<p>Marc Gravell wrote about <a href=\"http:\/\/www.infoq.com\/articles\/expression-compiler\">using <code>Expression&lt;T&gt;<\/code> as a compiler<\/a>. It was a bit of an eye-opener.<\/p>"},{"title":"Using PartCover with NUnit on 64-bit Windows","link":"https:\/\/blog.differentpla.net\/blog\/2009\/07\/16\/using-partcover-with-nunit-on-64-bit-windows\/","pubDate":"Thu, 16 Jul 2009 13:04:26 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2009\/07\/16\/using-partcover-with-nunit-on-64-bit-windows\/","description":"<p>Some random notes:<\/p>\n<h2 id=\"running-partcoverexe-on-x64\">Running PartCover.exe on x64<a href=\"#running-partcoverexe-on-x64\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>If you run it, you&rsquo;ll get the following error message:<\/p>"},{"title":"More unplanned downtime","link":"https:\/\/blog.differentpla.net\/blog\/2009\/07\/04\/more-unplanned-downtime\/","pubDate":"Sat, 04 Jul 2009 14:54:37 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2009\/07\/04\/more-unplanned-downtime\/","description":"<p>The hosting outfit that I&rsquo;ve been using for differentpla.net is cheap for a reason: they&rsquo;re not very good.<\/p>"},{"title":"Symbol Store: How are EXE files stored?","link":"https:\/\/blog.differentpla.net\/blog\/2009\/04\/23\/symbol-store-how-are-exe-files-stored\/","pubDate":"Thu, 23 Apr 2009 15:12:23 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2009\/04\/23\/symbol-store-how-are-exe-files-stored\/","description":"<p>If you&rsquo;re using the Microsoft Symbol Server to pull down symbols for Windows, or if you&rsquo;re using SYMSTORE.EXE for your\nown stuff, you&rsquo;ll see that EXE (and other binary files) are stored in a path similar to\n<code>C:\\WebSymbols\\user32.dll\\4226015990000\\user32.dll<\/code>.<\/p>"},{"title":"Source Server indexing fails with \"SVN: Can't Get details for <sourcefile>\"","link":"https:\/\/blog.differentpla.net\/blog\/2009\/04\/23\/source-server-indexing-fails-with-svn-cant-get-details-for-sourcefile\/","pubDate":"Thu, 23 Apr 2009 09:34:24 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2009\/04\/23\/source-server-indexing-fails-with-svn-cant-get-details-for-sourcefile\/","description":"<p>I&rsquo;m making some improvements to our build scripts at work, and I ran into a problem where Source Server indexing wasn&rsquo;t working.<\/p>"},{"title":"Using Castle Windsor for ASP.NET MVC Controller classes","link":"https:\/\/blog.differentpla.net\/blog\/2009\/03\/29\/using-castle-windsor-for-aspnet-mvc-controller-classes\/","pubDate":"Sun, 29 Mar 2009 09:41:41 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2009\/03\/29\/using-castle-windsor-for-aspnet-mvc-controller-classes\/","description":"<p>If you want to use Castle Windsor&rsquo;s MicroKernel (or another IoC container) for ASP.NET MVC controllers, it&rsquo;s fairly easy. The ASP.NET MVC team allowed you to replace the factory used to create controller objects.<\/p>"},{"title":"LINQ's ForEach doesn't work on IEnumerable<T>","link":"https:\/\/blog.differentpla.net\/blog\/2009\/03\/29\/linqs-foreach-doesnt-work-on-ienumerable-t\/","pubDate":"Sun, 29 Mar 2009 09:39:45 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2009\/03\/29\/linqs-foreach-doesnt-work-on-ienumerable-t\/","description":"<p>For some reason, LINQ&rsquo;s ForEach extension method doesn&rsquo;t work on <code>IEnumerable&lt;T&gt;<\/code>; it only works on <code>IList&lt;T&gt;<\/code>. Easy fix:<\/p>"},{"title":"\"Internet Explorer cannot display the webpage\" when using Cassini on Windows Vista","link":"https:\/\/blog.differentpla.net\/blog\/2009\/03\/29\/internet-explorer-cannot-display-the-webpage-when-using-cassini-on-windows-vista\/","pubDate":"Sun, 29 Mar 2009 09:08:33 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2009\/03\/29\/internet-explorer-cannot-display-the-webpage-when-using-cassini-on-windows-vista\/","description":"<p>I was doing some ASP.NET MVC this weekend, and I couldn&rsquo;t get the project to start: all I got was &ldquo;Internet Explorer cannot display the webpage&rdquo;, when using Visual Studio&rsquo;s built-in development web server (Cassini).<\/p>"},{"title":"Note to self: Don't call a .NET console project Something.Console","link":"https:\/\/blog.differentpla.net\/blog\/2009\/03\/29\/note-to-self-dont-call-a-net-console-project-somethingconsole\/","pubDate":"Sun, 29 Mar 2009 09:06:12 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2009\/03\/29\/note-to-self-dont-call-a-net-console-project-somethingconsole\/","description":"<p>&hellip;because then you can&rsquo;t (easily) use Console.Write, because &ldquo;Console&rdquo; clashes.<\/p>"},{"title":"Getting IntelliSense to work for NHibernate mapping files (.hbm.xml)","link":"https:\/\/blog.differentpla.net\/blog\/2009\/03\/29\/getting-intellisense-to-work-for-nhibernate-mapping-files-hbmxml\/","pubDate":"Sun, 29 Mar 2009 09:05:24 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2009\/03\/29\/getting-intellisense-to-work-for-nhibernate-mapping-files-hbmxml\/","description":"<h2 id=\"getting-intellisense-to-work-for-nhibernate-mapping-files-hbmxml\">Getting IntelliSense to work for NHibernate mapping files (.hbm.xml)<a href=\"#getting-intellisense-to-work-for-nhibernate-mapping-files-hbmxml\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>You&rsquo;ll need to copy the XSD files from <code>C:\\Program Files\\NHibernate\\src\\NHibernate-src\\src\\NHibernate<\/code> to <code>C:\\Program Files\\Microsoft Visual Studio 9.0\\Xml\\Schemas<\/code>.<\/p>"},{"title":"Using SQL Server Compact Edition for Unit Testing","link":"https:\/\/blog.differentpla.net\/blog\/2009\/03\/29\/using-sql-server-compact-edition-for-unit-testing\/","pubDate":"Sun, 29 Mar 2009 09:02:11 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2009\/03\/29\/using-sql-server-compact-edition-for-unit-testing\/","description":"<p>Ayende shows how to use SQLite with an in-memory database for unit testing your NHibernate code\n(<a href=\"http:\/\/ayende.com\/Blog\/archive\/2006\/10\/14\/UnitTestingWithNHibernateActiveRecord.aspx\">here<\/a>). This is a great idea:\nyour unit tests will run more quickly, and you don&rsquo;t have to worry about tearing the database down when you&rsquo;ve finished.\nOn the other hand, it&rsquo;s not an exact match for Microsoft SQL Server (which is probably what your production website will\nrun against).<\/p>"},{"title":"Unplanned downtime","link":"https:\/\/blog.differentpla.net\/blog\/2009\/03\/04\/unplanned-downtime\/","pubDate":"Wed, 04 Mar 2009 07:14:34 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2009\/03\/04\/unplanned-downtime\/","description":"<p>At the end of February, differentpla.net suffered filesystem corruption. I had to revert pretty much everything to a previous backup, which meant losing about a week&rsquo;s worth of stuff.<\/p>"},{"title":"Numbering on shop fronts","link":"https:\/\/blog.differentpla.net\/blog\/2009\/01\/29\/numbering-on-shop-fronts\/","pubDate":"Thu, 29 Jan 2009 16:50:22 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2009\/01\/29\/numbering-on-shop-fronts\/","description":"<p>When I&rsquo;m supreme ruler of the universe: shops will be required to place the &ldquo;house&rdquo; number somewhere on the front of the shop. It should be easily visible.<\/p>"},{"title":"Windows 7 beta on Samsung NC-10 Netbook","link":"https:\/\/blog.differentpla.net\/blog\/2009\/01\/29\/windows-7-beta-on-samsung-nc-10-netbook\/","pubDate":"Thu, 29 Jan 2009 16:38:42 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2009\/01\/29\/windows-7-beta-on-samsung-nc-10-netbook\/","description":"<p>Nothing to report. It <em>all<\/em> works fine. Installation took an hour. The only hiccup was that I had to download the Marvell Yukon drivers (I used the Vista x86 ones) from Marvell&rsquo;s website, but the WiFi works, so that was easy. I also slapped an SDHC card in there for some ReadyBoost goodness.<\/p>"},{"title":"Adding an extra (optional) page to the C# Wizard","link":"https:\/\/blog.differentpla.net\/blog\/2008\/10\/29\/adding-an-extra-optional-page-to-the-csharp-wizard\/","pubDate":"Wed, 29 Oct 2008 16:53:37 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2008\/10\/29\/adding-an-extra-optional-page-to-the-csharp-wizard\/","description":"<p>This seems to be causing a few problems, so I&rsquo;ll quickly walk through it. I&rsquo;ll try to throw some screenshots in later.<\/p>"},{"title":"Things I learnt this week: RegSvr32.EXE on Windows x64","link":"https:\/\/blog.differentpla.net\/blog\/2008\/10\/25\/things-i-learnt-this-week-regsvr32exe-on-windows-x64\/","pubDate":"Sat, 25 Oct 2008 16:17:29 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2008\/10\/25\/things-i-learnt-this-week-regsvr32exe-on-windows-x64\/","description":"<p>On Windows, 64-bit processes cannot load 32-bit DLLs, and 32-bit processes cannot load 64-bit DLLs. How does\nREGSVR32.EXE manage to successfully register both 32-bit and 64-bit COM DLLs?<\/p>"},{"title":"Things I learnt this week: SetWaitableTimer","link":"https:\/\/blog.differentpla.net\/blog\/2008\/10\/25\/things-i-learnt-this-week-setwaitabletimer\/","pubDate":"Sat, 25 Oct 2008 12:23:56 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2008\/10\/25\/things-i-learnt-this-week-setwaitabletimer\/","description":"<p><code>SetWaitableTimer<\/code> doesn&rsquo;t accept <code>NULL<\/code> for the <code>pDueTime<\/code> parameter.<\/p>\n<p>It returns <code>FALSE<\/code>; <code>GetLastError()<\/code> returns <code>ERROR_NOACCESS<\/code> (998). If you specify zero (i.e. a <code>LARGE_INTEGER<\/code>\ncontaining zero) for <code>pDueTime<\/code>, the timer is signalled immediately.<\/p>"},{"title":"Things I learnt this week: SVCHOST","link":"https:\/\/blog.differentpla.net\/blog\/2008\/10\/25\/things-i-learnt-this-week-svchost\/","pubDate":"Sat, 25 Oct 2008 12:23:02 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2008\/10\/25\/things-i-learnt-this-week-svchost\/","description":"<p><code>SVCHOST<\/code> services are configured by having <code>ImagePath<\/code> set to <code>&quot;%windir%\\system32\\svchost.exe -k _name-of-service_&quot;<\/code>,\nand a <code>Parameters<\/code> key containing <code>ServiceDll (REG_EXPAND_SZ)<\/code>, which names a DLL with a <code>ServiceMain<\/code> entry point.\n<code>ServiceMain<\/code> has <code>argc<\/code> and <code>argv<\/code>.<\/p>"},{"title":"Things I learnt this week: RegQueryValueEx","link":"https:\/\/blog.differentpla.net\/blog\/2008\/10\/25\/things-i-learnt-this-week-regqueryvalueex\/","pubDate":"Sat, 25 Oct 2008 12:21:49 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2008\/10\/25\/things-i-learnt-this-week-regqueryvalueex\/","description":"<p><code>RegQueryValueEx<\/code>, when passed <code>lpData = NULL<\/code>, will set <code>*lpcbData<\/code> to the length required in bytes, even if it&rsquo;s\nalready set to something. If <code>lpData != NULL<\/code>, and <code>*lpcbData<\/code> is too short, <code>RegQueryValueEx<\/code> will return\n<code>ERROR_MORE_DATA<\/code>.<\/p>"},{"title":"Things I learnt this week: RegSetValueEx","link":"https:\/\/blog.differentpla.net\/blog\/2008\/10\/25\/things-i-learnt-this-week-regsetvalueex\/","pubDate":"Sat, 25 Oct 2008 12:17:14 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2008\/10\/25\/things-i-learnt-this-week-regsetvalueex\/","description":"<p><code>RegSetValueEx<\/code>, when passed <code>REG_SZ<\/code>, needs the length to be in bytes, so don&rsquo;t just use <code>_tcslen<\/code> like this:<\/p>"},{"title":"Why is NUnit not in the GAC? (or Why does [assembly X] not appear in Visual Studio's Add Reference dialog?)","link":"https:\/\/blog.differentpla.net\/blog\/2008\/10\/25\/why-is-nunit-not-in-the-gac-or-why-does-assembly-x-not-appear-in-visual-studios-add-reference-dialog\/","pubDate":"Sat, 25 Oct 2008 10:58:08 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2008\/10\/25\/why-is-nunit-not-in-the-gac-or-why-does-assembly-x-not-appear-in-visual-studios-add-reference-dialog\/","description":"<p>Because Visual Studio doesn\u2019t look for references in the GAC:<\/p>"},{"title":"Generating SSL certificates for differentpla.net","link":"https:\/\/blog.differentpla.net\/blog\/2008\/05\/17\/generating-ssl-certificates-for-differentplanet\/","pubDate":"Sat, 17 May 2008 06:29:50 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2008\/05\/17\/generating-ssl-certificates-for-differentplanet\/","description":"<p>Because I keep forgetting how to.<\/p>\n<h2 id=\"preamble\">Preamble<a href=\"#preamble\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-text\" data-lang=\"text\"><span class=\"line\"><span class=\"cl\">$ **mkdir SSL**\n<\/span><\/span><span class=\"line\"><span class=\"cl\">$ **cd SSL**\n<\/span><\/span><span class=\"line\"><span class=\"cl\">$ **cp \/usr\/lib\/ssl\/misc\/CA.pl .**<\/span><\/span><\/code><\/pre><\/div>\n<h2 id=\"setting-up-a-certificate-authority\">Setting up a certificate authority<a href=\"#setting-up-a-certificate-authority\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-text\" data-lang=\"text\"><span class=\"line\"><span class=\"cl\">$ **.\/CA.pl -newca**\n<\/span><\/span><span class=\"line\"><span class=\"cl\">CA certificate filename (or enter to create)**Press Enter**\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">Making CA certificate ...\n<\/span><\/span><span class=\"line\"><span class=\"cl\">Generating a 1024 bit RSA private key\n<\/span><\/span><span class=\"line\"><span class=\"cl\">.......................++++++\n<\/span><\/span><span class=\"line\"><span class=\"cl\">.....................................................++++++\n<\/span><\/span><span class=\"line\"><span class=\"cl\">writing new private key to &#39;.\/demoCA\/private\/cakey.pem&#39;\n<\/span><\/span><span class=\"line\"><span class=\"cl\">Enter PEM pass phrase:**Enter a passphrase to use for the CA**\n<\/span><\/span><span class=\"line\"><span class=\"cl\">Verifying - Enter PEM pass phrase:**Enter the same passphrase**\n<\/span><\/span><span class=\"line\"><span class=\"cl\">-----\n<\/span><\/span><span class=\"line\"><span class=\"cl\">You are about to be asked to enter information that will be incorporated\n<\/span><\/span><span class=\"line\"><span class=\"cl\">into your certificate request.\n<\/span><\/span><span class=\"line\"><span class=\"cl\">What you are about to enter is what is called a Distinguished Name or a DN.\n<\/span><\/span><span class=\"line\"><span class=\"cl\">There are quite a few fields but you can leave some blank\n<\/span><\/span><span class=\"line\"><span class=\"cl\">For some fields there will be a default value,\n<\/span><\/span><span class=\"line\"><span class=\"cl\">If you enter &#39;.&#39;, the field will be left blank.\n<\/span><\/span><span class=\"line\"><span class=\"cl\">-----\n<\/span><\/span><span class=\"line\"><span class=\"cl\">Country Name (2 letter code) [AU]:**UK**\n<\/span><\/span><span class=\"line\"><span class=\"cl\">State or Province Name (full name) [Some-State]:**England**\n<\/span><\/span><span class=\"line\"><span class=\"cl\">Locality Name (eg, city) []:**London**\n<\/span><\/span><span class=\"line\"><span class=\"cl\">Organization Name (eg, company) [Internet Widgits Pty Ltd]:**differentpla.net**\n<\/span><\/span><span class=\"line\"><span class=\"cl\">Organizational Unit Name (eg, section) []:**Certificate Authority**\n<\/span><\/span><span class=\"line\"><span class=\"cl\">Common Name (eg, YOUR name) []:**ca.differentpla.net**\n<\/span><\/span><span class=\"line\"><span class=\"cl\">Email Address []:**Enter a valid email address**\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">Please enter the following &#39;extra&#39; attributes\n<\/span><\/span><span class=\"line\"><span class=\"cl\">to be sent with your certificate request\n<\/span><\/span><span class=\"line\"><span class=\"cl\">A challenge password []:**Press Enter**\n<\/span><\/span><span class=\"line\"><span class=\"cl\">An optional company name []:**Press Enter**\n<\/span><\/span><span class=\"line\"><span class=\"cl\">Using configuration from \/usr\/lib\/ssl\/openssl.cnf\n<\/span><\/span><span class=\"line\"><span class=\"cl\">Enter pass phrase for .\/demoCA\/private\/cakey.pem:**Enter the passphrase from above**\n<\/span><\/span><span class=\"line\"><span class=\"cl\">Check that the request matches the signature\n<\/span><\/span><span class=\"line\"><span class=\"cl\">Signature ok\n<\/span><\/span><span class=\"line\"><span class=\"cl\">Certificate Details:<\/span><\/span><\/code><\/pre><\/div>\n<p>(snip)<\/p>"},{"title":"empeg tools","link":"https:\/\/blog.differentpla.net\/blog\/2008\/05\/14\/empeg-tools\/","pubDate":"Wed, 14 May 2008 06:28:15 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2008\/05\/14\/empeg-tools\/","description":"<p>In response to <a href=\"http:\/\/empegbbs.com\/ubbthreads.php\/ubb\/showflat\/Number\/306574\">this thread<\/a> on the empeg BBS, I hacked together a couple of small tools for the empeg car player.<\/p>"},{"title":"Odd behaviour with WCF base addresses and HTTP.SYS wildcards","link":"https:\/\/blog.differentpla.net\/blog\/2008\/03\/13\/odd-behaviour-with-wcf-base-addresses-and-httpsys-wildcards\/","pubDate":"Thu, 13 Mar 2008 21:30:10 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2008\/03\/13\/odd-behaviour-with-wcf-base-addresses-and-httpsys-wildcards\/","description":"<p>I&rsquo;m at <a href=\"http:\/\/www.devweek.com\/\">DevWeek<\/a> this week, and I went (among other things) to a couple of WCF presentations by Aaron Skonnard.<\/p>"},{"title":"&lt;define&gt; task for NAnt","link":"https:\/\/blog.differentpla.net\/blog\/2008\/01\/24\/lessdefinegreater-task-for-nant\/","pubDate":"Thu, 24 Jan 2008 15:42:02 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2008\/01\/24\/lessdefinegreater-task-for-nant\/","description":"<p>Essentially, you write a new task like this:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-text\" data-lang=\"text\"><span class=\"line\"><span class=\"cl\">&lt;define name=&#34;echo3&#34;&gt;\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  &lt;echo message=&#34;${this.message}&#34;\/&gt;\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  &lt;echo message=&#34;${this.message}&#34;\/&gt;\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  &lt;echo message=&#34;${this.message}&#34;\/&gt;\n<\/span><\/span><span class=\"line\"><span class=\"cl\">&lt;\/define&gt;<\/span><\/span><\/code><\/pre><\/div>\n<p>&hellip;and then you call it like this:<\/p>"},{"title":"Tweaking TeamCity","link":"https:\/\/blog.differentpla.net\/blog\/2008\/01\/12\/tweaking-teamcity\/","pubDate":"Sat, 12 Jan 2008 14:11:52 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2008\/01\/12\/tweaking-teamcity\/","description":"<p>I just started using TeamCity Professional Edition for some personal projects (and we&rsquo;re evaluating the Enterprise edition for use at work).<\/p>"},{"title":"When I'm supreme ruler: Vacations","link":"https:\/\/blog.differentpla.net\/blog\/2008\/01\/02\/when-im-supreme-ruler-vacations\/","pubDate":"Wed, 02 Jan 2008 09:12:37 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2008\/01\/02\/when-im-supreme-ruler-vacations\/","description":"<p>When I&rsquo;m supreme ruler of the universe: <strong>If you&rsquo;ve taken more than 5 days vacation, employers will be required to let you work only a half-day on your first day back. It could be the morning, or the afternoon, but you&rsquo;ll be required to work only 4 hours.<\/strong><\/p>"},{"title":"12 Drinks of Christmas","link":"https:\/\/blog.differentpla.net\/blog\/2007\/12\/18\/12-drinks-of-christmas\/","pubDate":"Tue, 18 Dec 2007 16:29:27 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2007\/12\/18\/12-drinks-of-christmas\/","description":"<p>To the tune of <a href=\"http:\/\/www.carols.org.uk\/the_twelve_days_of_christmas.htm\">the twelve days of Christmas<\/a>&hellip;<\/p>\n<ul>\n<li>12 Piper Heisecks<\/li>\n<li>11 Flaming Absinthes<\/li>\n<li>10 Gin and Tonics<\/li>\n<li>9 Tequila Slammers<\/li>\n<li>8 Black Sambucas<\/li>\n<li>7 Whiskey Sodas<\/li>\n<li>6 Vodka Redbulls<\/li>\n<li>5 Goldschlagers<\/li>\n<li>4 Cointreaux<\/li>\n<li>3 Rum Cokes<\/li>\n<li>2 Mai Tais<\/li>\n<li>&hellip;and an ice cube in a Baileys&hellip;<\/li>\n<\/ul>"},{"title":"Getting the player type of an empeg","link":"https:\/\/blog.differentpla.net\/blog\/2007\/12\/16\/getting-the-player-type-of-an-empeg\/","pubDate":"Sun, 16 Dec 2007 19:37:18 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2007\/12\/16\/getting-the-player-type-of-an-empeg\/","description":"<p>The last couple of entries have shown the hex dumps of the individual packets. We&rsquo;ll step back to a slightly higher-level view now.<\/p>"},{"title":"An empeg reports results of OP_STATFID","link":"https:\/\/blog.differentpla.net\/blog\/2007\/12\/16\/an-empeg-reports-results-of-op_statfid\/","pubDate":"Sun, 16 Dec 2007 18:59:05 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2007\/12\/16\/an-empeg-reports-results-of-op_statfid\/","description":"<p>The next packet that the empeg sends is the actual response to the OP_STATFID request. It looks like this:<\/p>"},{"title":"An empeg reports progress of OP_STATFID","link":"https:\/\/blog.differentpla.net\/blog\/2007\/12\/16\/an-empeg-reports-progress-of-op_statfid\/","pubDate":"Sun, 16 Dec 2007 18:53:10 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2007\/12\/16\/an-empeg-reports-progress-of-op_statfid\/","description":"<p>We&rsquo;ve seen the format of the packet that emplode sends to find out the length of a file on the empeg (<code>OP_STATFID<\/code>). The empeg seems to always send a progress packet in response. The packet looks like this:<\/p>"},{"title":"empeg packet format","link":"https:\/\/blog.differentpla.net\/blog\/2007\/12\/16\/empeg-packet-format\/","pubDate":"Sun, 16 Dec 2007 18:18:47 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2007\/12\/16\/empeg-packet-format\/","description":"<p>The format of the packets in the empeg&rsquo;s TCP\/IP protocol owe a lot to the fact that the empeg mk1 communicated over a\nserial link. This means that there&rsquo;s a certain amount of cruft still in the protocol.<\/p>"},{"title":"Shell_NotifyIcon: Displaying a balloon from a hidden notification icon","link":"https:\/\/blog.differentpla.net\/blog\/2007\/10\/01\/shell_notifyicon-displaying-a-balloon-from-a-hidden-notification-icon\/","pubDate":"Mon, 01 Oct 2007 08:05:56 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2007\/10\/01\/shell_notifyicon-displaying-a-balloon-from-a-hidden-notification-icon\/","description":"<p>You should hide your notification icon unless you&rsquo;ve got something important to tell the user. More and more\napplications insist on putting mysterious icons in the notification area, and most users have no idea what they&rsquo;re for.<\/p>"},{"title":"Shell_NotifyIcon: NIM_SETVERSION should be sent after NIM_ADD","link":"https:\/\/blog.differentpla.net\/blog\/2007\/09\/30\/shell_notifyicon-nim_setversion-should-be-sent-after-nim_add\/","pubDate":"Sun, 30 Sep 2007 22:33:25 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2007\/09\/30\/shell_notifyicon-nim_setversion-should-be-sent-after-nim_add\/","description":"<p>Like it says: NIM_SETVERSION always returns FALSE unless you&rsquo;ve used NIM_ADD. So send NIM_ADD first.<\/p>"},{"title":"Debugging system processes without administrative privileges: it can be done","link":"https:\/\/blog.differentpla.net\/blog\/2007\/09\/29\/debugging-system-processes-without-administrative-privileges-it-can-be-done\/","pubDate":"Sat, 29 Sep 2007 14:14:09 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2007\/09\/29\/debugging-system-processes-without-administrative-privileges-it-can-be-done\/","description":"<p>A short while ago, I asked whether it was possible to <a href=\"https:\/\/blog.differentpla.net\/blog\/2007\/08\/13\/debugging-system-processes-without-administrative-privileges-can-it-be-done\/\">debug system processes without administrative privileges<\/a>. I ran into a brick wall and couldn&rsquo;t figure it out.<\/p>"},{"title":"Which of my MP3 directories don't have a Folder.jpg file?","link":"https:\/\/blog.differentpla.net\/blog\/2007\/09\/08\/which-of-my-mp3-directories-dont-have-a-folderjpg-file\/","pubDate":"Sat, 08 Sep 2007 16:39:22 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2007\/09\/08\/which-of-my-mp3-directories-dont-have-a-folderjpg-file\/","description":"<p>There&rsquo;s probably a better way to do this, but here&rsquo;s what I came up with in a couple of minutes&hellip;<\/p>"},{"title":"Installing Ubuntu 7.04 Server on Microsoft Virtual Server 2005","link":"https:\/\/blog.differentpla.net\/blog\/2007\/08\/17\/installing-ubuntu-704-server-on-microsoft-virtual-server-2005\/","pubDate":"Fri, 17 Aug 2007 12:04:43 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2007\/08\/17\/installing-ubuntu-704-server-on-microsoft-virtual-server-2005\/","description":"<h2 id=\"installation\">Installation<a href=\"#installation\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>When attempting to install Ubuntu on Microsoft Virtual Server (from ubuntu-7.04-server-i386.iso), the installation screen is stretched vertically, but the VMRC window isn&rsquo;t. This means that you can only see the top half of the display.<\/p>"},{"title":"Debugging system processes without administrative privileges: can it be done?","link":"https:\/\/blog.differentpla.net\/blog\/2007\/08\/13\/debugging-system-processes-without-administrative-privileges-can-it-be-done\/","pubDate":"Mon, 13 Aug 2007 10:17:36 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2007\/08\/13\/debugging-system-processes-without-administrative-privileges-can-it-be-done\/","description":"<p>I&rsquo;ve been running with a normal, non-administrator (LUA) account for the past 2 years or so, without any real problems. Most of the time, the problem is simply that you can&rsquo;t install something, or register something, or you need to install a service.<\/p>"},{"title":"Source Code License","link":"https:\/\/blog.differentpla.net\/blog\/2007\/08\/06\/source-code-license\/","pubDate":"Mon, 06 Aug 2007 11:41:07 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2007\/08\/06\/source-code-license\/","description":"<p>Unless specified otherwise, all source code published on the differentpla.net website is available under the following license terms: <strong>Do what you want with it, but don&rsquo;t claim you wrote it, and it&rsquo;s not my fault if it doesn&rsquo;t work.<\/strong><\/p>"},{"title":"GNU TLS reports \"Base64 Decoding Error\"","link":"https:\/\/blog.differentpla.net\/blog\/2007\/07\/17\/gnu-tls-reports-base64-decoding-error\/","pubDate":"Tue, 17 Jul 2007 18:54:22 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2007\/07\/17\/gnu-tls-reports-base64-decoding-error\/","description":"<p>I recently had a problem getting STARTTLS working on exim4 on Debian 4.0 (Etch). It kept reporting:<\/p>"},{"title":"Generating the Fibonacci sequence by using the yield keyword, non-recursively","link":"https:\/\/blog.differentpla.net\/blog\/2007\/06\/03\/generating-the-fibonacci-sequence-by-using-the-yield-keyword-non-recursively\/","pubDate":"Sun, 03 Jun 2007 15:21:14 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2007\/06\/03\/generating-the-fibonacci-sequence-by-using-the-yield-keyword-non-recursively\/","description":"<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-text\" data-lang=\"text\"><span class=\"line\"><span class=\"cl\">class FibonacciSequence : IEnumerable\n<\/span><\/span><span class=\"line\"><span class=\"cl\">{\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    public IEnumerator GetEnumerator()\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    {\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        yield return (long)0;\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        yield return (long)1;\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        long prev = 0;\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        long curr = 1;\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        for (; ; )\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        {\n<\/span><\/span><span class=\"line\"><span class=\"cl\">            long next = prev + curr;\n<\/span><\/span><span class=\"line\"><span class=\"cl\">            if (next &lt; 0)   \/\/ It overflowed. Stop.\n<\/span><\/span><span class=\"line\"><span class=\"cl\">                yield break;\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">            yield return next;\n<\/span><\/span><span class=\"line\"><span class=\"cl\">            prev = curr;\n<\/span><\/span><span class=\"line\"><span class=\"cl\">            curr = next;\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        }\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    }\n<\/span><\/span><span class=\"line\"><span class=\"cl\">}<\/span><\/span><\/code><\/pre><\/div>\n<p>Call it like this:<\/p>"},{"title":"FindFirstFile and SE_BACKUP_NAME","link":"https:\/\/blog.differentpla.net\/blog\/2007\/05\/25\/findfirstfile-and-se_backup_name\/","pubDate":"Fri, 25 May 2007 17:04:57 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2007\/05\/25\/findfirstfile-and-se_backup_name\/","description":"<p>If you want to read a file and bypass security (e.g., if you&rsquo;re writing a backup program), it&rsquo;s not enough to simply enable the SE_BACKUP_NAME privilege, you have to also pass FILE_FLAG_BACKUP_SEMANTICS to CreateFile.<\/p>"},{"title":"Removing duplicates from a table","link":"https:\/\/blog.differentpla.net\/blog\/2007\/05\/08\/removing-duplicates-from-a-table\/","pubDate":"Tue, 08 May 2007 12:21:37 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2007\/05\/08\/removing-duplicates-from-a-table\/","description":"<p>Let&rsquo;s assume that you&rsquo;ve got a table:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-sql\" data-lang=\"sql\"><span class=\"line\"><span class=\"cl\"><span class=\"k\">CREATE<\/span><span class=\"w\"> <\/span><span class=\"k\">TABLE<\/span><span class=\"w\"> <\/span><span class=\"o\">#<\/span><span class=\"n\">t<\/span><span class=\"w\"> <\/span><span class=\"p\">(<\/span><span class=\"w\">\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"w\">  <\/span><span class=\"n\">Id<\/span><span class=\"w\"> <\/span><span class=\"nb\">INT<\/span><span class=\"w\"> <\/span><span class=\"k\">IDENTITY<\/span><span class=\"p\">,<\/span><span class=\"w\">\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"w\">  <\/span><span class=\"n\">Name<\/span><span class=\"w\"> <\/span><span class=\"nb\">VARCHAR<\/span><span class=\"p\">(<\/span><span class=\"mi\">50<\/span><span class=\"p\">),<\/span><span class=\"w\">\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"w\">  <\/span><span class=\"nb\">Number<\/span><span class=\"w\"> <\/span><span class=\"nb\">INT<\/span><span class=\"w\"> <\/span><span class=\"p\">)<\/span><\/span><\/span><\/code><\/pre><\/div>\n<p>&hellip; into which you&rsquo;ve accidentally inserted some duplicate rows:<\/p>"},{"title":"Subtracting dates in Javascript","link":"https:\/\/blog.differentpla.net\/blog\/2007\/04\/30\/subtracting-dates-in-javascript\/","pubDate":"Mon, 30 Apr 2007 17:04:13 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2007\/04\/30\/subtracting-dates-in-javascript\/","description":"<p>Here&rsquo;s how to find the time 30 minutes ago:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-javascript\" data-lang=\"javascript\"><span class=\"line\"><span class=\"cl\"><span class=\"kd\">var<\/span> <span class=\"nx\">THIRTY_MINUTES_IN_MS<\/span> <span class=\"o\">=<\/span> <span class=\"mi\">30<\/span> <span class=\"o\">*<\/span> <span class=\"mi\">60<\/span> <span class=\"o\">*<\/span> <span class=\"mi\">1000<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"kd\">var<\/span> <span class=\"nx\">now<\/span> <span class=\"o\">=<\/span> <span class=\"k\">new<\/span> <span class=\"nb\">Date<\/span><span class=\"p\">();<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"kd\">var<\/span> <span class=\"nx\">nowMs<\/span> <span class=\"o\">=<\/span> <span class=\"nx\">now<\/span><span class=\"p\">.<\/span><span class=\"nx\">getTime<\/span><span class=\"p\">();<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"kd\">var<\/span> <span class=\"nx\">thenMs<\/span> <span class=\"o\">=<\/span> <span class=\"nx\">nowMs<\/span> <span class=\"o\">-<\/span> <span class=\"nx\">THIRTY_MINUTES_IN_MS<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"kd\">var<\/span> <span class=\"nx\">then<\/span> <span class=\"o\">=<\/span> <span class=\"k\">new<\/span> <span class=\"nb\">Date<\/span><span class=\"p\">(<\/span><span class=\"nx\">thenMs<\/span><span class=\"p\">);<\/span><\/span><\/span><\/code><\/pre><\/div>\n<p>The secret is that Date.getTime returns the number of milliseconds since the epoch, and that the Date constructor accepts these millisecond values.<\/p>"},{"title":"Debugging Sidebar Gadgets","link":"https:\/\/blog.differentpla.net\/blog\/2007\/04\/30\/debugging-sidebar-gadgets\/","pubDate":"Mon, 30 Apr 2007 16:01:29 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2007\/04\/30\/debugging-sidebar-gadgets\/","description":"<p>Apparently, you can debug JScript in Visual Studio.<\/p>\n<p>The documentation for this is horrendous, though. Almost every resource talks about debugging ASP.NET programs. If you&rsquo;re writing a Windows Vista Sidebar Gadget, this isn&rsquo;t a lot of use.<\/p>"},{"title":"Calling C# from JScript","link":"https:\/\/blog.differentpla.net\/blog\/2007\/04\/27\/calling-csharp-from-jscript\/","pubDate":"Fri, 27 Apr 2007 09:03:18 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2007\/04\/27\/calling-csharp-from-jscript\/","description":"<p>It&rsquo;s possible, through the magic of COM interop, to call C# code from JScript or VBScript. Here&rsquo;s an example of how to do it from JScript.<\/p>"},{"title":"Implementing For Each in JScript","link":"https:\/\/blog.differentpla.net\/blog\/2007\/04\/24\/implementing-for-each-in-jscript\/","pubDate":"Tue, 24 Apr 2007 11:01:30 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2007\/04\/24\/implementing-for-each-in-jscript\/","description":"<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-text\" data-lang=\"text\"><span class=\"line\"><span class=\"cl\">function forEach(enumerable, delegate)\n<\/span><\/span><span class=\"line\"><span class=\"cl\">{\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    for (var enumerator = new Enumerator(enumerable); !enumerator.atEnd(); enumerator.moveNext())\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    {\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        delegate(enumerator.item());\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    }\n<\/span><\/span><span class=\"line\"><span class=\"cl\">}<\/span><\/span><\/code><\/pre><\/div>\n<p>Used like this:<\/p>"},{"title":"How do I debug my gadget?","link":"https:\/\/blog.differentpla.net\/blog\/2007\/04\/24\/how-do-i-debug-my-gadget\/","pubDate":"Tue, 24 Apr 2007 10:34:09 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2007\/04\/24\/how-do-i-debug-my-gadget\/","description":"<p>As far as I can tell, you&rsquo;ll have to go &ldquo;old school&rdquo;, and do the equivalent of adding lots of <code>printf<\/code> statements to\nyour code. This should help:<\/p>"},{"title":"How do I add a settings page to my gadget?","link":"https:\/\/blog.differentpla.net\/blog\/2007\/04\/23\/how-do-i-add-a-settings-page-to-my-gadget\/","pubDate":"Mon, 23 Apr 2007 09:47:28 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2007\/04\/23\/how-do-i-add-a-settings-page-to-my-gadget\/","description":"<p>Some gadgets allow the user to configure extra settings.<\/p>\n<p><img alt=\"\" height=\"72\" id=\"h-rh-i-0\" src=\"https:\/\/blog.differentpla.net\/blog\/2007\/04\/23\/how-do-i-add-a-settings-page-to-my-gadget\/gadget_settings.png\" width=\"91\"><\/p>"},{"title":"What font should I use in my sidebar gadget?","link":"https:\/\/blog.differentpla.net\/blog\/2007\/04\/23\/what-font-should-i-use-in-my-sidebar-gadget\/","pubDate":"Mon, 23 Apr 2007 09:16:14 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2007\/04\/23\/what-font-should-i-use-in-my-sidebar-gadget\/","description":"<p>The <a href=\"http:\/\/msdn2.microsoft.com\/en-us\/library\/aa974179.aspx#sizing\">Sidebar Gadgets SDK documentation<\/a> recommends 12 pixel Segoe UI<\/p>\n<p>You should do this by putting the following in your CSS file:<\/p>"},{"title":"How do I change the details displayed for my sidebar gadget?","link":"https:\/\/blog.differentpla.net\/blog\/2007\/04\/23\/how-do-i-change-the-details-displayed-for-my-sidebar-gadget\/","pubDate":"Mon, 23 Apr 2007 09:08:09 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2007\/04\/23\/how-do-i-change-the-details-displayed-for-my-sidebar-gadget\/","description":"<p>When you click on the &ldquo;Show details&rdquo; expander in the Windows Vista gadget gallery, Windows displays various information\nabout the selected gadget (&ldquo;Calendar 1.0.0.0&rdquo; etc., in this example).<\/p>"},{"title":"How do I display a background image in my sidebar gadget?","link":"https:\/\/blog.differentpla.net\/blog\/2007\/04\/23\/how-do-i-display-a-background-image-in-my-sidebar-gadget\/","pubDate":"Mon, 23 Apr 2007 08:57:13 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2007\/04\/23\/how-do-i-display-a-background-image-in-my-sidebar-gadget\/","description":"<p>When your gadget is docked, it displays a background image, which is allowed to be alpha-transparent.<\/p>"},{"title":"How do I change the icon used by my gadget?","link":"https:\/\/blog.differentpla.net\/blog\/2007\/04\/23\/how-do-i-change-the-icon-used-by-my-gadget\/","pubDate":"Mon, 23 Apr 2007 08:50:36 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2007\/04\/23\/how-do-i-change-the-icon-used-by-my-gadget\/","description":"<p>When you add a new gadget to the sidebar (by right-clicking and selecting &ldquo;Add Gadgets&hellip;&rdquo;), Windows Vista displays an icon for it.<\/p>"},{"title":"Enabling Concurrent Remote Desktop Sessions in Vista","link":"https:\/\/blog.differentpla.net\/blog\/2007\/04\/22\/enabling-concurrent-remote-desktop-sessions-in-vista\/","pubDate":"Sun, 22 Apr 2007 20:26:08 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2007\/04\/22\/enabling-concurrent-remote-desktop-sessions-in-vista\/","description":"<p>At work, I do all of my development on a Windows 2003 box. I generally log in\nas a normal user, and then use Remote Desktop to concurrently log in as\nAdministrator. This means that I&rsquo;m relatively safe from malware when doing\nday-to-day stuff, but that I can still get hold of Administrator privileges\nwhen I need them.<\/p>"},{"title":"Error: Windows cannot access the specified device, path or file.","link":"https:\/\/blog.differentpla.net\/blog\/2007\/04\/20\/error-windows-cannot-access-the-specified-device-path-or-file\/","pubDate":"Fri, 20 Apr 2007 10:38:13 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2007\/04\/20\/error-windows-cannot-access-the-specified-device-path-or-file\/","description":"<p>I started getting this error on one of my Windows 2003 boxes yesterday:<\/p>"},{"title":"DrawEdge() samples","link":"https:\/\/blog.differentpla.net\/blog\/2007\/04\/01\/drawedge-samples\/","pubDate":"Sun, 01 Apr 2007 10:49:31 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2007\/04\/01\/drawedge-samples\/","description":"<p>Shame that the <code>DrawEdge()<\/code> documentation doesn&rsquo;t include examples. Fixed.<\/p>\n<p><img alt=\"\" height=\"598\" id=\"h-rh-i-0\" src=\"https:\/\/blog.differentpla.net\/blog\/2007\/04\/01\/drawedge-samples\/draw_edge.png\" width=\"749\"><\/p>"},{"title":"ShellExecute doesn't work for URLs when called from a multithreaded apartment","link":"https:\/\/blog.differentpla.net\/blog\/2007\/02\/27\/shellexecute-doesnt-work-for-urls-when-called-from-a-multithreaded-apartment\/","pubDate":"Tue, 27 Feb 2007 12:14:21 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2007\/02\/27\/shellexecute-doesnt-work-for-urls-when-called-from-a-multithreaded-apartment\/","description":"<p>I&rsquo;ve got a dialog box with a SysLink (<code>WC_SYSLINK<\/code>) control on it. When the user clicks on the link, it should open our\nwebsite in the user&rsquo;s default browser. In my test app, it works. In the production app, it doesn&rsquo;t.<\/p>"},{"title":"A list of HRESULT codes","link":"https:\/\/blog.differentpla.net\/blog\/2007\/02\/16\/a-list-of-hresult-codes\/","pubDate":"Fri, 16 Feb 2007 10:50:44 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2007\/02\/16\/a-list-of-hresult-codes\/","description":"<p>&hellip;because every time I search for a given HRESULT, all I get is yet another frigging VB website regurgitating the\ncontents of WinError.h<\/p>"},{"title":"Turning off Registry Virtualization","link":"https:\/\/blog.differentpla.net\/blog\/2007\/02\/15\/turning-off-registry-virtualization\/","pubDate":"Thu, 15 Feb 2007 10:51:58 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2007\/02\/15\/turning-off-registry-virtualization\/","description":"<p>On Windows Vista, applications running without admin privileges can write to HKEY_LOCAL_MACHINE, and they&rsquo;ll be transparently redirected to HKEY_CURRENT_USER\\Software\\Classes\\VirtualStore. Similar redirection applies to C:\\Program Files.<\/p>"},{"title":"Roman Numeral letter H","link":"https:\/\/blog.differentpla.net\/blog\/2007\/02\/07\/roman-numeral-letter-h\/","pubDate":"Wed, 07 Feb 2007 17:26:27 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2007\/02\/07\/roman-numeral-letter-h\/","description":"<p>Someone appears to have spent some time searching my site for the term &ldquo;Roman Numeral letter H&rdquo;. This is pointless, for two reasons:<\/p>"},{"title":"Things I found out today while looking at Side-by-Side DLLs","link":"https:\/\/blog.differentpla.net\/blog\/2007\/02\/07\/things-i-found-out-today-while-looking-at-side-by-side-dlls\/","pubDate":"Wed, 07 Feb 2007 16:37:45 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2007\/02\/07\/things-i-found-out-today-while-looking-at-side-by-side-dlls\/","description":"<ul>\n<li>You can add DLL dependencies to your EXE file&rsquo;s manifest by using the <code>\/manifestdependency<\/code> linker switch. As with several other linker switches, this can be done using <code>#pragma comment(linker, ...)<\/code>.<\/li>\n<li>The Visual C++ 2005 compiler automatically inserts a <code>\/manifestdependency<\/code> switch into .OBJ files that it creates. It marks them as dependent on the Microsoft.VC80.CRT DLL, version 8.0.50727.762. It does this in the VC\\include\\crtdefs.h file.<\/li>\n<\/ul>"},{"title":"regsvr32.exe reports error 0x80040200 on Windows Vista","link":"https:\/\/blog.differentpla.net\/blog\/2007\/01\/17\/regsvr32exe-reports-error-0x80040200-on-windows-vista\/","pubDate":"Wed, 17 Jan 2007 14:52:59 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2007\/01\/17\/regsvr32exe-reports-error-0x80040200-on-windows-vista\/","description":"<p><code>0x80040200<\/code> is <code>SELFREG_E_TYPELIB<\/code>. This result is returned from MFC ActiveX (.OCX) controls when <code>AfxOleRegisterTypeLib<\/code> fails.<\/p>"},{"title":"qmail STARTTLS is slow","link":"https:\/\/blog.differentpla.net\/blog\/2006\/12\/22\/qmail-starttls-is-slow\/","pubDate":"Fri, 22 Dec 2006 11:01:59 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2006\/12\/22\/qmail-starttls-is-slow\/","description":"<p>I&rsquo;ve recently been struggling to reliably send email via my qmail server. I&rsquo;ve got STARTTLS and SMTP AUTH enabled, in order to allow relaying for authenticated users. However, it&rsquo;s been really slow, and Thunderbird quite often times out and gives up on the connection.<\/p>"},{"title":"Splash screens should not be topmost windows","link":"https:\/\/blog.differentpla.net\/blog\/2006\/11\/16\/splash-screens-should-not-be-topmost-windows\/","pubDate":"Thu, 16 Nov 2006 16:33:35 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2006\/11\/16\/splash-screens-should-not-be-topmost-windows\/","description":"<p>Because I might want to get on with something else while your program loads, and if your splash screen is in the way, that&rsquo;s going to make it difficult.<\/p>"},{"title":"Unable to open Web Project","link":"https:\/\/blog.differentpla.net\/blog\/2006\/11\/16\/unable-to-open-web-project\/","pubDate":"Thu, 16 Nov 2006 12:43:08 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2006\/11\/16\/unable-to-open-web-project\/","description":"<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-text\" data-lang=\"text\"><span class=\"line\"><span class=\"cl\">Unable to open Web Project &#39;foo&#39;.\n<\/span><\/span><span class=\"line\"><span class=\"cl\">The file path &#39;C:\\wherever\\foo&#39; does not correspond to the URL &#39;http:\/\/localhost\/foo&#39;.\n<\/span><\/span><span class=\"line\"><span class=\"cl\">The two need to map to the same server location.<\/span><\/span><\/code><\/pre><\/div>\n<p>Some possible causes, and fixes.<\/p>"},{"title":"Using mod_rewrite, RewriteMap to re-arrange website content","link":"https:\/\/blog.differentpla.net\/blog\/2006\/10\/27\/using-mod_rewrite-rewritemap-to-re-arrange-website-content\/","pubDate":"Fri, 27 Oct 2006 12:39:30 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2006\/10\/27\/using-mod_rewrite-rewritemap-to-re-arrange-website-content\/","description":"<p>When moving differentpla.net from one server to another, I decided to move the content (currently served using drupal)\nfrom the root to <code>\/content<\/code>. I also decided to use more descriptive URLs.<\/p>"},{"title":"Bad UI: Why SQL Query Analyzer sucks","link":"https:\/\/blog.differentpla.net\/blog\/2006\/10\/19\/bad-ui-why-sql-query-analyzer-sucks\/","pubDate":"Thu, 19 Oct 2006 10:40:31 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2006\/10\/19\/bad-ui-why-sql-query-analyzer-sucks\/","description":"<p>I&rsquo;m doing a bunch of SQL hacking at the moment, and I&rsquo;ve decided to use SQL Query Analyzer as a good template for how not to write a text editor.<\/p>"},{"title":"Changing the output directories when converting a Visual C++ 6 project to Visual C++ 7.1","link":"https:\/\/blog.differentpla.net\/blog\/2006\/10\/12\/changing-the-output-directories-when-converting-a-visual-c-6-project-to-visual-c-71\/","pubDate":"Thu, 12 Oct 2006 11:16:21 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2006\/10\/12\/changing-the-output-directories-when-converting-a-visual-c-6-project-to-visual-c-71\/","description":"<p>When you import a project from Visual C++ 6 into Visual Studio 2003 (i.e. Visual C++ 7.1), it doesn&rsquo;t fix up the output directories to use the correct definitions.<\/p>"},{"title":"unresolved external symbol \"public: void __thiscall std::_String_base::_Xran(void)const","link":"https:\/\/blog.differentpla.net\/blog\/2006\/09\/13\/unresolved-external-symbol-public-void-__thiscall-std_string_base_xranvoidconst\/","pubDate":"Wed, 13 Sep 2006 14:20:54 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2006\/09\/13\/unresolved-external-symbol-public-void-__thiscall-std_string_base_xranvoidconst\/","description":"<p>When compiling a C++ program with Visual C++ 2003, you might get the error:<\/p>"},{"title":"Access Denied to Temporary ASP.NET Files","link":"https:\/\/blog.differentpla.net\/blog\/2006\/05\/08\/access-denied-to-temporary-aspnet-files\/","pubDate":"Mon, 08 May 2006 16:17:35 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2006\/05\/08\/access-denied-to-temporary-aspnet-files\/","description":"<p>Sometimes, when attempting to debug an ASP.NET Web Service, you&rsquo;ll get the following error:<\/p>"},{"title":"Debugging ASP.NET applications without Administrator privileges","link":"https:\/\/blog.differentpla.net\/blog\/2006\/02\/20\/debugging-aspnet-applications-without-administrator-privileges\/","pubDate":"Mon, 20 Feb 2006 11:32:53 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2006\/02\/20\/debugging-aspnet-applications-without-administrator-privileges\/","description":"<p>I recently had my machine at work rebuilt with Windows 2003, and had a spot of difficulty getting Visual Studio to debug\nmy ASP.NET applications. Here are the various error messages I encountered, and their fixes.<\/p>"},{"title":"Error: Failed to generate a user instance of SQL Server...","link":"https:\/\/blog.differentpla.net\/blog\/2006\/01\/18\/error-failed-to-generate-a-user-instance-of-sql-server\/","pubDate":"Wed, 18 Jan 2006 21:55:30 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2006\/01\/18\/error-failed-to-generate-a-user-instance-of-sql-server\/","description":"<p>I was just hacking something together in Visual Web Developer Express, and was attempting to add a database to my App_Data directory when I ran into problems.<\/p>"},{"title":"Using PropertyGrid with a dictionary object","link":"https:\/\/blog.differentpla.net\/blog\/2005\/02\/26\/using-propertygrid-with-a-dictionary-object\/","pubDate":"Sat, 26 Feb 2005 16:04:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2005\/02\/26\/using-propertygrid-with-a-dictionary-object\/","description":"<p>If you try using <code>IDictionary<\/code> with the <code>PropertyGrid<\/code> control, the results aren&rsquo;t spectacular:<\/p>"},{"title":"Implementing a Wizard in C#, Part 2","link":"https:\/\/blog.differentpla.net\/blog\/2005\/02\/26\/implementing-a-wizard-in-csharp-part-2\/","pubDate":"Sat, 26 Feb 2005 12:50:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2005\/02\/26\/implementing-a-wizard-in-csharp-part-2\/","description":"<p>In this installment (see <a href=\"https:\/\/blog.differentpla.net\/blog\/2005\/02\/26\/implementing-a-wizard-in-csharp\/\">here<\/a> for the previous installment), we&rsquo;ll be fixing a few things and making the whole thing prettier.<\/p>"},{"title":"Implementing a Wizard in C#","link":"https:\/\/blog.differentpla.net\/blog\/2005\/02\/26\/implementing-a-wizard-in-csharp\/","pubDate":"Sat, 26 Feb 2005 12:44:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2005\/02\/26\/implementing-a-wizard-in-csharp\/","description":"<p>Oddly, the Windows Forms libraries don&rsquo;t provide any support for writing wizards. Here&rsquo;s one way to do it.<\/p>"},{"title":"Empeg File Structures","link":"https:\/\/blog.differentpla.net\/blog\/2005\/02\/13\/empeg-file-structures\/","pubDate":"Sun, 13 Feb 2005 10:17:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2005\/02\/13\/empeg-file-structures\/","description":"<p>If you&rsquo;ve ever gone looking for the music and playlists on your empeg, you&rsquo;ll find them in the <code>\/empeg\/fids0<\/code> and\n<code>\/empeg\/fids1<\/code> directories.<\/p>"},{"title":"Implementing a paged Options dialog","link":"https:\/\/blog.differentpla.net\/blog\/2004\/10\/24\/implementing-a-paged-options-dialog\/","pubDate":"Sun, 24 Oct 2004 12:42:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/10\/24\/implementing-a-paged-options-dialog\/","description":"<p>Several popular applications implement their options dialog as a collection of pages. Here&rsquo;s one way to do this in your application.<\/p>"},{"title":"Indexing Service causes strange Access Denied errors in ASP.NET","link":"https:\/\/blog.differentpla.net\/blog\/2004\/07\/27\/indexing-service-causes-strange-access-denied-errors-in-aspnet\/","pubDate":"Tue, 27 Jul 2004 18:14:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/07\/27\/indexing-service-causes-strange-access-denied-errors-in-aspnet\/","description":"<p>A couple of weeks ago, I installed a trial copy of the Dundas .NET charting controls to play with in ASP.NET. It&rsquo;s actually pretty cool, but I was attempting to show it to someone on my laptop when it stopped working.<\/p>"},{"title":"Creating a Custom Reader Class for Ogg Vorbis\/FLAC Comments","link":"https:\/\/blog.differentpla.net\/blog\/2004\/07\/27\/creating-a-custom-reader-class-for-ogg-vorbisflac-comments\/","pubDate":"Tue, 27 Jul 2004 15:49:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/07\/27\/creating-a-custom-reader-class-for-ogg-vorbisflac-comments\/","description":"<p>In Dino Esposito&rsquo;s &ldquo;Cutting Edge&rdquo; column in <a href=\"http:\/\/msdn.microsoft.com\/msdnmag\/issues\/02\/08\/CuttingEdge\/default.aspx\">MSDN Magazine<\/a>, he talks about the various readers (<code>BinaryReader<\/code>, <code>XmlReader<\/code>, etc.) available in .NET.<\/p>"},{"title":"FileInfo doesn't cache its contents","link":"https:\/\/blog.differentpla.net\/blog\/2004\/07\/23\/fileinfo-doesnt-cache-its-contents\/","pubDate":"Fri, 23 Jul 2004 08:21:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/07\/23\/fileinfo-doesnt-cache-its-contents\/","description":"<p>Imagine this code:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-c#\" data-lang=\"c#\"><span class=\"line\"><span class=\"cl\"><span class=\"n\">FileInfo<\/span> <span class=\"n\">oldInfo<\/span> <span class=\"p\">=<\/span> <span class=\"k\">new<\/span> <span class=\"n\">FileInfo<\/span><span class=\"p\">(<\/span><span class=\"n\">path<\/span><span class=\"p\">);<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"n\">RemoveID3TagsFromFile<\/span><span class=\"p\">(<\/span><span class=\"n\">path<\/span><span class=\"p\">);<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"n\">FileInfo<\/span> <span class=\"n\">newInfo<\/span> <span class=\"p\">=<\/span> <span class=\"k\">new<\/span> <span class=\"n\">FileInfo<\/span><span class=\"p\">(<\/span><span class=\"n\">path<\/span><span class=\"p\">);<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"n\">Trace<\/span><span class=\"p\">.<\/span><span class=\"n\">Assert<\/span><span class=\"p\">(<\/span><span class=\"n\">newInfo<\/span><span class=\"p\">.<\/span><span class=\"n\">Length<\/span> <span class=\"p\">&lt;<\/span> <span class=\"n\">oldInfo<\/span><span class=\"p\">.<\/span><span class=\"n\">Length<\/span><span class=\"p\">);<\/span><\/span><\/span><\/code><\/pre><\/div>\n<p>So, we&rsquo;ve got some code that removes the ID3 tags from a file, thus shortening it. To check that it&rsquo;s working correctly,\nwe use <code>FileInfo<\/code> to make sure that the new file is smaller than the old one.<\/p>"},{"title":"Object must implement IConvertible","link":"https:\/\/blog.differentpla.net\/blog\/2004\/07\/13\/object-must-implement-iconvertible\/","pubDate":"Tue, 13 Jul 2004 15:29:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/07\/13\/object-must-implement-iconvertible\/","description":"<p>While writing some ASP.NET, I got this error. I&rsquo;ve just spent ten minutes figuring it out, so I thought I&rsquo;d share.<\/p>"},{"title":"Stupidly crippled Visual Studio.NET","link":"https:\/\/blog.differentpla.net\/blog\/2004\/07\/07\/stupidly-crippled-visual-studionet\/","pubDate":"Wed, 07 Jul 2004 11:47:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/07\/07\/stupidly-crippled-visual-studionet\/","description":"<p>It turns out that Visual Studio.NET <em>Professional<\/em> can&rsquo;t be used to design databases with SQL Server. It can be used with MSDE.<\/p>"},{"title":"Jam: Linking with System Libraries","link":"https:\/\/blog.differentpla.net\/blog\/2004\/07\/04\/jam-linking-with-system-libraries\/","pubDate":"Sun, 04 Jul 2004 07:00:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/07\/04\/jam-linking-with-system-libraries\/","description":"<p>Obviously, your code doesn&rsquo;t just link with your libraries. It also has to link with some of the system libraries. Jam manages this by using the <code>LINKLIBS<\/code> variable. The simplest way to make this work is something like the following:<\/p>"},{"title":"Using the Observer, Proxy and Command Patterns to Marshal Progress Reporting from a Background Thread","link":"https:\/\/blog.differentpla.net\/blog\/2004\/06\/28\/using-the-observer-proxy-and-command-patterns-to-marshal-progress-reporting-from-a-background-thread\/","pubDate":"Mon, 28 Jun 2004 12:30:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/06\/28\/using-the-observer-proxy-and-command-patterns-to-marshal-progress-reporting-from-a-background-thread\/","description":"<p>In an earlier article, <a href=\"https:\/\/blog.differentpla.net\/blog\/2004\/02\/27\/running-long-lived-tasks-in-a-background-thread\/\">Running Long-lived Tasks in a Background Thread<\/a>, I talked about some of the problems associated with reporting progress from a background thread in a Win32 application.<\/p>"},{"title":"Self-drawing CListBox, LBS_OWNERDRAWFIXED and subclassing","link":"https:\/\/blog.differentpla.net\/blog\/2004\/05\/28\/ownerdrawfixed-subclassing\/","pubDate":"Fri, 28 May 2004 14:31:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/05\/28\/ownerdrawfixed-subclassing\/","description":"<p>If you&rsquo;ve got a <code>LISTBOX<\/code> (as opposed to a <code>ListView<\/code>) control in a dialog, and you&rsquo;re using <code>LBS_OWNERDRAWFIXED<\/code>, you might be surprised to find that your <code>MeasureItem<\/code> function is never called.<\/p>"},{"title":"Getting hold of the current directory in a batch file.","link":"https:\/\/blog.differentpla.net\/blog\/2004\/05\/19\/getting-hold-of-the-current-directory-in-a-batch-file\/","pubDate":"Wed, 19 May 2004 16:33:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/05\/19\/getting-hold-of-the-current-directory-in-a-batch-file\/","description":"<p>A common UNIX shell idiom is to write things like <code>cwd=$(pwd)<\/code> to save\nthe current directory so that in case be used later when other things might\nhave changed it. For a long time I didn&rsquo;t think this was possible in Windows\nbatch files. It turns out that it is, but it isn&rsquo;t pretty and it does\ngeneralise to getting the output of any command.<\/p>"},{"title":"Using CListCtrl::SortItems","link":"https:\/\/blog.differentpla.net\/blog\/2004\/05\/19\/using-clistctrlsortitems\/","pubDate":"Wed, 19 May 2004 14:38:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/05\/19\/using-clistctrlsortitems\/","description":"<p>In my <a href=\"https:\/\/blog.differentpla.net\/blog\/2004\/05\/19\/handling-lvn-getdispinfo\/\">previous article<\/a>, I explained how to use <code>LPSTR_TEXTCALLBACK<\/code> and <code>LVN_GETDISPINFO<\/code>.<\/p>"},{"title":"Handling LVN_GETDISPINFO","link":"https:\/\/blog.differentpla.net\/blog\/2004\/05\/19\/handling-lvn-getdispinfo\/","pubDate":"Wed, 19 May 2004 14:24:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/05\/19\/handling-lvn-getdispinfo\/","description":"<p>If you specify <code>LPSTR_TEXTCALLBACK<\/code> when inserting an item into a ListView control, it no longer supports sorting; you can&rsquo;t click on the column heading to sort the list control.<\/p>"},{"title":"ShowScreen: display the empeg's screen in a window","link":"https:\/\/blog.differentpla.net\/blog\/2004\/05\/18\/showscreen-display-the-empegs-screen-in-a-window\/","pubDate":"Tue, 18 May 2004 13:15:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/05\/18\/showscreen-display-the-empegs-screen-in-a-window\/","description":"<p>Over on the <a href=\"http:\/\/empeg.comms.net\/php\/showthreaded.php?Cat=&amp;Board=hackers_prog&amp;Number=215408&amp;page=0&amp;view=collapsed&amp;sb=5&amp;o=0\">empeg BBS<\/a>, tfabris said:<\/p>\n\n\n\n\n  <blockquote>\n    <p>There&rsquo;s nothing unique or even special in those sources. It just downloads the URL of the Hijack screen capture over and over again in a fast loop. You don&rsquo;t need my sources to duplicate that.<\/p>\n\n  <\/blockquote>"},{"title":"Drawing a drop shadow: using a mono bitmap","link":"https:\/\/blog.differentpla.net\/blog\/2004\/05\/11\/drawing-a-drop-shadow-using-a-mono-bitmap\/","pubDate":"Tue, 11 May 2004 09:24:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/05\/11\/drawing-a-drop-shadow-using-a-mono-bitmap\/","description":"<p>In an <a href=\"https:\/\/blog.differentpla.net\/blog\/2004\/05\/11\/drawing-a-drop-shadow-from-imagelist\/\">earlier article<\/a>, I showed how to draw a drop shadow with the help of the ImageList control.<\/p>"},{"title":"Drawing an item from an Image List with a drop shadow","link":"https:\/\/blog.differentpla.net\/blog\/2004\/05\/11\/drawing-a-drop-shadow-from-imagelist\/","pubDate":"Tue, 11 May 2004 09:24:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/05\/11\/drawing-a-drop-shadow-from-imagelist\/","description":"<p>The documentation for <code>ImageList_DrawIndirect<\/code> seems to imply that it can draw an item from an ImageList control with a drop shadow.  Unfortunately, it doesn&rsquo;t seem to be supported.<\/p>"},{"title":"Adding custom logon pictures to Windows XP","link":"https:\/\/blog.differentpla.net\/blog\/2004\/04\/02\/adding-custom-logon-pictures-to-windows-xp\/","pubDate":"Fri, 02 Apr 2004 12:25:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/04\/02\/adding-custom-logon-pictures-to-windows-xp\/","description":"<p>Inspired by <a href=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2004\/04\/01\/105582.aspx\">this post<\/a> on Raymond Chen&rsquo;s <a href=\"http:\/\/blogs.msdn.com\/oldnewthing\/\">blog<\/a>, I thought I might explain how to change the logon pictures.<\/p>"},{"title":"Direct access to a Bitmap using GetDIBits and SetDIBits","link":"https:\/\/blog.differentpla.net\/blog\/2004\/04\/02\/direct-access-to-a-bitmap-using-getdibits-and-setdibits\/","pubDate":"Fri, 02 Apr 2004 11:28:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/04\/02\/direct-access-to-a-bitmap-using-getdibits-and-setdibits\/","description":"<p>In the <a href=\"https:\/\/blog.differentpla.net\/blog\/2004\/04\/02\/grabbing-a-snapshot-of-the-screen\/\">Grabbing a snapshot of the screen<\/a> article, I said: &ldquo;I&rsquo;m planning on altering the snapshot before displaying it.&rdquo;. This article shows how to alter a bitmap by directly accessing the raw bits.<\/p>"},{"title":"Grabbing a snapshot of the screen","link":"https:\/\/blog.differentpla.net\/blog\/2004\/04\/02\/grabbing-a-snapshot-of-the-screen\/","pubDate":"Fri, 02 Apr 2004 10:51:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/04\/02\/grabbing-a-snapshot-of-the-screen\/","description":"<p>Some (simple) code that shows how to grab a snapshot of the screen and display it in a window.<\/p>"},{"title":"Unresolved external symbol _WinMain@16","link":"https:\/\/blog.differentpla.net\/blog\/2004\/04\/02\/unresolved-external-symbol-_winmain16\/","pubDate":"Fri, 02 Apr 2004 08:55:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/04\/02\/unresolved-external-symbol-_winmain16\/","description":"<p>I got this error message today:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-text\" data-lang=\"text\"><span class=\"line\"><span class=\"cl\">msvcrt.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function _WinMainCRTStartup<\/span><\/span><\/code><\/pre><\/div>\n<p>The most common cause for this error message is adding Unicode configurations to your project and forgetting to change\nthe entry point to <code>wWinMainCRTStartup<\/code>.<\/p>"},{"title":"CTreeCtrl, TrackPopupMenu and CCmdTarget","link":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/31\/ctreectrl-trackpopupmenu-and-ccmdtarget\/","pubDate":"Wed, 31 Mar 2004 17:17:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/31\/ctreectrl-trackpopupmenu-and-ccmdtarget\/","description":"<p>Some twisted code showing how to combine MFC&rsquo;s <code>CTreeCtrl<\/code>, <code>CCmdTarget<\/code> and <code>TrackPopupMenu<\/code>.<\/p>"},{"title":"Using DrawDragRect to rubber-band a selection","link":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/31\/using-drawdragrect-to-rubber-band-a-selection\/","pubDate":"Wed, 31 Mar 2004 13:54:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/31\/using-drawdragrect-to-rubber-band-a-selection\/","description":"<p>If you&rsquo;re allowing the user to &ldquo;rubber-band&rdquo; a selection in your application, you might choose to use the <code>DrawDragRect<\/code> function. Here&rsquo;s how.<\/p>"},{"title":"Formatting an empeg's Hard Disk Manually","link":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/25\/formatting-an-empegs-hard-disk-manually\/","pubDate":"Thu, 25 Mar 2004 09:37:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/25\/formatting-an-empegs-hard-disk-manually\/","description":"<p>The sequel to <a href=\"https:\/\/blog.differentpla.net\/blog\/2004\/03\/25\/partitioning-an-empegs-hard-disk-manually\/\">Partitioning an empeg&rsquo;s Hard Disk Manually<\/a>.<\/p>\n<p>So, if you&rsquo;ve followed the instructions on the previous page, you&rsquo;ve now got a freshly-partitioned empeg hard disk. It&rsquo;s time to format it.<\/p>"},{"title":"Partitioning an empeg's Hard Disk Manually","link":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/25\/partitioning-an-empegs-hard-disk-manually\/","pubDate":"Thu, 25 Mar 2004 09:20:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/25\/partitioning-an-empegs-hard-disk-manually\/","description":"<p>If you&rsquo;re attempting to upgrade the hard disk in your empeg, and the disk builder is not working for you (this is often the case with disks larger than 60Gb), then you might want to build your new disk manually.<\/p>"},{"title":"Installing qmailadmin","link":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/24\/installing-qmailadmin\/","pubDate":"Wed, 24 Mar 2004 18:41:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/24\/installing-qmailadmin\/","description":"<p>To make it easier to manage the virtual domains on my email box, I&rsquo;ve decided to install <a href=\"http:\/\/www.inter7.com\/qmailadmin.html\">qmailAdmin<\/a>.<\/p>"},{"title":"Outlook XP: Storing Sent Items on the IMAP Server","link":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/24\/outlook-xp-storing-sent-items-on-the-imap-server\/","pubDate":"Wed, 24 Mar 2004 14:33:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/24\/outlook-xp-storing-sent-items-on-the-imap-server\/","description":"<p>By default, Outlook stores a copy of your outgoing email in the &ldquo;Sent Items&rdquo; folder in your local &ldquo;Personal Folders&rdquo; <code>.pst<\/code> file.<\/p>"},{"title":"Using SMTP-TLS with qmail","link":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/24\/using-smtp-tls-with-qmail\/","pubDate":"Wed, 24 Mar 2004 14:12:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/24\/using-smtp-tls-with-qmail\/","description":"<p>If you install <a href=\"http:\/\/shupp.org\/patches\/netqmail-1.05-tls-smtpauth-20040207.patch\">this patch<\/a> (mentioned <a href=\"https:\/\/blog.differentpla.net\/blog\/2004\/03\/11\/installing-smtp-auth-with-qmail\/\">here<\/a>), then you&rsquo;ll get SMTP-over-TLS in qmail.<\/p>"},{"title":"Making clamd Run Automatically","link":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/23\/making-clamd-run-automatically\/","pubDate":"Tue, 23 Mar 2004 13:25:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/23\/making-clamd-run-automatically\/","description":"<p>Whoops. Back when I was <a href=\"https:\/\/blog.differentpla.net\/blog\/2004\/03\/12\/installing-clamav-and-qmail-scanner\/\">installing ClamAV<\/a>, I\nstarted <code>clamd<\/code> running so that I could test the virus checker. Yesterday, I rebooted the PC.<\/p>"},{"title":"Sent Items: Thunderbird and Outlook Express on the same account","link":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/23\/sent-items-thunderbird-and-outlook-express-on-the-same-account\/","pubDate":"Tue, 23 Mar 2004 11:46:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/23\/sent-items-thunderbird-and-outlook-express-on-the-same-account\/","description":"<p>Outlook Express likes to store a copy of your outgoing email in a folder called &ldquo;Sent Items&rdquo;. Thunderbird likes to store\na copy of your outgoing email in a folder called &ldquo;Sent&rdquo;. If you use both to access the same email account using IMAP,\nyou&rsquo;ll end up with both folders being created, and your outgoing email will end up in either, depending on which client\nyou used at the time.<\/p>"},{"title":"Securing IMAP","link":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/23\/securing-imap\/","pubDate":"Tue, 23 Mar 2004 11:39:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/23\/securing-imap\/","description":"<p>BincIMAP supports IMAPS for communication. It can either do this if you compile in SSL support, or if you use an SSL tunnel, such as <a href=\"http:\/\/www.stunnel.org\/\">stunnel<\/a> or <a href=\"http:\/\/www.superscript.com\/ucspi-ssl\/intro.html\">ucspi-ssl<\/a>.<\/p>"},{"title":"Recursively Finding Files","link":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/21\/recursively-finding-files\/","pubDate":"Sun, 21 Mar 2004 09:45:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/21\/recursively-finding-files\/","description":"<p>On my list of &ldquo;things to do in my copious free time&rdquo; is: &ldquo;write a <a href=\"https:\/\/blog.differentpla.net\/blog\/2003\/09\/30\/writing-a-replacement-receiver-server\/\">replacement Rio Receiver server<\/a> in\nC#&rdquo;. So I&rsquo;ve started putting together snippets of code that might turn out to be useful as I start learning C#. This one\nis a recursive file finder. It uses delegates.<\/p>"},{"title":"Discovering empegs on the Network Using C#","link":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/19\/discovering-empegs-on-the-network-using-c\/","pubDate":"Fri, 19 Mar 2004 10:00:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/19\/discovering-empegs-on-the-network-using-c\/","description":"<p>I&rsquo;ve been playing around with learning C#. Today, I thought I&rsquo;d write a C# program to find empegs on the local network.<\/p>"},{"title":"Securing SquirrelMail using HTTPS","link":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/18\/securing-squirrelmail-using-https\/","pubDate":"Thu, 18 Mar 2004 15:19:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/18\/securing-squirrelmail-using-https\/","description":"<p>At the end of <a href=\"https:\/\/blog.differentpla.net\/blog\/2004\/03\/11\/installing-squirrelmail\/\">Installing SquirrelMail<\/a>, I&rsquo;d finished installing\nwebmail on my test box. Currently, this uses HTTP. This is not really secure enough for webmail, so this article is\ngoing to look at adding HTTPS access to webmail.<\/p>"},{"title":"Installing ClamAV and Qmail-Scanner","link":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/12\/installing-clamav-and-qmail-scanner\/","pubDate":"Fri, 12 Mar 2004 16:30:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/12\/installing-clamav-and-qmail-scanner\/","description":"<h2 id=\"virus-scanner\">Virus Scanner<a href=\"#virus-scanner\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>I&rsquo;m currently using <a href=\"http:\/\/www.mcafee.com\/\">McAfee<\/a> VirusScan on my Windows XP desktop, but I&rsquo;d prefer to add virus scanning on the mail server as well. This is for two reasons:<\/p>"},{"title":"Installing SquirrelMail","link":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/11\/installing-squirrelmail\/","pubDate":"Thu, 11 Mar 2004 14:22:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/11\/installing-squirrelmail\/","description":"<h2 id=\"squirrelmail\">SquirrelMail<a href=\"#squirrelmail\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>One requirement I listed earlier is webmail, so that I can access my email from anywhere. I&rsquo;m going to take a look at <a href=\"http:\/\/www.squirrelmail.org\/\">SquirrelMail<\/a>.<\/p>"},{"title":"Installing ezmlm with vpopmail","link":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/11\/installing-ezmlm-with-vpopmail\/","pubDate":"Thu, 11 Mar 2004 12:17:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/11\/installing-ezmlm-with-vpopmail\/","description":"<h2 id=\"installing-ezmlm\">Installing ezmlm<a href=\"#installing-ezmlm\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p><code>peculiar<\/code> is host to several mailing lists, using ezmlm-idx. This needs to continue working under vpopmail.<\/p>"},{"title":"Forwarding addresses to another account using vpopmail","link":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/11\/forwarding-addresses-to-another-account-using-vpopmail\/","pubDate":"Thu, 11 Mar 2004 11:03:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/11\/forwarding-addresses-to-another-account-using-vpopmail\/","description":"<h2 id=\"forwarding\">Forwarding<a href=\"#forwarding\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>Some of the email addresses on <code>peculiar<\/code> are &ldquo;vanity addresses&rdquo;. The people concerned don&rsquo;t have user accounts on the box and the email is forwarded somewhere else.<\/p>"},{"title":"Using qmail extension addresses with vpopmail","link":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/11\/using-qmail-extension-addresses-with-vpopmail\/","pubDate":"Thu, 11 Mar 2004 10:53:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/11\/using-qmail-extension-addresses-with-vpopmail\/","description":"<h2 id=\"extension-addresses\">Extension addresses<a href=\"#extension-addresses\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>Quite often, I&rsquo;ll hand out a qmail extension address (i.e. <code>roger-foo@domain.com<\/code>) so that I can more easily filter email received to this account. This is useful. According to the <code>vpopmail<\/code> documentation, the <code>--enable-qmail-ext<\/code> switch to <code>configure<\/code> is supposed to turn this on. Unfortunately, it doesn&rsquo;t appear to do anything. This is with vpopmail-5.4.0. I&rsquo;m not entirely sure what it&rsquo;s supposed to, but it doesn&rsquo;t make extension addresses work.<\/p>"},{"title":"Installing BincIMAP","link":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/11\/installing-bincimap\/","pubDate":"Thu, 11 Mar 2004 09:35:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/11\/installing-bincimap\/","description":"<h2 id=\"configuring-bincimap\">Configuring BincIMAP<a href=\"#configuring-bincimap\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>Another of my requirements is that my email should be accessible using IMAP. I&rsquo;ve had a quick look at Courier IMAP, and (IMO) it&rsquo;s a bit oversized for my needs. So, I&rsquo;m going to install <a href=\"http:\/\/www.bincimap.org\/\">BincIMAP<\/a> instead. I grabbed the 1.2.7beta5 tarball and unpacked it in <code>\/usr\/local\/src<\/code>.<\/p>"},{"title":"Installing vpopmail","link":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/11\/installing-vpopmail\/","pubDate":"Thu, 11 Mar 2004 09:33:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/11\/installing-vpopmail\/","description":"<h2 id=\"installing-vpopmail\">Installing vpopmail<a href=\"#installing-vpopmail\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>vpopmail is available from <a href=\"http:\/\/www.inter7.com\/vpopmail.html\">http:\/\/www.inter7.com\/vpopmail.html<\/a>. The latest version available at the time of this article was 5.4.0, so I grabbed that.<\/p>"},{"title":"Installing SMTP AUTH with qmail","link":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/11\/installing-smtp-auth-with-qmail\/","pubDate":"Thu, 11 Mar 2004 09:28:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/11\/installing-smtp-auth-with-qmail\/","description":"<h2 id=\"installing-smtp-auth\">Installing SMTP AUTH<a href=\"#installing-smtp-auth\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>In the Requirements list, above, I talked about being able to send email from anywhere, using my laptop. This is known as selective relaying.<\/p>"},{"title":"Removing exim and installing qmail","link":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/11\/removing-exim-and-installing-qmail\/","pubDate":"Thu, 11 Mar 2004 09:26:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/11\/removing-exim-and-installing-qmail\/","description":"<h2 id=\"removing-exim\">Removing exim<a href=\"#removing-exim\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>The first thing to do is to remove exim. Because of Debian&rsquo;s package management system, you can&rsquo;t remove exim without installing another package that provides mail-transfer-agent. Because qmail isn&rsquo;t available as a binary Debian package, this is a little trickier than it needs to be. The answer to this conundrum is in the <code>equivs<\/code> package, so we install that:<\/p>"},{"title":"Installing qmail and vpopmail","link":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/11\/installing-qmail-and-vpopmail\/","pubDate":"Thu, 11 Mar 2004 09:24:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/03\/11\/installing-qmail-and-vpopmail\/","description":"<p>My mail server runs <code>qmail<\/code>. This is the first of a multipart series showing how I went about installing <code>vpopmail<\/code> for virtual domain support.<\/p>"},{"title":"Running Long-lived Tasks in a Background Thread","link":"https:\/\/blog.differentpla.net\/blog\/2004\/02\/27\/running-long-lived-tasks-in-a-background-thread\/","pubDate":"Fri, 27 Feb 2004 13:00:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/02\/27\/running-long-lived-tasks-in-a-background-thread\/","description":"<p>In earlier articles, <a href=\"https:\/\/blog.differentpla.net\/blog\/2004\/01\/08\/displaying-progress-in-a-wizard\/\">Displaying Progress in a Wizard<\/a> and <a href=\"https:\/\/blog.differentpla.net\/blog\/2004\/02\/27\/cancelling-long-lived-tasks-from-a-wizard\/\">Cancelling Long-Lived Tasks from a Wizard<\/a>, I discussed how to run a long-lived task from a wizard and how to display progress in the wizard.<\/p>"},{"title":"Cancelling Long-Lived Tasks from a Wizard","link":"https:\/\/blog.differentpla.net\/blog\/2004\/02\/27\/cancelling-long-lived-tasks-from-a-wizard\/","pubDate":"Fri, 27 Feb 2004 10:23:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/02\/27\/cancelling-long-lived-tasks-from-a-wizard\/","description":"<p>This article, a follow-up to <a href=\"https:\/\/blog.differentpla.net\/blog\/2004\/01\/08\/displaying-progress-in-a-wizard\/\">this one<\/a>, shows how to modify our project to allow the user to cancel the long-lived operation.<\/p>"},{"title":"Downloading from an HTTP Server using WinInet","link":"https:\/\/blog.differentpla.net\/blog\/2004\/02\/26\/downloading-from-an-http-server-using-wininet\/","pubDate":"Thu, 26 Feb 2004 11:45:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/02\/26\/downloading-from-an-http-server-using-wininet\/","description":"<p>The WinInet functions allow an application to interact with Gopher, FTP and HTTP servers. This article shows how to use\nthe WinInet API to download from an HTTP server.<\/p>"},{"title":"Escaping HTML so you can quote it in HTML","link":"https:\/\/blog.differentpla.net\/blog\/2004\/02\/26\/escaping-html-so-you-can-quote-it-in-html\/","pubDate":"Thu, 26 Feb 2004 10:13:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/02\/26\/escaping-html-so-you-can-quote-it-in-html\/","description":"<p>Quick tip: How to escape HTML text so that it can be quoted in another piece of HTML, e.g. in a <code>&lt;pre&gt;<\/code> tag.<\/p>"},{"title":"Accepting HTML form data sent with POST","link":"https:\/\/blog.differentpla.net\/blog\/2004\/02\/26\/accepting-html-form-data-sent-with-post\/","pubDate":"Thu, 26 Feb 2004 10:06:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/02\/26\/accepting-html-form-data-sent-with-post\/","description":"<p>How to write a CGI script (in Ruby) to accept files uploaded with <code>POST<\/code>.<\/p>"},{"title":"Misleading Error: \"Parent class code is read only\" (Visual Studio.NET)","link":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/29\/misleading-error-parent-class-code-is-read-only-visual-studionet\/","pubDate":"Thu, 29 Jan 2004 21:09:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/29\/misleading-error-parent-class-code-is-read-only-visual-studionet\/","description":"<p>I just had a strange error message from Visual Studio.NET when attempting to add a handler for <code>WM_DESTROY<\/code> to a C++\ndialog class. It said:<\/p>"},{"title":"Using a modal or modeless dialog as a main window","link":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/29\/using-a-modal-or-modeless-dialog-as-a-main-window\/","pubDate":"Thu, 29 Jan 2004 20:37:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/29\/using-a-modal-or-modeless-dialog-as-a-main-window\/","description":"<h2 id=\"using-a-modal-dialog-as-a-main-window\">Using a modal dialog as a main window<a href=\"#using-a-modal-dialog-as-a-main-window\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>If you ask the MFC AppWizard to generate a dialog-based application, it generates code that looks like this:<\/p>"},{"title":"Generating a Proxy\/Stub DLL for an interface, the sane way","link":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/29\/generating-a-proxystub-dll-for-an-interface-the-sane-way\/","pubDate":"Thu, 29 Jan 2004 10:01:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/29\/generating-a-proxystub-dll-for-an-interface-the-sane-way\/","description":"<p>Note: This article applies to Visual C++ 6. There might be an easier way to do this in Visual Studio .NET<\/p>"},{"title":"Linux on Sony Vaio - Network Install","link":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/29\/linux-on-sony-vaio-network-install\/","pubDate":"Thu, 29 Jan 2004 10:01:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/29\/linux-on-sony-vaio-network-install\/","description":"<h2 id=\"configure-the-vaio-for-network-booting\">Configure the Vaio for Network booting<a href=\"#configure-the-vaio-for-network-booting\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>To do this:<\/p>"},{"title":"Displaying a tooltip when the user drags the scroll thumb","link":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/12\/displaying-a-tooltip-when-the-user-drags-the-scroll-thumb\/","pubDate":"Mon, 12 Jan 2004 12:24:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/12\/displaying-a-tooltip-when-the-user-drags-the-scroll-thumb\/","description":"<h2 id=\"you-wanna-do-this\">You wanna do this?<a href=\"#you-wanna-do-this\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p><img alt=\"\" height=\"407\" id=\"h-rh-i-0\" src=\"https:\/\/blog.differentpla.net\/blog\/2004\/01\/12\/displaying-a-tooltip-when-the-user-drags-the-scroll-thumb\/thumbtrack_tooltips.png\" width=\"240\"><\/p>\n<h2 id=\"heres-how\">Here&rsquo;s How:<a href=\"#heres-how\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p><strong>Note:<\/strong> For details on how to do the full-row colouring, see <a href=\"https:\/\/blog.differentpla.net\/blog\/2004\/01\/12\/colouring-alternate-rows-in-clistctrl\/\">this<\/a>.<\/p>"},{"title":"Colouring alternate rows in a CListCtrl","link":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/12\/colouring-alternate-rows-in-clistctrl\/","pubDate":"Mon, 12 Jan 2004 12:23:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/12\/colouring-alternate-rows-in-clistctrl\/","description":"<p>Nothing particularly strenuous: Just handle <code>NM_CUSTOMDRAW<\/code> and play with <code>clrTextBk<\/code>. The only real surprise is that you have to return <code>CDRF_NEWFONT<\/code> from your handler to get the new colour used.<\/p>"},{"title":"Windows ListView Control Returns -1 From LVM_INSERTITEM","link":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/12\/windows-listview-control-returns-1-from-lvm_insertitem\/","pubDate":"Mon, 12 Jan 2004 12:21:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/12\/windows-listview-control-returns-1-from-lvm_insertitem\/","description":"<p>I just spent the best part of a morning chasing this one down, so I thought I&rsquo;d share it with you:<\/p>"},{"title":"Test First: Roman Numeral Conversion","link":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/12\/test-first-roman-numeral-conversion\/","pubDate":"Mon, 12 Jan 2004 12:07:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/12\/test-first-roman-numeral-conversion\/","description":"<p>Question: Everyone &ldquo;knows&rdquo; that you should write a decimal to Roman number\nconverter using a table. What happens if you try it test-first?<\/p>"},{"title":"Deleting the Internet Explorer Cache programmatically","link":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/12\/deleting-the-internet-explorer-cache-programmatically\/","pubDate":"Mon, 12 Jan 2004 12:05:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/12\/deleting-the-internet-explorer-cache-programmatically\/","description":"<p>Here&rsquo;s some C source code that does it.<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-c\" data-lang=\"c\"><span class=\"line\"><span class=\"cl\"><span class=\"kt\">char<\/span> <span class=\"n\">buffer<\/span><span class=\"p\">[<\/span><span class=\"mi\">4096<\/span><span class=\"p\">];<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"n\">DWORD<\/span> <span class=\"n\">cb<\/span> <span class=\"o\">=<\/span> <span class=\"mi\">4096<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"n\">INTERNET_CACHE_ENTRY_INFO<\/span> <span class=\"o\">*<\/span><span class=\"n\">p<\/span> <span class=\"o\">=<\/span> <span class=\"p\">(<\/span><span class=\"n\">INTERNET_CACHE_ENTRY_INFO<\/span> <span class=\"o\">*<\/span><span class=\"p\">)<\/span><span class=\"n\">buffer<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"n\">HANDLE<\/span> <span class=\"n\">h<\/span> <span class=\"o\">=<\/span> <span class=\"nf\">FindFirstUrlCacheEntry<\/span><span class=\"p\">(<\/span><span class=\"nb\">NULL<\/span><span class=\"p\">,<\/span> <span class=\"n\">p<\/span><span class=\"p\">,<\/span> <span class=\"o\">&amp;<\/span><span class=\"n\">cb<\/span><span class=\"p\">);<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"k\">while<\/span> <span class=\"p\">(<\/span><span class=\"n\">h<\/span><span class=\"p\">)<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"c1\">\/\/ Do something with it...\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"nf\">printf<\/span><span class=\"p\">(<\/span><span class=\"s\">&#34;Deleting: %s...&#34;<\/span><span class=\"p\">,<\/span> <span class=\"n\">p<\/span><span class=\"o\">-&gt;<\/span><span class=\"n\">lpszSourceUrlName<\/span><span class=\"p\">);<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"k\">if<\/span> <span class=\"p\">(<\/span><span class=\"o\">!<\/span><span class=\"nf\">DeleteUrlCacheEntry<\/span><span class=\"p\">(<\/span><span class=\"n\">p<\/span><span class=\"o\">-&gt;<\/span><span class=\"n\">lpszSourceUrlName<\/span><span class=\"p\">))<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"nf\">printf<\/span><span class=\"p\">(<\/span><span class=\"s\">&#34;failed, 0x%x<\/span><span class=\"se\">\\n<\/span><span class=\"s\">&#34;<\/span><span class=\"p\">,<\/span> <span class=\"nf\">GetLastError<\/span><span class=\"p\">());<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"k\">else<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"nf\">printf<\/span><span class=\"p\">(<\/span><span class=\"s\">&#34;ok<\/span><span class=\"se\">\\n<\/span><span class=\"s\">&#34;<\/span><span class=\"p\">);<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"n\">cb<\/span> <span class=\"o\">=<\/span> <span class=\"mi\">4096<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"k\">if<\/span> <span class=\"p\">(<\/span><span class=\"o\">!<\/span><span class=\"nf\">FindNextUrlCacheEntry<\/span><span class=\"p\">(<\/span><span class=\"n\">h<\/span><span class=\"p\">,<\/span> <span class=\"p\">(<\/span><span class=\"n\">INTERNET_CACHE_ENTRY_INFO<\/span> <span class=\"o\">*<\/span><span class=\"p\">)<\/span><span class=\"n\">buffer<\/span><span class=\"p\">,<\/span> <span class=\"o\">&amp;<\/span><span class=\"n\">cb<\/span><span class=\"p\">))<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"k\">break<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">}<\/span><\/span><\/span><\/code><\/pre><\/div>"},{"title":"Shell Fish : For Fishing in your Windows Shell","link":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/12\/shell-fish-for-fishing-in-your-windows-shell\/","pubDate":"Mon, 12 Jan 2004 11:55:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/12\/shell-fish-for-fishing-in-your-windows-shell\/","description":"<p>Provides a quick way to find out where Windows is putting your &ldquo;Favorites&rdquo;, &ldquo;Application Data&rdquo; etc. folders.<\/p>"},{"title":"Building a static library with Jam","link":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/10\/link-static-library\/","pubDate":"Sat, 10 Jan 2004 21:49:22 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/10\/link-static-library\/","description":"<h2 id=\"introduction\">Introduction<a href=\"#introduction\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>Once again, we&rsquo;re going to do what we did with the <a href=\"https:\/\/blog.differentpla.net\/blog\/2001\/07\/14\/building-an-mfc-application-with-jam\/\">MFC application<\/a> and\n<a href=\"https:\/\/blog.differentpla.net\/blog\/2001\/07\/16\/building-a-dll-with-jam\/\">DLL<\/a> examples: build the project with AppWizard, and then get it built\nwith jam.<\/p>"},{"title":"Linking with a shared library","link":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/10\/link-shared-library\/","pubDate":"Sat, 10 Jan 2004 21:49:22 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/10\/link-shared-library\/","description":"<h2 id=\"introduction\">Introduction<a href=\"#introduction\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>Now we&rsquo;ve got our <a href=\"https:\/\/blog.differentpla.net\/blog\/2001\/07\/14\/building-an-mfc-application-with-jam\/\">application<\/a> and <a href=\"https:\/\/blog.differentpla.net\/blog\/2001\/07\/16\/building-a-dll-with-jam\/\">DLL<\/a> building as part of the same project, we really ought to persuade them to link together.<\/p>"},{"title":"Resource File Dependencies","link":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/10\/rc-depends\/","pubDate":"Sat, 10 Jan 2004 21:49:22 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/10\/rc-depends\/","description":"<p>Our MFC application has a resource script. This resource script suffers from a minor problem: It&rsquo;s not dependency-scanned. If we edit any file included by it &ndash; for example the <code>.rc2<\/code> file, it&rsquo;s not rebuilt properly.<\/p>"},{"title":"Disabling the Cancel button in a Wizard","link":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/09\/disabling-the-cancel-button-in-a-wizard\/","pubDate":"Fri, 09 Jan 2004 13:03:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/09\/disabling-the-cancel-button-in-a-wizard\/","description":"<p><code>CPropertySheet<\/code> provides the <code>SetWizardButtons<\/code> function, allowing you to enable or disable the &ldquo;Back&rdquo; or &ldquo;Next&rdquo; buttons. It doesn&rsquo;t, however, allow you to disable the &ldquo;Cancel&rdquo; button.<\/p>"},{"title":"Conflicting 'lib' target","link":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/09\/conflicting-lib-target\/","pubDate":"Fri, 09 Jan 2004 10:39:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/09\/conflicting-lib-target\/","description":"<p>empeg&rsquo;s source tree has a directory called <code>lib<\/code>, in which the core libraries used by all of our products live.\nUnfortunately, this conflicts with one of the included pseudo-targets that jam uses.<\/p>"},{"title":"Linker Command Line Length","link":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/09\/linker-command-line-length\/","pubDate":"Fri, 09 Jan 2004 10:37:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/09\/linker-command-line-length\/","description":"<p>Jam imposes a hard limit of 996 characters on command lines when built on NT. This limit is higher for other operating\nsystems, and can actually be raised to around 10Kb on Windows 2000. However, it&rsquo;s still not high enough for some link\nactions.<\/p>"},{"title":"Building Jam on Windows NT","link":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/09\/building-jam-on-windows-nt\/","pubDate":"Fri, 09 Jan 2004 10:28:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/09\/building-jam-on-windows-nt\/","description":"<p>First, you&rsquo;ll need to download jam version 2.3.2 from ftp.perforce.com in <a href=\"ftp:\/\/ftp.perforce.com\/pub\/jam\/jam-2.3.2.zip\">zip format<\/a> or <a href=\"ftp:\/\/ftp.perforce.com\/pub\/jam\/jam-2.3.2.tar.gz\">as a tar.gz<\/a><\/p>"},{"title":"Constructing a Medium-sized Project with Jam","link":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/09\/constructing-a-medium-sized-project-with-jam\/","pubDate":"Fri, 09 Jan 2004 10:27:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/09\/constructing-a-medium-sized-project-with-jam\/","description":"<h2 id=\"introduction\">Introduction<a href=\"#introduction\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>Jam is a replacement for <code>make(1)<\/code>. See <a href=\"http:\/\/www.perforce.com\/jam\/jam.html\">here<\/a> for more details.<\/p>"},{"title":"Displaying Progress in a Wizard","link":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/08\/displaying-progress-in-a-wizard\/","pubDate":"Thu, 08 Jan 2004 18:24:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/08\/displaying-progress-in-a-wizard\/","description":"<p>I&rsquo;m adding a wizard to the program that I&rsquo;m currently working on. The wizard walks the user through importing some information from a file. I&rsquo;d like to be able to display the import progress as a seamless part of the wizard.<\/p>"},{"title":"Wizard97: Watermark and Header Graphics are repeated","link":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/08\/wizard97-watermark-and-header-graphics-are-repeated\/","pubDate":"Thu, 08 Jan 2004 17:14:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/08\/wizard97-watermark-and-header-graphics-are-repeated\/","description":"<p>I was adding a new wizard to the program that I&rsquo;m currently working on, so I copied some code from a Wizard97 demo program that I wrote some time ago.<\/p>\n<p>When it comes up, the header and watermark graphics are displayed repeated.<\/p>"},{"title":"CPropertySheet vs CPropertySheetEx in Visual Studio .NET 2003","link":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/08\/cpropertysheet-vs-cpropertysheetex-in-visual-studio-net-2003\/","pubDate":"Thu, 08 Jan 2004 17:05:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/08\/cpropertysheet-vs-cpropertysheetex-in-visual-studio-net-2003\/","description":"<p>The program that I&rsquo;m working on at the moment needs a wizard to walk the user through something, and I ran into a problem with IntelliSense.<\/p>"},{"title":"Welcome","link":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/07\/welcome\/","pubDate":"Wed, 07 Jan 2004 19:16:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/07\/welcome\/","description":"<p>Welcome to <strong>differentpla.net<\/strong>, where Roger occasionally posts snippets of code and other stuff that he feels like sharing with the world.<\/p>"},{"title":"Installing Windows XP Pro on a Sony Vaio SRX87","link":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/02\/installing-windows-xp-pro-on-a-sony-vaio-srx87\/","pubDate":"Fri, 02 Jan 2004 16:52:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2004\/01\/02\/installing-windows-xp-pro-on-a-sony-vaio-srx87\/","description":"<h2 id=\"introduction\">Introduction<a href=\"#introduction\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>I&rsquo;ve recently acquired a shiny new Hitachi 7K60 hard disk to go into my laptop. The disk is 60Gb, which will hopefully\ngive me enough space to dual-boot Windows XP and Linux. I ran out of space on the 20Gb disk that the Sony comes with,\nand I had to remove Linux. The other nice thing about this disk is that it&rsquo;s a 7200 rpm disk, which should make those\naway-from-home hacking sessions go much more smoothly.<\/p>"},{"title":"Writing a Replacement Receiver Server","link":"https:\/\/blog.differentpla.net\/blog\/2003\/09\/30\/writing-a-replacement-receiver-server\/","pubDate":"Tue, 30 Sep 2003 23:01:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2003\/09\/30\/writing-a-replacement-receiver-server\/","description":"<h2 id=\"introduction\">Introduction<a href=\"#introduction\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>While I was at empeg, I wrote the original server software for the Rio Receiver. It has, shall we say, certain\nlimitations. Some of them were down to the way marketing wanted it to work, and some of them are squarely my fault.<\/p>"},{"title":"Using a Linux box to serve Rio Receiver Firmware","link":"https:\/\/blog.differentpla.net\/blog\/2003\/09\/30\/using-a-linux-box-to-serve-rio-receiver-firmware\/","pubDate":"Tue, 30 Sep 2003 23:00:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2003\/09\/30\/using-a-linux-box-to-serve-rio-receiver-firmware\/","description":"<p>First, you&rsquo;ll need to install a stock NFS server. On Debian, that&rsquo;s as simple as <code>apt-get install nfs-user-server<\/code>.<\/p>"},{"title":"Using FindWindow in an MFC application","link":"https:\/\/blog.differentpla.net\/blog\/2003\/08\/05\/findwindow-mfc\/","pubDate":"Tue, 05 Aug 2003 12:46:22 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2003\/08\/05\/findwindow-mfc\/","description":"<p>There are at least two reasons for using <code>FindWindow<\/code>.<\/p>\n<ul>\n<li>To activate the previous instance of your application.<\/li>\n<li>To close your application while the installer is upgrading it.<\/li>\n<\/ul>\n<h2 id=\"changing-window-class-names-in-mfc\">Changing window class names in MFC<a href=\"#changing-window-class-names-in-mfc\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>Unfortunately, <code>FindWindow<\/code> is only really guaranteed to return your application&rsquo;s main window if you use a unique class\nname.  If you&rsquo;re using MFC, you&rsquo;ll find this a little difficult: MFC automatically generates class names of the form\n&ldquo;Afx:400000:8:10011:0:7e0c0b&rdquo;.<\/p>"},{"title":"Using ON_COMMAND_RANGE and ON_UPDATE_COMMAND_UI_RANGE","link":"https:\/\/blog.differentpla.net\/blog\/2003\/07\/07\/using-on_command_range-and-on_update_command_ui_range\/","pubDate":"Mon, 07 Jul 2003 17:13:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2003\/07\/07\/using-on_command_range-and-on_update_command_ui_range\/","description":"<p>The <code>ON_COMMAND_RANGE<\/code> and <code>ON_UPDATE_COMMAND_UI_RANGE<\/code> macros are useful when you want to treat a group of commands\nsimilarly. In this case, it&rsquo;s the commands for changing list view style. The command IDs must be contiguous, and you\nmust specify the lower one first.<\/p>"},{"title":"RJ45\/UTP Crimps","link":"https:\/\/blog.differentpla.net\/blog\/2003\/06\/23\/rj45utp-crimps\/","pubDate":"Mon, 23 Jun 2003 15:16:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2003\/06\/23\/rj45utp-crimps\/","description":"<p>(Seen from the bottom of the connector, so that the tab is facing away from you, and the gold pins are facing towards you) Pin 1 is on the left. Pin 8 is on the right.<\/p>"},{"title":"Many to One Dependencies","link":"https:\/\/blog.differentpla.net\/blog\/2003\/04\/17\/dialog-mainwnd\/","pubDate":"Thu, 17 Apr 2003 09:30:46 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2003\/04\/17\/dialog-mainwnd\/","description":"<h2 id=\"using-a-modal-dialog-as-a-main-window\">Using a modal dialog as a main window<a href=\"#using-a-modal-dialog-as-a-main-window\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>If you ask the MFC AppWizard to generate a dialog-based application, it generates code that looks like this:<\/p>"},{"title":"Putting control bars in a dialog","link":"https:\/\/blog.differentpla.net\/blog\/2003\/04\/17\/putting-control-bars-in-a-dialog\/","pubDate":"Thu, 17 Apr 2003 08:30:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2003\/04\/17\/putting-control-bars-in-a-dialog\/","description":"<p>There&rsquo;s some discussion of this in Microsoft Knowledge Base Article\n<a href=\"http:\/\/support.microsoft.com\/default.aspx?scid=kb;en-us;141751\">Q141751<\/a>.<\/p>"},{"title":"Using background threads for long processes in MFC: Background Thread 4","link":"https:\/\/blog.differentpla.net\/blog\/2003\/04\/15\/bgthreads-background4\/","pubDate":"Tue, 15 Apr 2003 11:54:39 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2003\/04\/15\/bgthreads-background4\/","description":"<p>The reason that our previous example consumes 100% CPU is that it busy-waits while pumping messages. The correct answer\nis to run the dialog box modally. However, we can&rsquo;t (easily) use <code>DoModal<\/code>, because this causes ordering problems. Do we\ncreate the thread or the dialog first?<\/p>"},{"title":"Using background threads for long processes in MFC: Background Thread 3","link":"https:\/\/blog.differentpla.net\/blog\/2003\/04\/15\/bgthreads-background3\/","pubDate":"Tue, 15 Apr 2003 11:53:39 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2003\/04\/15\/bgthreads-background3\/","description":"<p>One simple way to run the task in the background, while reporting progress, which still allows the dialog to be\nrepainted\/moved correctly is to busy-wait for the background thread to finish, while pumping messages:<\/p>"},{"title":"Using background threads for long processes in MFC: Background Thread 2","link":"https:\/\/blog.differentpla.net\/blog\/2003\/04\/15\/bgthreads-background2\/","pubDate":"Tue, 15 Apr 2003 11:52:39 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2003\/04\/15\/bgthreads-background2\/","description":"<p>We can solve the problem of the memory leak, and of the premature destructor call, by simply blocking until the thread\nis finished:<\/p>"},{"title":"Using background threads for long processes in MFC: Background Thread 1","link":"https:\/\/blog.differentpla.net\/blog\/2003\/04\/15\/bgthreads-background1\/","pubDate":"Tue, 15 Apr 2003 11:51:39 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2003\/04\/15\/bgthreads-background1\/","description":"<p>We add another button to the dialog:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-c++\" data-lang=\"c++\"><span class=\"line\"><span class=\"cl\"><span class=\"kt\">void<\/span> <span class=\"n\">CBgthreadDlg<\/span><span class=\"o\">::<\/span><span class=\"n\">OnBackground<\/span><span class=\"p\">()<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"c1\">\/\/ Run on a background thread. Don&#39;t wait for the thread to exit.\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"n\">TaskThread<\/span> <span class=\"n\">t<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"n\">t<\/span><span class=\"p\">.<\/span><span class=\"n\">Start<\/span><span class=\"p\">();<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">}<\/span><\/span><\/span><\/code><\/pre><\/div>\n<p>This uses the code from <a href=\"https:\/\/blog.differentpla.net\/blog\/2003\/04\/15\/win32-threads-in-c\/\">here<\/a> to implement the\nthread class:<\/p>"},{"title":"Using background threads for long processes in MFC: Foreground Thread 3","link":"https:\/\/blog.differentpla.net\/blog\/2003\/04\/15\/bgthreads-foreground3\/","pubDate":"Tue, 15 Apr 2003 11:43:39 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2003\/04\/15\/bgthreads-foreground3\/","description":"<p>Because we have progress reporting, we can make use of a progress dialog to partially solve all of these problems. In\nVisual C++, select &ldquo;Project|Add To Project|Components and Controls&rdquo;.<\/p>"},{"title":"Using background threads for long processes in MFC: Foreground Thread 2","link":"https:\/\/blog.differentpla.net\/blog\/2003\/04\/15\/bgthreads-foreground2\/","pubDate":"Tue, 15 Apr 2003 11:42:39 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2003\/04\/15\/bgthreads-foreground2\/","description":"<p>We can deal with the first one (no feedback), by using an hourglass:<\/p>"},{"title":"Using background threads for long processes in MFC: Foreground Thread 1","link":"https:\/\/blog.differentpla.net\/blog\/2003\/04\/15\/bgthreads-foreground1\/","pubDate":"Tue, 15 Apr 2003 11:41:39 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2003\/04\/15\/bgthreads-foreground1\/","description":"<p>Initially, we&rsquo;ll run this as a foreground task. This will ensure that the code compiles and works before we get too\ncomplicated. Also, it&rsquo;ll show why we want this task to run as a background thread.<\/p>"},{"title":"Using background threads for long processes in MFC: Sidebar: The Task","link":"https:\/\/blog.differentpla.net\/blog\/2003\/04\/15\/bgthreads-task\/","pubDate":"Tue, 15 Apr 2003 11:30:39 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2003\/04\/15\/bgthreads-task\/","description":{}},{"title":"Switching Toolbars","link":"https:\/\/blog.differentpla.net\/blog\/2003\/04\/15\/switching-toolbars\/","pubDate":"Tue, 15 Apr 2003 11:20:39 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2003\/04\/15\/switching-toolbars\/","description":"<p>MFC provides support for automatically switching menus when the active MDI child changes. Why doesn&rsquo;t it automatically\nswitch toolbars?<\/p>"},{"title":"Using background threads for long processes in MFC","link":"https:\/\/blog.differentpla.net\/blog\/2003\/04\/15\/bgthreads-intro\/","pubDate":"Tue, 15 Apr 2003 11:20:39 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2003\/04\/15\/bgthreads-intro\/","description":"<p>It&rsquo;s not easy to write a Windows program that takes a long time to do something and yet still seems responsive to the\nuser. Consider that you&rsquo;ve got a single task that needs to be finished:<\/p>"},{"title":"Win32 Threads in C++","link":"https:\/\/blog.differentpla.net\/blog\/2003\/04\/15\/win32-threads-in-c\/","pubDate":"Tue, 15 Apr 2003 10:20:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2003\/04\/15\/win32-threads-in-c\/","description":"<p>Some code.<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-c++\" data-lang=\"c++\"><span class=\"line\"><span class=\"cl\"><span class=\"cm\">\/* thread.cpp\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"cm\"> *\/<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"cp\">#define WIN32_LEAN_AND_MEAN\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"cp\">#include<\/span> <span class=\"cpf\">&lt;windows.h&gt;<\/span><span class=\"cp\">\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"cp\">#include<\/span> <span class=\"cpf\">&lt;process.h&gt;<\/span><span class=\"cp\">\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"k\">class<\/span> <span class=\"nc\">Thread<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"n\">HANDLE<\/span> <span class=\"n\">m_hThread<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"n\">UINT<\/span> <span class=\"n\">m_idThread<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"k\">public<\/span><span class=\"o\">:<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"n\">Thread<\/span><span class=\"p\">()<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"o\">:<\/span> <span class=\"n\">m_hThread<\/span><span class=\"p\">(<\/span><span class=\"nb\">NULL<\/span><span class=\"p\">),<\/span> <span class=\"n\">m_idThread<\/span><span class=\"p\">(<\/span><span class=\"mi\">0<\/span><span class=\"p\">)<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"k\">virtual<\/span> <span class=\"o\">~<\/span><span class=\"n\">Thread<\/span><span class=\"p\">()<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"n\">CloseHandle<\/span><span class=\"p\">(<\/span><span class=\"n\">m_hThread<\/span><span class=\"p\">);<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"kt\">bool<\/span> <span class=\"nf\">Start<\/span><span class=\"p\">()<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"kt\">unsigned<\/span> <span class=\"n\">threadId<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"n\">HANDLE<\/span> <span class=\"n\">hThread<\/span> <span class=\"o\">=<\/span> <span class=\"p\">(<\/span><span class=\"n\">HANDLE<\/span><span class=\"p\">)<\/span><span class=\"n\">_beginthreadex<\/span><span class=\"p\">(<\/span><span class=\"nb\">NULL<\/span><span class=\"p\">,<\/span> <span class=\"mi\">0<\/span><span class=\"p\">,<\/span> <span class=\"n\">StaticThreadRoutine<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">                        <span class=\"k\">this<\/span><span class=\"p\">,<\/span> <span class=\"n\">CREATE_SUSPENDED<\/span><span class=\"p\">,<\/span> <span class=\"o\">&amp;<\/span><span class=\"n\">threadId<\/span><span class=\"p\">);<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"k\">if<\/span> <span class=\"p\">(<\/span><span class=\"o\">!<\/span><span class=\"n\">hThread<\/span><span class=\"p\">)<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">            <span class=\"k\">return<\/span> <span class=\"nb\">false<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"n\">m_hThread<\/span> <span class=\"o\">=<\/span> <span class=\"n\">hThread<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"n\">m_idThread<\/span> <span class=\"o\">=<\/span> <span class=\"n\">threadId<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"n\">ResumeThread<\/span><span class=\"p\">(<\/span><span class=\"n\">hThread<\/span><span class=\"p\">);<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"k\">return<\/span> <span class=\"nb\">true<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"kt\">unsigned<\/span> <span class=\"nf\">Join<\/span><span class=\"p\">()<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"n\">WaitForSingleObject<\/span><span class=\"p\">(<\/span><span class=\"n\">m_hThread<\/span><span class=\"p\">,<\/span> <span class=\"n\">INFINITE<\/span><span class=\"p\">);<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"n\">DWORD<\/span> <span class=\"n\">result<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"n\">GetExitCodeThread<\/span><span class=\"p\">(<\/span><span class=\"n\">m_hThread<\/span><span class=\"p\">,<\/span> <span class=\"o\">&amp;<\/span><span class=\"n\">result<\/span><span class=\"p\">);<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"k\">return<\/span> <span class=\"n\">result<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"k\">protected<\/span><span class=\"o\">:<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"k\">virtual<\/span> <span class=\"kt\">unsigned<\/span> <span class=\"n\">Run<\/span><span class=\"p\">()<\/span> <span class=\"o\">=<\/span> <span class=\"mi\">0<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"k\">private<\/span><span class=\"o\">:<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"k\">static<\/span> <span class=\"kt\">unsigned<\/span> <span class=\"kr\">__stdcall<\/span> <span class=\"n\">StaticThreadRoutine<\/span><span class=\"p\">(<\/span><span class=\"kt\">void<\/span> <span class=\"o\">*<\/span><span class=\"n\">pParams<\/span><span class=\"p\">)<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"k\">return<\/span> <span class=\"k\">static_cast<\/span><span class=\"o\">&lt;<\/span><span class=\"n\">Thread<\/span> <span class=\"o\">*&gt;<\/span><span class=\"p\">(<\/span><span class=\"n\">pParams<\/span><span class=\"p\">)<\/span><span class=\"o\">-&gt;<\/span><span class=\"n\">Run<\/span><span class=\"p\">();<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">};<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"k\">class<\/span> <span class=\"nc\">MyThread<\/span> <span class=\"o\">:<\/span> <span class=\"k\">public<\/span> <span class=\"n\">Thread<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"k\">protected<\/span><span class=\"o\">:<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"k\">virtual<\/span> <span class=\"kt\">unsigned<\/span> <span class=\"n\">Run<\/span><span class=\"p\">()<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"n\">Sleep<\/span><span class=\"p\">(<\/span><span class=\"mi\">1000<\/span><span class=\"p\">);<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"k\">return<\/span> <span class=\"mi\">0<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">};<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"kt\">int<\/span> <span class=\"nf\">main<\/span><span class=\"p\">(<\/span><span class=\"kt\">void<\/span><span class=\"p\">)<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"n\">MyThread<\/span> <span class=\"o\">*<\/span><span class=\"n\">myThread<\/span> <span class=\"o\">=<\/span> <span class=\"k\">new<\/span> <span class=\"n\">MyThread<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"n\">myThread<\/span><span class=\"o\">-&gt;<\/span><span class=\"n\">Start<\/span><span class=\"p\">();<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"n\">myThread<\/span><span class=\"o\">-&gt;<\/span><span class=\"n\">Join<\/span><span class=\"p\">();<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"k\">delete<\/span> <span class=\"n\">myThread<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"k\">return<\/span> <span class=\"mi\">0<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">}<\/span><\/span><\/span><\/code><\/pre><\/div>"},{"title":"empeg: Serial Port Commands","link":"https:\/\/blog.differentpla.net\/blog\/2003\/04\/02\/empeg-serial-port-commands\/","pubDate":"Wed, 02 Apr 2003 10:29:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2003\/04\/02\/empeg-serial-port-commands\/","description":"<p>You can send the empeg player commands using the serial port. This is a list.<\/p>"},{"title":"other_mem_fun and std::for_each","link":"https:\/\/blog.differentpla.net\/blog\/2003\/02\/27\/other_mem_fun-and-stdfor_each\/","pubDate":"Thu, 27 Feb 2003 14:53:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2003\/02\/27\/other_mem_fun-and-stdfor_each\/","description":"<p>How many times have you found yourself writing something like the following?<\/p>"},{"title":"Linux on Sony Vaio - Connecting an iPod","link":"https:\/\/blog.differentpla.net\/blog\/2003\/02\/04\/linux-on-sony-vaio-connecting-an-ipod\/","pubDate":"Tue, 04 Feb 2003 15:10:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2003\/02\/04\/linux-on-sony-vaio-connecting-an-ipod\/","description":"<p><strong>Note:<\/strong> This is a preliminary version of this document. I&rsquo;ve not fully verified that the stuff in here works.<\/p>"},{"title":"Using make-kpkg to build a custom Linux kernel for your VAIO","link":"https:\/\/blog.differentpla.net\/blog\/2003\/02\/04\/using-make-kpkg-to-build-a-custom-linux-kernel-for-your-vaio\/","pubDate":"Tue, 04 Feb 2003 15:10:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2003\/02\/04\/using-make-kpkg-to-build-a-custom-linux-kernel-for-your-vaio\/","description":"<p>Debian provides a powerful utility called <code>make-kpkg<\/code> for compiling your own custom kernels. It integrates tightly with\ndpkg by making <code>.deb<\/code> files and you can even use this to prepare your kernel image on a faster system. Later on it will\nmake complex operations, such as compiling in patches and modules, a snap.<\/p>"},{"title":"Linux on Sony Vaio - Firewire DVD-ROM drive","link":"https:\/\/blog.differentpla.net\/blog\/2003\/02\/04\/linux-on-sony-vaio-firewire-dvd-rom-drive\/","pubDate":"Tue, 04 Feb 2003 14:47:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2003\/02\/04\/linux-on-sony-vaio-firewire-dvd-rom-drive\/","description":"<p>To get the DVD-ROM drive working, you&rsquo;ll need to compile your kernel with the following options:<\/p>"},{"title":"Linux on Sony Vaio - Intel i820 onboard soundcard","link":"https:\/\/blog.differentpla.net\/blog\/2003\/01\/17\/linux-on-sony-vaio-intel-i820-onboard-soundcard\/","pubDate":"Fri, 17 Jan 2003 14:39:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2003\/01\/17\/linux-on-sony-vaio-intel-i820-onboard-soundcard\/","description":"<p><strong>Note:<\/strong> Caoilte wrote this. I&rsquo;ve not had a chance to check it yet.<\/p>"},{"title":"Linux on Sony Vaio - Built-in Wireless","link":"https:\/\/blog.differentpla.net\/blog\/2003\/01\/14\/linux-on-sony-vaio-built-in-wireless\/","pubDate":"Tue, 14 Jan 2003 15:50:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2003\/01\/14\/linux-on-sony-vaio-built-in-wireless\/","description":"<p>First, you&rsquo;ll need to recompile your kernel, with the following options:<\/p>"},{"title":"Vaio: ACPI patches","link":"https:\/\/blog.differentpla.net\/blog\/2003\/01\/13\/vaio-acpi-patches\/","pubDate":"Mon, 13 Jan 2003 16:03:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2003\/01\/13\/vaio-acpi-patches\/","description":"<p>You&rsquo;ll need to install the ACPI patches, and the ACPI daemon. Grab the patches from <a href=\"http:\/\/sourceforge.net\/project\/showfiles.php?group_id=36832\">here<\/a>, and apply them to the kernel:<\/p>"},{"title":"Linux on Sony Vaio - Miscellaneous","link":"https:\/\/blog.differentpla.net\/blog\/2003\/01\/13\/linux-on-sony-vaio-miscellaneous\/","pubDate":"Mon, 13 Jan 2003 15:53:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2003\/01\/13\/linux-on-sony-vaio-miscellaneous\/","description":"<p>A <a href=\"http:\/\/life.bio.sunysb.edu\/~jhajagos\/linux\/SRX87\/\">page<\/a> that I found recommends installing the <code>spicctrl<\/code> and <code>sjog<\/code> packages to get control over the LCD brightness and JogDial.<\/p>"},{"title":"Linux on Sony Vaio - Installing XFree86","link":"https:\/\/blog.differentpla.net\/blog\/2003\/01\/13\/linux-on-sony-vaio-installing-xfree86\/","pubDate":"Mon, 13 Jan 2003 15:44:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2003\/01\/13\/linux-on-sony-vaio-installing-xfree86\/","description":"<h2 id=\"xfree86\">XFree86<a href=\"#xfree86\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>According to <a href=\"http:\/\/jhecking.netgaroo.com\/asus_m1300.html\">this page<\/a>, the\nDebian xserver-xfree86 package includes support for the Intel i815 chipset in\nthe SRX87, so grab that using dselect or similar.<\/p>"},{"title":"Linux on Sony Vaio - Upgrading to a 2.4 kernel and ext3","link":"https:\/\/blog.differentpla.net\/blog\/2003\/01\/13\/linux-on-sony-vaio-upgrading-to-a-24-kernel-and-ext3\/","pubDate":"Mon, 13 Jan 2003 15:11:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2003\/01\/13\/linux-on-sony-vaio-upgrading-to-a-24-kernel-and-ext3\/","description":"<h2 id=\"upgrading-to-a-24-kernel\">Upgrading to a 2.4 kernel<a href=\"#upgrading-to-a-24-kernel\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>In dselect, install <code>kernel-image-2.4.18-686<\/code>. This will drag in all of the other required packages for a 2.4 kernel. It&rsquo;ll suggest <code>kernel-pcmcia-modules-2.4.18-686<\/code> as well. You might as well select this as well.<\/p>"},{"title":"Installing Debian GNU\/Linux on Sony Vaio SRX87","link":"https:\/\/blog.differentpla.net\/blog\/2003\/01\/13\/installing-debian-gnulinux-on-sony-vaio-srx87\/","pubDate":"Mon, 13 Jan 2003 15:10:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2003\/01\/13\/installing-debian-gnulinux-on-sony-vaio-srx87\/","description":"<p>Because the DVD-ROM drive supplied with the SRX87 is Firewire, and is not\nsupported by the standard Debian boot images, you&rsquo;ll need to use network\nbooting (using PXE) to get it going. This\n<a href=\"http:\/\/theo.me.uk\/pages.shtml?page=debremoteboot\">page<\/a> has some instructions\nfor installing Debian in this manner.<\/p>"},{"title":"Including resources in Static Library projects","link":"https:\/\/blog.differentpla.net\/blog\/2002\/07\/31\/resources-in-static-libs\/","pubDate":"Wed, 31 Jul 2002 17:11:03 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2002\/07\/31\/resources-in-static-libs\/","description":"<h2 id=\"introduction\">Introduction<a href=\"#introduction\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>Consider the following situation:<\/p>\n<p>You&rsquo;ve got an MFC application, which uses a lot of static libraries to do a lot of the work. These libraries need to\ninteract with the user (perhaps they&rsquo;ve got dialog boxes in them). Unfortunately, Visual C++ and MFC effectively force\nyou to store all of your resources in the main application .rc file. This makes it difficult to use the static library\n(with the same resources) in multiple projects. Moreover, it makes the library dependent on the main application, for\nthe resource IDs.<\/p>"},{"title":"Finding duplicate files","link":"https:\/\/blog.differentpla.net\/blog\/2002\/04\/01\/finding-duplicate-files\/","pubDate":"Mon, 01 Apr 2002 23:00:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2002\/04\/01\/finding-duplicate-files\/","description":"<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-text\" data-lang=\"text\"><span class=\"line\"><span class=\"cl\">$ find . -type f -print0 |\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    xargs -0 md5sum &gt; MD5SUMS\n<\/span><\/span><span class=\"line\"><span class=\"cl\">$ sort &lt; MD5SUMS | uniq -D -w 32 &gt; DUPLICATES<\/span><\/span><\/code><\/pre><\/div>\n<p>&hellip;or the complicated way&hellip;<\/p>"},{"title":"Lazy Bastard's Guide to Cloning your empeg","link":"https:\/\/blog.differentpla.net\/blog\/2002\/03\/18\/lazy-bastards-guide-to-cloning-your-empeg\/","pubDate":"Mon, 18 Mar 2002 07:59:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2002\/03\/18\/lazy-bastards-guide-to-cloning-your-empeg\/","description":{}},{"title":"empeg files","link":"https:\/\/blog.differentpla.net\/blog\/2002\/03\/07\/empeg-files\/","pubDate":"Thu, 07 Mar 2002 12:21:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2002\/03\/07\/empeg-files\/","description":"<p>Some stripped down utilities for the empeg:<\/p>"},{"title":"Installing rsh on the empeg","link":"https:\/\/blog.differentpla.net\/blog\/2002\/03\/07\/empeg-rsh-client\/","pubDate":"Thu, 07 Mar 2002 12:21:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2002\/03\/07\/empeg-rsh-client\/","description":"<p>Grab a copy of rsh-client from the debian archive.<\/p>\n<p>You&rsquo;ll need a line saying <code>root::0:0:root:\/:\/bin\/sh<\/code> in <code>\/etc\/passwd<\/code> on the empeg.<\/p>"},{"title":"Using rsync to Synchronise empegs","link":"https:\/\/blog.differentpla.net\/blog\/2002\/03\/07\/using-rsync-to-synchronise-empegs\/","pubDate":"Thu, 07 Mar 2002 12:21:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2002\/03\/07\/using-rsync-to-synchronise-empegs\/","description":"<h2 id=\"introduction\">Introduction<a href=\"#introduction\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>A while ago, I published my <a href=\"https:\/\/blog.differentpla.net\/blog\/2002\/03\/18\/lazy-bastards-guide-to-cloning-your-empeg\/\">Lazy Bastard&rsquo;s Guide to Cloning your empeg<\/a>. This has worked successfully for me and other people.\nHowever, it has one major limitation &ndash; it&rsquo;s an all-or-nothing operation &ndash; it clones the entire empeg. If you add a\nbunch of tracks to one of your empegs, you end up having to copy <em>all<\/em> of your tracks again.<\/p>"},{"title":"Jam - Separate Release\/Debug Target Directories","link":"https:\/\/blog.differentpla.net\/blog\/2002\/02\/01\/jam-separate-releasedebug-target-directories\/","pubDate":"Fri, 01 Feb 2002 12:05:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2002\/02\/01\/jam-separate-releasedebug-target-directories\/","description":"<p>By default, AppWizard-generated applications use separate directories for the output of the different debug and release builds. We&rsquo;d like to replicate that functionality.<\/p>"},{"title":"Rio Receiver: Layout Definitions","link":"https:\/\/blog.differentpla.net\/blog\/2002\/01\/22\/rio-receiver-layout-definitions\/","pubDate":"Tue, 22 Jan 2002 18:06:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2002\/01\/22\/rio-receiver-layout-definitions\/","description":"<h2 id=\"introduction\">Introduction<a href=\"#introduction\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>Inspired by the stirling effort that David Schuetz has put into deciphering the layout definitions for the Rio Receiver (see <a href=\"http:\/\/www.dasnet.org\/David\/Rio\/Layout.html\">here<\/a>), I&rsquo;ve decided to expand on his work.<\/p>"},{"title":"Streaming to Winamp","link":"https:\/\/blog.differentpla.net\/blog\/2001\/12\/18\/streaming-to-winamp\/","pubDate":"Tue, 18 Dec 2001 22:44:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2001\/12\/18\/streaming-to-winamp\/","description":"<p>Since the Audio Receiver Manager (the server) uses HTTP to stream the MP3 data to the Rio Receiver, it&rsquo;s possible (with some work) to stream directly to Winamp. Here&rsquo;s how.<\/p>"},{"title":"Advanced Searches in emplode v2.0","link":"https:\/\/blog.differentpla.net\/blog\/2001\/10\/25\/advanced-searches-in-emplode-v20\/","pubDate":"Thu, 25 Oct 2001 19:29:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2001\/10\/25\/advanced-searches-in-emplode-v20\/","description":"<p>emplode v2.0 adds the ability to search your music database. It provides two methods of doing this: simple searches (which are hopefully so simple that I won&rsquo;t explain them here), and advanced searches.<\/p>"},{"title":"Diagnosing Synchronisation Errors","link":"https:\/\/blog.differentpla.net\/blog\/2001\/10\/25\/diagnosing-synchronisation-errors\/","pubDate":"Thu, 25 Oct 2001 19:29:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2001\/10\/25\/diagnosing-synchronisation-errors\/","description":"<p><em>Note that this only applies to v1.x car player software. v2.x uses a different error numbering scheme.<\/em><\/p>"},{"title":"Enumerating interfaces supported by a COM object","link":"https:\/\/blog.differentpla.net\/blog\/2001\/10\/03\/enumerating-com-interfaces\/","pubDate":"Wed, 03 Oct 2001 15:58:50 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2001\/10\/03\/enumerating-com-interfaces\/","description":"<p>The best way I&rsquo;ve found to do this is to enumerate the <code>HKCR\\Interface<\/code> registry key and query your object to see which ones it supports.<\/p>"},{"title":"Scanner trials and tribulations","link":"https:\/\/blog.differentpla.net\/blog\/2001\/09\/25\/scanner-trials-and-tribulations\/","pubDate":"Tue, 25 Sep 2001 15:50:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2001\/09\/25\/scanner-trials-and-tribulations\/","description":"<p>This morning, I decided to buy myself a scanner. I&rsquo;m planning on using it for document filing &ndash; keeping my credit card statements on CDROM, etc.<\/p>"},{"title":"Building a DLL with Jam","link":"https:\/\/blog.differentpla.net\/blog\/2001\/07\/16\/building-a-dll-with-jam\/","pubDate":"Mon, 16 Jul 2001 10:29:57 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2001\/07\/16\/building-a-dll-with-jam\/","description":"<h2 id=\"introduction\">Introduction<a href=\"#introduction\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>empeg&rsquo;s code base contains several Windows DLL projects. I&rsquo;m going to investigate getting these built with jam the <a href=\"https:\/\/blog.differentpla.net\/blog\/2001\/07\/14\/building-an-mfc-application-with-jam\/\">same way<\/a> as I did for the MFC applications &ndash; by building a simple project with the AppWizard, and getting the project built.<\/p>"},{"title":"Remote Debugging With Visual C++","link":"https:\/\/blog.differentpla.net\/blog\/2001\/07\/16\/remote-debugging\/","pubDate":"Mon, 16 Jul 2001 10:29:57 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2001\/07\/16\/remote-debugging\/","description":"<h2 id=\"overview\">Overview<a href=\"#overview\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>This document contains some quick tips for getting remote debugging with Visual C++ working. The document was originally\nwritten by Roger Lipscombe to cover VC5. Rei Wilkinson reviewed it, and added some stuff for VC6 use.<\/p>"},{"title":"Building an MFC Application with Jam","link":"https:\/\/blog.differentpla.net\/blog\/2001\/07\/14\/building-an-mfc-application-with-jam\/","pubDate":"Sat, 14 Jul 2001 00:25:38 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2001\/07\/14\/building-an-mfc-application-with-jam\/","description":"<h2 id=\"introduction\">Introduction<a href=\"#introduction\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>Since the majority of our Windows applications are written using MFC, it&rsquo;s a useful experiment to get jam to build a freshly-generated MFC application. Once we&rsquo;ve got this working, we can turn our attention to the things that make our build process different.<\/p>"},{"title":"Jam SubDir Rule","link":"https:\/\/blog.differentpla.net\/blog\/2001\/07\/13\/jam-subdir-rule\/","pubDate":"Fri, 13 Jul 2001 18:25:38 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2001\/07\/13\/jam-subdir-rule\/","description":"<h2 id=\"introduction\">Introduction<a href=\"#introduction\"><span class=\"icon icon-link\"><\/span><\/a>\n<\/h2>\n<p>Now we&rsquo;ve built <a href=\"https:\/\/blog.differentpla.net\/blog\/2001\/07\/14\/building-an-mfc-application-with-jam\/\">an MFC application<\/a>\nand <a href=\"https:\/\/blog.differentpla.net\/blog\/2001\/07\/16\/building-a-dll-with-jam\/\">a DLL<\/a>, we&rsquo;d like to include them in\nthe same build process. This is what Jam&rsquo;s <code>SubDir<\/code> rule does.<\/p>"},{"title":"Building an MFC Application with Jam: Building within Developer Studio","link":"https:\/\/blog.differentpla.net\/blog\/2001\/07\/13\/building-jamfile-within-developer-studio\/","pubDate":"Fri, 13 Jul 2001 11:42:08 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2001\/07\/13\/building-jamfile-within-developer-studio\/","description":"<p>While getting our MFC application to build with Jam, we got to a point where it would compile and link, but wouldn&rsquo;t\nrun.  This calls for a trip into the debugger.  The simplest thing might be to just run the executable within Developer\nStudio.<\/p>"},{"title":"RPC_X_NULL_REF_POINTER - what?","link":"https:\/\/blog.differentpla.net\/blog\/2001\/07\/10\/rpc-x-null-ptr\/","pubDate":"Tue, 10 Jul 2001 09:44:57 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2001\/07\/10\/rpc-x-null-ptr\/","description":"<p>I just came across a problem where <code>IEnumFoo::Next<\/code> was returning<code>RPC_X_NULL_REF_POINTER<\/code>. Of course, the first thing that I did wasundertake a search in MSDN, and with Google to see if I could find anyexplanation of what the problem is.<\/p>"},{"title":"Many to One Dependencies","link":"https:\/\/blog.differentpla.net\/blog\/2001\/07\/10\/many-one-deps-vc\/","pubDate":"Tue, 10 Jul 2001 09:44:50 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2001\/07\/10\/many-one-deps-vc\/","description":"<p>There are times when you want to have multiple input files in a Visual C++ project configured to generate the same\noutput file. For example, you want to catenate a bunch of files to generate a file to be #included.<\/p>"},{"title":"Using [iid_is] gives me stack overflows. What's with that?","link":"https:\/\/blog.differentpla.net\/blog\/2001\/07\/10\/iid-is-oleautomation\/","pubDate":"Tue, 10 Jul 2001 09:44:50 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2001\/07\/10\/iid-is-oleautomation\/","description":"<p>The problem here is that you have a piece of IDL like this, where you want to be able to specify the IID of the returned interface.<\/p>"},{"title":"Building Shared Libraries (DLLs)","link":"https:\/\/blog.differentpla.net\/blog\/2001\/07\/04\/shared-lib-rule\/","pubDate":"Wed, 04 Jul 2001 07:00:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2001\/07\/04\/shared-lib-rule\/","description":"<p>The default Jambase file doesn&rsquo;t come with a rule to make DLLs (or shared libraries in the Unix parlance).<\/p>"},{"title":"TMC PCI48AF Front Panel Connectors","link":"https:\/\/blog.differentpla.net\/blog\/2001\/06\/01\/pci48af-header_j23\/","pubDate":"Fri, 01 Jun 2001 11:47:28 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2001\/06\/01\/pci48af-header_j23\/","description":"<p>This information comes (indirectly) from TMC UK.<\/p>\n<p>The front panel connectors go onto header J23, as follows:<\/p>"},{"title":"TMC PCI48AF PCI Slots","link":"https:\/\/blog.differentpla.net\/blog\/2001\/06\/01\/pci48af-pci-slots\/","pubDate":"Fri, 01 Jun 2001 11:46:28 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2001\/06\/01\/pci48af-pci-slots\/","description":"<p>A diagram of the PCI slots on the TMC PCI48AF motherboard.<\/p>"},{"title":"TMC PCI48AF Miscellaneous Jumpers","link":"https:\/\/blog.differentpla.net\/blog\/2001\/06\/01\/pci48af-jumpers\/","pubDate":"Fri, 01 Jun 2001 11:45:28 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2001\/06\/01\/pci48af-jumpers\/","description":{}},{"title":"TMC PCI48AF Main Memory Installation","link":"https:\/\/blog.differentpla.net\/blog\/2001\/06\/01\/pci48af-memory\/","pubDate":"Fri, 01 Jun 2001 11:44:28 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2001\/06\/01\/pci48af-memory\/","description":{}},{"title":"TMC PCI48AF CPU Jumpers","link":"https:\/\/blog.differentpla.net\/blog\/2001\/06\/01\/pci48af-cpu\/","pubDate":"Fri, 01 Jun 2001 11:43:28 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2001\/06\/01\/pci48af-cpu\/","description":{}},{"title":"TMC PCI48AF Specifications","link":"https:\/\/blog.differentpla.net\/blog\/2001\/06\/01\/pci48af-specifications\/","pubDate":"Fri, 01 Jun 2001 11:42:28 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2001\/06\/01\/pci48af-specifications\/","description":{}},{"title":"TMC PCI48AF Motherboard","link":"https:\/\/blog.differentpla.net\/blog\/2001\/06\/01\/pci48af\/","pubDate":"Fri, 01 Jun 2001 11:41:28 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2001\/06\/01\/pci48af\/","description":"<p>A while back, I was trying to get a computer built out of some spare parts to run Linux in the corner of the office.\nHowever, I had some trouble with random lockups. I think it had something to do with the memory configuration of the\nmotherboard.<\/p>"},{"title":"Moving Message Sign","link":"https:\/\/blog.differentpla.net\/blog\/2001\/06\/01\/moving-message-sign\/","pubDate":"Fri, 01 Jun 2001 10:41:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2001\/06\/01\/moving-message-sign\/","description":"<p>A couple of weeks ago, we got an LED message board at work. They had them on offer at Maplin (if I recall correctly).\nAnyway, the manual with the board is singularly useless. It&rsquo;s labelled &ldquo;Moving Message Sign&rdquo;, and has a picture of the\ndisplay with &ldquo;Taiwan Kingpul&rdquo; on it.<\/p>"},{"title":"Internet Explorer 5 displays the wrong language","link":"https:\/\/blog.differentpla.net\/blog\/2001\/05\/13\/internet-explorer-5-displays-the-wrong-language\/","pubDate":"Sun, 13 May 2001 23:00:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2001\/05\/13\/internet-explorer-5-displays-the-wrong-language\/","description":"<p>Recently, while wandering along to my local <a href=\"http:\/\/www.uk.debian.org\/\">Debian mirror<\/a>, I was surprised by the fact that it decided to come up in an Asian script.<\/p>"},{"title":"Displaying a transparent CAnimateCtrl in a dialog","link":"https:\/\/blog.differentpla.net\/blog\/2001\/03\/29\/displaying-a-transparent-canimatectrl-in-a-dialog\/","pubDate":"Thu, 29 Mar 2001 23:00:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2001\/03\/29\/displaying-a-transparent-canimatectrl-in-a-dialog\/","description":"<p>Microsoft&rsquo;s knowledge base article, <a href=\"http:\/\/support.microsoft.com\/default.aspx?scid=kb;en-us;Q179907\">Q179907<\/a> explains how to use a transparent CAnimateCtrl in a CView or a CDialog.<\/p>"},{"title":"Asus A7V Linux Box","link":"https:\/\/blog.differentpla.net\/blog\/2000\/12\/08\/asus-a7v-linux-box\/","pubDate":"Fri, 08 Dec 2000 00:02:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2000\/12\/08\/asus-a7v-linux-box\/","description":"<p>Having been so impressed with the speed of Linux on the A7V (see <a href=\"https:\/\/blog.differentpla.net\/blog\/2000\/12\/08\/asus-a7v-windows-box\/\">here<\/a>), I accidentally slipped while in <a href=\"http:\/\/www.cambridge-computers.com\/\">Cambridge Computers<\/a> and bought another one.<\/p>"},{"title":"Asus A7V Windows Box","link":"https:\/\/blog.differentpla.net\/blog\/2000\/12\/08\/asus-a7v-windows-box\/","pubDate":"Fri, 08 Dec 2000 00:01:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2000\/12\/08\/asus-a7v-windows-box\/","description":"<p>As mentioned <a href=\"https:\/\/blog.differentpla.net\/blog\/2000\/12\/08\/overclockerscouk-power-supplies\/\">here<\/a>, my Pentium II-400 got fried by an ocuk power supply. As they say, however: Every cloud has a silver lining. With a dead computer, I could finally persuade my girlfriend that some long-overdue upgrades were necessary.<\/p>"},{"title":"Overclockers.co.uk Power Supplies","link":"https:\/\/blog.differentpla.net\/blog\/2000\/12\/08\/overclockerscouk-power-supplies\/","pubDate":"Fri, 08 Dec 2000 00:00:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2000\/12\/08\/overclockerscouk-power-supplies\/","description":"<p>I don&rsquo;t know if there&rsquo;s something in particular about Overclockers.co.uk, but we&rsquo;ve not had any good experiences with their power supplies. We&rsquo;ve had two power supplies from ocuk, and they&rsquo;ve both gone horribly wrong, and fried a whole shedload of hardware.<\/p>"},{"title":"Windows 2000 Explorer Web View and Media Files","link":"https:\/\/blog.differentpla.net\/blog\/2000\/10\/26\/windows-2000-explorer-web-view-and-media-files\/","pubDate":"Thu, 26 Oct 2000 16:29:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2000\/10\/26\/windows-2000-explorer-web-view-and-media-files\/","description":"<p><strong>Warning:<\/strong> I&rsquo;ve recently received a couple of emails stating that this\ntechnique totally breaks Web View in Windows Explorer. Use it at your\nown risk. Back up any files you change.<\/p>"},{"title":"Internet Explorer displays MP3 files, rather than downloading them","link":"https:\/\/blog.differentpla.net\/blog\/2000\/10\/25\/internet-explorer-displays-mp3-files-rather-than-downloading-them\/","pubDate":"Wed, 25 Oct 2000 23:00:00 +0000","guid":"https:\/\/blog.differentpla.net\/blog\/2000\/10\/25\/internet-explorer-displays-mp3-files-rather-than-downloading-them\/","description":"<p>This one&rsquo;s very rare. I don&rsquo;t anticipate it ever happening to anyone\nelse. It did, however, happen to me, so I thought I&rsquo;d share it.<\/p>"}]}}