Skip to content

Instantly share code, notes, and snippets.

View rpetrich's full-sized avatar
Out with time lord dragon

Ryan Petrich rpetrich

Out with time lord dragon
View GitHub Profile
#!/bin/sh
# git-ticket-show by Ryan Petrich
if [ -e $1 ] ; then
echo "usage: git ticket-show <ticket>"
else
BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
REVLIST=`git rev-list HEAD`
echo "Merge status of ticket $1 relative to $BRANCH:"
git log --all --no-merges --format=%H --grep="$1[:+]" | \
while read commit
#!/bin/bash
(
for ARG in "$@"
do
tail -n+6 "$ARG" | awk '{print $2}'
done
) | sort | uniq -c | egrep ^\\s+$# | awk '{print $2}'
@rpetrich
rpetrich / springboard-crash-help.sh
Created November 9, 2013 08:03
Basic crash debugging script
#!/bin/bash
# Basic iOS Crash Debugging Helper Script by rpetrich
apt-get install jp.ashikase.symbolicate grep curl coreutils coreutils-bin > /dev/null
if [ $? -ne 0 ]; then
echo "Unable to install debug script dependencies!" >&2
echo "Run script as root and make sure you have exited Cydia." >&2
exit 1
fi
IFS='|' read -r code url < <(
(
@rpetrich
rpetrich / BioLockdown.h
Created January 23, 2015 23:07
BioLockdown API header
#import <Foundation/Foundation.h>
#import <AddressBook/AddressBook.h>
@class SBApplication;
__attribute__((visibility("hidden")))
@interface BioLockdownController : NSObject
+ (BioLockdownController *)sharedController;
@rpetrich
rpetrich / symbolicate
Created April 12, 2015 18:00
Symbolicate script for iOS
#!/bin/sh
if [[ $# == 0 ]]; then
ssh tunnel "bash -c \"symbolicate /var/mobile/Library/Logs/CrashReporter/LatestCrash.*\""
else
if [[ $1 == /* ]]; then
ssh tunnel "symbolicate '$1'"
else
ssh tunnel "bash -c \"symbolicate /var/mobile/Library/Logs/CrashReporter/LatestCrash-$1.*\""
fi
fi
@rpetrich
rpetrich / Rename Hook Procedures.py
Created July 21, 2015 20:34
Annotate hook procedure names in Hopper by parsing Objective C runtime calls
print "--"
print "Renaming Hooks for Current Procedure..."
print "Message from rpetrich: Please use this for good and not evil"
print "--"
doc = Document.getCurrentDocument()
def procedure_end(seg, proc):
addr = proc.getEntryPoint()
currentIndex = seg.getProcedureIndexAtAddress(addr)
@rpetrich
rpetrich / BioLockdown.h
Created August 2, 2015 21:22
BioLockdown API
#import <Foundation/Foundation.h>
#import <AddressBook/AddressBook.h>
@class SBApplication, CKConversation;
__attribute__((visibility("hidden")))
@interface BioLockdownController : NSObject
+ (BioLockdownController *)sharedController;
#!/bin/bash
if [ -z "$GIT_AUTHOR_EMAIL" ]; then
GIT_AUTHOR_EMAIL=`git config --get user.email`
fi
if [[ `uname` != Darwin ]]; then
IDENTITY=`readlink -f ~/.ssh/$GIT_AUTHOR_EMAIL`
elif which -s greadlink; then
IDENTITY=`greadlink -f ~/.ssh/$GIT_AUTHOR_EMAIL`
else
# No modern readlink with -f support, symlinks must be absolute paths :'(
@rpetrich
rpetrich / Makefile
Created August 15, 2017 01:07
rotation
.PHONY: clean all
CPPFLAGS = -std=c++14
LINK.o = $(LINK.cc)
all: rotation
clean:
rm *.o rotation
@rpetrich
rpetrich / userscript.js
Created October 12, 2017 17:48
Kill JIRA Banner and Hover Indentation
// ==UserScript==
// @name No JIRA banner or Hover Indentation
// @namespace http://rpetri.ch/
// @version 0.1
// @description Remove JIRA announcement banners; Remove comment relayout on hover
// @author Ryan Petrich
// @match https://*.atlassian.net/*
// @grant none
// ==/UserScript==