Shell

Language

一些存档

打开 VimWiki 的快捷命令

alias mwiki='mvim "+colo automation" "+VimwikiIndex" "+Goyo" "+ set guifont=M+\ 1m\ regular:h16"'
alias wiki='vim "+colo soso" "+VimwikiIndex" "+Goyo"'

设置代理

# Get Qujing
function getqujing() {
    export http_proxy='http://theironislands.f.getqujing.net:28471' 
    export https_proxy='https://theironislands.f.getqujing.net:28471'
}
function dropqujing() {
    unset http_proxy
    unset https_proxy
}
function getpanda() {
    export http_proxy='http://47565:62aa147d@hk1.dig.name:25' 
    export https_proxy='http://47565:62aa147d@hk1.dig.name:25' 
}
function droppanda() {
    unset http_proxy
    unset https_proxy
}
function getvpnso() {
    export http_proxy='https://graycarl:5dd8909c5@SG04.60in.com:443' 
    export https_proxy='https://graycarl:5dd8909c5@SG04.60in.com:443' 
}
function dropvpnso() {
    unset http_proxy
    unset https_proxy
}

暖丘开发

# WarmChat Dev
export WARMCHAT_RUN=/tmp/warmchat-run
function nuanqiu-sb() {
    method=$1
    p=$2
    shift 2
    nuanqiu-client nnsb https://api-sb.nuanqiu.me $method $p $@
}
function nuanqiu-aws() {
    method=$1
    p=$2
    shift 2
    nuanqiu-client nnsb https://api.nuanqiu.me $method $p $@
}
function xiaoqiu-sb() {
    method=$1
    p=$2
    shift 2
    nuanqiu-client nnsb https://xq-sb.nuanqiu.me/api/v1 $method $p $@
}
function xiaoqiu-ws() {
    tools/wsclient.py wss://xq-sb.nuanqiu.me/api/v1/ws/messages UON3kPiIE5CGQZo7mkFTBAOjbRNsW9Rf
}

function nuanqiu-client() {
    session=$1
    urlbase=$2
    method=$3
    p=$4
    shift 4

    cmd="http -f --session $session $method $urlbase$p $@"
    echo $cmd
    eval $cmd
}

Polipo

# Polipo
function polipo-start() {
    if `pgrep -q polipo`; then
        echo 'Polipo is running.'
        pgrep -fl polipo
    else
        nohup polipo socksParentProxy=localhost:1080 >> /tmp/polipo.log &
        disown
        echo "Polipo is started, Ctrl-C to detach."
        tail -f /tmp/polipo.log
    fi
}
function polipo-stop() {
    if `pkill polipo`; then
        echo 'Polipo stopped.'
    else
        echo 'Nothing found.'
    fi
}
END

Published @ Aug 15, 2017