Skip to content

Instantly share code, notes, and snippets.

View ttimasdf's full-sized avatar

Known Rabbit ttimasdf

View GitHub Profile
ttimasdf /
Last active January 10, 2024 15:36
Integrate Git diffs and commits with Word DOCX files
ttimasdf /
Last active January 1, 2024 21:57 — forked from thomasfr/autossh.service
Systemd service for autossh


curl -sSL | \
  sudo tee /etc/default/autossh@example
curl -sSL | \
  sudo tee /etc/systemd/system/autossh@.service

sudo useradd -g nogroup -s /bin/false -m tunnel
sudo -u tunnel mkdir -p ~tunnel/.ssh # and copy your private key here
ttimasdf /
Last active August 22, 2023 15:30
Migrate your OTA key, step by step guide


Migrate from self-built (test-key or dev-key) or Official Release from, to our self-signed builds, RETAINING DATA!!! and avoid the annoying error:

Can't install this package on top of incompatible data. Please try another package or run a factory reset


Apply the two patch accordingly, with command below. (Changed a little bit from 156047 and 162144

ttimasdf /
Last active July 23, 2022 08:34
Hexo to Hugo Article & Images migrator

Hexo to Hugo Migrator


  1. cd to Hexo source/ directory. copy here.
  2. If you have image host CDN mapped to local directory, change LOCAL_CDN_DOMAIN and p_imgcdn accordingly
  3. run ./, pip package requests is the only dependency.
  4. check output in _export/
ttimasdf / awstats-nginx.conf
Last active August 31, 2021 22:44
Fancy&customized URL support for awstats with Nginx. Access through
View awstats-nginx.conf
server {
server_name _;
access_log /var/log/nginx/awstats.access_log combined;
error_log /var/log/nginx/awstats.error_log;
root /usr/share/awstats/wwwroot;
index /;
location ~ \.pl$ {
# The following is adapted from
# ===========================================================================================
# Copyright 2017 Reswitched Team
# Permission to use, copy, modify, and/or distribute this software for any purpose with or
# without fee is hereby granted, provided that the above copyright notice and this permission
# notice appear in all copies.
ttimasdf / Dockerfile
Created October 12, 2020 11:10
花生壳内网穿透 (phddns 5.0) Docker 容器
View Dockerfile
FROM ubuntu:20.04
RUN apt-get update && apt-get install -y wget
ARG url=""
RUN wget "$url" -O phddns.deb && \
dpkg -i phddns.deb && \
rm phddns.deb
ttimasdf / patch-android.diff
Last active August 13, 2020 10:55
Necessary patches for building busybox for Android
View patch-android.diff
diff --git a/Makefile.flags b/Makefile.flags
index cff935ff5..e5818f5db 100644
--- a/Makefile.flags
+++ b/Makefile.flags
@@ -152,7 +152,7 @@ CRYPT_AVAILABLE := $(shell echo 'int main(void){return 0;}' >crypttest.c; $(CC)
LDLIBS += m rt crypt
-LDLIBS += m rt
+LDLIBS += m
ttimasdf /
Created April 2, 2020 06:01
How to build Clash dashboard inside Docker
ttimasdf / Open iterm tab here
Last active March 1, 2020 17:49 — forked from eric-hu/Open iterm tab here
Apple script to open an iterm2 tab from right-clicking on a file or folder in Finder.To use:(1) Open Automator(2) Create a new service(3) Change "Service receives selected" drop downs to "Files or folders" in "Finder"(4) Select "Run applescript" from the sidebar, then paste this script in and save
View Open iterm tab here
-- Adapted from these sources:
-- Modified to work with files as well, cd-ing to their container folder
on run {input, parameters}
tell application "Finder"
set my_file to first item of input
set is_folder to (do shell script "file -b " & quoted form of (POSIX path of my_file))
if is_folder ends with "directory" then