Skip to content

Instantly share code, notes, and snippets.

@funollet
funollet / dashboard-es.sh
Created December 14, 2017 16:14
Quick&dirty dashboard for Elasticsearch in kubernetes
#!/usr/bin/env bash
# dashboard-es
#
# Args:
# $1: k8s namespace (default: read from $KUBECONFIG)
#
# You need some port redirection already established:
#
# kubectl port-forward <pod-name> 9200
@funollet
funollet / fzf-and-readline.sh
Last active December 17, 2017 16:27
Dummy example of using fzf with GNU readline in Bash
fzfsimple () {
local out
out=$(echo -e 'pim\npam\npum' | fzf )
# Append to current line.
READLINE_LINE="${READLINE_LINE}${out}"
# Optional: move cursor to end of line.
READLINE_POINT=${#READLINE_LINE}
}
@funollet
funollet / keybase.md
Created October 6, 2017 13:52
Keybase proof

Keybase proof

I hereby claim:

  • I am funollet on github.
  • I am funollet (https://keybase.io/funollet) on keybase.
  • I have a public key ASBGE9YDmq6N0pR4gUK9fa1qzPlZCxSO5I5X_o2f-t6J_go

To claim this, I am signing this object:

kubernetes:
desc: Install kubectl (stable release).
dir: /tmp
cmds:
- wget -nv -c {{.URL}}
- sudo install kubectl /usr/local/bin
- kubectl completion bash > k8s.completion
- sudo install -m 644 k8s.completion /etc/bash_completion.d/kubernetes
vars:
VERSION:
@funollet
funollet / Makefile
Created March 21, 2015 16:05
An example with Ansible to manage files in a directory; unmanaged files must be removed
init:
mkdir -p results/conf.d/
mkdir -p templates
touch templates/{a,b}.conf.j2
touch results/conf.d/unwanted_file.conf
touch results/conf.d/break_my_config.conf
run:
ansible-playbook -i localhost, clumsy.yml
@funollet
funollet / ferm variables
Created January 13, 2015 17:00
Ferm + ansible
ferm_tcp_dports_accept:
- "5666"
- "http"
- "https"
- "30301 saddr 192.168.141.200"
ferm_tcp_forward:
- "(5757 5758), 192.168.164.195, 5758"
- "20, 192.168.124.43, 20"
- "21, 192.168.124.43, 21"
@funollet
funollet / closer.py
Created September 27, 2014 11:36
Proof of concept: handle TERM signal but finish a job if it's already started
#!/usr/bin/python -u
# closer.py
#
# Just a trivial demo that handlers a TERM signal to exit cleanly, while still finishing
# any job that could have been running.
import signal
import sys
import time
@funollet
funollet / deploy_graylog.py
Created December 8, 2011 17:25
deploy graylog2
def graylog2server(release='0.9.5p1'):
# Needs debian-backports on /etc/apt/sources.list
__apt_do('install -t squeeze-backports', 'mongodb')
__apt_do('install', 'openjdk-6-jre')
# Download.
name = 'graylog2-server-%s' % release
url = 'https://github.com/downloads/Graylog2/graylog2-server/%s.tar.gz' \
@funollet
funollet / quix-custom.txt
Created November 7, 2011 12:28
Quix custom command file
> This is a Quix Command File
>
> For the syntax of this file, please refer to http://quixapp.com/syntax/
>
@funollet's extra commands
* http://www.google.com/search?q=%s Google (ntriggered search)
edit http://gist.github.com/gists/1344810/edit Edit my Quix Commands
@funollet
funollet / gist:923225
Created April 16, 2011 16:00
requirements.fs2.squeeze
scikits.audiolab==0.11.0
akismet==0.2.0
gearman==2.0.2
recaptcha-client==1.0.6
Django==1.3.0
django-piston==0.2.2
django-extensions==0.6
django-debug-toolbar==0.8.4