Skip to content

Instantly share code, notes, and snippets.

View asrail's full-sized avatar

Caio Tiago Oliveira asrail

  • Salvador, Bahia, Brasil
View GitHub Profile
@adambom
adambom / README.md
Last active May 22, 2020 05:09
Backup Kubernetes Cluster State

Run this in order to backup all you k8s cluster data. It will be saved in a folder bkp. To restore the cluster, you can run kubectl apply -f bkp.

Please note: this recovers all resources correctly, including dynamically generated PV's. However, it will not recover ELB endpoints. You will need to update any DNS entries manually, and manually remove the old ELB's.

Please note: This has not been tested with all resource types. Supported resource types include:

  • services
  • replicationcontrollers
  • secrets
  • deployments
  • horizontal pod autoscalers
@caiosba
caiosba / post-commit
Created June 12, 2014 00:30
Git hook to run tests after commit and notify a Slack channel
#!/bin/bash
# Run tests after commit and notify a Slack channel
webhook_url="https://<your subdomain>.slack.com/services/hooks/incoming-webhook?token=<your token>"
channel="#<your channel>"
root=$(git rev-parse --show-toplevel)
cd $root
repo=$(basename $root)
user=$(git config --global --get user.name)
output=$(bundle exec rake test)
@asrail
asrail / .gitconfig
Created November 18, 2010 17:38
git config
[user]
name = ...
email = ...
[color]
ui = true
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]