This file contains hidden or 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
version: '2' | |
services: | |
consul-lb: | |
image: rancher/lb-service-haproxy:v0.7.8 | |
ports: | |
- 8400 | |
- 8500 | |
- 8600 | |
expose: |
This file contains hidden or 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
openssl rand 60 | openssl base64 -A |
This file contains hidden or 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
/* Find out the slow query */ | |
SELECT pid, query FROM pg_stat_activity WHERE state = 'active'; | |
/* Kill the slow query by pid */ | |
select pg_terminate_backend(pid) | |
from pg_stat_activity | |
where pid = $pid; |
This file contains hidden or 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
const promises = []; // an array of promises. | |
promises.reduce((prev, next) => prev.then(next), Promise.resolve()); |
This file contains hidden or 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 | |
relname as relation_name, | |
query, | |
pg_locks.* | |
from pg_locks | |
join pg_class on pg_locks.relation = pg_class.oid | |
join pg_stat_activity on pg_locks.pid = pg_stat_activity.pid |