Skip to content

Instantly share code, notes, and snippets.

View itd24's full-sized avatar

Ziga Petek itd24

View GitHub Profile
@itd24
itd24 / nginx_local_reverse_proxy.sh
Created April 22, 2022 12:36
NginX Local Reverse Proxy
server {
listen 8764 default_server;
listen [::]:8764 default_server;
server_name _;
location / {
proxy_pass http://192.168.1.123;
proxy_set_header Host $http_host;
}
@itd24
itd24 / restart_systemd.sh
Created April 22, 2022 12:08
Restart Systemd
sudo systemctl daemon-reload
@itd24
itd24 / autossh-tunnel.service
Created April 22, 2022 12:07
The autoSSH tunnel service
[Unit]
Description=AutoSSH tunnel service to remote server on local port 8764
After=network.target
[Service]
Environment="AUTOSSH_GATETIME=0"
ExecStart=/usr/bin/autossh -M 0 -o "ServerAliveInterval 20" -o "ServerAliveCountMax 3" -o "ConnectTimeout=1" -N -R 8764:127.0.0.1:8764 root@my.awesome-domain-name.com
[Install]
WantedBy=multi-user.target
@itd24
itd24 / autossh_tunnel.sh
Created April 22, 2022 11:44
Create an ssh tunnel with autoSSH
autossh -M 0 -o "ServerAliveInterval 20" -o "ServerAliveCountMax 3" -o "ConnectTimeout=1" -N -R 8764:127.0.0.1:8764 root@my.awesome-domain-name.com
@itd24
itd24 / install_autossh.sh
Created April 22, 2022 11:38
Install AutoSSH
sudo apt-get install autossh
@itd24
itd24 / default
Last active April 21, 2022 14:13
NginX Reverse Proxy Configuration
server {
listen 80;
listen [::]:80;
server_name my.awesome-domain-name.com;
gzip on;
gzip_comp_level 5;
location / {
proxy_pass http://localhost:8764;
proxy_set_header Host $http_host;
@itd24
itd24 / check_nginx_status.sh
Created April 21, 2022 13:59
Check NginX Status
systemctl status nginx
@itd24
itd24 / install_nginx.sh
Last active April 21, 2022 13:58
Install NginX
sudo apt update
sudo apt install nginx
@itd24
itd24 / docker-compose.yml
Created September 19, 2021 13:01
Building your first microservice: creating a development environment
version: "3.7"
services:
app:
image: node:14
container_name: cryptowatcher
restart: always
volumes:
- ./app:/usr/src/app
- /app/node_modules
working_dir: /app
@itd24
itd24 / Dockerfile
Created September 19, 2021 12:39
Build your first microservice: Dockerfile
# we create this container from a standard nodejs container
FROM node:14
# we create the app directory, this will be our working directory
WORKDIR /usr/src/app
# we install the app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
COPY app/package*.json ./