Skip to content

Instantly share code, notes, and snippets.

View garethpaul's full-sized avatar
:octocat:

Gareth Paul Jones (GPJ) garethpaul

:octocat:
View GitHub Profile
package com.garethpaul.teethy;
import org.json.JSONException;
import org.json.JSONObject;
import org.scribe.builder.ServiceBuilder;
import org.scribe.builder.api.TwitterApi;
import org.scribe.model.OAuthRequest;
import org.scribe.model.Response;
import org.scribe.model.Token;
import hashlib
import hmac
import base64
import argparse
def mact_hash(mact_id, secret_key):
"""Twitter's base hashing algorithm for MACT"""
return base64.b64encode(
@garethpaul
garethpaul / gist:349650ce2637ea0be3bb
Last active August 29, 2015 14:25
iOS SDK Run Script [Target: Aggregate]
######################
# Options
######################
REVEAL_ARCHIVE_IN_FINDER=false
FRAMEWORK_NAME="${PROJECT_NAME}"
SIMULATOR_LIBRARY_PATH="${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${FRAMEWORK_NAME}.framework"
@garethpaul
garethpaul / arp_probe.py
Last active December 8, 2015 05:40
arp_probe.py
from scapy.all import *
def arp_display(pkt):
if pkt[ARP].op == 1: #who-has (request)
print "Request from " + pkt[ARP].hwsrc
print sniff(prn=arp_display, filter="arp", store=0, count=0)
@garethpaul
garethpaul / it_listener.py
Created December 8, 2015 05:41
iot_listener.py
from scapy.all import *
import tweepy
# Make constants to hold values of our keys
CONSUMER_KEY = "xxxxxx"
CONSUMER_SECRET = "xxxx"
ACCESS_TOKEN = "xxxx"
ACCESS_SECRET = "xxxx"
MAIN_USER = "gpj"
import ConfigParser
import urllib
import random
import base64
import hmac
import binascii
import time
import collections
import hashlib
import requests
@garethpaul
garethpaul / ton_api.py
Created January 6, 2016 03:18
TonAPI Helper
import ConfigParser
import urllib
import random
import base64
import hmac
import binascii
import time
import collections
import hashlib
import requests
Development Phase:
Step 1: Create Certificate .pem from Certificate .p12
Command: openssl pkcs12 -clcerts -nokeys -out apns-dev-cert.pem -in apns-dev-cert.p12
Step 2: Create Key .pem from Key .p12
Command : openssl pkcs12 -nocerts -out apns-dev-key.pem -in apns-dev-key.p12
Step 3: Optional (If you want to remove pass phrase asked in second step)
Command : openssl rsa -in apns-dev-key.pem -out apns-dev-key-noenc.pem
@garethpaul
garethpaul / gnip.py
Created February 5, 2016 22:10
GNIP
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
__author__="Scott Hendrickson, Josh Montague"
import sys
import requests
import json
import codecs
import datetime
import time