Skip to content

Instantly share code, notes, and snippets.

View Senorsen's full-sized avatar
👋
Hello

Sen Zhang Senorsen

👋
Hello
View GitHub Profile
@Senorsen
Senorsen / win-set-git-sh-path.bat
Created June 7, 2016 13:30
Set Git for Windows' sh.ext to PATH
REM need administrator's privilege!
setx path "%PATH%;C:\Program Files\Git\bin" /M
@Senorsen
Senorsen / set_path.cmd
Created July 5, 2016 05:45
Add git\bin folder to PATH (git for windows)
@echo off
cls
echo Set objShell = CreateObject("WScript.Shell") > c:\set_path.vbs
echo Set objEnv = objShell.Environment("System") >> c:\set_path.vbs
echo PathToAdd = "C:\Program Files\Git\bin" >> c:\set_path.vbs
echo oldSystemPath = objEnv("PATH") >> c:\set_path.vbs
echo newSystemPath = oldSystemPath ^& ";" ^& PathToAdd >> c:\set_path.vbs
echo objEnv("PATH") = newSystemPath >> c:\set_path.vbs
echo wscript.echo "Complete" >> c:\set_path.vbs
c:\set_path.vbs
# for generate import
for f in *.ts; do MODEL_NAME=$(grep -ohw 'class \(\w\+Model\)' $f | grep -ohw '\w\+Model'); test $MODEL_NAME && echo "import ${MODEL_NAME} from './$(echo $f | sed 's/\.ts$//')';"; done
# for generate Interface
for f in *.ts; do MODEL_NAME=$(grep -ohw 'class \(\w\+Model\)' $f | grep -ohw '\w\+Model'); test $MODEL_NAME && echo "$(echo ${MODEL_NAME} | sed -e 's/\w/\L\0/' | sed -e 's/Model$//'): ${MODEL_NAME};"; done
@Senorsen
Senorsen / use-wsl-zsh-in-cmder.bat
Created September 18, 2016 16:28
Use wsl's zsh in cmder
%windir%\system32\bash.exe -cur_console:p -c zsh
@Senorsen
Senorsen / flac-fix.sh
Last active April 26, 2017 07:38
Generate common flac file with 'fLaC' header (use flac package), so firefox or other softwares will support the file
#!/bin/sh
set -e
flac 2>&1 >/dev/null || (echo "Install flac package first. "; exit 1)
FILE=$1
# get the tags
ARTIST=$(metaflac "$FILE" --show-tag=ARTIST | sed s/.*=//g || true)
TITLE=$(metaflac "$FILE" --show-tag=TITLE | sed s/.*=//g || true)
ALBUM=$(metaflac "$FILE" --show-tag=ALBUM | sed s/.*=//g || true)
@Senorsen
Senorsen / sysctl-tcp-bbr-append.conf
Last active July 21, 2018 08:48
Enable TCP BBR in Linux 4.9.0
# Only in Linux >= 4.9.0
# Append to sysctl.conf
# TCP BBR
net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDqSTvd4u7WEGgv/GGJ2E7XlD5UlHAuv2B2mRKcCwa2UAQyPCTiOXUpLV9nffnSj04JOweJCsMUnIM71nWDp0j/+sswWHEzk6vPWLTjQvhsF+0R3jxZBk/IGS6mv0Qme9wjHeHPCkqrl7oAEg2JTpzAzJsPniIcZp0Axvc1cJyj9MJaiKhiIjGyL+m7IhBjWu953CHE4YNMUG3FlpWqy9+ykp3Wzpbr1E2sQjuWWgJA8uVtNScFfC1zkKBYElTVtZSlBaJ7jXZqLYW2uhozHg922N5gQlg4pffMZbbe0sGLprnJtFeCMD8iWbXqaSkNIrdPWDjJoN/QooFyEVyBKYWh senorsen@pat
@Senorsen
Senorsen / nf-persistent-ipset-solve.md
Last active June 3, 2019 13:29
netfilter-persistent.service 15-ip4tables exited with return code 2 problem solver
@Senorsen
Senorsen / qiniu-delete-files.js
Created February 28, 2017 16:33
qiniu delete files
$('.operate .btn').eq(1).click(); setTimeout(() => $('.file-op a').click()); setTimeout(() => $('.text-center button,.btn-emphasis').eq(1).click())
@Senorsen
Senorsen / csr-caps-lock-osd-mute.reg
Last active September 5, 2024 15:01
CSR Bluetooth 'Caps Lock' OSD notification mute
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Cambridge Silicon Radio\Harmony\Default]
"OSD"=dword:00000000