This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
yum install -y epel-release | |
yum makecache | |
yum install -y @development git cmake ruby zlib-devel openssl-devel libevent-devel ncurses-devel libssh-devel msgpack-devel | |
git clone https://github.com/nviennot/tmate.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#from a fresh install of centos 7 (after running yum update and rebooting) | |
#run as root | |
set -e | |
sed -i 's/^SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux | |
setenforce 0 | |
systemctl disable --now firewalld |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: extensions/v1beta1 | |
kind: Ingress | |
metadata: | |
name: microbot-ingress | |
spec: | |
rules: | |
- host: microbot | |
http: | |
paths: | |
- path: / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# Copyright (c) 2010, Jeremy Cole <jeremy@jcole.us> | |
# This program is free software; you can redistribute it and/or modify it | |
# under the terms of either: the GNU General Public License as published | |
# by the Free Software Foundation; or the Artistic License. | |
# | |
# See http://dev.perl.org/licenses/ for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM scratch | |
LABEL BUILD_CMD="docker build -t docker-registry:5000/kubernetes/kubectl:v1.3.0" | |
# Put your kubectl binary in the local folder | |
ADD kubectl / | |
ENTRYPOINT ["/kubectl"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
incognito() { | |
if [[ -z ${SHELL} ]]; then | |
echo "Could not determin shell.\nUsing /bin/bash" | |
SHELL=bash | |
fi | |
case "${SHELL}" in | |
*bash) | |
set -o history | |
;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ping once per minute. Every minute for a day | |
ping -i 60 -c 1440 google.com | grep loss | awk -F ',' '{print $3}' | |
# print avg latency (ms) per hour. One ping per minute | |
ping -i 60 -c 60 google.com | awk '{print $8}' | sed -n '/^time/p' | awk -F '=' '{print $2}' | awk '{ sum += $1 } END { if (NR > 0) print sum / NR }' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm -f out | |
mkfifo out | |
trap "rm -f out" EXIT | |
while true | |
do | |
cat out | nc -l 1500 > >( # parse the netcat output, to build the answer redirected to the pipe "out". | |
export REQUEST= | |
while read line | |
do | |
line=$(echo "$line" | tr -d '[\r\n]') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# stolen from http://www.charliedrage.com/kubernetes-dev-in-one-command | |
dev_k8s(){ | |
local choice=$1 | |
K8S_VERSION=1.2.0 | |
if [ ! -f /usr/bin/kubectl ] && [ ! -f /usr/local/bin/kubectl ]; then | |
echo "No kubectl bin exists! Install the bin to continue :)." | |
return 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PCRE_VERSION="8.38" | |
XZ_UTILS_VERSION="5.2.2" | |
AG_VERSION="0.31.0" | |
PCRE_URL="ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-${PCRE_VERSION}.tar.gz" | |
XZ_URL="http://tukaani.org/xz/xz-${XZ_UTILS_VERSION}.tar.gz" | |
AG_URL="http://geoff.greer.fm/ag/releases/the_silver_searcher-${AG_VERSION}.tar.gz" | |
WORK_DIR="${TMPDIR:-/var/tmp/}" | |
pushd ${WORK_DIR} |