Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
set -ex
TAR_FILE="/tmp/kubeval.tar.gz"
RELEASES_URL="https://github.com/garethr/kubeval/releases"
test -z "$TMPDIR" && TMPDIR="$(mktemp -d)"
last_version() {
curl -sL -o /dev/null -w %{url_effective} "$RELEASES_URL/latest" |
rev |
@caarlos0
caarlos0 / eq.or.higher.than.9.2.sql
Created June 3, 2014 19:25
PostgreSQL query monitoring (deadlocks and shit)
SELECT bl.pid AS blocked_pid,
a.usename AS blocked_user,
ka.query AS blocking_statement,
now() - ka.query_start AS blocking_duration,
kl.pid AS blocking_pid,
ka.usename AS blocking_user,
a.query AS blocked_statement,
now() - a.query_start AS blocked_duration
FROM pg_catalog.pg_locks bl
JOIN pg_catalog.pg_stat_activity a ON a.pid = bl.pid
#!/bin/bash -e
# common stuff
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y ubuntu-restricted-extras git zsh terminator curl xsel \
gnome-tweak-tool vim-nox smbclient htop openssh-server s3cmd openvpn network-manager-openvpn
# chrome
wget -O chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
@caarlos0
caarlos0 / vale.sh
Created April 9, 2018 18:43
valelint godownloader script
#!/bin/sh
set -e
# Code generated by godownloader on 2018-04-09T18:43:07Z. DO NOT EDIT.
#
usage() {
this=$1
cat <<EOF
$this: download go binaries for ValeLint/vale
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: example-app
spec:
replicas: 2
template:
metadata:
labels:
app: example-app
@caarlos0
caarlos0 / deploy.sh
Last active December 18, 2017 01:00
Continous deploy with Jenkins and Heroku. This is the post-build script.
#!/bin/bash
#
# login in the jenkins server with:
#
# heroku login
# heroku keys:add
#
# Doing so, jenkins will have permission to deploy to
# the heroku remote.
#
tap 'caarlos0/tap'
tap 'caskroom/cask'
tap 'caskroom/fonts'
tap 'caskroom/versions'
tap 'eqnxio/ngrok'
tap 'getantibody/tap'
tap 'go-delve/delve'
tap 'goreleaser/tap'
tap 'homebrew/bundle'
tap 'homebrew/core'
@caarlos0
caarlos0 / shot.png
Last active January 23, 2017 18:41
shot.png
@caarlos0
caarlos0 / postmortem.md
Created September 26, 2016 14:39 — forked from mlafeldt/postmortem.md
Example Postmortem from SRE book, pp. 487-491

Shakespeare Sonnet++ Postmortem (incident #465)

Date

2015-10-21

Authors

  • jennifer
  • martym