This has been updated to install Dashboard v2.0.0, see below for pre v2.0.0 instructions
Generate the kubeconfig file for your cluster using the Kubeconfig File
button in the Cluster view of your cluster.
This has been updated to install Dashboard v2.0.0, see below for pre v2.0.0 instructions
Generate the kubeconfig file for your cluster using the Kubeconfig File
button in the Cluster view of your cluster.
#!/bin/sh | |
# OUTDATED: please refer to the link below for the latest version: | |
# https://github.com/rancherlabs/support-tools/blob/master/extended-rancher-2-cleanup/extended-cleanup-rancher2.sh | |
docker rm -f $(docker ps -qa) | |
docker volume rm $(docker volume ls -q) | |
cleanupdirs="/var/lib/etcd /etc/kubernetes /etc/cni /opt/cni /var/lib/cni /var/run/calico /opt/rke" | |
for dir in $cleanupdirs; do | |
echo "Removing $dir" | |
rm -rf $dir | |
done |
from __future__ import (absolute_import, division, print_function) | |
__metaclass__ = type | |
DOCUMENTATION = ''' | |
vars: sops | |
version_added: "N/A" | |
short_description: In charge of loading SOPS-encrypted vars | |
description: | |
- Loads SOPS-encrytped YAML vars into corresponding groups/hosts in group_vars/ and host_vars/ directories. | |
- Only SOPS-encrypted vars files, with a top-level "sops" key, will be loaded. |
[TOC]
Aggregations are a way to process the results of a search query, group, sort and transform them - and extract analytic insights from them. Much like aggregation queries in other databases and search engines, they can be used to create analytics report, or to perform Faceted Search style queries.
For example, indexing a web-server's logs, we can create report for unique users by hour, country or any other breakdown; or create different reports for errors, warnings, etc.
#!/bin/bash | |
cd /tmp | |
sudo apt-get install --assume-yes jq > /dev/null | |
terraform_url="https://releases.hashicorp.com/terraform/$(curl -s https://checkpoint-api.hashicorp.com/v1/check/terraform | jq -r -M '.current_version')/terraform_$(curl -s https://checkpoint-api.hashicorp.com/v1/check/terraform | jq -r -M '.current_version')_linux_amd64.zip" | |
packer_url="https://releases.hashicorp.com/packer/$(curl -s https://checkpoint-api.hashicorp.com/v1/check/packer | jq -r -M '.current_version')/packer_$(curl -s https://checkpoint-api.hashicorp.com/v1/check/packer | jq -r -M '.current_version')_linux_amd64.zip" | |
# ----------------------------------------------------------------- | |
# User-Agent strings that are worth blocking with the following rule | |
# in haproxy to prevent your content being stolen, stop spammers and | |
# to limit your bandwidth usage. | |
# | |
# acl badbots hdr_reg(User-Agent) -i -f /etc/haproxy/badbots.lst | |
# block if badbots | |
# | |
# By Danny Sheehan | |
# http://www.setuptips.com |
#!/bin/bash | |
function terraform-install() { | |
[[ -f ${HOME}/bin/terraform ]] && echo "`${HOME}/bin/terraform version` already installed at ${HOME}/bin/terraform" && return 0 | |
LATEST_URL=$(curl -sL https://releases.hashicorp.com/terraform/index.json | jq -r '.versions[].builds[].url' | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n | egrep -v 'rc|beta' | egrep 'linux.*amd64' |tail -1) | |
curl ${LATEST_URL} > /tmp/terraform.zip | |
mkdir -p ${HOME}/bin | |
(cd ${HOME}/bin && unzip /tmp/terraform.zip) | |
if [[ -z $(grep 'export PATH=${HOME}/bin:${PATH}' ~/.bashrc) ]]; then | |
echo 'export PATH=${HOME}/bin:${PATH}' >> ~/.bashrc |
package main | |
import ( | |
"bytes" | |
"compress/zlib" | |
"fmt" | |
"time" | |
"github.com/vmihailenco/msgpack" | |
redis "gopkg.in/redis.v5" |
kubectl get pods | grep Evicted | awk '{print $1}' | xargs kubectl delete pod |
package main | |
import "fmt" | |
func main() { | |
slice := make([]int, 159) | |
// Split the slice into batches of 20 items. | |
batch := 20 |