Шпаргалка с командами Docker
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/bash | |
| ## | |
| ## Creates Service file based on JSON data | |
| ## | |
| # Sample JSON file: | |
| # { | |
| # "service_name": "test_service", | |
| # "description": "Netcore dev server", |
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 | |
| # ============================================================================= | |
| # Harden Ubuntu Linux 20.04 (focal) | |
| # Run commands as root (sudo su -) | |
| # ----------------------------------------------------------------------------- | |
| # Developer.......: Andre Essing (https://www.andre-essing.de/) | |
| # (https://github.com/aessing) | |
| # (https://twitter.com/aessing) | |
| # (https://www.linkedin.com/in/aessing/) | |
| # ----------------------------------------------------------------------------- |
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 | |
| ############################################################################## | |
| # SHORTCUTS and HISTORY | |
| ############################################################################## | |
| CTRL+A # move to beginning of line | |
| CTRL+B # moves backward one character | |
| CTRL+C # halts the current command | |
| CTRL+D # deletes one character backward or logs out of current session, similar to exit | |
| CTRL+E # moves to end of line |
Install raspbian, set up your users however you would like, so long as you have sudo access on the user you are running this with. You probably want to resize the image so it fills the SD card as well.
- Copy this entire gist to your raspberry pi
- Do
chmod +x step1.sh step2.sh iptables.shin the gist folder (so that - Run step1.sh a) This script does a few things - it first updates your raspberry pi, then it installs a few needed utilities, then it upgrades the firmware on your raspberry pi
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
| ### | |
| # Proxmox or other server kernel params cheap tune and secure. | |
| # Try it if you have heavy load on server - network or memory / disk. | |
| # No harm assumed but keep your eyes open. | |
| # | |
| # @updated: 2020-02-06 - more params used, adjust some params values, more comments on params | |
| # | |
| ### NETWORK ### |
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
| https://devhints.io/bash | |
| Example | |
| #!/usr/bin/env bash | |
| NAME="John" | |
| echo "Hello $NAME!" | |
| Variables | |
| NAME="John" |
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 | |
| remote="$1" | |
| url="$2" | |
| [[ $url =~ git[@|\.]heroku.com[:|\/](.+)\.git ]] | |
| app=${BASH_REMATCH[1]} | |
| z40=0000000000000000000000000000000000000000 |
В результате будет 2 react проекта на 1 сервере доступных по разным ссылкам
- Запустить nginx в одном контейнере
- Запустить другие проекты в других контейнерах
- Научить nginx перенаправлять запросы с разных доменов на разные проекты
- Получить ssl сертификаты для всех проектов
NewerOlder






