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 | |
| # Do not run if removal already in progress. | |
| pgrep "docker rm" && exit 0 | |
| # Remove Dead and Exited containers. | |
| docker rm $(docker ps -a | grep "Dead\|Exited" | awk '{print $1}'); true | |
| # It will fail to remove images currently in use. | |
| docker rmi $(docker images -qf dangling=true); true |
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
| <!doctype html> | |
| <title>Site Maintenance</title> | |
| <style> | |
| body { text-align: center; padding: 150px; } | |
| h1 { font-size: 50px; } | |
| body { font: 20px Helvetica, sans-serif; color: #333; } | |
| article { display: block; text-align: left; width: 650px; margin: 0 auto; } | |
| a { color: #dc8100; text-decoration: none; } | |
| a:hover { color: #333; text-decoration: none; } | |
| </style> |
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
| # Secure local IPs: | |
| # | |
| # 127.0.0.2 - www.example.dev | |
| # | |
| 127.0.0.1 localhost | |
| # example.com | |
| 127.0.0.2 www.example.dev |
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/python | |
| # Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. | |
| # | |
| # Licensed under the Amazon Software License (the "License"). You may not use | |
| # this file except in compliance with the License. A copy of the License is | |
| # located at http://aws.amazon.com/asl/ or in the "license" file accompanying | |
| # this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR | |
| # CONDITIONS OF ANY KIND, either express or implied. See the License for the specific | |
| # language governing permissions and limitations under the License. |
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 | |
| MONGO_DATABASE="your_db_name" | |
| APP_NAME="your_app_name" | |
| MONGO_HOST="127.0.0.1" | |
| MONGO_PORT="27017" | |
| TIMESTAMP=`date +%F-%H%M` | |
| MONGODUMP_PATH="/usr/bin/mongodump" | |
| BACKUPS_DIR="/home/username/backups/$APP_NAME" |
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 | |
| # Make sure to: | |
| # 1) Name this file `backup.sh` and place it in /home/ubuntu | |
| # 2) Run sudo apt-get install awscli to install the AWSCLI | |
| # 3) Run aws configure (enter s3-authorized IAM user and specify region) | |
| # 4) Fill in DB host + name | |
| # 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket) | |
| # 6) Run chmod +x backup.sh | |
| # 7) Test it out via ./backup.sh |
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
| --- | |
| - hosts: localhost | |
| become: yes | |
| vars: | |
| driver: 378.13 | |
| driver_url: http://us.download.nvidia.com/XFree86/Linux-x86_64/{{driver}}/NVIDIA-Linux-x86_64-{{driver}}-no-compat32.run | |
| tasks: | |
| - get_url: dest=. url={{driver_url}} | |
| - command: systemctl isolate multi-user.target | |
| - service: name=nvidia-docker state=stopped |
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
| TMPDIR=$(mktemp -d $MKTEMP_BASEDIR) | |
| # k3s | |
| if $(command -v k3s >/dev/null 2>&1); then | |
| mkdir -p $TMPDIR/k3s/crictl | |
| mkdir -p $TMPDIR/k3s/logs | |
| mkdir -p $TMPDIR/k3s/podlogs | |
| mkdir -p $TMPDIR/k3s/kubectl | |
| k3s check-config > $TMPDIR/k3s/check-config 2>&1 | |
| k3s kubectl get nodes -o json > $TMPDIR/k3s/kubectl/nodes 2>&1 | |
| k3s kubectl version > $TMPDIR/k3s/kubectl/version 2>&1 |