Skip to content

Instantly share code, notes, and snippets.

Pavel Repin paxan

Block or report user

Report or block paxan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Keybase proof

I hereby claim:

  • I am paxan on github.
  • I am paxan ( on keybase.
  • I have a public key ASCofZ0PjVQOf9m_rtS0h2_iLGunooGXCW3FPvNSZUgdKQo

To claim this, I am signing this object:

paxan /
Created Mar 9, 2017
How to get daemontools onto a dyno running heroku-16 stack
curl -sO
dpkg-deb -x daemontools_0.76-6ubuntu1_amd64.deb daemontools
paxan /
Last active Aug 15, 2016
Get the element in an arbitrarily nested JSON structure by following a path of keys (inspired by Clojure's get-in function)
package some.package;
import java.util.Arrays;
import java.util.Optional;
class SomeClass {
paxan / ae.clj
Last active Nov 25, 2016
AEAD decryption process using AWS KMS & AES/GCM/NoPadding cipher
View ae.clj
;; CAVEAT: Ensure your JDK/JRE is configured with Java Cryptography
;; Extension (JCE) Unlimited Strength Jurisdiction Policy Files.
;; Visit
;; and look for "JCE".
;; Given a ciphertext (produced by AES/GCM/NoPadding cipher), a nonce,
;; and a KMS-encrypted content encrypting key (cek), here is the
;; process for producing the plaintext:
(defn b64dec [x] (javax.xml.bind.DatatypeConverter/parseBase64Binary x))
paxan /
Last active Jan 26, 2016
A tool for storing secrets on disk securely using AWS KMS
from __future__ import absolute_import, print_function
import boto3
import errno
import json
import os
import re
import shlex
import sys
import tempfile
paxan /
Last active Nov 23, 2015
A hack to make Tornado web server redirect http requests to https for Heroku or similar reverse-proxied deployments
from __future__ import absolute_import, print_function
import os
import tornado.httpserver
import tornado.ioloop
import tornado.web
def create_server(*args, **kwargs):
paxan / dynamic-jar-loading
Created Jun 12, 2015
Example of loading a local jar file dynamically using boot-clj
View dynamic-jar-loading
#!/usr/bin/env boot
;; -*- mode: clojure -*-
(set-env! :dependencies '[[org.apache.hadoop/hadoop-common "2.4.0"]
[org.apache.pig/pig "0.12.0"
:exclusions [commons-logging
paxan / runtime-metrics.clj
Created May 23, 2015
boot.clj Heroku runtime metrics
View runtime-metrics.clj
{:time #inst "2015-05-23T16:45:35.294Z", :from "run.6221", :text "source=run.6221 sample#memory_total=7.62MB sample#memory_rss=0.66MB sample#memory_cache=6.96MB sample#memory_swap=0.00MB sample#memory_pgpgin=2512pages sample#memory_pgpgout=561pages"}
{:time #inst "2015-05-23T16:45:56.995Z", :from "run.6221", :text "source=run.6221 sample#memory_total=259.27MB sample#memory_rss=220.50MB sample#memory_cache=38.77MB sample#memory_swap=0.00MB sample#memory_pgpgin=91599pages sample#memory_pgpgout=25225pages"}
{:time #inst "2015-05-23T16:46:19.082Z", :from "run.6221", :text "source=run.6221 sample#load_avg_1m=1.36"}
{:time #inst "2015-05-23T16:46:19.082Z", :from "run.6221", :text "source=run.6221 sample#memory_total=627.97MB sample#memory_rss=481.32MB sample#memory_cache=7.44MB sample#memory_swap=139.21MB sample#memory_pgpgin=208632pages sample#memory_pgpgout=83508pages"}
{:time #inst "2015-05-23T16:46:19.083Z", :from "run.6221", :text "Process running mem=627M(122.7%)"}
{:time #inst "2015-05-23T16:46:19.083Z", :fr
paxan / demo
Last active Aug 29, 2015
View demo
> (try-let [x (/ 5 1) y (/ 5 2)] [x y])
[5 5/2]
> (try-let [x (/ 5 1) y (/ 5 0)] [x y])
#<ArithmeticException java.lang.ArithmeticException: Divide by zero>
paxan / librato.go
Created Dec 5, 2014
HACK: Librato measurement sender
View librato.go
package main
import (
You can’t perform that action at this time.