Skip to content

Instantly share code, notes, and snippets.

View jpascal's full-sized avatar

Evgeniy Shurmin jpascal

View GitHub Profile
@jpascal
jpascal / postgres_queries_and_commands.sql
Created January 16, 2018 11:39 — 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%'
@jpascal
jpascal / .about+license.md
Created January 27, 2020 14:21 — forked from anilnairxyz/.about+license.md
Candlestick Chart

A zoomable candlestick chart.

Copyright © 2015, Anil Nair - MIT License

@jpascal
jpascal / restic_cron.sh
Created October 22, 2023 07:33 — forked from perfecto25/restic_cron.sh
Restic cron script
#!/bin/bash
# Runs Restic backup on a schedule via cron, emails with status
# 1. add a cred file with your repo logins to /etc/restic/cred
# 2.
FROM="restic@$(hostname)"
EMAIL="user@company.com"
LOG="/var/log/restic.log"
RDIR="/etc/restic"