Skip to content

Instantly share code, notes, and snippets.

View karampok's full-sized avatar

Konstantinos Karampogias karampok

View GitHub Profile
@karampok
karampok / weave.yml
Created March 7, 2018 18:39
Weave with FASTDP disabled
apiVersion: v1
kind: List
items:
- apiVersion: v1
kind: ServiceAccount
metadata:
name: weave-net
annotations:
cloud.weave.works/launcher-info: |-
{
#!/bin/sh
# http://iamvery.com/2013/11/16/tmux-pairing-anywhere-on-your-box.html
command="$(basename "$0")"
# Make sure dependencies are installed
[ ! "$(command -v gh-auth)" ] && echo "gh-auth not found (gem install github-auth)" && exit 1
[ ! "$(command -v tmux)" ] && echo "tmux not found" && exit 1
help(){
@karampok
karampok / tmate.conf
Last active December 12, 2017 09:10
kubo-team tmate.conf (`tmate -f ~/.tmate.conf`)
set-option -g prefix C-space
bind-key C-space last-window
set -g base-index 1
set -s escape-time 0
set-option -g history-limit 200000
set-option -g status-keys vi
setw -g mode-keys vi
unbind p
bind p paste-buffer
@karampok
karampok / install-run-consul.sh
Last active November 24, 2017 15:20
install-run-consul.sh
#! /bin/bash
echo "Installing dependencies ..."
sudo apt-get update
sudo apt-get install -y unzip curl jq
echo "Determining Consul version to install ..."
CHECKPOINT_URL="https://checkpoint-api.hashicorp.com/v1/check"
if [ -z "$CONSUL_DEMO_VERSION" ]; then
CONSUL_DEMO_VERSION=$(curl -s "${CHECKPOINT_URL}"/consul | jq .current_version | tr -d '"')
fi
@karampok
karampok / pair
Last active August 23, 2017 08:33
pair with tmux/ngrok
#!/bin/sh
# http://iamvery.com/2013/11/16/tmux-pairing-anywhere-on-your-box.html
command="$(basename "$0")"
# Make sure dependencies are installed
[ ! "$(command -v gh-auth)" ] && echo "gh-auth not found (gem install github-auth)" && exit 1
[ ! "$(command -v tmux)" ] && echo "tmux not found" && exit 1
help(){
@karampok
karampok / .sh
Created June 29, 2017 10:54
Bring up a bosh-lite
#!/bin/bash
set -euo pipefail
bosh_deployment=~/workspace/bosh-deployment
if [ ! -d "$bosh_deployment" ]; then
echo "try: git clone https://github.com/cloudfoundry/bosh-deployment.git ~/workspace/bosh-deployment"
exit 1
fi
director_dir=~/workspace/bosh-lite
@karampok
karampok / killme.go
Created May 24, 2017 15:41
go-killme
package main
import (
"bufio"
"crypto/rand"
"flag"
"fmt"
"log"
"net"
"os"
@karampok
karampok / bosh_concourse.sh
Created May 24, 2017 07:06
bosh_concourse alias/functions
# Aliases
alias gfd='bosh create release --force && bosh -n upload release && bosh -n deploy'
alias bsoh='bosh'
alias bsho='bosh'
alias box='bosh'
# Restart bosh-lite and upload the stemcell
function blup() {
stemcell=$1
#!/bin/bash
set -e
set -x
runs=$(seq 100 200 1000)
dir=/var/vcap/data
echo cfq > /sys/block/sda/queue/scheduler
#create files, need different files not to share cached one
@karampok
karampok / gist:d75116097d6a3d9e25b9959e517616c7
Created February 7, 2017 09:31
Test GDN stop with long process
var _ = FDescribe("DEBUG", func() {
var (
client *runner.RunningGarden
args []string
)
BeforeEach(func() {
// we need to pass --properties-path to prevent guardian from deleting containers
// after restarting the server
propertiesDir, err := ioutil.TempDir("", "props")