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
trojanports() { | |
## 读取 Trojan-qt5.exe 代理端口配置; | |
## See Also:"D:\Extra\Trojan-Qt5-Windows-1.4.0\config.json" | |
print_color 40 "通过 netstat 命令获取 trojan-qt5.exe 端口监听信息..." | |
local pid=$(ps2 trojan-qt5.exe --nopath|dos2unix -q|awk -F '=' '/ProcessId=/{print $2;exit}') | |
[ -z "$pid" ] && print_color 9 "没有发现 trojan-qt5.exe 进程!" && return | |
local portsInfo=$(netstat -ano|grep $pid|dos2unix -q|awk -F " " '{if(match($2,/0.0.0.0:/) && $4=="LISTENING") print;}'|tee /dev/tty) | |
local portsInfo=$(echo "$portsInfo"|awk -F " " '{sub("0.0.0.0","127.0.0.1",$2);print}') | |
print_color 40 "探测各个端口类型..." | |
while read line |
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
读书,先是从厚读到薄,然后是从薄读到厚;写代码也是一样一样的 | |
不停coding,但又及时回顾、提炼,总结出一些规律和方法,再从这些规律和方法出发,指导后续的工作,这是一个「从厚到薄」的过程 | |
针对其中的每个点,可以从容自得地、深入浅出地讲解、分享给其他人,可以解决一些深层次的问题,这个过程就是「从薄到厚」 | |
正所谓「厚积薄发」,「厚积」容易,「薄发」难,最近这半年在支付宝的工作,自我感觉提升非常大,但是提升的内容仅仅只能抽象出一些要点,还做不到由点及面地开展,简单记录下,希望不久将来,可以「薄发」 | |
架构层面 |
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 nocompatible | |
" 括号自动补全 | |
inoremap ( ()<Esc>i | |
inoremap [ []<Esc>i | |
inoremap { {<CR>}<Esc>O | |
autocmd Syntax html,vim inoremap < <lt>><Esc>i| inoremap > <c-r>=ClosePair('>')<CR> | |
inoremap ) <c-r>=ClosePair(')')<CR> | |
inoremap ] <c-r>=ClosePair(']')<CR> | |
inoremap } <c-r>=CloseBracket()<CR> |
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
function Read-HtmlPage { | |
param ([Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)][String] $Uri) | |
# Invoke-WebRequest and Invoke-RestMethod can't work properly with UTF-8 Response so we need to do things this way. | |
[Net.HttpWebRequest]$WebRequest = [Net.WebRequest]::Create($Uri) | |
[Net.HttpWebResponse]$WebResponse = $WebRequest.GetResponse() | |
$Reader = New-Object IO.StreamReader($WebResponse.GetResponseStream()) | |
$Response = $Reader.ReadToEnd() | |
$Reader.Close() |
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
#!/usr/bin/perl -W | |
#用途:命令行传递主机名称关键字搜索~/.ssh/config的主机配置项 | |
#参数说明: | |
# $1 --- 主机名称搜索关键字 | |
# $2 --- 要显示主机的个数限制 | |
#Usage: | |
# sshfind.pl racknerd #查找主机名包含racknerd的主机 | |
# sshfind.pl racknerd 1 #查找主机名包含racknerd的主机,仅列出一个 | |
# sshfind.pl . 5 #查找主任意关键字主机,仅列出前5个 |
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
## 命令行工具 | |
H2数据库提供了一组命令行工具,如果你需要了解这些工具,使用参数`-?`,如: | |
java -cp h2*.jar org.h2.tools.Backup -? | |
命令行工具有: | |
* Backup 创建数据库备份 | |
* ChangeFileEncryption 允许改变文件加密密码和数据库的加密算法 |
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
_hook-cd() { | |
#劫持cd命令,方便在手机终端不方便打汉字的情况下切换目录 | |
[ $# -gt 0 ] && \cd "$@" && return | |
[[ "$-" != *i* ]] && \cd "$@" && return #非交互式会话操作直接返回 | |
[ -z "$SSH_TTY" ] && \cd "$@" && return #如果是本地终端窗口,不是SSH远程会话连接,则不做任何修改 | |
#echo "创建交互式选择列表..." | |
print_color 40 "请选择要切换到的子目录..." | |
local subDirs=$(\ls -F|grep '/$'|tr '\t' '\n') | |
local toDir | |
echo "$subDirs"|awk '{print NR" ):"$0}' |
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
#!/usr/bin/perl | |
#################################### | |
# Design By Mistiq | |
#-[Zr Commands List]- | |
#-----[Hacking Based]----- |
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
#! perl -w | |
# test ports 80 and 1433 on given IP | |
# HTTP and SQL | |
# for new NAT addresses | |
use strict; | |
use IO::Socket::PortState qw(check_ports); | |
my $timeout = 10; |
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
# Run this in the project repo from the command-line | |
# http://stackoverflow.com/a/4593065/99923 | |
git log --shortstat --author "Xeoncross" --since "2 weeks ago" --until "1 week ago" | grep "files changed" | awk '{files+=$1; inserted+=$4; deleted+=$6} END {print "files changed", files, "lines inserted:", inserted, "lines deleted:", deleted}' |
NewerOlder