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
# 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.=" $_"; | |
} |
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 ( | |
"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() { |
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 ( | |
"encoding/hex" | |
"fmt" | |
"github.com/ethereum/go-ethereum/crypto" | |
) | |
func main() { |
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
<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> |
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
# | |
# 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 |
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
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 |
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
# 全局环境变量设置 | |
export GOPATH=/users/choe | |
# 局部环境变量设置,必须是前置条件 | |
ok1:export GOPATH=/users/choe/github/en/code/ | |
ok1: | |
@echo $(GOPATH) | |
# 错误的环境变量的设置 | |
error: | |
export GOPATH=/users/choe/github/ |
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
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) |
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 ( | |
"fmt" | |
"runtime" | |
) | |
func trace2() { | |
pc := make([]uintptr, 15) | |
n := runtime.Callers(2, pc) |
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
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)' |