Skip to content

Instantly share code, notes, and snippets.

@stephen
stephen / data.log
Created November 13, 2014 00:57
airport express airplay log (soundcloud teardown)
OPTIONS * RTSP/1.0
CSeq: 138
X-Apple-Device-ID: 0x80e650104f9c
Apple-Challenge: CY8Exs+7FfjQ9n17/3m0qg==
DACP-ID: 95482F9B7AEACEB
Active-Remote: 2783123138
User-Agent: AirPlay/215.10
RTSP/1.0 200 OK
Public: ANNOUNCE, SETUP, RECORD, PAUSE, FLUSH, TEARDOWN, OPTIONS, GET_PARAMETER, SET_PARAMETER, POST, GET
@stephen
stephen / gist:9f75655c87c00ae02e94
Created November 10, 2014 20:03
failed "could not connect to airsonos" log
OPTIONS * RTSP/1.0
CSeq: 0
X-Apple-Device-ID: 0x80e650104f9c
Apple-Challenge: b0m+LEonvoFTnJYrVo5Y1g==
DACP-ID: 95482F9B7AEACEB
Active-Remote: 67316247
User-Agent: AirPlay/215.10
RTSP/1.0 200 OK
CSeq:0
<Buffer 20 00 00 04 00 13 08 09 2d f4 da 0a 0b fa b6 13 af 07 d2 d2 9e f7 ac 52 41 66 52 6b 42 c4 c3 86 87 c6 30 f0 d5 b2 6d 29 7a 7d 07 68 26 9e 3d f1 65 d0 f1 ...>
<Buffer 20 00 00 04 02 13 08 09 01 f4 7a 09 b3 fa a4 13 59 d5 0f 89 90 f2 84 15 ec a3 f8 c9 52 8c 21 37 bb 2d 6b ef 29 7f 53 ef c8 61 d3 14 f3 f3 b2 6d 53 cb 5e ...>
<Buffer 20 00 00 04 06 13 08 09 65 f4 b4 09 bb fa e6 13 c4 ad f8 18 c0 42 94 c6 e7 61 be e0 cb 74 08 cf a5 c1 b8 9e 30 f7 40 fd 6f 1a 1f 24 ca c4 e9 65 f9 11 86 ...>
<Buffer 20 00 00 04 04 13 08 09 35 f4 a2 09 dd fa d4 13 17 f0 75 68 09 3e f7 64 dc 60 28 f2 e4 de fb 2d 5d 0f 61 8c f7 db ff c2 d2 85 c6 31 dc de 9e 51 35 13 fb ...>
<Buffer 20 00 00 04 08 13 08 09 3d f4 9c 09 af fa 64 13 de 9e 55 ea 31 4f 04 1c 15 6c f8 3c 18 aa b4 84 98 92 b9 0a 91 8f ef 7c b3 88 ce 98 56 6f ce 11 a8 86 37 ...>
<Buffer 20 00 00 04 06 13 08 09 5d f4 b2 09 dd fa 32 13 34 93 b1 87 68 7b 70 ac 7a 8b 4d 3f 43 85 0e 57 96 8e 21 d2 06 93 b9 0d 51 d9 c7 14 ef 36 43 45 ba 5d c6 ...>
<Buffer 20 00 00 04 06 13 08
this.baseServer.on('message', function(msg) {
var meta = msg.slice(0, 12);
var sequenceNumber = meta.slice(2, 4).readUInt16BE(0);
var encryptedAudio = msg.slice(12);
var decryptedAudio = new Buffer(0);
for (var i = 0; i < encryptedAudio.length; i += 16) {
GET /listen HTTP/1.1
Host: 172.17.106.64:8000
Accept-Language: en-us
X-Playback-Session-Id: 2E989289-87D5-4609-9DA1-7F7BEDC37D92
icy-metadata: 1
Accept: */*
User-Agent: AppleCoreMedia/1.0.0.14A389 (Macintosh; U; Intel Mac OS X 10_10; en_us)
Referer: http://localhost:8000/listen.m3u
Accept-Encoding: identity
Connection: keep-alive
@stephen
stephen / unwrapUrl.js
Last active August 29, 2015 14:08
unwraps a url from shorteners. assumes request is available.
var unwrapUrl = function(input, callback) {
var options = {};
if (typeof(input) === 'string') {
options.url = input;
} else if (typeof(input) === 'object') {
options = input;
}
options._attempts = options._attempts || 0;
options.maxAttempts = options.maxAttempts || 5;
[ '323691386-sjtjekAATMeZAmRyASlFTuXwAYpJZLeWQZoQS1iW',
'TMVfFcX0r1OjQf9i2xrisdn1CH7OeVyvi5x6oodiT1YbH',
{ user_id: '323691386', screen_name: 'stephencwan' } ]
[gulp] [nodemon] clean exit - waiting for changes before restart
import time;
import hmac;
import hashlib;
import os;
import math;
import base64;
import struct;
def get_hotp(secret, counter):
# get and decode shared secret
@stephen
stephen / gist:5def6c44cac8caa82692
Created May 19, 2014 16:55
4 letter twitter handles available
testing 456976 handles
ZKYL
XETY
WFLW
VEMR
SESL
PEEP
NWZY
ILSB
@stephen
stephen / handles
Last active August 29, 2015 14:01
Twitter handles available from /usr/share/dict/words
testing 254164 handles
zythem
zymotoxic
zymotize
zymotically
zymotechnic
zymotechny
zymotechnical
zymosterol
zymosimeter