Skip to content

Instantly share code, notes, and snippets.

View bkyryliuk's full-sized avatar

Bogdan bkyryliuk

  • Dropbox
  • San Francisco
View GitHub Profile
@bkyryliuk
bkyryliuk / postgres_queries_and_commands.sql
Created January 19, 2018 17:59 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@bkyryliuk
bkyryliuk / z.md
Created May 22, 2017 23:18 — forked from mischah/z.md
Installing und initializing z (https://github.com/rupa/z) with help of Homebrew.

#The power of z

Do you spend lots of time doing things like this?

cd this/is/the/path/that/i/want/so/i/type/it/all/out/to/get/whereiwant

With z, you could just do this: