Skip to content

Instantly share code, notes, and snippets.

View hapam's full-sized avatar
🎯
Focusing

Lý Mạnh hà hapam

🎯
Focusing
View GitHub Profile
@hapam
hapam / compose.yml
Last active July 21, 2025 08:51
Sample compose
services:
db_n8n:
image: postgres:15
container_name: ${POSTGRES_HOST}
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
@hapam
hapam / Puppeteer_n8n_docker.txt
Created June 11, 2025 19:54
Hướng dẫn cài Puppeteer trong n8n Docker
1. Vào thư mục custom_node đã liên kết để cài custom node
cd /var/n8n/custom-nodes/
npm install n8n-nodes-puppeteer
2. Cấu hình lại compose.yml:
environment:
...
- N8N_CUSTOM_EXTENSIONS=/home/node/custom/node_modules/n8n-nodes-puppeteer
volumes:
...
@hapam
hapam / MTProxy.txt
Created May 27, 2025 16:04
Create MTProxy
# install app
sudo apt update
sudo apt install git curl build-essential libssl-dev zlib1g-dev
# clone source
git clone https://github.com/GetPageSpeed/MTProxy
cd MTProxy
make && cd objs/bin
# Obtain a secret, used to connect to telegram servers
@hapam
hapam / SquidProxy.txt
Last active May 27, 2025 13:41
Squid Proxy
# install app
sudo apt update
sudo apt install squid -y
sudo apt install apache2-utils -y
#config
sudo nano /etc/squid/squid.conf
auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwd
auth_param basic realm Squid Proxy
@hapam
hapam / todo.io.vn.conf
Created March 31, 2025 05:14
Sample config n8n in nginx
server {
listen 80;
server_name todo.io.vn;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-for $remote_addr;
proxy_pass http://127.0.0.1:5678;
proxy_ssl_verify off;
@hapam
hapam / update_dns.sh
Last active March 30, 2025 18:06
Auto change IP on clouflare
#!/bin/bash
# API Token (Recommended)
auth_token=""
# Define domains and their corresponding zone identifiers
declare -A domains
# Example configuration (Add your own domains and zone identifiers)
domains["a.com"]="ZONE_ID_1"
@hapam
hapam / .env
Last active April 19, 2025 21:10
n8n env
DOMAIN_NAME=todo.io.vn
EXTERNAL_MY_IP=1.53.21.43
GENERIC_TIMEZONE=Asia/Ho_Chi_Minh
N8N_DEFAULT_BINARY_DATA_MODE=filesystem
N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
EXECUTIONS_DATA_PRUNE=true
EXECUTIONS_DATA_MAX_AGE=168
EXECUTIONS_DATA_PRUNE_MAX_COUNT=50000
POSTGRES_HOST=db_n8n
POSTGRES_DB=n8n_db
@hapam
hapam / compose.yml
Last active April 19, 2025 20:54
n8n docker compose
services:
db_n8n:
image: postgres:15
container_name: ${POSTGRES_HOST}
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
@hapam
hapam / smaple-gzip
Created November 22, 2023 18:05
Setup gzip
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_min_length 256;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype font/collection font/otf font/sfnt font/ttf font/woff font/woff2 application/octet-stream image/svg+xml image/x-icon image/png image/jpeg;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_http_version 1.1;