Skip to content

Instantly share code, notes, and snippets.

@lavaxun
lavaxun / README.md
Last active February 18, 2018 00:22 — forked from vincent99/README.md
Rancher on docker-for-mac with xhyve

Install Docker for Mac (http://beta.docker.com)

Install docker-machine-driver-xhyve (https://github.com/zchee/docker-machine-driver-xhyve)

brew install docker-machine-driver-xhyve
sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
sudo chmod u+s $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve

Deploy the latest release

@DayoOliyide
DayoOliyide / thread-info.clj
Last active July 30, 2022 15:50
Get all thread information in clojure
(defn print-threads [& {:keys [headers pre-fn]
:or {pre-fn identity}}]
(let [thread-set (keys (Thread/getAllStackTraces))
thread-data (mapv bean thread-set)
headers (or headers (-> thread-data first keys))]
(clojure.pprint/print-table headers (pre-fn thread-data))))
(defn print-threads-str [& args]
(with-out-str (apply print-threads args)))
@gwillem
gwillem / ansible-bootstrap-ubuntu-16.04.yml
Created June 16, 2016 21:59
Get Ansible to work on bare Ubuntu 16.04 without python 2.7
# Add this snippet to the top of your playbook.
# It will install python2 if missing (but checks first so no expensive repeated apt updates)
# gwillem@gmail.com
- hosts: all
gather_facts: False
tasks:
- name: install python 2
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
(ns lcm.utils.jython
"This NS has functionality for interop between jython and clojure"
(:require [clojure.tools.logging :as log]
[clojure.pprint :refer [pprint]]
[slingshot.slingshot :refer [throw+ try+]])
(:import [org.python.core
Py
JyAttribute
PyString
PyInteger
@tpoisot
tpoisot / icanhazpdf.py
Created February 14, 2016 15:53
#ICanHazPDF
#! /usr/bin/env python
import re
import requests
import tempfile
import urllib.request
import random
import sys
import os
@longle255
longle255 / ngrok-selfhosting-setup.md
Last active February 14, 2019 10:52 — forked from lyoshenka/ngrok-selfhosting-setup.md
How to setup Ngrok with a self-signed SSL cert

Intro

The plan is to create a pair of executables (ngrok and ngrokd) that are connected with a self-signed SSL cert. Since the client and server executables are paired, you won't be able to use any other ngrok to connect to this ngrokd, and vice versa.

DNS

Add two DNS records: one for the base domain and one for the wildcard domain. For example, if your base domain is domain.com, you'll need a record for that and for *.domain.com.

Different Operating Systems

@vasanthk
vasanthk / System Design.md
Last active August 30, 2025 23:27
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@noisesmith
noisesmith / gist:d9a804212f3759043053
Created January 29, 2016 23:09
start a clojure 1.8 socket repl
=> (clojure.core.server/start-server {:name "debug connection" :port 5555 :accept 'clojure.core.server/repl})
#object[java.net.ServerSocket 0x631883f0 "ServerSocket[addr=localhost/127.0.0.1,localport=5555]"]
@bishboria
bishboria / springer-free-maths-books.md
Last active July 17, 2025 06:34
Springer made a bunch of books available for free, these were the direct links
@bitjockey42
bitjockey42 / 00_OSX_Docker_Machine_Setup.md
Last active November 9, 2020 13:49 — forked from andystanton/Start up local Docker Machine on OSX automatically.md
Use native virtualization on OS X docker with xhyve

What this?

So one of the painful points of using docker on OS X is that you need to run a virtualbox VM, which often suffers from performance issues. With xhyve, a OS X virtualization system, and docker-machine-xhyve you can now have docker use the native OS X hypervisor to run containers.

No more dealing with virtualbox shenanigans!

In this script, I've also set up a way to autoconfigure terminal sessions to load docker's environment vars (dependent on docker-machine) so you do not have to run eval $(docker-machine env whatever) every time you open a new terminal window.

Requirements