Skip to content

Instantly share code, notes, and snippets.

View cuiwm's full-sized avatar
🎯
Focusing

cuiwm cuiwm

🎯
Focusing
  • UK
View GitHub Profile
@cuiwm
cuiwm / mysql_tcpdump.sh
Created September 11, 2018 10:45 — forked from ffeast/mysql_tcpdump.sh
Mysql traffic tcpdump one-liner
# a handy one-liner to print out sql queries if you wouldn't like to enable
# queries logging in mysql server itself
tcpdump -i lo -s 0 -l -w - dst port 3306 | strings | perl -e '
while(<>) { chomp; next if /^[^ ]+[ ]*$/;
if(/^(SELECT|UPDATE|DELETE|INSERT|SET|COMMIT|ROLLBACK|CREATE|DROP|ALTER)/i) {
if (defined $q) { print "$q\n\n"; }
$q=$_;
} else {
$_ =~ s/^[ \t]+//; $q.=" $_";
}
package main
import (
"fmt"
"github.com/ethereum/go-ethereum/crypto"
)
//In cryptography, the Elliptic Curve Digital Signature Algorithm (ECDSA) offers a variant of the Digital Signature Algorithm (DSA) which uses elliptic curve cryptography
func main() {
package main
import (
"encoding/hex"
"fmt"
"github.com/ethereum/go-ethereum/crypto"
)
func main() {
<script type="text/javascript" src="/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="/js/jquery.serializejson.js"></script>
<form id="loginform" action="/user/login" method="POST">
<div class="container">
<input type="hidden" name="id" data-value-type="number" value=100 required>
<input type="hidden" name="error" data-value-type="auto" value="null" required>
<input type="hidden" name="message" value="/user/login" required>
<label><b>Username</b></label>
<input type="text" placeholder="Enter Username" name="data[username]" required>
#
# It will:
#
# deal with files with spaces, newlines, leading dashes, and other funniness
# handle an unlimited number of files
# won't repeatedly overwrite your backup.tar.gz like using tar -c with xargs will do when you have a large number of files
# Also see:
#
# GNU tar manual http://www.gnu.org/software/tar/manual/tar.html#SEC107
# How can I build a tar from stdin?, searc
on write_to_file(this_data, target_file, append_data)
try
set the target_file to the target_file as string
set the open_target_file to open for access file target_file with write permission
if append_data is false then set eof of the open_target_file to 0
write this_data to the open_target_file starting at eof
close access the open_target_file
return true
on error
try
# 全局环境变量设置
export GOPATH=/users/choe
# 局部环境变量设置,必须是前置条件
ok1:export GOPATH=/users/choe/github/en/code/
ok1:
@echo $(GOPATH)
# 错误的环境变量的设置
error:
export GOPATH=/users/choe/github/
@cuiwm
cuiwm / Makefile_go_version
Created June 8, 2018 10:24
golang build with version info
SFILE:=$(wildcard *.go)
VERSION=`git describe --tags`
BUILD=`date +%F_%T%z`
TAGETFILE=uploadTool
LDFLAGS_DEBUG=-ldflags "-X main.Version=${VERSION} -X main.Build=${BUILD}"
LDFLAGS_REL=-ldflags "-w -s -X main.Version=${VERSION} -X main.Build=${BUILD}"
all: mac
@echo ${BUILD} ${VERSION} $(SFILE)
@cuiwm
cuiwm / trace.go
Created June 8, 2018 03:38
runtime function
package main
import (
"fmt"
"runtime"
)
func trace2() {
pc := make([]uintptr, 15)
n := runtime.Callers(2, pc)
@cuiwm
cuiwm / yum_install_openresty.sh
Last active June 11, 2018 05:59
yum_install_openresty
bash -c "echo 7 > /etc/yum/vars/releasever" && yum install -y yum-utils && sudo yum-config-manager --add-repo https://openresty.org/package/rhel/openresty.repo && sudo yum install -y openresty && command -v opentresty
yum install -y yum-utils
sudo yum-config-manager --add-repo https://openresty.org/package/rhel/openresty.repo
sudo yum install -y openresty
# change info about os version
vi /etc/yum.repos.d/openresty.repo
sudo yum install openresty
#python -c 'import yum, pprint; yb = yum.YumBase(); pprint.pprint(yb.conf.yumvar, width=1)'