Skip to content

Instantly share code, notes, and snippets.

View andypiper's full-sized avatar
🛠️
tinkering

Andy Piper andypiper

🛠️
tinkering
View GitHub Profile
@andypiper
andypiper / dtrace of mosquitto_pub 1.2.3
Last active August 29, 2015 13:57
Mosquitto OS X issue
mosquitto-1.3 sudo dtruss mosquitto_pub -t andy -m "hello"
SYSCALL(args) = return
madvise(0x103D89000, 0x2000, 0x5) = 0 0
open("/dev/dtracehelper\0", 0x2, 0x7FFF5C02A010) = 3 0
__sysctl(0x7FFF5C0299A0, 0x6, 0x0) = 0 0
__sysctl(0x7FFF5C0299A0, 0x6, 0x7FFC7D000000) = 0 0
kqueue(0x7FFF5C029BD0, 0x7FFFFFE00050, 0x193) = 3 0
kevent(0x3, 0x7FFF5C029BB0, 0x1) = 0 0
socket(0x1, 0x1, 0x0) = 4 0
setsockopt(0x4, 0xFFFF, 0x1022) = 0 0
@andypiper
andypiper / Concierge Shell output
Last active August 29, 2015 13:57
Running moquette in Concierge
feeStr null
org.apache.commons.logging
org.fusesource.hawtbuf.hawtbuf
org.fusesource.hawtdb.hawtdb
log4j
org.dna.mqtt.moquette-bundle
org.apache.felix.javax.servlet
io.netty.buffer
io.netty.codec
io.netty.common
@andypiper
andypiper / system_profiler
Created March 26, 2014 18:25
Export Mac System info from cmdline
$ system_profiler -detailLevel mini SPPrefPaneDataType SPApplicationsDataType SPDeveloperToolsDataType SPExtensionsDataType > sysreport.txt
@andypiper
andypiper / svg2png
Created April 24, 2014 10:17
Convert SVG->PNG on OS X cmdlin
qlmanage -t -s 1000 -o . picture.svg
@andypiper
andypiper / basic-recipes.md
Last active May 21, 2025 15:12
Twitter API recipes for twurl +jq, and other useful Twitter code snippets and tools
@andypiper
andypiper / CRC_Example.java
Last active December 31, 2020 09:45
Java snippet to generate Twitter Webhooks CRC response
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import org.apache.commons.codec.binary.Base64;
public class CRC_Example {
public static void main(String[] args) {
try {
String consumer_secret = "secret";
String crc_token = "Message";
@andypiper
andypiper / bledump.txt
Last active January 24, 2022 18:52
experimenting with BLE and LEGO Boost
LEGO Move Hub
8E552B7A-1B9E-4F4D-A0AE-7D585F784B73
advertisementData: ["kCBAdvDataIsConnectable": 1, "kCBAdvDataTxPowerLevel": 0, "kCBAdvDataLocalName": LEGO Move Hub]
00001623-1212-EFDE-1623-785FEABCD123 []
00001624-1212-EFDE-1623-785FEABCD123 ["read", "writeWithoutResponse", "write", "notify"] <0f00043c 01140002 00000002 000000> ["Client Characteristic Configuration <0100>"]
Notification Log:
1502201043.29111 - 00001624-1212-EFDE-1623-785FEABCD123 isNotifying: true
@andypiper
andypiper / random_followers.py
Created January 25, 2018 16:45 — forked from aparrish/random_followers.py
random sample of twitter followers for a given screen name
# return a random sample of your twitter followers
# run like so:
# $ python random_followers.py <screen_name>
# where <screen_name> is the account you want followers for
import sys, random, json, urllib
sname = sys.argv[1]
ids_raw = urllib.urlopen(
"https://api.twitter.com/1/followers/ids.json?screen_name="+sname).read()
@andypiper
andypiper / 30dayssearch.js
Created March 13, 2019 15:44
Twitter Premium 30-Day search simple request using node-oauth (Bearer Token only)
var OAuth2 = require('OAuth').OAuth2;
var https = require('https');
var consumerKey = '';
var consumerSecret = ''
var oauth2 = new OAuth2(consumerKey, consumerSecret, 'https://api.twitter.com/', null, 'oauth2/token', null);
oauth2.getOAuthAccessToken('', {
'grant_type': 'client_credentials'
}, function (e, access_token) {