Skip to content

Instantly share code, notes, and snippets.

View ma-04's full-sized avatar

ma-04

  • Dhaka, Bangladesh
View GitHub Profile
#!/bin/bash
set -e
# Define ANSI color codes
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Define the paths for the configuration files
DOCKER_COMPOSE_FILE=~/.fly/docker-compose.yml

FlyWP: Setting Up a Custom Docker Container with SSL

This guide shows you how to run any custom Docker container on your FlyWP server and secure it with a free, auto-renewing Let's Encrypt SSL certificate. The setup uses the server's existing nginx-proxy to automatically handle traffic routing and SSL termination.

Prerequisites:

  • A server managed by FlyWP.
  • A user account with permissions to run Docker commands or sudo permission (default fly User).
  • A domain (e.g., app.yourdomain.com) with its DNS A record pointing to your server's public IP address.
@ma-04
ma-04 / Dockerfile
Last active July 28, 2025 06:50
Tideways Integration with FlyWP
FROM meghsh/php:8.2
USER root
COPY --from=ghcr.io/tideways/php:alpine /tideways/ /tideways/
RUN docker-php-ext-enable --ini-name tideways.ini "$(php /tideways/get-ext-path.php)"
USER www-data
@ma-04
ma-04 / wg.conf
Created October 31, 2024 11:11
List of all Mega VPN server and their wireguard server in wireguard format, currently numbering in 11.
[Peer]
PublicKey = Mwqisw4gOg3uivUS/w6mOpb26RKI2SYNstPTglVMEGA=
AllowedIPs = 0.0.0.0/0, ::/0
Endpoint = JP.vpn.mega.nz:51820
[Peer]
PublicKey = Mwqisw4gOg3uivUS/w6mOpb26RKI2SYNstPTglVMEGA=
AllowedIPs = 0.0.0.0/0, ::/0
Endpoint = LU.vpn.mega.nz:51820
@ma-04
ma-04 / index.html
Last active September 10, 2024 17:49
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>Where is Contolini?</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<meta itemprop="description" content="Where is Contolini?">
<meta itemprop="image" content="https://i.imgur.com/2o2QlvU.png">
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.26.0/mapbox-gl.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/fetch/1.0.0/fetch.min.js'></script>
@ma-04
ma-04 / install-wg-easy.sh
Created September 4, 2024 18:12
this will install wg-easy on your server that is accessible only on localhost:51821. Use ssh tunnel if on remote server or modify the WEB_BIND_ADDRESS
#!/bin/bash
IP=$(curl -s ifconfig.co)
DOCKER_IMAGE=ghcr.io/wg-easy/wg-easy
WEB_BIND_ADDRESS='127.0.0.1' #WARNING wg-easy web doesnt come with SSL
# For colour coding and stuff
red=`tput setaf 1`
green=`tput setaf 2`
blue=`tput setaf 4`
blue=`tput setaf 5`
- hosts:
- all
become: true
tasks:
- name: set restart_server variable
set_fact:
restart_server: false
# by default, this playbook will not reboot any vm, it will just print if reboot
# is required for any vm
# Set this to `true` to reboot a vm if neccessary
@ma-04
ma-04 / zsh.yml
Last active August 5, 2023 12:46
Ansible set user shell to zsh with autocomplete for both user and root user
- name: install zsh and zsh suggestion
ansible.builtin.apt:
name:
- zsh
- zsh-autosuggestions
- zsh-syntax-highlighting
state: present
update_cache: yes
become: true
@ma-04
ma-04 / swap.yml
Created August 5, 2023 12:43
Ansible playbook that creates a 2GB swap file at /swapfile
## This is a sample playbook to create swap file on linux
## This playbook will check if swap file exist, if not it will create one
- name: check if swap file exist in /swapfile
become: true
stat:
path: "/swapfile"
register: swapfile
- name: check if swap is on
@ma-04
ma-04 / mount-multiple.sh
Created July 20, 2023 11:57
mount multiple remote ssh directory on local folder
#!/usr/bin/env bash
set -e
mountdir="$HOME/mount"
hosts=("host2" "host23 " "host3" "host5" "host6") # must exist in ~/.ssh/config
hostdir="$HOME"
GID=1000
sshkey=$mountdir/sshfs.key