Skip to content

Instantly share code, notes, and snippets.

@pvillamil
pvillamil / postgres_queries_and_commands.sql
Created July 22, 2024 23:19 — forked from rgreenjr/postgres_queries_and_commands.sql
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%'
@pvillamil
pvillamil / Visual Studio 2015
Created July 31, 2024 22:11 — forked from NehemiahLimo/Visual Studio 2015
Product keys for Visual Studio 2015
Visual Studio Professional 2015
Key : HMGNV-WCYXV-X7G9W-YCX63-B98R2
Visual Studio Enterprise 2015
Key :HM6NR-QXX7C-DFW2Y-8B82K-WTYJV
Visual Studio Enterprise 2015
@pvillamil
pvillamil / clear_systemd_journal_logs.md
Created May 27, 2025 12:44 — forked from bearlike/clear_systemd_journal_logs.md
Clear Systemd Journal Logs in Ubuntu 20.04

Clear Systemd Journal Logs in Ubuntu 20.04

Systemd has its own logging system called the journal, and the log files are stored in /var/log/journal.

Check current disk usage of journal files

sudo journalctl --disk-usage

Rotate journal files

  • Active journal files will be marked as archived, so that they are never written to in future.