Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
everyday I'm hustlin'

Alex Ausch aausch

💭
everyday I'm hustlin'
View GitHub Profile
@brad-anton
brad-anton / requests_connect_with_headers.py
Last active Oct 24, 2019
Certain proxy servers require the Full HTTP request to be included in the same packet as the HTTP CONNECT, however requests seems to split these up into multiple packets. This work around combines the headers and connect into a single send(). Documented here: https://github.com/requests/requests/issues/4884
View requests_connect_with_headers.py
"""
requests_connect_with_headers.py
@brad_anton
Certain proxy servers require the Full HTTP request to be included in
the same packet as the HTTP CONNECT, however requests seems to split
these up into multiple packets. This work around combines the headers
and connect into a single send().
Documented here: https://github.com/requests/requests/issues/4884
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active Dec 1, 2021
Useful PostgreSQL Queries and Commands
View postgres_queries_and_commands.sql
-- 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%'