Skip to content

Instantly share code, notes, and snippets.

@prehensile
prehensile / GenerateParentzoneGalleryImageLinks.user.js
Last active August 3, 2023 14:54
Userscript and instructions for downloading images from a ParentZone gallery
@prehensile
prehensile / SB2 Speaker EQ.json
Created November 15, 2020 17:10
PulseEffects presets for Microsoft Surface Book 2 speakers
{
"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 / prehensile.networkwatcher.plist
Created November 14, 2010 04:41
A launchd daemon to execute a Python script when network configuration changes.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>prehensile.networkwatcher</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/python</string>
@prehensile
prehensile / asterisk.log
Created September 28, 2020 22:26
asterisk log 202009282326
[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 / raspi-streamer.md
Last active March 8, 2020 20:55
setting up a raspberry pi for streaming

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 / chunk.py
Created May 12, 2015 09:49
A Python function to chop up a string into chunks with a maximum length for each chunk. Chops at whitespace for nice separation, rather than just every n characters. Useful, for, say, breaking up a long piece of text into multiple tweets.
import re
def chunk_string( str_in, max_chunk_length ):
l = len(str_in)
chunks =[]
if l <= max_chunk_length:
chunks = [str_in]
else:
@prehensile
prehensile / features.md
Last active December 29, 2018 18:38
Specs for SIM800 board GSM-GPRS-V4.72, designed by UNV. Copypasted from ebay for reference.

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 / dj-rnn.txt
Last active September 4, 2018 23:44
9012 DJ names generated by torch-rnn, trained on listings at residentadvisor.net
Aromino Lu
Farlos Gabate
Kukog Gracux
Cassunex De 90C
Alex Nede
Jeerra Bylentron
Eddeysive
Fair Figo
Andries Gamper
Ladewenteah
@prehensile
prehensile / gnm-server.js
Created May 8, 2018 09:09
Bits and pieces of gig'n'mix
// 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 / airbnb-search.py
Created July 18, 2017 21:04
A Python script which crawls airbnb search results for a given set of keywords.
#!/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.