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 | |
# Check if the script received the correct number of arguments | |
if [ "$#" -ne 2 ]; then | |
echo "Usage: $0 <repo_path> <output_file>" | |
exit 1 | |
fi | |
REPO_PATH=$1 | |
OUTPUT_FILE=$2 |
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 | |
set -euo pipefail | |
DRY_RUN=0 | |
if [[ $# -gt 0 && "$1" == "--dry-run" ]]; then | |
DRY_RUN=1 | |
echo "Dry run mode. No changes will be made." | |
fi |
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
#cloud-config | |
groups: | |
- docker | |
users: | |
- default | |
# the docker service account | |
- name: docker-service | |
groups: docker | |
package_upgrade: true | |
packages: |
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 gitlab | |
import urllib3 | |
import humanfriendly | |
import timeago, datetime | |
# 2020-04-24T12:04:26.475+00:00 | |
date_now = datetime.datetime.now() | |
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) |
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 | |
#a simple bash function for updating servers safely (to avoid branch conflicts and corruption) | |
pullpush() { | |
ifgit=$(git status &>/dev/null; echo $?) | |
if [[ "$ifgit" = 0 ]]; then | |
echo "A git repository" | |
else | |
echo "Not a git repository, exiting..." | |
return 1 | |
fi |