Skip to content

Instantly share code, notes, and snippets.

@apsega
apsega / backup.sh
Created April 11, 2016 21:55
Docker containers backup
#!/bin/bash
# Variables
CONTAINER_NAME=$1
IMAGE_NAME=$(docker ps -f name=$CONTAINER_NAME --format {{.Image}})
TMP_DIR="/tmp"
DATE=$(date +"%Y-%m-%d")
DATA_VOLUMES=$(docker inspect --format '{{range .Mounts}}{{.Source}}{{" "}}{{end}}' $CONTAINER_NAME)
BKP_FILE="$TMP_DIR"/"$CONTAINER_NAME"_"$DATE"
@apsega
apsega / restore.sh
Last active April 11, 2016 22:12
To restore Docker containers from Dropbox backups
#!/bin/bash
# Usage example: ./script.sh container_name dropbox_user -days_back, i.e. ./script.sh jenkins EA -1
# Variables
CONTAINER_NAME=$1
IMAGE_NAME=$(docker ps -f name=$CONTAINER_NAME --format {{.Image}})
DATE=$(date +"%Y-%m-%d" --date="$3 day")
# From which Dropbox to download
@apsega
apsega / aws_keepalived_eip.sh
Last active September 7, 2017 12:30
aws_keepalive_eip.sh
#!/bin/bash
# parameter
INSTANCE_ID=$1
# variables
export AWS_ACCESS_KEY_ID=XXXXXXXXXXX
export AWS_SECRET_ACCESS_KEY=XXXXXXXXXXX
EIP1=eipalloc-XXXXXXXXXXX # EIP1 xx.xx.xx.xx
EIP2=eipalloc-XXXXXXXXXXX # EIP2 xx.xx.xx.xx
#!/bin/bash
set -e
VERSION="0.15.2"
ARCHITECTURE=$(uname -m)
if [[ ${ARCHITECTURE} == "x86_64" ]]
then
ARCHITECTURE="amd64"
fi
@apsega
apsega / minkube-macos.md
Last active October 6, 2018 19:14
Run Minikube on MacOS and local Docker images

Run Minikube on MacOS and local Docker images

Install required packages

VirtualBox:

brew cask install virtualbox
const text = `0 0 ***.novo.dk 805465029 GET /ksc.html 200 7067
2 1 ***.novo.dk 805465031 GET /images/ksclogo-medium.gif 200 5866
3 2 ***.novo.dk 805465051 GET /images/MOSAIC-logosmall.gif 200 363
4 3 ***.novo.dk 805465053 GET /images/USA-logosmall.gif 200 234
5 4 ***.novo.dk 805465054 GET /images/NASA-logosmall.gif 200 786
6 5 ***.novo.dk 805465058 GET /images/WORLD-logosmall.gif 200 669
7 6 ***.novo.dk 805465068 GET /shuttle/missions/missions.html 200 8678
8 7 ***.novo.dk 805465071 GET /images/launchmedium.gif 200 11853
9 8 ***.novo.dk 805465153 GET /images/KSC-logosmall.gif 200 1204
10 9 ***.novo.dk 805465157 GET /images/NASA-logosmall.gif 200 786

Keybase proof

I hereby claim:

  • I am apsega on github.
  • I am eapsega (https://keybase.io/eapsega) on keybase.
  • I have a public key ASCqgwNCekkGNlCYRBpAZ3SFnua1D-X3NUExWwxYDQTIAAo

To claim this, I am signing this object: