This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
speed=100 | |
if [ $# != 2 ];then | |
echo "[ERROR] Usage: $0 wav.scp(archived) outdir" && exit 1 | |
fi | |
wavscp=$1 | |
outdir=$2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ====================== | |
# To write folder size info into curdir as a file, | |
# with timestamps. | |
# ====================== | |
du -d 1 -h | tee "du."$(date "+%Y%m%d_%H-%M-%S") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Save following lines as '/usr/local/sbin/ssr-on' | |
# Enable proxy using command: . ssr-on | |
proxy_list=( | |
http://username:[email protected]:1080 | |
http://192.168.1.11:1080 | |
) | |
for proxy in ${proxy_list[@]}; do | |
ip_addr=$(echo $proxy | sed -re 's|^http://||g;s|.*@||g;s|:[0-9]*/?$||g') | |
port=$(echo $proxy | awk '{port=gensub(/.*:([0-9]{1,5})\/?/,"\\1","g",$0);print port}') | |
nc -vz -w 1 $ip_addr $port &> /dev/null && { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sshcd, Useful when you are switching between hosts with shared file systems | |
# Example Usage: | |
# sshcd 172.168.2.32 $(pwd) | |
# sshpwd 172.168.2.32 | |
sshcd () { ssh -t "$1" "cd \"$2\"; exec \$SHELL -l"; } | |
sshpwd() { ssh -t "$1" "cd \"$(pwd)\"; exec \$SHELL -l"; } | |
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) | |
HISTSIZE=5000 | |
HISTFILESIZE=8000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set number " 显示行号 | |
set hlsearch " 高亮搜索 | |
set incsearch " 输入立即开始搜索 | |
syntax enable | |
filetype on | |
filetype plugin indent on | |
set t_Co=256 " 256色 | |
set encoding=utf-8 " 命令行显示的编码 | |
set fileencodings=utf-8,gb18030,gb2312,gbk,ucs-bom,cp936 " 打开文件的编码 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The Fast Inverse Square Root code in the game "Quake" | |
// translated from C | |
// Reference: https://en.wikipedia.org/wiki/Fast_inverse_square_root | |
package main | |
import ( | |
"fmt" | |
"unsafe" | |
) |