Skip to content

Instantly share code, notes, and snippets.

View johnboiles's full-sized avatar

John Boiles johnboiles

View GitHub Profile
@johnboiles
johnboiles / next-typescript-macos.md
Created September 15, 2021 19:38
Create a new Next.js Typescript web app on macOS

Make sure you have Node.js installed either from the nodejs.org page or via HomeBrew (brew install node).

You’ll also need yarn set up in order to run this code. You can get yarn with:

npm install -g yarn

Create a new Next.js app (it will prompt for a name)

@johnboiles
johnboiles / webmcp.service
Last active November 13, 2018 07:19
WebMCP Systemd Unit File
[Unit]
Description=WebMCP
Requires=docker.service
After=docker.service
[Service]
# Uncomment to have systemd automatically restart this process if it fails
#Restart=always
# In case we didn't shut down properly, try to remove any container with the same name
@johnboiles
johnboiles / start_both.sh
Created June 16, 2018 03:00
EZ-WifiBroadcast in the cloud
# Receives packets over udp, transforms dual-fisheye to equirectangular and sends out over RTMP
rx -d 100 -p 0 -d 100 -b 24 -r 12 -f 768 -s 10.0.0.21 -u 6000 | tee >(ffmpeg -f h264 -i - -i /home/xmap_insta360.pgm -i /home/ymap_insta360.pgm -filter_complex remap -vcodec h264 -b:v 3000k -strict experimental -f flv rtmp://space.prscp.net/live/payload360) | ffmpeg -f h264 -i - -vcodec copy -strict experimental -f flv rtmp://space.prscp.net/live/payload360unstitched
@johnboiles
johnboiles / bashrc.sh
Last active December 22, 2015 19:29
My .bashrc for Raspberry PIs
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
@johnboiles
johnboiles / enable-charles-proxy.sh
Last active January 28, 2021 07:48
Add this as a "Run Script" build phase in Xcode to enable Charles Proxy on iOS 9
#!/bin/sh
# enable-charles-proxy.sh
#
# Created by John Boiles on 9/21/15.
#
# This script sets :NSAppTransportSecurity:NSAllowsArbitraryLoads to true in the Info.plist file if building the Debug configuration.
# This enables debugging from https proxies such as Charles.
INFO_PLIST="${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"
@johnboiles
johnboiles / keybase.md
Created October 21, 2014 15:10
Identity Verification for Keybase

Keybase proof

I hereby claim:

  • I am johnboiles on github.
  • I am johnboiles (https://keybase.io/johnboiles) on keybase.
  • I have a public key whose fingerprint is 9B52 AC6C F13A 01C5 9783 896F 9FBD B3CE B38B 16CF

To claim this, I am signing this object:

@johnboiles
johnboiles / SerialEcho.c
Created September 4, 2014 06:51
Super simple Arduino serial echo from one serial port to another
void setup()
{
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
// Leotracker has connection to the gps power pin
pinMode(8, OUTPUT);
digitalWrite(8, LOW);
@johnboiles
johnboiles / base.html
Created August 12, 2014 20:14
Jinja2 version of Django Rest Framework's rest_framework/templates/base.html file
<!DOCTYPE html>
<html>
<head>
{% block head %}
{% block meta %}
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="robots" content="NONE,NOARCHIVE" />
{% endblock %}
@johnboiles
johnboiles / GNURadio Modules + MacPorts + OSX.md
Last active June 8, 2024 02:33
How to build GNURadio modules from source on OSX 10.9 with GNURadio installed via MacPorts

Building GNURadio Modules on OSX with MacPorts

I'm on OSX 10.9.4 and recently picked up an RTL2832u dongle. After trying to get GNURadio to build on Homebrew, I gave up and installed MacPorts (via Homebrew using Cask). Since MacPorts and Homebrew don't always play nicely, I silo'd my MacPorts PATH settings using this technique. With this method, you prefix any commands that you want to run in a MacPorts-friendly environment with a script that sets up your PATH. This keeps MacPorts from intruding when I don't want to use the things installed by MacPorts (which is most of the time). That script is also included in this Gist.

Not sure if it's unique to installs that use both MacPorts and Homebrew, but I ran into several issues:

  • PMT would raise linker errors that looked like this Undefined symbols for architecture x86_64: pmt::dict_has_key(. I fixed this by modernizing the project I was workin
@johnboiles
johnboiles / stripe_to_balanced_import.py
Created July 11, 2014 22:32
Script for migrating data from Stripe to Balanced. Modify TODOs to fit your specific application then run after Stripe sends your data over to Balanced.
#!/usr/bin/env python
import argparse
import balanced
import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
balanced.configure("TODOInsertBalancedSecretKeyHere")