Skip to content

Instantly share code, notes, and snippets.

View recall704's full-sized avatar
💭
I may be slow to respond.

recall704 recall704

💭
I may be slow to respond.
View GitHub Profile
@recall704
recall704 / README.md
Created June 11, 2022 07:28 — forked from cld4h/README.md
Bypass the GFW; clash fake-ip and tproxy; iptables and transparent proxy on Linux; 在Linux上通过 iptables 以及 clash 配置透明代理用于本机及局域网翻墙网关; Linux 翻墙路由器配置

This article show you the ultimate way to set up a transparent proxy on Linux using clash and iptables to bypass the GFW in China.

We use:

You can go to github gist to download all files mentioned in this article.

Direct copy of pre-encoded file:

$ ffmpeg -i filename.mp4 -codec: copy -start_number 0 -hls_time 10 -hls_list_size 0 -f hls filename.m3u8

@recall704
recall704 / iprule.sh
Created September 10, 2021 16:51 — forked from codehz/iprule.sh
nftables for redir proxy
ip rule add fwmark 0x233 lookup 100
ip route add local 0.0.0.0/0 dev lo table 100

It seems that it does not matter what timezone is on the server as long as you have the time set right for the current timezone, know the timezone of the datetime columns that you store, and are aware of the issues with daylight savings time.

On the other hand if you have control of the timezones of the servers you work with then you can have everything set to UTC internally and never worry about timezones and DST.

Here are some notes I collected of how to work with timezones as a form of cheatsheet for myself and others which might influence what timezone the person will choose for his/her server and how he/she will store date and time.

MySQL Timezone Cheatsheet

#!/bin/bash
# Set iptables for clash redir mode

REDIR_PORT=1234
DNS_PORT=2253
UID_OWNER=1000

iptables -t nat -N CLASH
#!/bin/sh /etc/rc.common
USE_PROCD=1
START=99
STOP=98
ProxyIPSet="proxy_ipset"
InternalIPSet="internal_ipset"
GreatFireWallIPSet="gfw_ipset"
@recall704
recall704 / clash
Created February 27, 2021 09:07 — forked from tony1016/clash
Openwrt init.d script for clash
#!/bin/sh /etc/rc.common
START=99
STOP=15
USE_PROCD=1
start_service(){
procd_open_instance clash
procd_set_param command /usr/bin/clash -d /etc/clash
@recall704
recall704 / pip.md
Created January 19, 2021 03:17 — forked from saurabhshri/pip.md
Install and use pip in a local directory without root/sudo access.

Install and use pip in a local directory without root/sudo access.

Why?

Many users when are given server access, do not have root (or sudo) privileges and can not simply do sudo apt-get install python-pip . Here's an easy way you can install and use pip without root (or sudo) access in a local directory. Note : This works without easy_install too.

How?

@recall704
recall704 / bash_curl_loop
Created November 13, 2020 09:24 — forked from ceme/bash_curl_loop
bash curl loop
while true; do sleep 1; curl http://www.google.com; echo -e '\n\n\n\n'$(date);done
@recall704
recall704 / human_time_duration.py
Created October 13, 2020 14:57 — forked from borgstrom/human_time_duration.py
Python: Convert seconds (duration) to human readable string
TIME_DURATION_UNITS = (
('week', 60*60*24*7),
('day', 60*60*24),
('hour', 60*60),
('min', 60),
('sec', 1)
)
def human_time_duration(seconds):