My Elasticsearch cheatsheet with example usage via rest api (still a work-in-progress)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "This will generate a new kube config for accessing your RKE-created kubernetes cluster. This script MUST be run on a Kubernetes node." | |
echo "Please enter the IP of one of your control plane hosts, followed by [ENTER]:" | |
read cphost | |
openssl genrsa -out kube-admin.key 2048 | |
openssl req -new -sha256 -key kube-admin.key -subj "/O=system:masters/CN=kube-admin" -out kube-admin.csr | |
sudo openssl x509 -req -in kube-admin.csr -CA /etc/kubernetes/ssl/kube-ca.pem -CAcreateserial -CAkey /etc/kubernetes/ssl/kube-ca-key.pem -out kube-admin.crt -days 365 -sha256 | |
sudo rm -f /etc/kubernetes/ssl/kube-ca.srl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First, download the ISO file from the internet (NOTE: you could equally use a locally stored ISO) | |
Get-ChocolateyWebFile 'WindowsSDK2008' "$env:temp\winsdk2008.iso" 'http://download.microsoft.com/download/f/e/6/fe6eb291-e187-4b06-ad78-bb45d066c30f/6.0.6001.18000.367-KRMSDK_EN.iso' | |
# Next, mount the ISO file, ready for using it's contents | |
$iso = Get-Item "$env:temp\winsdk2008.iso" | |
Mount-DiskImage -ImagePath $iso | |
#Get the drive letter where iso is mounted | |
$driveLetter = (Get-DiskImage $iso | Get-Volume).DriveLetter |
Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.
git revert {commit_id}'
Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:
- Auto Scaling
- GroupMinSize
- GroupMaxSize
- GroupDesiredCapitity
- GroupInServiceInstances
- GroupPendingInstances
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Elastic Load Balancer, CloudFront and Let's Encrypt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
connection { | |
agent = false | |
bastion_host = "${var.bastion_host}" | |
bastion_user = "ec2-user" | |
bastion_port = 22 | |
bastion_private_key = "${file("${path.module}/../keys/${var.serverinfo["bastion_private_key"]}")}" | |
user = "${var.serverinfo["user"]}" | |
private_key = "${file("${path.module}/../keys/${var.serverinfo["private_key"]}")}" | |
host = "192.168.2.10" | |
timeout = "2m" |
NewerOlder