First, create a GPT partition table.
- boot partition, label: EFI, flags: boot + ESP; size: 1GB, format to FAT32;
- root partition (label: root), must same size on all devices!
- swap partition.
| #!/usr/bin/env bash | |
| mariabackup --stream=xbstream --backup --user root|pigz >mariadb-backup.gz |
| # Use envFrom to load Secrets and ConfigMaps into environment variables | |
| apiVersion: apps/v1beta2 | |
| kind: Deployment | |
| metadata: | |
| name: mans-not-hot | |
| labels: | |
| app: mans-not-hot | |
| spec: | |
| replicas: 1 |
| echo "Updates packages. Asks for your password." | |
| sudo apt-get update -y | |
| echo "Installs packages. Give your password when asked." | |
| sudo apt-get install -y curl nodejs libcurl4-gnutls-dev git-core libxslt1-dev libxml2-dev libsqlite3-dev libgmp-dev libmysqlclient-dev git git-doc libncurses5-dev build-essential rake libqt4-dev libqtwebkit-dev openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config libv8-dev libmagickwand-dev libreadline-dev libedit-dev libgdbm-dev libffi-dev zlib1g-dev rake curl vim libgmp3-dev phantomjs imagemagick | |
| echo "Setting up mysql" | |
| sudo apt-get install -y mysql-server mysql-client | |
| echo "Setting up postgres" |
| #!/usr/bin/env bash | |
| declare -i last_called=0 | |
| declare -i throttle_by=2 | |
| @throttle() { | |
| local -i now=$(date +%s) | |
| if (($now - $last_called >= $throttle_by)) | |
| then | |
| "$@" |
| require 'benchmark/ips' | |
| Benchmark.ips do |x| | |
| SingleFilterStruct = Struct.new(:method, :values) do | |
| def call(value) | |
| Array(value).any? { |v| v.send(method, *values) } | |
| end | |
| end | |
| class SingleFilterClass |
| #!/bin/bash | |
| # Slack notification script for Munin | |
| # Mark Matienzo (@anarchivist) | |
| # | |
| # To use: | |
| # 1) Create a new incoming webhook for Slack | |
| # 2) Edit the configuration variables that start with "SLACK_" below | |
| # 3) Add the following to your munin configuration: | |
| # |
| package main | |
| import ( | |
| "bytes" | |
| "encoding/gob" | |
| "fmt" | |
| "github.com/ugorji/go/codec" | |
| "io/ioutil" | |
| "labix.org/v2/mgo" | |
| "labix.org/v2/mgo/bson" |
| # Pass in an enumeration of data and | |
| # (optionally) a block to extract the grouping aspect of the data. | |
| # | |
| # Optional: sort_by lambda (operates on group key and count) | |
| # | |
| def puts_hist(data, sort_by:nil, &blk) | |
| data = data.map(&blk) if blk | |
| counts = data.each_with_object(Hash.new(0)) {|k,h| h[k]+=1} | |
| max = counts.values.max | |
| width = Pry::Terminal.size!.last |