Skip to content

Instantly share code, notes, and snippets.

@Srobin2020S
Srobin2020S / docker_rus.md
Created August 8, 2024 09:48 — forked from wtw24/docker_rus.md
Шпаргалка с командами Docker

Шпаргалка с командами Docker

1552317264965 1552317537397 1552317711879

1552318467562 1552318531067 1552318577900 1552318614839

@Srobin2020S
Srobin2020S / create-service.sh
Created July 21, 2023 04:56 — forked from ahmedsadman/create-service.sh
Bash script to create systemd service
#!/usr/bin/bash
##
## Creates Service file based on JSON data
##
# Sample JSON file:
# {
# "service_name": "test_service",
# "description": "Netcore dev server",
@Srobin2020S
Srobin2020S / harden-Ubuntu2004.sh
Created May 24, 2023 08:38
Harden Ubuntu 20.04 server installation
#!/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/)
# -----------------------------------------------------------------------------
@Srobin2020S
Srobin2020S / bash.sh
Created October 30, 2022 13:00 — forked from mshafiee/bash.sh
bash cheatsheets
#!/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
@Srobin2020S
Srobin2020S / git-cheat-list.md
Created October 30, 2022 12:59 — forked from mshafiee/git-cheat-list.md
Git cheat list

Git cheat list

  • name of the current banch and nothing else (for automation)

    git rev-parse --abbrev-ref HEAD
    
  • all commits that your branch have that are not yet in master

    git log master..<HERE_COMES_YOUR_BRANCH_NAME>
    

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.

  1. Copy this entire gist to your raspberry pi
  2. Do chmod +x step1.sh step2.sh iptables.sh in the gist folder (so that
  3. 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
@Srobin2020S
Srobin2020S / sysctl-proxmox-tune.conf
Created April 21, 2022 04:46 — forked from sergey-dryabzhinsky/sysctl-proxmox-tune.conf
Most popular speedup sysctl options for Proxmox. Put in /etc/sysctl.d/
###
# 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 ###
@Srobin2020S
Srobin2020S / bash.sh
Created December 4, 2020 16:04 — forked from cristian-sr/bash.sh
Bash-scripting
https://devhints.io/bash
Example
#!/usr/bin/env bash
NAME="John"
echo "Hello $NAME!"
Variables
NAME="John"
@Srobin2020S
Srobin2020S / pre-push.sh
Created December 4, 2020 16:04 — forked from ang3lkar/pre-push.sh
Git hook scripts
#!/bin/bash
remote="$1"
url="$2"
[[ $url =~ git[@|\.]heroku.com[:|\/](.+)\.git ]]
app=${BASH_REMATCH[1]}
z40=0000000000000000000000000000000000000000

Certbot и nginx, как обратный прокси в Docker (пример с 2 react проектами)

В результате будет 2 react проекта на 1 сервере доступных по разным ссылкам

Цели

  • Запустить nginx в одном контейнере
  • Запустить другие проекты в других контейнерах
  • Научить nginx перенаправлять запросы с разных доменов на разные проекты
  • Получить ssl сертификаты для всех проектов