Skip to content

Instantly share code, notes, and snippets.

View ttimasdf's full-sized avatar

Known Rabbit ttimasdf

View GitHub Profile
@ttimasdf
ttimasdf / zshrc.sh
Last active August 10, 2017 02:47
My .zshrc with ohmyzsh and bullet train theme, includes various utilities for easy life
export ZSH=/Users/u/.oh-my-zsh
# Bullet train needs powerline fonts unavailable in VSCode
# ps -p `ps -o pid,ppid | awk "/^ *$$/ {print \$2}"` | grep -q "Visual Studio Code" && ZSH_THEME="random"
[[ -n "$VSCODE_PID" ]] && ZSH_THEME="random" || ZSH_THEME="bullet-train"
plugins=(git brew virtualenv osx zsh-completions)
# DISABLE_AUTO_UPDATE="true"
# export UPDATE_ZSH_DAYS=13
BULLETTRAIN_CUSTOM_MSG="Rabbit!"
@ttimasdf
ttimasdf / cve.patch
Last active December 18, 2017 02:04
My cve-search patch
diff --git a/sbin/db_mgmt_cpe_dictionary.py b/sbin/db_mgmt_cpe_dictionary.py
index 4c904cf..37cd9c8 100755
--- a/sbin/db_mgmt_cpe_dictionary.py
+++ b/sbin/db_mgmt_cpe_dictionary.py
@@ -31,6 +31,7 @@ from lib.ProgressBar import progressbar
from lib.Toolkit import toStringFormattedCPE
from lib.Config import Configuration
import lib.DatabaseLayer as db
+from time import time

STEPS

  • Click on Help menu

  • Select Enter License

  • Then paste given KEY given at bottom

  • Finally click on Use License

@ttimasdf
ttimasdf / shadowsocks-server
Created April 27, 2019 14:21 — forked from evianzhow/shadowsocks-server
shadowsocks-server OpenWRT init.d script
#!/bin/sh /etc/rc.common
#
# Copyright (C) 2016 Jian Chang <aa65535@live.com>
# Copyright (C) 2016 Evian Zhow <evianzhow@gmail.com>
#
# This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.
#
START=90
@ttimasdf
ttimasdf / IPTV_API_to_m3u8.md
Last active January 30, 2020 13:04
WASU IPTV box to m3u8 file

Fetch channels from WASU IPTV box web API and generate m3u8 from return data.

@ttimasdf
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
-- Adapted from these sources:
-- http://peterdowns.com/posts/open-iterm-finder-service.html
-- https://gist.github.com/cowboy/905546
--
-- 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
@ttimasdf
ttimasdf / Build-clash-dashboard.md
Created April 2, 2020 06:01
How to build Clash dashboard inside Docker
@ttimasdf
ttimasdf / patch-android.diff
Last active August 13, 2020 10:55
Necessary patches for building busybox for Android
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)
ifeq ($(CRYPT_AVAILABLE),y)
LDLIBS += m rt crypt
else
-LDLIBS += m rt
+LDLIBS += m
@ttimasdf
ttimasdf / Dockerfile
Created October 12, 2020 11:10
花生壳内网穿透 (phddns 5.0) Docker 容器
FROM ubuntu:20.04
RUN apt-get update && apt-get install -y wget
ARG url="https://dl-cdn.oray.com/hsk/linux/phddns-5.0.0-amd64.deb"
RUN wget "$url" -O phddns.deb && \
dpkg -i phddns.deb && \
rm phddns.deb
# The following is adapted from https://github.com/reswitched/loaders/blob/master/nxo64.py
#
# ===========================================================================================
#
# 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.
#