Skip to content

Instantly share code, notes, and snippets.

@sanonz
sanonz / config
Created December 10, 2024 14:39
Secure Shell
Host remote
HostName 1.1.1.1
User root
Port 22
IdentityFile ~/.ssh/IdentityFiles/remote.cer
@sanonz
sanonz / Makefile
Created December 10, 2024 14:36
Make Commands
upload-to-remote:
tar zcf app.tar.gz ./*.js ./package.json ./app.config.cjs
scp app.tar.gz remote:/opt/app
ssh tencent "cd /opt/app; tar zxvf app.tar.gz; rm -f ./app.tar.gz"
rm -f app.tar.gz
@sanonz
sanonz / proxy.js
Last active January 17, 2025 13:13
CloudFlare Workers
/**
* @typedef {Object} Env
*/
export default {
/**
* @param {Request} request
* @param {Env} env
* @param {ExecutionContext} ctx
* @returns {Promise<Response>}
@sanonz
sanonz / .gitconfig-works
Last active December 20, 2024 06:34
Git Config
[user]
name = Works
email = works@example.com
@sanonz
sanonz / Dockerfile
Last active January 23, 2024 07:21
RT-Thread Dev Containner
FROM ubuntu:20.04
RUN apt-get update && \
apt-get install -y \
wget git python3 python3-venv python3-pip && \
python3 -m venv /opt/venv && \
pip install psutil requests scons==4.4.0 && \
apt-get clean
RUN cd /tmp && \
@sanonz
sanonz / install-specified-version.sh
Last active December 10, 2024 03:38
Homebrew Scripts
# /usr/local/Homebrew/Library/Taps/sanonz/homebrew-local-tap
brew tap-new $USER/local-tap
brew extract --version=6-2017-q2-update armmbed/formulae/arm-none-eabi-gcc $USER/local-tap
brew install $USER/local-tap/arm-none-eabi-gcc@6-2017-q2-update
@sanonz
sanonz / shadowrocket.conf
Last active July 5, 2025 14:43
Private Proxy
[General]
bypass-system = true
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, localhost, *.local, captive.apple.com
tun-excluded-routes = 10.0.0.0/8, 100.64.0.0/10, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.0.0.0/24, 192.0.2.0/24, 192.88.99.0/24, 192.168.0.0/16, 198.18.0.0/15, 198.51.100.0/24, 203.0.113.0/24, 224.0.0.0/4, 255.255.255.255/32
dns-server = system
ipv6 = true
[Rule]
@sanonz
sanonz / axios-interceptor.js
Last active January 17, 2025 12:48
JavaScript Snippets
import axios from 'axios';
const request = axios.create({
baseURL: `https://hacker-news.firebaseio.com/`,
headers: {
'Accept': 'application/json',
'X-Requested-With': 'XMLHttpRequest',
},
});