Skip to content

Instantly share code, notes, and snippets.

[standard_users]
some.host.net
--- # create_userA.yml tasks:
- name: Create the "${user}" user
action: user
state=present
name="${user}"
createhome=yes
- name: Insert authorized_keys for user "$user"
action: authorized_key
@wu-lee
wu-lee / test.j2
Created September 16, 2013 14:05
reproduce ansible template_path variable issue
hello from {{template_path}}
@wu-lee
wu-lee / gist:9274194
Created February 28, 2014 16:31
Using Apache as s CORS-handling proxy to a CouchDB server
<IfModule !proxy_module>
LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
</IfModule>
<IfModule !proxy_http_module>
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so
</IfModule>
<IfModule !headers_module>
LoadModule headers_module /usr/lib/apache2/modules/mod_headers.so
;; FIXME work in progress
;; ----------------------------------------------------------------------
;; Gets a cons cell indicating the bounds of the current region (if set) or word
(defun bounds-of-word-or-region ()
(if (and transient-mark-mode mark-active)
(cons (region-beginning) (region-end))
(bounds-of-thing-at-point 'symbol)))
;; ----------------------------------------------------------------------
make -f c.makefile clean upload
rm -f blink5.hex blink5.o nimcache/stdlib_system.o nimcache/stdlib_unsigned.o
avr-gcc -I ~/i/installs/Nim/lib -g -mmcu=atmega168 -c -o blink5.o blink5.c
avr-gcc -I ~/i/installs/Nim/lib -g -mmcu=atmega168 -c -o nimcache/stdlib_system.o nimcache/stdlib_system.c
avr-gcc -I ~/i/installs/Nim/lib -g -mmcu=atmega168 -c -o nimcache/stdlib_unsigned.o nimcache/stdlib_unsigned.c
avr-gcc blink5.o nimcache/stdlib_system.o nimcache/stdlib_unsigned.o -o blink5.bin
avr-objcopy -j .text -j .data -O ihex blink5.bin blink5.hex
avrdude -p atmega168 -c arduino -b19200 -e -U flash:w:blink5.hex -P /dev/ttyUSB1
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wu-lee
wu-lee / watch.bash
Created August 11, 2015 23:19
An inotifywait driven script to run erica push in a couchdb development directory
#!/bin/bash
root=$(dirname $(readlink -f $0))
app=$(basename $root)
src="$root/render"
couchdb=${couchdb:-http://${couchdb_auth:+$couchdb_auth@}localhost:5984/$app}
while true; do
echo "pushing $src to $couchdb id $app"
<html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><style type="text/css">@import url('https://themes.googleusercontent.com/fonts/css?kit=wAPX1HepqA24RkYW1AuHYA');.lst-kix_5wknczree46j-4>li:before{content:"\0025cb "}.lst-kix_8kgwfupas1dp-0>li{counter-increment:lst-ctn-kix_8kgwfupas1dp-0}.lst-kix_5wknczree46j-2>li:before{content:"\0025a0 "}.lst-kix_5wknczree46j-6>li:before{content:"\0025cf "}.lst-kix_5wknczree46j-3>li:before{content:"\0025cf "}.lst-kix_5wknczree46j-7>li:before{content:"\0025cb "}ol.lst-kix_ofx39mac5r44-8.start{counter-reset:lst-ctn-kix_ofx39mac5r44-8 0}ol.lst-kix_463rtqr13yoi-5.start{counter-reset:lst-ctn-kix_463rtqr13yoi-5 0}.lst-kix_5wknczree46j-5>li:before{content:"\0025a0 "}.lst-kix_b5d3ihyd12zv-6>li:before{content:"" counter(lst-ctn-kix_b5d3ihyd12zv-6,decimal) ". "}.lst-kix_5wknczree46j-8>li:before{content:"\0025a0 "}ol.lst-kix_pyr2qwdixxa2-4.start{counter-reset:lst-ctn-kix_pyr2qwdixxa2-4 0}.lst-kix_b5d3ihyd12zv-5>li:before{content:"" counter(lst-ctn-kix
@wu-lee
wu-lee / im-pair.c
Created July 11, 2017 16:43
Immutable C lists experiment
#include "im-pair.h"
#include <stdio.h>
#include <stdlib.h>
bool imPairHeap_defaultOnEmpty(imPairHeap* heap)
{
fprintf(stderr, "heap 0x%p empty", heap);
exit(1);
}