Skip to content

Instantly share code, notes, and snippets.

@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active May 22, 2024 05:53
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), 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(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@pzol
pzol / install_ruby192_freebsd.sh
Created December 18, 2010 23:24
How to install rvm 1.9.2 under FreeBSD - this is work in progress and not complete. You have to su or sudo -i to run this
# this does not run as a complete script :(
pkg_add -r bash curl sudo
pkg_add -r git vim # can you live without it?
pkg_add -r libxml2 libxslt # for nokogiri later
pw usermod pzol -G wheel
bash # start bash and run the rest inside it
curl -# -L http://bit.ly/rvm-install-system-wide > rvm-install-system-wide
bash -l < rvm-install-system-wide