Skip to content

Instantly share code, notes, and snippets.

View karampok's full-sized avatar

Konstantinos Karampogias karampok

View GitHub Profile

Keybase proof

I hereby claim:

  • I am karampok on github.
  • I am karampok (https://keybase.io/karampok) on keybase.
  • I have a public key whose fingerprint is 090D 9687 04FF 0117 C086 D32A 64BB 170B 2777 4C45

To claim this, I am signing this object:

bind _ split-window -v
bind | split-window -h
set -g base-index 1
set-option -g allow-rename off
set-window-option -g window-status-current-bg blue
set-window-option -g window-status-current-fg white
# confirm before killing a window or the server
bind-key K confirm kill-server
bind q killp
@karampok
karampok / swap-apps.sh
Created December 20, 2015 10:37
Which app is swapping
#!/bin/bash
while :
do
SUM=0
OVERALL=0
for DIR in `find /proc/ -maxdepth 1 -type d -regex "^/proc/[0-9]+"`
do
PID=`echo $DIR | cut -d / -f 3`
PROGNAME=`ps -p $PID -o comm --no-headers`
@karampok
karampok / gist:5dd4985d77886b84b7c3575b77a2d723
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")
@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")
#!/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 / 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
@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 / .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 / 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(){