Skip to content

Instantly share code, notes, and snippets.

View ghuntley's full-sized avatar
minimalist

Geoffrey Huntley ghuntley

minimalist
View GitHub Profile
wpa_supplicant -B -i interface -c <(wpa_passphrase 'SSID' 'key').
ping 1.1.1.1
parted /dev/nvme0n1 -- mklabel gpt
parted /dev/nvme0n1 -- mkpart primary 512MiB -0
parted /dev/nvme0n1 -- mkpart ESP fat32 1MiB 512MiB
parted /dev/nvme0n1 -- set 2 esp on
cryptsetup luksFormat /dev/nvme0n1p1

Install NixOS on Oracle Cloud over Ubuntu 18.04

# install useful tools
sudo apt-get update
sudo apt-get install --no-install-recommends -y nano mc git

# prepare /boot
sudo umount /boot/efi
sudo mv /boot /boot.bak
@ghuntley
ghuntley / TelstraAirConnect.py
Created August 22, 2020 01:24 — forked from Steve-Tech/TelstraAirConnect.py
Python Telstra Air Connector
import requests
import re
session = requests.Session()
# This isn't your Telstra ID but rather the Fon credentials found in the Telstra Air app, you can also find this in the network tab of inspect element when logging in normally.
anid = "m61400000000@wifi.telstra.com"
anidpassword = ""
try: login = re.findall(r'<LoginURL>(.*)</LoginURL>', session.get("http://msftconnecttest.com/redirect").text)[0] # Get the Telstra Air login URL
@ghuntley
ghuntley / TelstraAirConnect.py
Created August 22, 2020 01:24 — forked from Steve-Tech/TelstraAirConnect.py
Python Telstra Air Connector
import requests
import re
session = requests.Session()
# This isn't your Telstra ID but rather the Fon credentials found in the Telstra Air app, you can also find this in the network tab of inspect element when logging in normally.
anid = "m61400000000@wifi.telstra.com"
anidpassword = ""
try: login = re.findall(r'<LoginURL>(.*)</LoginURL>', session.get("http://msftconnecttest.com/redirect").text)[0] # Get the Telstra Air login URL
@ghuntley
ghuntley / TodoMVC.purs
Created June 9, 2020 13:14
PureScript implementation of WebCheck frontend language
module TodoMVC where
import DSL
import Data.Array (filter, head, last)
import Data.Array as Array
import Data.Foldable (length)
import Data.Maybe (Maybe(..))
import Data.Number as Number
import Data.String (Pattern(..), split)
@ghuntley
ghuntley / cliff-notes.md
Created July 28, 2018 22:20 — forked from shiftkey/cliff-notes.md
Working Distributed - Cliff Notes
@ghuntley
ghuntley / TheDateTime.cs
Created May 3, 2018 07:36 — forked from glennstephens/TheDateTime.cs
If you have an app that is designed to be used over a long period of time (say a year). To write tests you need to simulate the passage of time. I've been using this little helper to allow to simulated tests in the fourth dimension
// Instead of using calls like DateTime.Now, use TheDateTime.Now instead. In your production code it will default to using
// the read details and for testing you would make calls like:
// TheDateTime.SwitchToMockDate(new DateTime(2018, 12, 3);
// and then test what the outcome would be. It assumes that you have this throughout
public static class TheDateTime
{
static Lazy<LiveDateTimeFunctions> _liveDates = new Lazy<LiveDateTimeFunctions>(() => new LiveDateTimeFunctions());
static Lazy<MockDateTimeFunctions> _mockDates = new Lazy<MockDateTimeFunctions>(() => new MockDateTimeFunctions());
static IDateTimeFunctions _instance = _liveDates.Value;
@ghuntley
ghuntley / demo.sh
Created October 9, 2017 01:11 — forked from agc93/demo.sh
Script used for demos and live coding
# This is pretty trimmed down, but is the basic idea, at least
docker ps -a -q -f status=exited | xargs -r docker rm
git reset --hard
git checkout stage-$1

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

@ghuntley
ghuntley / AppPickerExtensions.cs
Created June 28, 2017 04:30 — forked from richseviora/AppPickerExtensions.cs
Xamarin UI Test Date/Time Picker Extensions
// Tested with Xamarin.UITest V1.3.7;
using System;
using Xamarin.UITest;
namespace {APPNAMEHERE}.UITests
{
/// <summary>
/// This extension class extends the <see cref="IApp"/> interface to add extension methods for selecting values from the default Date/Time pickers in iOS and Android.
/// </summary>
public static class AppPickerExtensions