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 | |
# should be run as root | |
fallocate -l 1G /swapfile && chmod 600 /swapfile && mkswap /swapfile && swapon /swapfile |
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 | |
TIMESTAMP=`date +"%Y-%m-%d %H.%M.%S"` | |
FILENAME="Backup Name $TIMESTAMP.sql.gz" | |
BAK_PATH="$HOME/bak" | |
mysqldump -u user --password=`cat ~/some/path/.env | grep DB_PASSWORD | sed 's/DB_PASSWORD=//'` your_db_name | gzip > "$BAK_PATH/$FILENAME" | |
echo $FILENAME > "$BAK_PATH/latest_backup" |
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
VOLUME=vol_name_here; ssh your.server "cd `docker volume inspect --format "{{ .Mountpoint }}" $VOLUME`; tar -czf - ." > ${VOLUME}-backup-`date +"%Y-%m-%d_%H.%M.%S"`.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
[Unit] | |
Description=Persistent SSH Tunnel from port XXXX on this server, docker ip to port localhost:YYYY on example.com server (local port forwarding) | |
After=network.target | |
[Service] | |
Restart=on-failure | |
RestartSec=5 | |
ExecStart=/usr/bin/ssh -NTC -o ServerAliveInterval=60 -o ExitOnForwardFailure=yes -L 172.17.0.1:XXXX:127.0.0.1:YYYY example.com | |
[Install] |
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
/* | |
Basically, base64URL is a modification of common base64 standard containing following changes: | |
* Replaces "+" by "-" (minus) | |
* Replaces "/" by "_" (underline) | |
* Does not require a padding character | |
* Forbids line separators | |
Considering above, base64url string may be safely used as part of the URL without any further encoding. | |
For more details please see https://base64.guru/standards/base64url | |
*/ |
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
docker volume inspect --format "{{ .Mountpoint }}" aura_prod_files_storage |
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
ssh [email protected] "cd ~/whenewer/you/want/to; tar -czf - ." > files-backup.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
<? phpinfo(); |
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
RESULT="" | |
for element in $ARRAY ; do | |
RESULT="$RESULT${RESULT:+,}$element" | |
done |
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
Host github | |
Hostname github.com | |
User git | |
IdentityFile "D:/path/to the/private.key" |
NewerOlder