Skip to content

Instantly share code, notes, and snippets.

View NatLee's full-sized avatar
🌵
I NEED SLEEP *FOREVER*

Nat NatLee

🌵
I NEED SLEEP *FOREVER*
View GitHub Profile
@NatLee
NatLee / .env
Last active May 19, 2025 07:53
Docker compose filt of `n8n` with Chrome container
POSTGRES_USER=root
POSTGRES_PASSWORD=my-secret-password
POSTGRES_DB=n8n
N8N_ENCRYPTION_KEY=your-super-secret-key
N8N_USER_MANAGEMENT_JWT_SECRET=even-more-cute-secret
N8N_DEFAULT_BINARY_DATA_MODE=filesystem
# Optional timezone to set which gets used by Cron and other scheduling nodes
# New York is the default value if not set
@NatLee
NatLee / prevent-windows-sleep.ps1
Created May 15, 2025 07:06
Bypass group rules to avoid your Windows get sleeping. 忽略群組規則避免你的Windows自己睡眠
echo "[+] Script start"
# Add-Type for PowerManagement to prevent sleep
Add-Type -TypeDefinition @"
using System;
using System.Runtime.InteropServices;
public static class PowerManagement {
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern uint SetThreadExecutionState(uint esFlags);
@NatLee
NatLee / glient-mt3000-change-area.sh
Created December 2, 2024 08:31
GL-iNet MT3000 切換成國際版🌐
# 1. 連上路由器
# 2. 使用 SSH 指令連線進入路由器
# -> ssh [email protected]
# 3. 輸入以下指令
echo "US" | dd of=/dev/mtdblock3 bs=1 seek=136
sync
reboot
# 4. 重啟後,將介面切換成繁體中文(zh-TW)
@NatLee
NatLee / get_camera_info.py
Last active November 19, 2024 05:53
Get USB Camera information with system command `udevadm` in Linux
import uuid
import subprocess
import gc
from pathlib import Path
from loguru import logger
def cat_output(command:str):
"""
Use `python` to do system calls with `subproess`.
@NatLee
NatLee / gitlab-backup-utils.py
Created February 14, 2023 09:08
A python wrapped utility for making a backup of repo in self-host Gitlab
from concurrent.futures import ThreadPoolExecutor, wait
import subprocess
from pathlib import Path
from loguru import logger
import requests
HOST = '<YOUR_GITLAB_HOST>'
TOKEN = '<YOUR_TOKEN_TO_READ_REPO>'
@NatLee
NatLee / subprocess_example.py
Created July 22, 2022 07:03
Subprocess Check Output Example
import subprocess
output = subprocess.check_output("export ABC=123; echo $ABC", shell=True)
print("ABC:", output)
# ABC: b'123\n'
@NatLee
NatLee / curl.md
Created March 23, 2022 09:39 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@NatLee
NatLee / restart_docker.sh
Last active October 18, 2024 03:44
Synology DSM 7.x - A way to restart service of docker
# Use new Synology CLI tool -> `synopkgctl`
#usage: synopkgctl <command> [...]
#command:
# enable <package>
# disable <package>
# setup <package>
# start <package>
# stop <package>
# teardown <package>
@NatLee
NatLee / generate_template.py
Created August 30, 2021 05:18
Report template generator with date
'''
### Week 01
- 01/06
- 01/07
- 01/08
- 01/09
- 01/10
**Weekly conclusion**
@NatLee
NatLee / Android_ID_modify.md
Last active July 18, 2021 13:30
Modify Android ID with ADB

Modify Android ID with ADB

Query ID

adb shell content query --uri content://settings/secure --where "name=\'android_id\'"

Modify ID