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 [email protected]
- 1. Container Wrappers
- 2. Home directory customization
- 3. zsync to sync files between local and server
- 4. VPN Initialization script
- 5. Docker based Ubuntu VM
- Create a directory
nginx-proxy-manager
and copy compose.yaml to it. - Create a
.env
file as below and rundocker 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 rundocker compose up -d
DATA=portainer/data
PORT_443=...
PORT_8000=...
1.3. Nextcloud initialization command with reverse-proxy
- Setup Home directory customization
- Run the command:
./containers/nextcloud/nc-setup.sh
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 rundocker 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
1.6. Odoo with reverse-proxy
- Use
nginx.conf
file for nginx reverse proxy settings. Replaceodoo.example.com
with your domain name. - Also update docker container name.
- Create a directory
odoo
and copycompose.yaml
to it. - Create a directory
config
insideodoo
and copyodoo.conf
to it. - in
odoo.conf
, uncommentadmin_passwd
and set a password. - Create a
.env
file as below and rundocker compose up -d
COMPOSE_PROJECT_NAME=your_project_name
# Port configuration
PORT_443=443
# Odoo configuration
CONFIG=/path/to/config
ADDONS=/path/to/addons
# Postgres configuration
POSTGRES_USER=your_postgres_user
POSTGRES_PASSWORD=your_postgres_password
./home/setup.sh
source ~/.profile
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.
zsync [pull|push] syncserver syncdir
Setup Docker
Net tools
cd vpn
./setup.sh
sudo reboot
cd /opt/wireguard-server
docker-compose ps
https://www.wireguard.com/install
docker exec -it wireguard /app/show-peer 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
- cd into the directory where you want the home directory of the user.
- Run the container with command
docker run -d -v .:/home --network host --name my-vm vm