Skip to content

Instantly share code, notes, and snippets.

View edelooff's full-sized avatar

Elmer de Looff edelooff

View GitHub Profile
@Khazbs
Khazbs / https_non-www_letsencrypt.nginx.conf
Last active December 13, 2020 10:09
Try this site conf if you (use SSL/TLS certificates by letsencrypt certbot for nginx and) want to redirect http: to https: and www to non-www
server {
# Listen for http:
listen [::]:80;
listen 80;
# Handle . and www.
server_name example.com www.example.com;
# Redirect to https:
return 301 https://$host$request_uri;
@althonos
althonos / setup.cfg
Last active March 4, 2024 18:08
A `setup.cfg` template for my Python projects
# https://gist.github.com/althonos/6914b896789d3f2078d1e6237642c35c
[metadata]
name = {name}
version = file: {name}/_version.txt
author = Martin Larralde
author_email = martin.larralde@embl.de
url = https://github.com/althonos/{name}
description = {description}
long_description = file: README.md
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active May 7, 2024 15:24
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%'