Source range lb:
apiVersion: v1
kind: Service
metadata:
annotations:
service.beta.kubernetes.io/load-balancer-source-ranges: "10.0.0.0/8"
name: netexec
labels:
app: netexec
Source range lb:
apiVersion: v1
kind: Service
metadata:
annotations:
service.beta.kubernetes.io/load-balancer-source-ranges: "10.0.0.0/8"
name: netexec
labels:
app: netexec
.ONESHELL: | |
.PHONEY: help set-env init update plan plan-destroy show graph apply output taint | |
help: | |
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | |
set-env: | |
@if [ -z $(ENVIRONMENT) ]; then\ | |
echo "ENVIRONMENT was not set"; exit 10;\ | |
fi |
kingfisher.core=> (def hndlr (reify sun.misc.SignalHandler (handle [this signal](println "handling some sig!")))) | |
#'kingfisher.core/hndlr | |
kingfisher.core=> (sun.misc.Signal/handle (sun.misc.Signal. "USR2") hndlr) | |
#object[kingfisher.core$reify__32853 0x6bc27f36 "kingfisher.core$reify__32853@6bc27f36"] | |
kingfisher.core=> (clojure.java.shell/sh "kill" "-s" "SIGUSR2" "72011") | |
handling some sig! | |
{:exit 0, :out "", :err ""} |
#!/bin/sh | |
PROJECT=thockin-dev | |
ZONE=us-central1-b | |
K8S_MIG=kubernetes-minion-group | |
# Assume I have 2 kubernetes services running, svc1 and svc1. Both are type | |
# NodePort with ports defined below. I want to expose them as hostnames | |
# defined below. | |
SVC1_NODE_PORT=30001 |
import java.util.concurrent._ | |
/** | |
* A thread pool for superstitious parent threads who | |
* know they shouldn't let their child threads back in the pool after | |
* eating, without waiting at least `crampFactor` milliseconds. | |
*/ | |
object Superstitious { | |
def pool(crampFactor: Long) = new ThreadPoolExecutor( | |
0, Int.MaxValue, 60L, TimeUnit.SECONDS, new SynchronousQueue[Runnable]) { |
Problem: Terraform doesn't play nicely with pre-existing infrastructure.
Solution: Officially there isn't one - but here's a work-around that does the trick.
Apply
the plan, thus instantiating the temporary "twinned" resource and building a state file.-- Optimized MYSQL schema for datomic | |
-- Unfortunately the bin/sql/mysql-*.sql bootstrapping files for datomic are not | |
-- very good, and can actually cause failures if not adjusted. | |
-- One symptom of this is the following error: | |
-- SQL Error (1071): Specified key was too long; max key length is 767 bytes. | |
-- Reported here: https://support.cognitect.com/entries/28462168-MySQL-Caveats | |
-- This is caused by the default collation for the `id` column possibly being |
" run command | |
" no stdin | |
" output displayed in "Press enter to continue" style | |
" current buffer untouched | |
:!uptime | |
" run command | |
" pipe range of text to command on stdin | |
" output replaces the range in the current buffer | |
:RANGE!grep foo |
FIELDS = ['cmd', 'command', 'start', 'end', 'delta', 'msg', 'stdout', 'stderr'] | |
def human_log(res): | |
if type(res) == type(dict()): | |
for field in FIELDS: | |
if field in res.keys(): | |
encoded_field = res[field].encode('utf-8') | |
print '\n{0}:\n{1}'.format(field, encoded_field) |