Skip to content

Instantly share code, notes, and snippets.

View amanjuman's full-sized avatar
😉
Ill

Aman Juman amanjuman

😉
Ill
View GitHub Profile
@amanjuman
amanjuman / Install V2RayA Client on OpenWRT and Configure Outline 2023
Last active April 21, 2024 08:24
Install V2RayA Client on OpenWRT and Configure Outline 2023
## You need to remove the default dnsmasq package.
## If you remove straight, it will stop resolving DNS, and that is why we are going to use these following commands
opkg update; cd /tmp/ && opkg download dnsmasq-full; opkg install ipset libnettle8 libnetfilter-conntrack3;
opkg remove dnsmasq; opkg install dnsmasq-full --cache /tmp/; rm -f /tmp/dnsmasq-full*.ipk;
## Install wget if you don't have it.
## You can skip that if you can upload those files using SCP
## Check the official repo as those endpoints update frequently therefore change it accordingly
opkg install wget
wget https://downloads.sourceforge.net/project/v2raya/openwrt/v2raya.pub -O /etc/opkg/keys/94cc2a834fb0aa03
@amanjuman
amanjuman / kuoruan-public.key
Last active July 23, 2023 09:36
kuoruan-public openwrt
untrusted comment: Public usign key of kuoruan
RWRiiYfggx/lURV6KddLLtVJuBc0mzi4FSfYQ9/uurLmRksSREKkRkR8
@amanjuman
amanjuman / bash.md
Last active July 20, 2023 14:48
Minio API and Console setup with Nginx Reverse Proxy for Ubuntu

Install Nginx and Certbot

sudo apt install nginx python3-certbot-nginx -y

Download Minio for x64

sudo wget https://dl.min.io/server/minio/release/linux-amd64/minio

Add Executable Permission to Minio Dir

sudo chmod +x ./minio

Add Minio User and Permission

@amanjuman
amanjuman / bash
Created July 20, 2023 14:25
Mount Hetzner Storage Box with Ubuntu Server using WebDev Protocol
sudo apt update
sudo apt install davfs2 -y
sudo adduser $USER davfs2
sudo mkdir -p /mnt/hetzner
echo "/mnt/hetzner username password" | sudo tee -a /etc/davfs2/secrets
sudo chmod 600 /etc/davfs2/secrets
echo "https://storage-box-url.your-storagebox.de:443 /mnt/hetzner davfs rw,user,noauto 0 0" | sudo tee -a /etc/fstab
mount /mnt/hetzner
@amanjuman
amanjuman / minio.conf
Created July 20, 2023 14:22
Minio Nginx Reverse Proxy for API and Console Access for Subdomain
## API End Point
server
{
# Listen
listen 80;
listen [::]:80;
listen 443 ssl http2;
listen [::]:443 ssl http2;
# Directory & Server Naming
@amanjuman
amanjuman / install.sh
Last active April 6, 2024 22:52
Install Outline Server on Linux
## Install Server
sudo bash -c "$(wget -qO- https://raw.githubusercontent.com/Jigsaw-Code/outline-server/master/src/server_manager/install_scripts/install_server.sh)" --hostname=fqdn.domain.tld --api-port 34567 --keys-port 23456
## Uninstall Server
docker rm -f shadowbox watchtower && docker system prune -a
@amanjuman
amanjuman / UrBackup.conf
Last active April 30, 2024 11:08
UrBackup Nginx Configuration
server
{
# Listen
listen 80;
listen [::]:80;
listen 443 ssl http2;
listen [::]:443 ssl http2;
# Server Name and Alias
server_name urbackup.example.com;
@amanjuman
amanjuman / import.sh
Last active April 30, 2023 01:10
MailCow Import Multiple Mailbox from CSV File
#!/bin/bash
# Set the API endpoint URL and key
ENDPOINT="https://mcow.domain.tld/api/v1/add/mailbox"
API_KEY="XXX-YYY"
# Read the CSV file line by line and create mailbox users
while IFS=',' read -r from_name from_email user_name password; do
# Extract the domain from the user_name field
domain=$(echo "$user_name" | awk -F'@' '{print $2}')
@amanjuman
amanjuman / add_domains.sh
Created April 28, 2023 21:29
MailCow Add Multiple Domain from a text file using API
#!/bin/bash
# Set your Mailcow API key and endpoint
api_key="xxx-xxx-xxxx"
api_endpoint="https://mcow.example.ltd/api/v1/add/domain"
# Set default domain values
aliases="400"
mailboxes="100"
defquota="1024"
@amanjuman
amanjuman / wg0.conf.md
Created March 28, 2023 20:14
WireGuard Port Forwarding to Connected Peer

TCP Forwarding Only

PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o ens32 -j MASQUERADE; iptables -t nat -A PREROUTING -i ens32 -p tcp --match multiport --dports 1024:65535 -j DNAT --to-destination 10.0.0.10
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o ens32 -j MASQUERADE; iptables -t nat -D PREROUTING -i ens32 -p tcp --match multiport --dports 1024:65535 -j DNAT --to-destination 10.0.0.10

TCP & UDP Forwarding

PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o ens32 -j MASQUERADE; iptables -t nat -A PREROUTING -i ens32 -p tcp -m multiport --dports 1024:65535 -j DNAT --to-destination 10.0.0.10; iptables -t nat -A PREROUTING -i ens32 -p udp -m multiport --dports 1024:65535 -j DNAT --to-destination 10.0.0.10
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o ens32 -j MASQUERADE; iptables -t nat -D PREROUTING -i ens32 -p tcp -m multiport --dports 1024:65535 -j DNAT --