Skip to content

Instantly share code, notes, and snippets.

View morgant's full-sized avatar

Morgan Aldridge morgant

View GitHub Profile
@morgant
morgant / pt100reg.py
Last active April 4, 2024 13:53 — forked from anonymous/pt100reg.py
PT100Reg - allows you to create a registration key for the PT100 terminal emulator for Newton
maxUnsigned = 0x1FFFFFFF
bitsInUnsigned = int(29)
seventyFivePercent = int(22)
twelvePercent = int(4)
highBits = 0x1E000000
lowBits = 0x01FFFFFF
def generateRegCode(userName):
reg = ""
sn = ""
@morgant
morgant / acme-client.conf
Created October 14, 2023 16:29
OpenBSD httpd & relayd reverse proxy configuration
authority letsencrypt {
api url "https://acme-v02.api.letsencrypt.org/directory"
account key "/etc/acme/letsencrypt-privkey.pem"
}
# example.net
domain example.net {
alternative names { www.example.net }
domain key "/etc/ssl/private/example.net.key"
domain certificate "/etc/ssl/example.net.crt"
export default {
get(page) {
return this.all().find(p => p.page == page)
},
all() {
return [
{
page: 'signup',
title: 'Sign up',
subtitle: 'Please enter your name, email and set a password.',

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@morgant
morgant / dumpoverssh.sh
Last active July 11, 2018 04:29 — forked from kirkegaard/dumpoverssh.sh
pipe a mysql dump through gzip and send it over ssh
# dump to another server
mysqldump -u MYSQL_USERNAME -p YOUR_DATABASE | gzip -c | ssh USERNAME@YOUR_TO_HOST 'cat > ~/dump.sql.gz'
# dump from another server
ssh USERNAME@YOUR_TO_HOST 'mysqldump -u MYSQL_USERNAME -pPASSWORD YOUR_DATABASE | gzip -c' > ~/dump.sql.gz
@morgant
morgant / js-get-fn-name.js
Last active June 14, 2018 13:28 — forked from dfkaye/js-get-fn-name.js
get a javascript function name
function getFnName(fn) {
var f = typeof fn == 'function';
var s = f && ((fn.name && ['', fn.name]) || fn.toString().match(/function ([^\(]+)/));
return (!f && 'not a function') || (s && s[1] || 'anonymous');
}
function currentFnName() {
try {
return getFnName(arguments.caller);
} catch(e) {
@morgant
morgant / 01.make
Created June 11, 2015 19:55
tigerbrew ld64 on 400MHz PowerBook G3 (Pismo) w/Mac OS X 10.4.11 Tiger
Wed Jun 10 08:43:17 EDT 2015
make
CC=/usr/local/bin/gcc-4.2
CXX=/usr/local/bin/g++-4.2
OTHER_CPPFLAGS=-I/usr/local/opt/libunwind-headers/include -I/usr/local/opt/dyld-headers/include -I/usr/local/opt/cctools-headers/include
OTHER_LDFLAGS=-L/usr/local/lib -Wl,-headerpad_max_install_names
OTHER_LDFLAGS_LD64=-lcrypto
touch src/ld/configure.h
@morgant
morgant / gist:0d7c32c5520965a84292
Created November 24, 2014 21:31
Asterisk 12.7.0 crash on OS X 10.10.1 in app_voicemail's notify_new_message()
Process: asterisk [42090]
Path: /usr/local/sbin/asterisk
Identifier: asterisk
Version: ???
Code Type: X86-64 (Native)
Parent Process: asterisk [42047]
Responsible: Terminal [315]
User ID: 0
Date/Time: 2014-11-24 16:01:41.259 -0500
@morgant
morgant / gist:49ca14d05d8b5469e5d1
Last active August 29, 2015 14:10
Asterisk 12.7.0 successful build on OS X Yosemite 10.10.1
$ LDFLAGS=-L/opt/local/lib \
> CFLAGS=-I/opt/local/include \
> CPPFLAGS=-I/opt/local/include \
> ./configure \
> --without-netsnmp
checking build system type... x86_64-apple-darwin14.0.0
checking host system type... x86_64-apple-darwin14.0.0
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
@morgant
morgant / gist:53b57c2eab7c74653eb2
Created November 20, 2014 18:27
Asterisk editline failure (Yosemite)
cd editline && test -f config.h || CFLAGS="-D_THREAD_SAFE -I../..//include -I/opt/local/include -fno-strict-aliasing -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/libxml2 -pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -g3 -D__Darwin__ -mmacosx-version-min=10.6 -O3 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 " LDFLAGS="-L/opt/local/lib -L/usr/local/lib " ./configure --build=x86_64-apple-darwin14.0.0 --host=x86_64-apple-darwin14.0.0 --with-ncurses=/opt/local --with-curses= --with-termcap= --with-tinfo=
loading cache ./config.cache
checking for gcc... gcc
checking whether the C compiler (gcc -D_THREAD_SAFE -I../..//include -I/opt/local/include -fno-strict-aliasing -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/libxml2 -pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -g3 -D__Darwin__ -mmacosx-version-min=10.6 -O3 -U_FORTIFY_SOU