Skip to content

Instantly share code, notes, and snippets.

View imsmith's full-sized avatar

Ian Smith imsmith

  • Seattle
  • 13:20 (UTC -07:00)
View GitHub Profile
@kekru
kekru / 01nginx-tls-sni.md
Last active May 21, 2024 11:19
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
@Fuwn
Fuwn / xp.md
Last active May 21, 2024 00:44
Windows XP All Editions Universal Product Keys Collection.

Although Microsoft does not support Windows XP updates any more, I’m sure there are still many users using it due to their personal habits or job demands. Therefore XP’s product keys may be necessary even now, and Fuwn provided you with the most comprehensive Windows XP product keys here, just in order to provide some convenience.

The following CD-KEYs are official and original from Microsoft, mainly used for Windows XP Professional Service Pack 2/3 VOL/VLK system images which are the easiest ones to find on the Internet. Their biggest advantage is your Windows XP will be activated after using these CD-KEYs to complete installation.

// Windows XP Pro Product Keys //

@voodoohop
voodoohop / chatgpt_commit_messages.sh
Last active May 19, 2024 09:25
One-Liner Using ChatGPT for Concise, Automated Git Commit Messages
# install
pip install shell-gpt
sgpt "hi" (and enter your API key)
# commit the current folder with the generated message
git commit . -m "$(git diff | sgpt --model gpt-4o --code 'Write concise, informative commit messages: Start with a summary in imperative mood, explain the 'why' behind changes, keep the summary under 50 characters, use bullet points for multiple changes, and reference related issues or tickets. What you write will be passed to git commit -m "[message]"')"
# you could assign an alias now if you like it
@ScottKillen
ScottKillen / print.css
Last active May 15, 2024 15:33
PDF export stylesheet for obsidian
/* Obsidian snippet to style output of pdf exports
*/
@media print {
/* set your preferred fonts here.
*/
:root {
--body-font-family: "Newsreader Text", TimesNewRoman, "Times New Roman", Times, Baskerville, Georgia, serif;
@pamolloy
pamolloy / README.md
Last active May 12, 2024 04:17
Mesh network using VXLAN over Wireguard
@Tras2
Tras2 / cloudflare-ddns-update.sh
Last active May 11, 2024 21:57
A bash script to update a Cloudflare DNS A record with the external IP of the source machine
#!/bin/bash
# A bash script to update a Cloudflare DNS A record with the external IP of the source machine
# Used to provide DDNS service for my home
# Needs the DNS record pre-creating on Cloudflare
# Proxy - uncomment and provide details if using a proxy
#export https_proxy=http://<proxyuser>:<proxypassword>@<proxyip>:<proxyport>
# Cloudflare zone is the zone which holds the record
@reborg
reborg / rich-already-answered-that.md
Last active May 8, 2024 14:20
A curated collection of answers that Rich gave throughout the history of Clojure

Rich Already Answered That!

A list of commonly asked questions, design decisions, reasons why Clojure is the way it is as they were answered directly by Rich (even when from many years ago, those answers are pretty much valid today!). Feel free to point friends and colleagues here next time they ask (again). Answers are pasted verbatim (I've made small adjustments for readibility, but never changed a sentence) from mailing lists, articles, chats.

How to use:

  • The link in the table of content jumps at the copy of the answer on this page.
  • The link on the answer itself points back at the original post.

Table of Content

@searls
searls / github
Created November 16, 2023 02:11
I got sick of going through multiple steps to visit the current directory's github URL when I'm looking at a terminal, but I don't necessarily want to install `gh` or `hub` just for this feature.
#!/usr/bin/env ruby
begin
repo = `git remote -v`.split("\n").find { |line|
line.include?("github.com")
}.split("\t")[1].match(/git@github.com:(.*).git/)[1]
system "open https://github.com/#{repo}"
rescue
warn "No github remote found"
@chriswayg
chriswayg / create-cloud-template.sh
Last active May 1, 2024 20:47
This script will download a cloud image of many Linux distros and create a Proxmox 6 KVM template from it.
#!/bin/bash
set -o errexit
clear
printf "\n*** This script will download a cloud image and create a Proxmox VM template from it. ***\n\n"
### HOW TO USE
### Pre-req:
### - run on a Proxmox 6 server
### - a dhcp server should be active on vmbr1
@vindarel
vindarel / Common Lisp VS Racket - testimonies.md
Last active April 20, 2024 03:18
Common Lisp VS Racket. Feedback from (common) lispers.

Developer experience, libraries, performance… (2021/11)

I'll preface this with three things. 1. I prefer schemes over Common Lisps, and I prefer Racket of the Schemes. 2. There is more to it than the points I raise here. 3. I assume you have no previous experience with Lisp, and don't have a preference for Schemes over Common Lisp. With all that out of the way... I would say Common Lisp/SBCL. Let me explain

  1. SBCL Is by far the most common of the CL implementations in 2021. It will be the easiest to find help for, easiest to find videos about, and many major open source CL projects are written using SBCL
  2. Download a binary directly from the website http://www.sbcl.org/platform-table.html (even for M1 macs) to get up and running (easy to get started)
  3. Great video for setting up Emacs + Slime + Quick Lisp https://www.youtube.com/watch?v=VnWVu8VVDbI

Now as to why Common Lisp over Scheme