Skip to content

Instantly share code, notes, and snippets.

View bmarkons's full-sized avatar
💨

Marko Bogdanović bmarkons

💨
View GitHub Profile
@bmarkons
bmarkons / gist:5bf80b97ac4f5860f903c60cbbe3540d
Created October 5, 2021 19:38 — forked from jampajeen/gist:d19f36a7309d0ead0e1f9735a26d66f3
Disable/Enable Mac OSX sleep on lid closed
# disable sleep
sudo pmset -b sleep 0; sudo pmset -b disablesleep 1
# re-enable sleep
sudo pmset -b sleep 5; sudo pmset -b disablesleep 0
@bmarkons
bmarkons / postgres_queries_and_commands.sql
Last active October 8, 2020 14:24 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- kill running query
SELECT pg_cancel_backend(procpid);
-- kill idle query