Skip to content

Instantly share code, notes, and snippets.

@rootmos
rootmos / Makefile
Created May 24, 2019 13:47
How to write a Makefile :D
#Make Gustav Make a Makefile
@rootmos
rootmos / ld-finder-outer.sh
Last active May 22, 2019 05:48
Usage: ld-finder-outer.sh python -c 'print("hello?")'
#!/bin/bash
set -o nounset -o pipefail -o errexit
TRACE=$(mktemp)
trap "rm -f $TRACE" EXIT
EXEC=$(which "$1")
shift 1
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);
#!/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
### 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:
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 January 25, 2018 15:16
Scripts for running a Cassandra cluster using Docker
#!/bin/sh
docker ps --filter="name=cassandra" --format="{{.Names}}" | xargs docker update --cpus $1
@rootmos
rootmos / sk.scm
Created September 27, 2017 17:48
; 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)))]