Skip to content

Instantly share code, notes, and snippets.

View ianthetechie's full-sized avatar

Ian Wagner ianthetechie

View GitHub Profile
@ianthetechie
ianthetechie / build-rust-ios-lib.sh
Created April 24, 2023 10:25
A minimal zsh script that can be used by an Xcode External Build System target to build for iOS
#!/bin/zsh
# Clears environment variables set by Xcode by taking a whitelist approach.
# We only need our HOME and PATH, as well as the ACTION and CONFIGURATION set by Xcode
env -i HOME="$HOME" PATH="$PATH" ACTION="$ACTION" CONFIGURATION="$CONFIGURATION" \
/bin/zsh -l -c "$(cat <<-'END_OF_SCRIPT'
# Function to perform a clean build
clean_build() {
echo "Cleaning..."
cargo clean
@ianthetechie
ianthetechie / bhyve-debian.md
Created February 1, 2023 04:39
A short guide on setting up Debian guests in bhyve

A short guide on setting up Debian guests in bhyve

I have a problem. I need to run some Docker containers for work. Docker, as you may know, has a design that is tightly coupled to Linux. This is rather unfortunate since my desktop is running FreeBSD, and my laptop is running its distant cousin, macOS. Normally I'd just do such things on my Mac, but 1) my desktop has a lot more storage, and 2) the Docker images in question are amd64 already. Also I just wanted a challenge, so let's set up a VM to run Docker on FreeBSD.

Aside in case you're wondering why Docker runs on your Mac: Docker Desktop actually ships a hypervisor,

@ianthetechie
ianthetechie / string_concat_timings.py
Created June 24, 2019 09:16
Simple test of string concatenation strategies
import timeit
loop_count = 100
def concat_strings():
out_str = ""
for num in range(loop_count):
out_str += str(num)
return out_str
@ianthetechie
ianthetechie / pg_mbtileserve.py
Created October 2, 2018 05:11
WIP version of openmaptiles/postserve that has better concurrency
###
# NOTE: This is super WIP and is intended to demonstrate one method of improving concurrency.
###
import io
import os
from sqlalchemy import Column, ForeignKey, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship, scoped_session, sessionmaker
from sqlalchemy import create_engine
@ianthetechie
ianthetechie / keybase.md
Created September 6, 2018 00:44
Keybase

Keybase proof

I hereby claim:

  • I am ianthetechie on github.
  • I am ianthetechie (https://keybase.io/ianthetechie) on keybase.
  • I have a public key ASDdy2kpjq4cdIELhui1sUnQ113bWCf7uBkDAzWipYU1mQo

To claim this, I am signing this object:

@ianthetechie
ianthetechie / Twilio Asterisk Secure Trunking HOWTO.md
Last active November 1, 2023 16:01
A short guide on how to set up an encrypted VoIP system using Twilio and Asterisk.

Twilio Asterisk Secure Trunking HOWTO

This is a short guide on how to set up an encrypted VoIP system using Twilio and Asterisk. I was a little annoyed that just about everything these days still uses unencrypted RTP for media (though just about everyone supports SIP over TLS). So I spent a weekend looking at options, and settled on a totally overkill solution involving Twilio's secure trunking to an Asterisk PBX. While all bets are off once it hits the PSTN, at least you won't be blasting your conversations over the internet in clear text.