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
select pid, query | |
from pg_stat_activity | |
where datname = 'table' | |
and wait_event_type = 'Lock'; | |
select 'select pg_cancel_backend( ''' || pid || ''');' pid | |
from pg_stat_activity | |
where datname = 'table' | |
and wait_event_type = 'Lock'; |
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
CREATE DEFINER=`root`@`localhost` PROCEDURE `database`.`name`() | |
BEGIN | |
DECLARE pre_name BIGINT; | |
DECLARE ageVal INT; | |
DECLARE i INT; | |
SET pre_name=862362681; | |
SET ageVal=100; | |
SET i=1; | |
WHILE i < 1000000 DO | |
INSERT shop(name,union_id, open_id) VALUES(CONCAT(pre_name,'@qq.com'),CONCAT(i ,'unionId'),CONCAT(i,'openId')); |
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
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
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
环境:shadowsocks、windows | |
本地ss端口设置(这里1080) | |
cmd命令行:(不用socks5)(临时设置)(也可放置环境变量) | |
set http_proxy=http://127.0.0.1:1080 | |
set https_proxy=http://127.0.0.1:1080 | |
ps:一定要用cmd命令行,千万别用powershell !!! | |
简易测试命令:curl https://www.google.com(别用ping) |
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
git config --global credential.helper store |
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 GOROOT=/usr/lib/go-1.10 | |
export GOPATH=/home/lu/gowork | |
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin |