This file contains 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
version: '3.2' | |
services: | |
agent: | |
image: portainer/agent:2.9.2 | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock | |
- /var/lib/docker/volumes:/var/lib/docker/volumes | |
environment: | |
AGENT_CLUSTER_ADDR: tasks.agent |
This file contains 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
# Sample Nginx config with sane caching settings for modern web development | |
# | |
# Motivation: | |
# Modern web development often happens with developer tools open, e. g. the Chrome Dev Tools. | |
# These tools automatically deactivate all sorts of caching for you, so you always have a fresh | |
# and juicy version of your assets available. | |
# At some point, however, you want to show your work to testers, your boss or your client. | |
# After you implemented and deployed their feedback, they reload the testing page – and report | |
# the exact same issues as before! What happened? Of course, they did not have developer tools | |
# open, and of course, they did not empty their caches before navigating to your site. |
This file contains 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
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Backup with compression | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE | gzip > `date +%Y-%m-%d-%T%z`-NAME.sql.gz | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
# Restore from gzip | |
zcat 2018-11-14-backup.sql.gz | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE |
This file contains 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
version: '3.7' | |
services: | |
traefik: | |
# Use the latest Traefik image | |
image: traefik:v2.5 | |
ports: | |
# Listen on port 80, default for HTTP, necessary to redirect to HTTPS | |
- target: 80 |
This file contains 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 -e | |
# Usages: | |
# wget -O - https://gist.githubusercontent.com/piihuynh/xxx/raw/yyy/add-user-on-ubuntu.sh | bash -s username | |
# bash -c "$(wget -qO - 'https://gist.githubusercontent.com/piihuynh/xxx/raw/587yyy/add-user-on-ubuntu.sh')" '' username | |
[ $EUID -ne 0 ] && echo "This script must be run as root" 1>&2 && exit 1 | |
[ -z "$1" ] && echo "Please provide a username in 1st param" && exit 1 | |
# Define username from param |
This file contains 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 -e | |
# Credit: https://gist.github.com/coderua/5592d95970038944d099, https://gist.github.com/Mins/4602864 | |
# Usages: | |
# wget -O - https://gist.githubusercontent.com/piihuynh/xxx/raw/xxx/install-mariadb-10.6.sh | bash -s newpassword | |
# bash -c "$(wget -qO - 'https://gist.githubusercontent.com/piihuynh/xxx/raw/xxx/install-mariadb-10.6.sh')" '' newpassword | |
# Check the bash shell script is being run by root | |
if [[ $EUID -ne 0 ]]; then |
This file contains 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
# Ask for the user password | |
# Script only works if sudo caches the password for a few minutes | |
sudo true | |
# ============================= | |
# Install docker | |
# ----------------------------- | |
# Option 1 | |
# ----------------------------- | |
# Install kernel extra's to enable docker aufs support |
OlderNewer