Gogs

Usage with postgresql 1 2 3 4 docker pull gogs/gogs docker network create -d bridge --subnet 192.168.88.0/24 --gateway 192.168.88.1 docker-net sudo systemctl restart postgresql docker run -d --network docker-net --name=gogs -p 10022:22 -p 10080:3000 -v /var/gogs:/data gogs/gogs

Docker

Usage Install(for archlinux) 1 2 3 sudo pacman -S docker sudo systemctl enable docker sudo gpasswd -a who-am-i docker Clean 1 2 3 docker system prune --volumes # clear, DON RUN IT ON SERVER docker image prune -a # remove all dangling images docker ps Build & push 1 2 3 4 docker build -t NAME . docker build --no-cache -t NAME .

PostgreSql

Usage backup && restore 1 2 $ pg_dump dbname > outfile $ psql dbname < infile create database with owner 1 2 3 4 5 $ sudo su - postgres $ psql > CREATE USER who-am-i WITH PASSWORD 'change-me'; > CREATE DATABASE db-name WITH ENCODING='UTF8'; > GRANT ALL PRIVILEGES ON DATABASE db-name TO who-am-i; apply privileges to user 1 2 3 4 > \c db-name > GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA PUBLIC TO who-am-i; > GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA PUBLIC TO who-am-i; > GRANT ALL PRIVILEGES ON ALL FUNCTIONS IN SCHEMA PUBLIC TO who-am-i; psql 1 2 3 4 5 > psql -U USER -d DB -W > \l # show databases > \c db-name # connect database > \d # show tables > \d table-name # show table scheme change owner 1 > ALTER DATABASE db-name OWNER TO who-am-i; 1 2 3 4 5 6 7 8 9 > SELECT format( 'ALTER TABLE %I.

Swap

Create a swap file 1 2 3 4 dd if=/dev/zero of=/swap.fs bs=1M count=2048 chmod 600 /swap.fs mkswap /swap.fs swapon /swap.fs /etc/fstab 1 /swap.fs none swap defaults 0 0

Nginx

Usage Disable .git 1 2 3 location ~ /.git/ { deny all; } Hugo build && upload 1 2 $ hugo -D --minify $ rsync -avz --delete public/ deploy@www.yoursite.com:/var/www/www.yoursite.com/htdocs nginx.conf 1 2 3 4 5 6 7 8 server { listen 80; index index.html; gzip on; root /var/www/www.yoursite.com/htdocs; server_name www.yoursite.com; } Rust & React 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 server { listen 80; server_name www.