Skip to content

Instantly share code, notes, and snippets.

# check supported k8s versions
rke config --list-version --all
# upgrade rancher via helm
helm repo update
helm get values rancher # use values below with set
helm upgrade rancher rancher-stable/rancher \
--set hostname=k8smgmt.xxxx.com \
--set ingress.tls.source=secret \
--set proxy=http://10.2.3.124:3128 \
@chuegel
chuegel / gist:65f10493db47786791ff44b0c44c82b6
Created February 5, 2019 16:30
workaround for grafana alerts: "Template variables are not supported in alert queries"
https://dzone.com/articles/pmm-alerting-with-grafana-working-with-templated-d
@chuegel
chuegel / sauser.cf
Created March 6, 2018 18:41 — forked from jclausen/sauser.cf
ZCS SpamAssassin Default sauser.cf (Default required score)
use_bayes 1
skip_rbl_checks 0
dns_available yes
bayes_auto_learn 1
bayes_auto_learn_threshold_spam 5.0
use_pyzor 1
pyzor_path /usr/bin/pyzor
@chuegel
chuegel / btrfs-scrub
Created January 30, 2018 20:19 — forked from gbrks/btrfs-scrub
btrfs scrub: script and systemd timers to run monthly
#! /bin/bash
#######################################################
# This is a helper script to be used in a systemd timer
# or cron job to scrub all mounted btrfs filessytems
#
# $Author: gbrks
# $Revision 0.1
# $Date: 2015.05.15
#
# Update email address below
@chuegel
chuegel / iptables.sh
Created January 29, 2018 18:40 — forked from thomasfr/iptables.sh
iptable rules to allow outgoing DNS lookups, outgoing icmp (ping) requests, outgoing connections to configured package servers, outgoing connections to all ips on port 22, all incoming connections to port 22, 80 and 443 and everything on localhost
#!/bin/bash
IPT="/sbin/iptables"
# Server IP
SERVER_IP="$(ip addr show eth0 | grep 'inet ' | cut -f2 | awk '{ print $2}')"
# Your DNS servers you use: cat /etc/resolv.conf
DNS_SERVER="8.8.4.4 8.8.8.8"
# Allow connections to this package servers
@chuegel
chuegel / clean-docker-for-mac.sh
Created August 25, 2017 23:29 — forked from MrTrustor/clean-docker-for-mac.sh
This script cleans the Docker.qcow2 file that takes a lot of disk space with Docker For Mac. You can specify some Docker images that you would like to keep.
#!/bin/bash
# Copyright 2017 Théo Chamley
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
# to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or
@chuegel
chuegel / Mac SSH Autocomplete
Created August 22, 2017 13:23 — forked from aliang/Mac SSH Autocomplete
Add auto complete to your ssh, put into your .bash_profile
_complete_ssh_hosts ()
{
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
comp_ssh_hosts=`cat ~/.ssh/known_hosts | \
cut -f 1 -d ' ' | \
sed -e s/,.*//g | \
grep -v ^# | \
uniq | \
grep -v "\[" ;
Ansible playbook to setup HTTPS using Let's encrypt on nginx.
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS.
The server pass A rating on [SSL Labs](https://www.ssllabs.com/).
To use:
1. Install [Ansible](https://www.ansible.com/)
2. Setup an Ubuntu 16.04 server accessible over ssh
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder)
@chuegel
chuegel / le-renew-webroot
Last active February 8, 2016 08:08 — forked from thisismitch/le-renew-webroot
Let's Encrypt Auto-Renewal using the Webroot Plugin (Nginx)
#!/bin/bash
# 08.02.2016: Small improvement to load all config files at once
web_service='nginx'
#config_file="/usr/local/etc/le-renew-webroot.ini"
le_path='/opt/letsencrypt'
exp_limit=30;
# Lets parse all config files at ones: