Skip to content

Instantly share code, notes, and snippets.


Alun Davey 4lun

View GitHub Profile
View index.html
<meta name="viewport" content="width=device-width, initial-scale=1.0">
body {
box-sizing: border-box;
margin: 0;
padding: 2vh 5vh 4vh;
background: #050505;
/usr/bin/ruby -e "$(curl -fsSL"
brew install nvm && echo -e "\
NVM_DIR=\"$HOME/.nvm\"\n. \"/usr/local/opt/nvm/\"
" >> ~/.bash_profile && source ~/.bash_profile &&
nvm install v8 --default &&
brew cask install iterm2 chromium visual-studio-code 1password authy alfred
sudo rm -rf Downloads/
ln -s ~/Desktop Downloads
4lun /
Last active Nov 20, 2020
NGINX config for using Let's Encrypt via the client, assumes the existence of a `/var/www/.letsencrypt` directory and enforces HTTPS while allowing cert issue/renewal over HTTP
server {
listen 80;
include letsencrypt_params;
server {
listen 443;
4lun /
Last active Jul 3, 2018
Pack list for travelling and outdoor pursuits

Pack List


  • Bag
  • T-shirts
  • Trousers
  • Socks
  • Underwear
  • Travel adapter
  • Plug splitter
  • Various chargers
4lun /
Created Aug 29, 2017
Install and run a vanilla Minecraft server (1.7.4) on a new install of Ubuntu 16.04
fallocate -l 1G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
apt update
apt install -y screen default-jdk
ln -s minecraft_server.1.7.4.jar minecraft_server.jar
screen -S minecraft
4lun /
Last active Jul 9, 2019
How to trigger a remote build via a URL for a Jenkins job
  1. Create new user (e.g. webhook) with the following permissions: Overall > Read, Job > Build, Job > Read & Job > Workspace. Login as the user and get their API token
  2. Under a job, enable "Trigger Builds Remotely" and set an authentication token
  3. Trigger a POST request with the following structure:


4lun /
Last active Mar 10, 2017
Generate and install SSL certificate with letsencrypt (for nginx)
export DOMAIN=""
curl | sh
bash --login
mkdir -p /etc/nginx/certs/$DOMAIN/ --issue -d $DOMAIN -w /var/www/$DOMAIN/public/ --install-cert -d $DOMAIN \
--certpath /etc/nginx/certs/$DOMAIN/cert.pem \
--keypath /etc/nginx/certs/$DOMAIN/key.pem \
--fullchainpath /etc/nginx/certs/$DOMAIN/fullchain.pem \
4lun / s3-redirect-routing-rules.xml
Last active Jun 4, 2017
Redirect all requests from an S3 bucket to another domain with explicit path (example redirects all requests to Substitute 404 code with 403 if bucket is not publicly readable. Note this all assumes there are no matching files in the bucket.
View s3-redirect-routing-rules.xml
4lun /
Created Feb 14, 2017
Generate a self signed wildcard SSL cert (run one line at a time)
# Based on:
# Replace with desired domain (and x.domain instances)
openssl genrsa 2048 > x.domain.key
openssl req -new -x509 -nodes -sha1 -days 3650 -key x.domain.key > x.domain.cert
# Interactive prompt: enter * for the Common Name
openssl x509 -noout -fingerprint -text < x.domain.cert >
cat x.domain.cert x.domain.key > x.domain.pem
4lun /
Created Jan 17, 2017
Generate a personal access token for Instagram
  1. Register a client at (redirect_uri can be something simple such as http://localhost)
  2. Go to the 'Security' tab for your client (under manage) and untick 'Disable implicit OAuth'
  3. Take the following URL, subsitute the [client_id] with your own and the [redirect_uri] with one you specified during the registration process:[client_id]&redirect_uri=[redirect_uri]&response_type=token
  4. Navigate to the URL in the browser (while logged in as the same user), after accepting any prompts you should be redirected to your specified redirect_uri with the access token appended