Skip to content

Instantly share code, notes, and snippets.


Per Guth perguth

View GitHub Profile
perguth / nano
Last active Sep 13, 2019
⏲️📝 Back ups every file that gets touched by `nano`.
View nano
# Back ups every file that gets touched by `nano`.
# Install by:
# 1. `sudo mv /bin/nano /bin/nano-real`
# 2. Put this file in `/usr/local/bin` and make it executable.
# 3. Set your user:
perguth / computer
Last active Jul 23, 2019
Sleep host when Mosh is idle. Wake up on reconnect.
View computer
echo 🚀 Connecting Mosh.
mosh user@computer.y
mattiaslundberg / Ansible Let's Encrypt Nginx setup
Last active May 9, 2021
Let's Encrypt Nginx setup with Ansible
View Ansible Let's Encrypt Nginx setup
Ansible playbook to setup HTTPS using Let's encrypt on nginx.
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS.
The server pass A rating on [SSL Labs](
To use:
1. Install [Ansible](
2. Setup an Ubuntu 16.04 server accessible over ssh
3. Create `/etc/ansible/hosts` according to template below and change to your domain
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder)
ldong /
Last active Feb 17, 2021
download egghead videos

Download videos from egghead

Go to the egghead website, i.e. Building a React.js App


$.each($('h4 a'), function(index, video){
kyledrake /
Last active Aug 18, 2019
IPFS replication service with one line of unix shell code!
# First, install ncat:
# Usually comes with the 'nmap' package on distributions.
ncat -k -v -l -p 5555 -c 'ipfs refs local | gzip'
# To retrieve on the client machine:
# nc 5555 | gunzip | ipfs pin add -r
dylansmith /
Created Jan 12, 2015
Configure npm to install global modules to userspace (set npm prefix to ~/npm)
if [[ ! -e $DIR ]]; then
mkdir $DIR
elif [[ ! -d $DIR ]]; then
echo "$DIR exists but is not a directory" 1>&2
exit 1
9point6 /
Last active Apr 13, 2021
Keep retrying SSH connection until success (Useful for waiting for VMs to boot)
#!/usr/bin/env bash
# Check we've got command line arguments
if [ -z "$*" ] ; then
echo "Need to specify ssh options"
exit 1
# Start trying and retrying
((count = 100))

channel operator quick reference

direct discussion about administrative action away from the main channel and into #reddit-diabetes-ops to minimise disruption. our -ops channel is the place where users should come to ask for our help. examples:

  • any sort of operator request or discussion of channel administration in the main channel
  • PMs asking why a ban was set
  • reports of harassment (unless the user is confiding in you)
  • any request for operator action

changing channel access permissions

staltz /
Last active May 10, 2021
The introduction to Reactive Programming you've been missing
gavinhungry / nginx-tls.conf
Last active May 5, 2021
Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
View nginx-tls.conf
# Name: nginx-tls.conf
# Auth: Gavin Lloyd <>
# Desc: Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
# Enables HTTP/2, PFS, HSTS and OCSP stapling. Configuration options not related
# to SSL/TLS are not included here.
# Additional tips: