Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/ruby
require 'json'
require 'net/http'
require 'shellwords'
require 'time'
require 'uri'
require 'yaml'
@target_sidecar_image = YAML.load(YAML.load(`kubectl --namespace=istio-system get configmap istio-sidecar-injector -o yaml`)['data']['config'])['template'].match(/.*(eu.gcr.io\/at-artefacts\/platform-istio-proxy.*)".*/)[1]
@taomaree
taomaree / consul.service
Created October 10, 2016 07:18 — forked from yunano/consul.service
/etc/systemd/system/consul.service
[Unit]
Description=consul agent
Requires=network-online.target
After=network-online.target
[Service]
EnvironmentFile=-/etc/sysconfig/consul
Environment=GOMAXPROCS=2
Restart=on-failure
ExecStart=/usr/local/sbin/consul agent $OPTIONS -config-dir=/etc/consul.d
@taomaree
taomaree / gist:22d5e0b74f61592d22fdfbe045bbc4ed
Created September 30, 2016 09:01 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@taomaree
taomaree / _INSTALL.md
Created January 11, 2016 05:07 — forked from robinsmidsrod/_INSTALL.md
Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
    filename "undionly.kpxe";
}

(or see https://gist.github.com/4008017 for a more elaborate setup

@taomaree
taomaree / buildHAProxy.sh
Last active January 3, 2018 10:14 — forked from codingtony/buildHAProxy.sh
Compile of Haproxy using LibreSSL static. See https://github.com/codingtony/docker-build-haproxy for how to use with a Docker Image (libressl 2.2.3, libpcre 8.37 and haproxy 1.5.14)
#!/bin/bash -e
DIR=$PWD
yum install -y gcc-c++ gcc make zlib-devel bzip2-devel systemd-devel
#Compile static version of libressl
export STATICLIBSSL=/app/libssl
LIBRESSL=libressl-2.2.5
HAPROXY=haproxy-1.6.3
@taomaree
taomaree / xenserver_create_jessie_template_64bit.sh
Last active November 21, 2015 12:42 — forked from jniltinho/xenserver_create_jessie_template_64bit.sh
Script to install a Debian Jessie 8.0 template on Xenserver 6.5
#!/bin/bash
## Script to install a Debian Jessie 8.0 template on Xenserver 6.5
## https://gist.github.com/hingstarne/5320400
# Add your favourite mirror here
MIRROR=http://ftp.us.debian.org/debian/
MIRROR=http://mirrors.ustc.edu.cn/debian/
# No need to edit something below
#!/bin/bash
# Pull this file down, make it executable and run it with sudo
# wget https://gist.githubusercontent.com/bryanhunter/10380945/raw/build-erlang-17.0.sh
# chmod u+x build-erlang-17.0.sh
# sudo ./build-erlang-17.0.sh
ver=18.0
#if [ $(id -u) != "0" ]; then
#echo "You must be the superuser to run this script" >&2
@taomaree
taomaree / compareVersion
Last active August 29, 2015 13:56
compare version of ver1 and ver2
/**
* compare version of ver1 and ver2
*
* @param ver1
* @param ver2
* @return
* 0: when ver1 equals ver2 <br>
* 1: when ver1 Minor or Patch version less than ver2 <br>
* 2: when ver1 Major version less than ver2 <br>
*/
@taomaree
taomaree / backup-mssql.ps1
Last active December 26, 2015 20:59
backup SQL Server DBs
# run first by administrator :
# set-executionpolicy remotesigned
$timestr=get-date -uformat "%Y-%m-%d-%H-%M-%S"
$tsql=""
$prefix="D:\sqlbackup\"
$filepath=$prefix + $timestr + "\"
if (! ( Test-Path $filepath)) {mkdir $filepath }
#if (! (Test-Path D:\sqlbackuptsql) ) {mkdir D:\sqlbackuptsql }
@taomaree
taomaree / diag.php
Last active December 22, 2015 10:29
diag.php : diagnosis http request info
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<body style="font-size: smaller;">
<table>
<tr>
<th>key</th>
<th>value</th>
</tr>