Skip to content

Instantly share code, notes, and snippets.

# *.home.mydomain.name is configured as a catchall CNAME in my DNS provider to point to the Caddy box.
# That way, everything needed to add a new subdomain/service is adding it in this file and reloading Caddy.
...
project-1.home.mydomain.name {
respond "This will be provided as a static HTTP response"
}
project-2.home.mydomain.name {
# HTTP basic authentication. Static hosted content served directly by Caddy.
@schl3ck
schl3ck / BetterRequest.js
Last active August 8, 2023 14:41
A wrapper for the Request API of Scriptable, automatically handling common mime types.
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: deep-green; icon-glyph: cloud-upload-alt;
/*******************************************
* *
* ____ _ _ *
* | _ \ | | | | *
* | |_) | ___| |_| |_ ___ _ __ *
* | _ < / _ \ __| __/ _ \ '__| *
* _____| |_) | __/ |_| || __/ | _ *
@andrewlkho
andrewlkho / gist:7373190
Last active March 25, 2024 03:37
How to use authentication subkeys in gpg for SSH public key authentication

GPG subkeys marked with the "authenticate" capability can be used for public key authentication with SSH. This is done using gpg-agent which, using the --enable-ssh-support option, can implement the agent protocol used by SSH.

Requirements

A working gpg2 setup is required. It may be possible to use gpg 1.4 but with gpg-agent compiled from gpg2. If you are using OS X 10.9 (Mavericks) then you may find the instructions [here][1] useful.

@jbenet
jbenet / simple-git-branching-model.md
Last active June 17, 2024 14:53
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@pezz
pezz / crypto-pi-root.md
Last active December 17, 2020 15:40
Archlinux ARM encrypted root

Intro

Just some FYI, to get started:

  • I'm using a 16 GB Sandisk SD card.
  • I have a model B Pi, 512 MB RAM (not really relevant, thought I'd mention it).
  • Monitor and keyboard connected to the Pi itself, for now.
  • Network working, internet access.
@mattoc
mattoc / .bash_aliases
Created September 27, 2012 23:34
mattoc's .screenrc
# http://www.deadman.org/sshscreen.php
# Use this when on your remote machine, before you reattach a screen session
alias scratch='$HOME/bin/grabssh; screen -d -R'
# Use this in a screen session on your remote machine when you need agent forwarding
alias fixssh='source $HOME/bin/fixssh'
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 26, 2024 12:21
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jboner
jboner / latency.txt
Last active July 26, 2024 04:31
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@mdales
mdales / gist:2622886
Created May 6, 2012 15:20
Updating Xcode project version number from git
# Assumes that you tag versions with the version number (e.g., "1.1") and then the build number is
# that plus the number of commits since the tag (e.g., "1.1.17")
echo "Updating version/build number from git..."
plist=${PROJECT_DIR}/${INFOPLIST_FILE}
# increment the build number (ie 115 to 116)
versionnum=`git describe | awk '{split($0,a,"-"); print a[1]}'`
buildnum=`git describe | awk '{split($0,a,"-"); print a[1] "." a[2]}'`
@troelskn
troelskn / app.rb
Last active August 12, 2021 17:25 — forked from dstrelau/app.rb
Gollum protected by HTTP Basic
require 'gollum/frontend/app'
require 'digest/sha1'
class App < Precious::App
User = Struct.new(:name, :email, :password_hash, :can_write)
before { authenticate! }
before /^\/(edit|create|delete|livepreview|revert)/ do authorize_write! ; end
helpers do