Skip to content

Instantly share code, notes, and snippets.

View kingpong's full-sized avatar

Philip Garrett kingpong

View GitHub Profile
@kingpong
kingpong / core.clj
Created August 17, 2017 01:35
How to use Hazelcast fully async ICompletableFuture with manifold/deferred
(ns scratch.core
(:require [chazel.core :as chazel]
[manifold.deferred :as d])
(:gen-class)
(:import (com.hazelcast.core IMap ICompletableFuture ExecutionCallback)))
;; Hazelcast's ICompletableFuture is a Future<> which means it works
;; out of the box with manifold/deferred. Unfortunately, though, since it doesn't
;; derive CompletableFuture, manifold must block a thread to know when
;; the future has been realized. This protocol extension adapts ICompletableFuture
@kingpong
kingpong / proxy.go
Created May 26, 2017 02:29
golang tcp proxy
package main
import (
"fmt"
"io"
"net"
"os"
"os/signal"
"strings"
"sync"
@kingpong
kingpong / example.sh
Created February 22, 2017 03:34
How to run systemd-tmpfiles in verbose/debug mode
SYSTEMD_LOG_LEVEL=debug /usr/bin/systemd-tmpfiles --clean
[2017-01-10 01:26:56,389] Repair command #1 finished in 9 minutes 27 seconds
[2017-01-10 01:35:39,344] Repair command #1 finished in 8 minutes 39 seconds
[2017-01-10 01:36:02,196] Repair command #1 finished in 18 seconds
[2017-01-10 01:36:24,311] Repair command #1 finished in 17 seconds
[2017-01-10 01:44:47,856] Repair command #1 finished in 8 minutes 19 seconds
[2017-01-10 01:45:09,393] Repair command #1 finished in 17 seconds
[2017-01-10 01:45:34,896] Repair command #1 finished in 21 seconds
[2017-01-10 01:45:53,702] Repair command #1 finished in 9 minutes 25 seconds
[2017-01-10 01:46:00,264] Repair command #1 finished in 21 seconds
[2017-01-10 01:46:21,295] Repair command #1 finished in 24 seconds
@kingpong
kingpong / kitchen.txt
Created June 12, 2016 16:21
Consul cookbook freebsd test-kitchen failure
-----> Starting Kitchen (v1.7.3)
-----> Creating <default-freebsd-102>...
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'bento/freebsd-10.2'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'bento/freebsd-10.2' is up to date...
==> default: Setting the name of the VM: kitchen-consul-cookbook-default-freebsd-102_default_1465748173233_22475
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
@kingpong
kingpong / EarthView wallpaper saver bookmarklet
Last active August 29, 2015 14:09
EarthView wallpaper saver bookmarklet
This bookmarklet will let you save Google EarthView images on your Mac.
When you click the bookmark button, it will present a box on screen with
instructions for how to proceed. For now, it requires using the Terminal
window. Maybe I'll make a full-fledged Chrome Extension later to avoid
that requirement.
Images are filed under EarthView in your Pictures folder.
IMPORTANT: Although iTerm2's pasting works much faster than