Skip to content

zuman/scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

97 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scripts

A list of useful scripts to make your terminal life easy.

Tried and tested in Ubuntu & MacOS.

If you are facing any problems, you can reach out to me on zuman.one@icloud.com

Table of Contents


1. Container Wrappers

1.1. Nginx Proxy Manager

  • Create a directory nginx-proxy-manager and copy compose.yaml to it.
  • Create a .env file as below and run docker compose up -d
DATA=nginx-proxy-manager/data
LETSENCRYPT=nginx-proxy-manager/letsencrypt

1.2. Portainer with reverse-proxy

  • Create a directory portainer and copy compose.yaml to it.
  • Create a .env file as below and run docker compose up -d
DATA=portainer/data
PORT_443=...
PORT_8000=...

1.3. Nextcloud initialization command with reverse-proxy

1.4. Gitlab with reverse-proxy

  • Create a directory gitlab and copy compose.yaml to it.
  • Create a .env file as below.
HOSTNAME=...
GITLAB_HOME=...
PORT_22=...
PORT_80=...
PORT_443=...
  • Run docker compose up -d and wait for it to set up.
  • Copy file containers/gitlab/gitlab.rb to $GITLAB_HOME/config/ directory.
  • Reconfigure gitlab with command docker exec -it gitlab gitlab-ctl reconfigure

1.5. Transmission with reverse-proxy

  • Create a directory transmission and copy compose.yaml to it.
  • Create a .env file as below and run docker compose up -d
PUID=...
PGID=...
TZ=Asia/Kolkata # Your timezone
USER=...
PASS=...
CONFIG=/path/to/transmission/config
DOWNLOADS=/path/to/transmission/downloads
WATCH=/path/to/transmission/watch

2. Home directory customization

Commands to setup home directory.

./home/setup.sh
source ~/.profile

3. zsync to sync files between local and server

Prerequisites:

1. Complete section above : 1. Home directory customization
2. Create a ssh profile in ~/.ssh/config file as below (Use your own details):
    Host syncserver
        Hostname server.com
        User username
        Port 22
        IdentityFile ~/.ssh/id_rsa

3. Make sure the directory ~/zsync/syncdir exists and is writable at server and in local machine.

Usage:

zsync [pull|push] syncserver syncdir

4. VPN Initialization script

From home/packages.sh, copy and run the following sections:

Setup Docker

Net tools

Run the following commands to initialize VPN:

cd vpn
./setup.sh
sudo reboot

Confirm that wireguard is running:

cd /opt/wireguard-server
docker-compose ps

Add the following ingress rules to your firewall:

Ingress rule

Install Wireguard client on your device:

https://www.wireguard.com/install

Show QR code for the VPN peer:

docker exec -it wireguard /app/show-peer 1


5. Docker based Ubuntu VM

  1. Run the below commands. (make sure to replace your username and password accordingly)

cd vm

docker build . -t vm --build-arg username=myuser --build-arg password=mypassword

  1. cd into the directory where you want the home directory of the user.
  2. Run the container with command

docker run -d -v .:/home --network host --name my-vm vm


About

Collection of useful linux scripts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages