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
| My Docker Notes. I will post more in future on details about Docker, Docker Compose, Docker Swarm on my blog under: | |
| https://sysadmins.co.za/tag/docker | |
| Get Docker: | |
| # curl -sSL https://get.docker.io | bash | |
| Docker Hub: | |
| Search: | |
| # docker search ubuntu |
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
| #!/usr/bin/env bash | |
| mkdir -p ~/workspace/go | |
| cd /tmp | |
| wget https://storage.googleapis.com/golang/go1.8.1.linux-amd64.tar.gz | |
| tar -xf go1.8.1.linux-amd64.tar.gz | |
| sudo chown -R root:root ./go | |
| sudo mv go /usr/local | |
| rm -rf go1.8.1.linux-amd64.tar.gz | |
| echo 'export GOPATH=$HOME/workspace/go' >> ~/.profile | |
| echo 'export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin' >> ~/.profile |
parse.sh
#!/bin/sh
buffer=$(cat)
name=$(echo $buffer | jq -r '.source.name')
surname=$(echo $buffer | jq -r '.source.surname')
echo "Hello ${name}, ${surname}"
Encryption
$ openssl enc -aes-256-cbc -in un_encrypted.data -out encrypted.data
Decryption
$ openssl enc -d -aes-256-cbc -in encrypted.data -out un_encrypted.data
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
| import ( | |
| "encoding/json" | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "github.com/gorilla/mux" | |
| "github.com/rs/xid" | |
| ) |
mkdir letsencrypt
docker run -ti --rm -v "$(pwd)"/letsencrypt:/etc/letsencrypt \
certbot/certbot --manual --preferred-challenges dns certonly -d sub.domain.com
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 | |
| # Credit: https://callistaenterprise.se/blogg/teknik/2017/12/18/docker-in-swarm-mode-on-docker-in-docker/ | |
| # https://hub.docker.com/_/docker?tab=tags | |
| # https://www.blog.labouardy.com/docker-swarm-networking-and-dynamic-reverse-proxy/ | |
| SWARM_ENABLED=true | |
| DOCKER_VERSION=18.06.3-ce-dind | |
| NUM_WORKERS=3 | |
| if [ ${SWARM_ENABLED} == "false" ] |
NewerOlder