Skip to content

Instantly share code, notes, and snippets.

@j0sh
j0sh / Makefile
Created March 31, 2011 07:05
iOS static library cross-compile script.
# iOS builds for ARMv7 and simulator i386.
# Assumes any dependencies are in a local folder called libs and
# headers in a local folder called headers.
# Dependencies should already have been compiled for the target arch.
PROJ=untitled
ifeq ($(IOS), 1)
ARCH=armv7
DEVICE=OS
CC_FLAGS=-arch $(ARCH)

##libpcap for Android

###Android.mk

LOCAL_PATH := ./jni  

include $(CLEAR_VARS)  
LOCAL_MODULE    := pcaptest  
LOCAL_SRC_FILES := libpcap-native.c  
@smileart
smileart / README.md
Last active March 16, 2024 15:42 — forked from agnoster/README.md
My ZSH Theme — Agnoster Mod

My modified fork of agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

Compatibility

@scottyab
scottyab / SignatureCheck.java
Last active June 5, 2024 11:36
Simple Android signature check. Please note: This was created in 2013, not actively maintained and may not be compatible with the latest Android versions. It's not particularly difficult for an attacker to decompile an .apk, find this tamper check, replace the APP_SIGNATURE with theirs and rebuild (or use method hooking to return true from `vali…
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.Signature;
public class TamperCheck {
//we store the hash of the signture for a little more protection
private static final String APP_SIGNATURE = "1038C0E34658923C4192E61B16846";
#!/bin/bash
ADBShell () { adb ${2+-s }$2 shell "$1" | tr -d '\r'
}
GetAndroidVersion () {
local ALL_TAGS=$(wget -qO - "$GOOGLE_SOURCE/$REPO/+refs/tags/?format=text" | \
tr -d '^{}' | cut -d/ -f3 | sort -u | grep -vE -- '-(cts|sdk)-' | grep -v "_r0")
TAG=${1:-$(ADBShell 'getprop ro.build.version.release')}
echo -e "ANDROID_SERIAL=$ANDROID_SERIAL\nro.build.version.release=$TAG" 1>&2
@yig
yig / Latex space saving tricks
Last active June 19, 2024 20:21
Latex space saving tricks
%% Make everything look better.
%% http://tex.stackexchange.com/questions/553/what-packages-do-people-load-by-default-in-latex
%% http://www.howtotex.com/packages/9-essential-latex-packages-everyone-should-use/
\usepackage{microtype}
%% Shrink space around figures.
%% This beats manually adding negative \vspace commands everywhere.
%\setlength{\textfloatsep}{0pt}
%\setlength{\textfloatsep}{20pt plus 2pt minus 4pt}
%\setlength{\textfloatsep}{10pt plus 2pt minus 4pt}
@artjomb
artjomb / PairingLibs.md
Last active June 5, 2024 07:54
List of Pairing Libraries

Pairings can be used for all kinds of advanced cryptographic schemes such as Encryption (Identity-based, Attribute-based, Predicate-based, etc.), Signatures, Zero-Knowledge Proofs, etc. It is in no particular order.

Provides multiple types of Elliptic Curve groups with appropriate pairings on top of them. Code repository resides here.

License: LGPL
Language: C
Thesis: On the Implementation of Pairing-Based Cryptography by Ben Lynn (2007)

@rjorgenson
rjorgenson / README.md
Last active March 26, 2022 13:13 — forked from agnoster/README.md
My ZSH Theme

agnoster.zsh-theme

forked by rjorgenson

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)
  • NVM
  • RVM
# This script may use ~8 MiB Memory, it is fast and safe
def find_IP(dns_ser, domain, timeout = 2):
import dns.resolver, sys
try:
T = dns.resolver.Resolver(); T.nameservers = [dns_ser, ]; T.timeout = T.lifetime = timeout
answers = T.query(domain, raise_on_no_answer=False)
return [rdata for rdata in answers]
except Exception as e:
if e.__class__.__base__ == dns.exception.DNSException: