Skip to content

Instantly share code, notes, and snippets.

rduplain /
Last active November 28, 2019 00:17
Vagrantfiles for testing configuration management (Ansible).

Vagrantfiles for testing configuration management (Ansible).


Configuration management that runs over SSH, namely Ansible, benefits in having test machines available on the network. The enclosed Vagrantfiles provide multiple virtual machines to run as guests on the developer's machine. The guests appear as hosts on the LAN, providing a local ephemeral cloud.

The virtual machines here are similar, but different. One provides **Ubuntu

rduplain / refresh-hosts.bash
Last active November 8, 2019 21:55
Refresh /etc/hosts file with unpublished IPv4 aliases.
View refresh-hosts.bash
#!/usr/bin/env bash
# Refresh /etc/hosts file with unpublished IPv4 aliases.
# Set /etc/hosts.alias with domain/alias pairs, one pair per line:
# server-alias
# another
rduplain / nginx-site-include.conf
Last active November 8, 2019 21:55
Configuration files for deployment on a single server.
View nginx-site-include.conf
# nginx configuration
# gzip is enabled, but only used by clients requesting it:
# curl -H 'Accept-Encoding: gzip,deflate' -sSL
server {
listen 80;
pbostrom /
Last active December 10, 2022 03:16
Loading third-party npm modules in ClojureScript

Loading third-party npm modules in ClojureScript

This example shows how to load the re-resizable npm module which provides a resizable React component. Requires the lein-npm plugin.

  1. Add the npm module to the :npm :dependencies section of project.clj:
 :npm {:package {:scripts {:build "webpack -p"}}
       :dependencies [[react "16.4.0"]
                      [react-dom "16.4.0"]
                      ["@cljs-oss/module-deps" "1.1.1"]
vidia / nginx-unificontroller.conf
Last active January 26, 2023 16:15
Example, working, NGINX config for proxying to Unifi Controller software and using letsencrypt. Includes websocket fix.
View nginx-unificontroller.conf
# I had a bit of trouble getting my unifi controller (hosted offsite) to use a proxy/letsencrypt. So here are the fruits of my labor.
# The unifi default port is 8443 running on localhost.
# License: CC0 (Public Domain)
server {
# SSL configuration
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
rduplain /
Last active April 10, 2019 01:48
Code Quarterly's 2011 Q&A with Rich Hickey, by Michael Fogus

From the Archives: Code Quarterly's 2011 Q&A with Rich Hickey

Rich Hickey is frequently quoted as saying:

You can reach a point with Lisp where, between the conceptual simplicity, the large libraries, and the customization of macros, you are able to write only code that matters. And, once there, you are able to achieve a very high degree of focus, such as you would when playing Go, or playing a musical instrument, or meditating. And then, as with those activities, there can be a feeling of elation that accompanies that mental state of focus.

fm4dd / gcc compiler optimization for arm
Last active December 2, 2022 00:04
GCC compiler optimization for ARM-based systems
View gcc compiler optimization for arm

GCC compiler optimization for ARM-based systems

2017-03-03 fm4dd

The gcc compiler can optimize code by taking advantage of CPU specific features. Especially for ARM CPU's, this can have impact on application performance. ARM CPU's, even under the same architecture, could be implemented with different versions of floating point units (FPU). Utilizing full FPU potential improves performance of heavier operating systems such as full Linux distributions.

-mcpu, -march: Defining the CPU type and architecture

These flags can both be used to set the CPU type. Setting one or the other is sufficient.

cfra /
Last active February 14, 2018 05:23
A short description on how to use iohyve on FreeNAS 9.10


FreeNAS 9.10 is based on FreeBSD 10.3 and as such, supports the BSD hypervisor bhyve. There are different frontends for bhyve, one of them is iohyve which is included in FreeNAS 9.10. This document describes how to setup iohyve for operation on FreeNAS 9.10 and basic VM management tasks.

Setting up Iohyve

Iohyve is already installed in FreeNAS 9.10, so it only needs to be enabled. This is done by adding the following lines to /conf/base/etc/rc.conf:


iohyve_flags="kmod=1 net=igb0 pool=storage-volume"

husobee /
Last active February 24, 2021 23:21
fun beginnings of a bash progress bar
function progress {
cat1=' ,------, '
cat2=' | /\_/\ '
cat3=' |__( ^ .^) '
cat4=' "" "" '
frankhenderson / file.cljs
Last active January 20, 2019 04:34
learning about channels ... context: ClojureScript, nodejs, spawning a child_process
View file.cljs
(ns some-project.core
(:require-macros [cljs.core.async.macros :refer [go]])
(:require [cljs.nodejs :as nodejs]
[cljs.core.async :as a :refer [put! <! chan alts! timeout]]))
(def -main (fn [] nil))
(set! *main-cli-fn* -main)
(def spawn (.-spawn (js/require "child_process")))