Skip to content

Instantly share code, notes, and snippets.

@rootmos
rootmos / Makefile
Created May 24, 2019
How to write a Makefile :D
View Makefile
#Make Gustav Make a Makefile
@rootmos
rootmos / ld-finder-outer.sh
Last active May 22, 2019
Usage: ld-finder-outer.sh python -c 'print("hello?")'
View ld-finder-outer.sh
#!/bin/bash
set -o nounset -o pipefail -o errexit
TRACE=$(mktemp)
trap "rm -f $TRACE" EXIT
EXEC=$(which "$1")
shift 1
View index.js
var http = require('http');
var request = require('request');
http.createServer(function (req, res) {
request('https://ip.rootmos.io/ip', function (error, response, body) {
res.write(body);
res.end();
});
}).listen(8080);
View address
#!/bin/bash
set -o errexit
set -o pipefail
SCRIPT_DIR=$(readlink -f $0 | xargs dirname)
. $SCRIPT_DIR/lib.sh
owner "$1" | openssl dgst -binary -sha256 | bin_to_base64_url
View gist:d8216c6f62a5b081bac0f664ac7ec724
### Keybase proof
I hereby claim:
* I am rootmos on github.
* I am rootmos (https://keybase.io/rootmos) on keybase.
* I have a public key whose fingerprint is 0F8E EB98 5F9E E05B D35B AD03 BB43 FAF5 535B 14B7
To claim this, I am signing this object:
View gist:3f6b8214e1bbc4a7c8923fd2f3a2d0f9
POST /tx HTTP/1.1
User-Agent: HTTPie/0.9.8
Accept-Encoding: gzip, deflate
Accept: application/json, */*
Connection: keep-alive
Content-Type: application/json
upvestMsgId: rootmos-269f1505-3894-464d-beea-fdd4dbeea19d
Content-Length: 315
Host: walletd.unstable.svc.cluster.local
@rootmos
rootmos / limit_cpu.sh
Created Jan 25, 2018
Scripts for running a Cassandra cluster using Docker
View limit_cpu.sh
#!/bin/sh
docker ps --filter="name=cassandra" --format="{{.Names}}" | xargs docker update --cpus $1
View sk.scm
; Regular SKI evaluator
(define eval-sk
(lambda (es)
(cond
; drop parenthesis (left-associativity)
[(and (list? es) (positive? (length es)) (list? (car es)))
(eval-sk (append (car es) (cdr es)))]
; K
[(and (list? es) (>= (length es) 3) (eq? (car es) 'K))
(eval-sk (cons (cadr es) (cdddr es)))]