This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:{$PORT} | |
root * /srv | |
# Do not rewrite up to this point! | |
file_server | |
templates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
app: | |
image: nginx:alpine | |
ports: ["80:80"] | |
restart: unless-stopped | |
restarter: | |
image: docker:cli | |
volumes: ["/var/run/docker.sock:/var/run/docker.sock"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
set -euo pipefail | |
# This script will remove automatic association for all networks not listed in the whitelist | |
# passed as the first argument. Passwords will NOT be removed from the Keychain. | |
# | |
# Alternatively, you can untick "Remember networks" in Network Preferences > Wi-Fi > Advanced, | |
# but then you won't be able to auto-join networks even temporarily, and you might already | |
# have a long list to go through. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Proxy PAC File | |
// - Used to redirect certain addresses to the server through the SOCKS ssh port (1280 for this file), i.e. | |
// tunnel traffic through server. | |
// - Useful for easily accessing webpages from services running on a server (Jupyter notebooks, TensorBoard, Spark UI, etc.) | |
// that is otherwise locked down by a firewall. | |
// - To install on OS X/MacOS, go to "Settings->Network->Advanced->Proxies->Automatic Proxy Configuration" | |
// and paste the local file url (`file:///absolute/path/to/proxy.pac`). | |
// - Alternatively, use `./reinstall_proxy.sh`. | |
// - SSH to the server with `ssh -D 1280 ....`. | |
function FindProxyForURL(url, host) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adapted from https://developers.yubico.com/ykneo-openpgp/ResetApplet.html | |
gpg-connect-agent <<EOF | |
/hex | |
scd serialno | |
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40 | |
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40 | |
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40 | |
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40 | |
scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40 | |
scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The command finds the most recent tag that is reachable from a commit. | |
# If the tag points to the commit, then only the tag is shown. | |
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object | |
# and the abbreviated object name of the most recent commit. | |
git describe | |
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix: | |
git describe --abbrev=0 | |
# other examples |
Use case: You have repository A with remote location rA, and repository B (which may or may not have remote location rB). You want to do one of two things:
- preserve all commits of both repositories, but replace everything from A with the contents of B, and use rA as your remote location
- actually combine the two repositories, as if they are two branches that you want to merge, using rA as the remote location
NB: Check out git subtree
/git submodule
and this Stack Overflow question before going through the steps below. This gist is just a record of how I solved this problem on my own one day.
Before starting, make sure your local and remote repositories are up-to-date with all changes you need. The following steps use the general idea of changing the remote origin and renaming the local master branch of one of the repos in order to combine the two master branches.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSTALL_ROOT=$HOME/Python | |
CPY=$INSTALL_ROOT/CPython | |
PYPY=$INSTALL_ROOT/PyPy | |
SANDBOX=$(mktemp -d /tmp/python.XXXXXX) | |
CURL='wget --no-check-certificate' | |
mkdir -p $INSTALL_ROOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- http://www.brucelawson.co.uk/2010/a-minimal-html5-document/ --> | |
<!doctype html> | |
<html lang=en> | |
<head> | |
<meta charset=utf-8> | |
<title>blah</title> | |
</head> | |
<body> | |
<p>I'm the content</p> |
NewerOlder