Skip to content

Instantly share code, notes, and snippets.

@rduplain
rduplain / README.md
Last active Nov 28, 2019
Vagrantfiles for testing configuration management (Ansible).
View README.md

Vagrantfiles for testing configuration management (Ansible).

Overview

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
rduplain / refresh-hosts.bash
Last active Nov 8, 2019
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:
#
# example.com server-alias
# example.net another
#
# https://github.com/rduplain/hosts
@rduplain
rduplain / nginx-site-include.conf
Last active Nov 8, 2019
Configuration files for qwerty.sh deployment on a single server.
View nginx-site-include.conf
# qwerty.sh nginx configuration
#
# gzip is enabled, but only used by clients requesting it:
#
# curl -H 'Accept-Encoding: gzip,deflate' -sSL qwerty.sh
server {
listen 80;
server_name qwerty.sh www.qwerty.sh;
@pbostrom
pbostrom / cljs-npm.md
Last active Oct 23, 2019
Loading third-party npm modules in ClojureScript
View cljs-npm.md

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
vidia / nginx-unificontroller.conf
Last active Dec 26, 2021
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
rduplain / README.md
Last active Apr 10, 2019
Code Quarterly's 2011 Q&A with Rich Hickey, by Michael Fogus
View README.md

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.

@cfra
cfra / freenas-iohyve.md
Last active Feb 14, 2018
A short description on how to use iohyve on FreeNAS 9.10
View freenas-iohyve.md

Introduction

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_enable="YES"
iohyve_flags="kmod=1 net=igb0 pool=storage-volume"
@husobee
husobee / progress.sh
Last active Feb 24, 2021
fun beginnings of a bash progress bar
View progress.sh
#!/bin/bash
function progress {
cattail='='
cat1=' ,------, '
cat2=' | /\_/\ '
cat3=' |__( ^ .^) '
cat4=' "" "" '
echo;echo;echo;echo;echo;echo
@frankhenderson
frankhenderson / file.cljs
Last active Jan 20, 2019
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]]))
(nodejs/enable-util-print!)
(def -main (fn [] nil))
(set! *main-cli-fn* -main)
(def spawn (.-spawn (js/require "child_process")))
View gist:122907e95956602e5c09
<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//