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
sudo lsof -i -n | egrep '\<ssh\>' |
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
manage.py celery amqp queue.purge <QUEUE_NAME> |
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
/sbin/ifconfig NET_NAME | grep 'inet ' | tr -s " " | cut -d " " -f3 |
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
s3cmd mv s3://SOURCE_BUCKET/foo s3://DESTINATION_BUCKET/bar --recursive |
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
./manage.py celery amqp queue.purge <queue_name> |
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
set work_mem = '56GB'; | |
commit; | |
-- Do your work here. | |
-- Then be a good neighbour. | |
set work_mem = default; | |
commit; |
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
-- To enable | |
\o output_file | |
SELECT * FROM .....; | |
-- TO disable | |
\o |
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 relname as "table", | |
heap_blks_read as "heap from disc", | |
heap_blks_hit as "heap from cache", | |
idx_blks_read as "index from disc", | |
idx_blks_hit as "index from cache", | |
toast_blks_read as "toast from disc", | |
toast_blks_hit as "toast from cache", | |
tidx_blks_read as "toast index disc", | |
tidx_blks_hit as "toast index cache" | |
from pg_statio_user_tables |
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 relname as "table", | |
seq_scan as "table scans", | |
idx_scan as "index lookups" | |
from pg_stat_user_tables | |
where relname = 'TABLE_NAME'; |
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 relname as "table", | |
seq_scan as "table scans", | |
seq_tup_read as "tuples scanned", | |
idx_scan as "index lookups", | |
idx_tup_fetch as "tuples fetched via index" | |
from pg_stat_user_tables | |
where relname = 'TABLE_NAME'; |