Skip to content

Instantly share code, notes, and snippets.

Avatar

Henry Cooke prehensile

View GitHub Profile
@prehensile
prehensile / SB2 Speaker EQ.json
Created Nov 15, 2020
PulseEffects presets for Microsoft Surface Book 2 speakers
View SB2 Speaker EQ.json
{
"spectrum": {
"show": "true",
"n-points": "100",
"height": "120",
"use-custom-color": "false",
"fill": "true",
"show-bar-border": "true",
"sampling-freq": "10",
"line-width": "2",
@prehensile
prehensile / asterisk.log
Created Sep 28, 2020
asterisk log 202009282326
View asterisk.log
[2020-09-28 23:24:30] VERBOSE[29964][C-0000000e] pbx.c: Executing [9001@from-internal:1] Set("PJSIP/2001-0000000d", "__RINGTIMER=15") in new stack
[2020-09-28 23:24:30] VERBOSE[29964][C-0000000e] pbx.c: Executing [9001@from-internal:2] ExecIf("PJSIP/2001-0000000d", "0?Set(__CWIGNORE=)") in new stack
[2020-09-28 23:24:30] VERBOSE[29964][C-0000000e] pbx.c: Executing [9001@from-internal:3] Macro("PJSIP/2001-0000000d", "exten-vm,novm,9001,0,0,1") in new stack
[2020-09-28 23:24:30] VERBOSE[29964][C-0000000e] pbx.c: Executing [s@macro-exten-vm:1] Macro("PJSIP/2001-0000000d", "user-callerid,") in new stack
[2020-09-28 23:24:30] VERBOSE[29964][C-0000000e] pbx.c: Executing [s@macro-user-callerid:1] Set("PJSIP/2001-0000000d", "TOUCH_MONITOR=1601331870.13") in new stack
[2020-09-28 23:24:30] VERBOSE[29964][C-0000000e] pbx.c: Executing [s@macro-user-callerid:2] Set("PJSIP/2001-0000000d", "AMPUSER=2001") in new stack
[2020-09-28 23:24:30] VERBOSE[29964][C-0000000e] pbx.c: Executing [s@macro-user-callerid:3] Set("PJSIP/200
@prehensile
prehensile / GenerateParentzoneGalleryImageLinks.user.js
Last active Aug 29, 2020
Userscript and instructions for downloading images from a ParentZone gallery
View GenerateParentzoneGalleryImageLinks.user.js
@prehensile
prehensile / raspi-streamer.md
Last active Mar 8, 2020
setting up a raspberry pi for streaming
View raspi-streamer.md

Setting up a Raspberry Pi for use as an audio streamer

TODO

  • Automate setup of spotify in the browser (autofill login etc), probbaly using selenium -- This is probably needed in a caretaker process too, keep an eye on Spotify and reload if "something went wrong" message comes up
  • Implement exclusive playback between spotify / shairport: if one starts playing, the other stops
@prehensile
prehensile / features.md
Last active Dec 29, 2018
Specs for SIM800 board GSM-GPRS-V4.72, designed by UNV. Copypasted from ebay for reference.
View features.md

Features

NOTE: Not my specs, copypasted from ebay for reference.

  • Serial interface: TTL/USART serial support.
  • Antenna circuit: Three common antenna interfaces (SMA interface only soldered)
  • Two way power interface: DC IN 5 v DC power supply OR 3.5-4.2 V power supply, suitable for lithium battery power supply applications.
  • Audio interface: increased by 3.5 MM audio interface, easily implement voice calls, voice broadcast, etc.
  • SIM booth: new mainstream type metal MICRO thrust booth, strong and durable.
  • LED indicator light: onboard two LED indicators. Allows you to monitor module working condition.
@prehensile
prehensile / gnm-server.js
Created May 8, 2018
Bits and pieces of gig'n'mix
View gnm-server.js
// http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/
"use strict";
// Optional. You will see this name in eg. 'ps' or 'top' command
process.title = 'node-chat';
// Port where we'll run the websocket server
var webSocketsServerPort = 1337;
// websocket and http servers
@prehensile
prehensile / dj-rnn.txt
Last active Sep 4, 2018
9012 DJ names generated by torch-rnn, trained on listings at residentadvisor.net
View dj-rnn.txt
Aromino Lu
Farlos Gabate
Kukog Gracux
Cassunex De 90C
Alex Nede
Jeerra Bylentron
Eddeysive
Fair Figo
Andries Gamper
Ladewenteah
@prehensile
prehensile / timezone.py
Last active Mar 22, 2018
Parses timezone strings in ISO 8601 format to datetime.tzinfo objects
View timezone.py
import datetime
import re
import logging
class TimeZone( datetime.tzinfo ):
def __init__( self, offset ):
# expects offset in ISO 8601 format e.g '+00:00', '+0000', 'Z'
# see https://en.wikipedia.org/wiki/ISO_8601#Time_zone_designators
@prehensile
prehensile / oulipo.py
Last active Jan 6, 2018
Oulipo S+7 constraint, implemented in Python 3 & NLTK
View oulipo.py
# an implementation of Oulipo S+7
# see https://en.wikipedia.org/wiki/Oulipo
from nltk import pos_tag, word_tokenize
from nltk.corpus import wordnet
text = "I am sitting in a room different from the one you are in now. I am recording the sound of my speaking voice and I am going to play it back into the room again and again until the resonant frequencies of the room reinforce themselves so that any semblance of my speech, with perhaps the exception of rhythm, is destroyed. What you will hear, then, are the natural resonant frequencies of the room articulated by speech. I regard this activity not so much as a demonstration of a physical fact, but more as a way to smooth out any irregularities my speech might have."
# download nltk tokeniser if missing
try:
@prehensile
prehensile / airbnb-search.py
Created Jul 18, 2017
A Python script which crawls airbnb search results for a given set of keywords.
View airbnb-search.py
#!/usr/bin/env python
#########################
# airbnb-search.py
#########################
# by prehensile, 18/07/17
#########################
# Crawl airbnb search results (descriptions and reviews) for keywords.
# A quick, dirty and brittle set of hacks.
# Very likely to break the next time anything changes in airbnb's HTML.
You can’t perform that action at this time.