Skip to content

Instantly share code, notes, and snippets.

@Neal
Neal / wifi-cleanup.py
Last active July 19, 2017 07:13
"Forget" all known open wifi networks
import os
import plistlib
pl = plistlib.readPlist('/Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist')
for key, network in pl['KnownNetworks'].items():
if network['SecurityType'] == 'Open':
os.system('networksetup -removepreferredwirelessnetwork en0 "{}"'.format(network['SSIDString']))
@Neal
Neal / webhook.php
Created December 14, 2015 05:14
a simple php webhook receiver to update repo
<?php
if (!$_GET['access_token'] || $_GET['access_token'] !== '__ACCESS_TOKEN__') {
die(header('HTTP/1.1 403 Forbidden'));
}
$commands = array(
'cd /path/to/project',
'git reset --hard HEAD',
'git pull --force origin master'
@Neal
Neal / pebble.h
Created August 16, 2015 13:30
Pebble SDK 3.2 header file
#pragma once
#include "pebble_fonts.h"
#include "src/resource_ids.auto.h"
#define PBL_APP_INFO(...) _Pragma("message \"\n\n \
*** PBL_APP_INFO has been replaced with appinfo.json\n \
Try updating your project with `pebble convert-project`\n \
Visit our developer guides to learn more about appinfo.json:\n \
http://developer.getpebble.com/guides/pebble-apps/\n \""); \
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# tcprelay.py - TCP connection relay for usbmuxd
#
# Copyright (C) 2009 Hector Martin "marcan" <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 or version 3.
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CONNECTTIMEOUT => 9,
CURLOPT_TIMEOUT => 6,
CURLOPT_VERBOSE => 0,
CURLOPT_URL => 'http://gs.apple.com/TSS/controller?action=2',

Keybase proof

I hereby claim:

  • I am Neal on github.
  • I am neal (https://keybase.io/neal) on keybase.
  • I have a public key whose fingerprint is A278 F61A 42C7 828E DF7D 98B6 B859 0B87 BEE9 55D4

To claim this, I am signing this object:

/***
* Pebble Assist
* Copyright (C) 2014 Matthew Tole
*
* Version 0.2.0
***/
/**
The MIT License (MIT)
@Neal
Neal / pebble-js-app.js
Last active March 9, 2016 17:14
PebbleKit JS AppMessage queue.
var appMessageQueue = {
queue: [],
numTries: 0,
maxTries: 5,
working: false,
clear: function() {
this.queue = [];
this.working = false;
},
isEmpty: function() {
@Neal
Neal / savethemblobs.py
Last active November 29, 2016 19:48
A simple script to grab all SHSH blobs from Apple that it's currently signing to save them locally and on Cydia server. And now also grabs blobs already cached on Cydia and iFaith servers to save them locally. Updated version on GitHub: https://github.com/Neal/savethemblobs
#!/usr/bin/env python
#
# savethemblobs.py
# A simple script to grab all SHSH blobs from Apple that it's currently signing to save them locally and on Cydia server.
# And now also grabs blobs already cached on Cydia and iFaith servers to save them locally.
#
# Copyright (c) 2013 Neal <[email protected]>
#
# examples:
# savethemblobs.py 1050808663311 iPhone3,1
@Neal
Neal / putiodl
Created July 17, 2013 02:53
put.io cli downloader
#!/bin/bash
#
# putiodl - put.io cli downloader
#
# Copyright (C) 2013 Neal <[email protected]>
#
# Dependencies: jq, curl, wget
#
# Make sure ~/.putiodl exists and contains your put.io OAuth token.
#