Skip to content

Instantly share code, notes, and snippets.

jorinvo / signals.clj
Created June 18, 2023 10:10
Handle system signals in Clojure
;; This uses
(signal/with-handler :term
(log/info "caught SIGTERM, quitting")
(System/exit 0))
(signal/with-handler :hup
(log/info "caught SIGHUP, reloading")
{:deps {org.clojure/tools.cli {:mvn/version "0.3.7"}
org.clojure/data.csv {:mvn/version "0.1.4"}
semantic-csv {:mvn/version "0.2.1-alpha1"}}}
package main
import (
#!/usr/bin/env bash
# Exit on error
set -e
# On MacOS, make sure shuf command is available
if uname | grep -q Darwin
which brew &> /dev/null || echo "please install brew:" && exit 1

Follow the dirty money

A shady Internet business has been discovered.

The website has been made public by a whistle blower. We have enough evidence about the dirty deals they did. But to charge them we need to get hands on precise numbers about the transactions that happened on their platform.

Unfortunately no record of the transactions could be seized so far. The only hint we have is this one transaction:

jorinvo /
Created May 17, 2016 11:23
Experiments writing a LISP interpreter in Python. Thanks
class Library:
def first(x):
return x[0]
def add(*x):
if type(x[0]) == list:
return sum(x[0])
jorinvo /
Last active July 2, 2016 11:33
Update ownCloud on Uberspace
set -e # Exit script on errors
# Update ownCloud on Uberspace
# WARNING: Please don't use this script as is!
$ npm start
> sharesome@0.9.0 start /home/jorin/projects/sharesome
> ember server
version: 1.13.15
Livereload server on http://localhost:49152
Serving on http://localhost:4200/
ENOENT: no such file or directory, lstat 'node_modules/ember-cli-moment/node_modules'
Error: ENOENT: no such file or directory, lstat 'node_modules/ember-cli-moment/node_modules'
> sharesome@0.9.0 postinstall /home/jorin/projects/sharesome
> bower install
bower loader.js#3.4.0 not-cached git://
bower loader.js#3.4.0 resolve git://
bower ember#1.13.12 not-cached git://
bower ember#1.13.12 resolve git://
bower ember-cli-test-loader#0.2.1 not-cached git://
bower ember-cli-test-loader#0.2.1 resolve git://
bower ember-data#1.13.15 not-cached git://
jorinvo / encedit
Last active November 11, 2016 10:44
Shell Script to make it painless to edit an openssl encrypted file
#!/usr/bin/env bash
# exit on error
set -e
# no undefined variables
set -u
# cancel if wrong number of arguments
if [ $# -ne 1 ]; then