Skip to content

Instantly share code, notes, and snippets.

View will-riley's full-sized avatar

Will Riley will-riley

View GitHub Profile
@agharbeia
agharbeia / fill_unmerger_gaps.py
Last active April 19, 2021 22:41
LibreOffice Calc macro in Python to fill empty column cells to value on top
# This is LibreOffice Calc macro to set the values of empty cells in
# a column to the value of the first non-empty cells above the empty range.
# It is meant to be used to normalise table rows after unmerging cells
# in compound tables, thus converting them to simple tables that can then
# be algorithmically processed or exported to tabular formats such as CSV.
#
# Themacro is authored by Ahmad Gharbeia<ahmad@gharbeia.org>
# on 2020-05-19 and is licensed under GPL 3.0 license.
#from __future__ import unicode_literals
@JMichaelTX
JMichaelTX / revealPFItemInFinder.applescript
Last active February 2, 2026 19:48
Here is a handler I use to reveal in Finder the item currently selected in Path Finder. Often I need to do something in the Finder window, so I have added a pause until the Finder window name is the same as the Path Finder window name. Revised to Ve
--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
on revealPFItemInFinder()
--–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
(* VER: 2.1 2018-03-19
PURPOSE: Reveal Item in Finder that is Selected in Path Finder
RETURNS: alias of item selected in both Finder and Path Finder
AUTHOR: JMichaelTX
--–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
@andrewlkho
andrewlkho / debian-strongswan.md
Last active April 18, 2026 14:56
Setting up a secure VPN with strongSwan on debian

With heightening concern regarding the state of internet privacy (fuelled in part by the passing of the Investigatory Powers Act in the UK), I have set up a VPN server on the virtual server I have hosted with Mythic Beasts. This uses strongSwan and certificate-based IKEv2 authentication.

Assumptions:

  • Debian Jessie server already set up and accessible via debian.example.com, a public IPv4 of 203.0.113.1 and a public IPv6 of 2001:db8::1
  • Client username of me
  • Clients are running the latest versions of macOS and iOS (Sierra and 10 respectively at the time of writing)
  • No need to support any other operating systems (although the setup is easily translated)

For automated deployment of a similar setup, albeit Ubuntu-based and using ansible for deployment, I recommend you take a look at Algo VPN. I used that project as a basis for my configuration.

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@edhemphill
edhemphill / regextest.cpp
Created February 3, 2012 18:35
ICU4C regex example test program w/ capture groups
// http://www.wigwag.com/devblog/using-icu4c-regex-test-program/
// The following code is freeware:
// regextest.c
// Author: ed
//
// Simple test program for regex using ICU's regex matching.
#include <stdio.h>
#include <getopt.h>
#include <string.h>