Skip to content

Instantly share code, notes, and snippets.

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

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 November 8, 2019 21:55
Refresh /etc/hosts file with unpublished IPv4 aliases.
#!/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 November 8, 2019 21:55
Configuration files for qwerty.sh deployment on a single server.
# 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 March 8, 2024 07:53
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
vidia / nginx-unificontroller.conf
Last active January 1, 2024 18:08
Example, working, NGINX config for proxying to Unifi Controller software and using letsencrypt. Includes websocket fix.
# 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 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
fm4dd / gcc compiler optimization for arm systems.md
Last active April 9, 2024 19:24
GCC compiler optimization for ARM-based systems

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
cfra / freenas-iohyve.md
Last active February 14, 2018 05:23
A short description on how to use iohyve on FreeNAS 9.10

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 February 24, 2021 23:21
fun beginnings of a bash progress bar
#!/bin/bash
function progress {
cattail='='
cat1=' ,------, '
cat2=' | /\_/\ '
cat3=' |__( ^ .^) '
cat4=' "" "" '
echo;echo;echo;echo;echo;echo
@frankhenderson
frankhenderson / file.cljs
Last active January 20, 2019 04:34
learning about channels ... context: ClojureScript, nodejs, spawning a child_process
(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")))