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 | |
# @author Nikolas Lahtinen <nikolas.lahtinen@gmail.com> | |
# | |
# Print a spinner in bash | |
# Use in a script: | |
# source ./spinner.sh | |
# let TIME=0 | |
# while [[ "$TIME" != "10" ]]; do | |
# echo -ne "\r" # Reset to beginning of the line | |
# spinner # Print spinner |
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 | |
# @author Nikolas Lahtinen <nikolas.lahtinen@gmail.com> | |
# | |
# Merge json files with jq-1.5 | |
# Usage: | |
# ./merge-json.sh *.json | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
source $DIR/auto-jq.sh # https://gist.github.com/Hallian/a3f53d247a92f4ace621 |
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 | |
# @author Nikolas Lahtinen <nikolas.lahtinen@gmail.com> | |
# | |
# Check if Jq version 1.5 is installed, if not, download it. | |
# Use in a script: | |
# source ./auto-jq.sh | |
# echo '{"key": "value"}' | $JQ .[] | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
JQ="$DIR/jq" |
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 | |
# @author Nikolas Lahtinen <nikolas.lahtinen@gmail.com> | |
# List the files you want to package between the lines that say "FILES" | |
read -r -d '' FILES << FILES | |
src | |
config | |
public | |
codedeploy/scripts | |
codedeploy/appspec.yml |
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 | |
if [[ -z $1 ]]; then | |
echo "Usage: ./remote-backup-letsencrypt.sh [user@host]" | |
exit 1 | |
fi | |
ssh $1 "sudo tar -czf /tmp/letsencrypt.tar.gz /etc/letsencrypt" | |
scp -r $1:/tmp/letsencrypt.tar.gz . | |
ssh $1 "sudo rm /tmp/letsencrypt.tar.gz" |
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 | |
# @author Nikolas Lahtinen <nikolas.lahtinen@gmail.com> | |
# | |
# Clones or pulls the repositories defined bellow. | |
# NOTE: Repository url must end in .git | |
read -r -d '' REPOSITORIES << REPOSITORIES | |
git@github.com:octocat/Hello-World.git | |
git@github.com:octocat/hello-worId.git | |
git@github.com:octocat/Spoon-Knife.git |