Skip to content

Instantly share code, notes, and snippets.

View eduardvercaemer's full-sized avatar
💭
working with simon

Ed eduardvercaemer

💭
working with simon
View GitHub Profile
@andreibosco
andreibosco / gist:cb8506780d0942a712fc
Created October 21, 2014 17:28
Using GNU Stow to manage your dotfiles

Fonte: http://brandon.invergo.net/news/2012-05-26-using-gnu-stow-to-manage-your-dotfiles.html?round=two

I accidentally stumbled upon something yesterday that I felt like sharing, which fell squarely into the "why the hell didn't I know about this before?" category. In this post, I'll describe how to manage the various configuration files in your GNU/Linux home directory (aka "dotfiles" like .bashrc) using GNU Stow.

The difficulty is that it would be helpful to manage one's configuration files with a version control system like Git, Mercurial or Bazaar, but many/most dotfiles reside at the top-level of your home directory, where it wouldn't be a good idea to initialize a VCS repository. Over time I've come across various programs which aim to manage this for you by keeping all the files in a subdirectory and then installing or linking them into their appropriate places. None of those programs ever really appealed to me. They would require a ton of dependencies (like Ruby and a ton of libraries for it) or t

@kekru
kekru / 01nginx-tls-sni.md
Last active April 24, 2025 10:07
nginx TLS SNI routing, based on subdomain pattern

Nginx TLS SNI routing, based on subdomain pattern

Nginx can be configured to route to a backend, based on the server's domain name, which is included in the SSL/TLS handshake (Server Name Indication, SNI).
This works for http upstream servers, but also for other protocols, that can be secured with TLS.

prerequisites

  • at least nginx 1.15.9 to use variables in ssl_certificate and ssl_certificate_key.
  • check nginx -V for the following:
    ...
    TLS SNI support enabled
@eatnumber1
eatnumber1 / cookieauth.conf
Last active March 23, 2025 16:06
Stateless Nginx Cookie Authentication
# Simple Cookie Authorization (SCA)
#
# SCA sets up an auth scheme which uses a secure cookie, presenting basic
# auth if the cookie isn't supplied.
#
# Put this file in /etc/nginx/conf.d
#
# To use it, put a stanza like the following in a server section:
#
# set $sca_realm "My Website";
@abatko
abatko / 2022-US-zip-codes-abatko.csv
Last active September 17, 2024 13:53
All US zip codes from 2022 Government Data, with geolocations (latitude and longitude coordinates), comma delimited. Source: https://www.census.gov/geographies/reference-files/time-series/geo/gazetteer-files.html > ZIP Code Tabulation Areas > Download the ZIP Code Tabulation Areas Gazetteer File. Based on https://gist.github.com/abatko/ee7b24db8…
We can't make this file beautiful and searchable because it's too large.
ZIP,LAT,LNG
00601,18.180555, -66.749961
00602,18.361945, -67.175597
00603,18.457399, -67.124867
00606,18.158327, -66.932928
00610,18.293960, -67.127182
00611,18.276316, -66.807165
00612,18.416727, -66.700090
00616,18.420412, -66.671979
00617,18.446889, -66.561154