Skip to content

Instantly share code, notes, and snippets.

View joseph-henry's full-sized avatar

Joseph Henry joseph-henry

View GitHub Profile

Find your auth token

the authtoken.secret file

  • On Mac this is in "/Library/Application Support/ZeroTier/One". also, the installer copies it to ~/Library/Application
    Support/ZeroTier/One
  • Windows this is usually in "\ProgramData\ZeroTier\One". also, the installer copies it somewhere local to the installing user... I
# Gist example of IB wrapper ...
#
# Download API from http://interactivebrokers.github.io/#
#
# Install python API code /IBJts/source/pythonclient $ python3 setup.py install
#
# Note: The test cases, and the documentation refer to a python package called IBApi,
# but the actual package is called ibapi. Go figure.
#
# Get the latest version of the gateway:
@julianxhokaxhiu
julianxhokaxhiu / create-iso.sh
Created September 24, 2016 21:46
Simple bash script to create a Bootable ISO from macOS Sierra Install Image from Mac App Store
#!/bin/bash
#
# Credits to fuckbecauseican5 from https://www.reddit.com/r/hackintosh/comments/4s561a/macos_sierra_16a238m_install_success_and_guide/
# Adapted to work with the official image available into Mac App Store
#
# Enjoy!
hdiutil attach /Applications/Install\ macOS\ Sierra.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
@r15ch13
r15ch13 / convert-aax-to-m4a.cmd
Last active December 18, 2023 18:45
Convert aax to m4a
@echo off
setlocal enableextensions
chcp 65001
set input=%1
set device=%2
set loglevel=quiet
for %%i in ("%~f1") do set dirname=%%~dpi
for %%i in ("%~f1") do set extension=%%~xi
set tempfile=%dirname%%RANDOM%-temp.m4a
@NeoTeo
NeoTeo / UDPSendReceive.swift
Last active November 7, 2021 13:32
A minimal implementation of a Posix UDP server and client in Swift.
/// This playground shows how to send and receive packets with low-level Posix UPD protocol API.
import Foundation /// Used for NSUTF8StringEncoding
import XCPlayground
/// Ensure the playground doesn't stop executing at the end of the main thread.
XCPlaygroundPage.currentPage.needsIndefiniteExecution = true
/** Workaround for Swift not having access to the htons, htonl, and other C macros.
This is equivalent to casting the value to the desired bitsize and then
@jamiltron
jamiltron / NetworkClient.cs
Created November 23, 2015 00:30
Unity LLAPI networking client/server
using System.Collections;
using System.Runtime.Serialization.Formatters.Binary;
using System.IO;
using UnityEngine;
using UnityEngine.Networking;
public class NetworkClient : MonoBehaviour {
public string host = "127.0.0.1";
public int port = 8000;
@angstwad
angstwad / dict_merge.py
Last active March 1, 2024 23:53
Recursive dictionary merge in Python
# Copyright 2016-2022 Paul Durivage
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@vargeorge
vargeorge / gist:8b20488b7d7b6c101b4b
Created September 4, 2014 20:45
Show full path on OS X terminal / iTerm before the $ prompt
1. Edit ~/.bash_profile and add the following line to show full path before the $ prompt.
For example, as user@hostname:path/to/directory$
# show path before the $ prompt
export PS1='\u@\H:\w$ '
2. Save file and restart terminal or run source command
$ source ~/.bash_profile
@kwk
kwk / Makefile
Last active March 17, 2024 22:54
Compiling with Address Sanitizer (ASAN) with CLANG and with GCC-4.8
.PHONY: using-gcc using-gcc-static using-clang
using-gcc:
g++-4.8 -o main-gcc -lasan -O -g -fsanitize=address -fno-omit-frame-pointer main.cpp && \
ASAN_OPTIONS=symbolize=1 ASAN_SYMBOLIZER_PATH=$(shell which llvm-symbolizer) ./main-gcc
using-gcc-static:
g++-4.8 -o main-gcc-static -static-libstdc++ -static-libasan -O -g -fsanitize=address -fno-omit-frame-pointer main.cpp && \
ASAN_OPTIONS=symbolize=1 ASAN_SYMBOLIZER_PATH=$(shell which llvm-symbolizer) ./main-gcc-static
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 28, 2024 07:00
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k