Skip to content

Instantly share code, notes, and snippets.

View CypherpunkSamurai's full-sized avatar
😶
Currently Busy 🌻🐢

Cypherpunk Samurai CypherpunkSamurai

😶
Currently Busy 🌻🐢
View GitHub Profile
@shoghicp
shoghicp / 0.6.1.txt
Created May 17, 2013 19:55
Minecraft: Pocket Edition 0.6.1 protocol
# Minecraft PE v0.6.1 alpha Protocol #9
# 49 identified Packets
[C ==> S] 0x82 LoginPacket (String, int, int)
[C <== S] 0x83 LoginStatusPacket (int)
[C ==> S] 0x84 ReadyPacket (bits[8])
[C <== S] 0x85 MessagePacket (String)
[C <== S] 0x86 SetTimePacket (long)
[C <== S] 0x87 StartGamePacket (long, int, int, int, float, float, float)
[C <== S] 0x88 AddMobPacket (int, int, float, float, float, byte, byte, Metadata)
@fabriceleal
fabriceleal / gist:5900143
Last active March 31, 2022 19:59
Recursively download site with wget
wget -r -k -p the-site -X exclude-dir-1,exclude-dir-2
@doublerebel
doublerebel / signasdebug.sh
Created September 4, 2013 21:07
Sign apk with Android default debug keystore. Required for TestFlight module to recognize build as debug. Titanium Mobile signs with its own tirocks keystore by default.
cp app-unsigned.apk temp.apk
jarsigner -verbose -keystore ~/.android/debug.keystore -digestalg SHA1 -sigalg MD5withRSA -storepass android -keypass android temp.apk androiddebugkey
$ANDROID_SDK/tools/zipalign -v 4 temp.apk temp.apkz
mv temp.apkz $1 && rm temp.apk
@nickelpro
nickelpro / yggdrasil.py
Created October 16, 2013 21:51
Yggdrasil Authentication implementation for Minecraft, implements all known Yggdrasil methods and is a lot simpler than some of the other implementations floating around
import urllib.request as request
from urllib.error import HTTPError
import json
class YggAuth:
def __init__(self,
client_token=None,
access_token=None,
username=None,
password=None
@schnell18
schnell18 / create_chrootjail.sh
Created November 3, 2013 05:23
Script to automate the creation of chroot jail w/ minimal executables to run git.
#!/bin/sh
# script to automate the creation of chroot jail
# w/ minimal executables to run git
export CHROOT=/var/chroot
function copy_binary() {
for i in $(ldd $*|grep -v dynamic|cut -d " " -f 3|sed 's/://'|sort|uniq)
do
cp --parents $i $CHROOT
@mycodeschool
mycodeschool / InfixToPostfix.cpp
Created December 9, 2013 05:34
Infix to Postfix conversion in C++ using stack. We are assuming that both operators and operands in input will be single character.
/*
Infix to postfix conversion in C++
Input Postfix expression must be in a desired format.
Operands and operator, both must be single character.
Only '+' , '-' , '*', '/' and '$' (for exponentiation) operators are expected.
*/
#include<iostream>
#include<stack>
#include<string>
@videlais
videlais / accelerometer.js
Created December 25, 2013 12:14
Complete Accelerometer.js code
/**
* An accelerometer object for detecting device orientation
* and motion (if supported)
*
* Chrome 7+, Firefox 6+, IE11+, iOS Safari 4.0+, Android Browser 3.0, Blackberry 10.0
* http://caniuse.com/#feat=deviceorientation
*
* The DeviceOrientationEvent.alpha value represents the motion of the device around the z axis,
* represented in degrees with values ranging from 0 to 360.
*
// http://www.html5rocks.com/en/tutorials/es6/promises/
function get(url) {
// Return a new promise.
return new Promise(function(resolve, reject) {
// Do the usual XHR stuff
var req = new XMLHttpRequest();
req.open('GET', url);
req.onload = function() {
@mvpotter
mvpotter / download_file.py
Created February 19, 2014 09:08
Download large files using python
def download_file(url):
local_filename = url.split('/')[-1]
# NOTE the stream=True parameter
r = requests.get(url, stream=True)
with open(local_filename, 'wb') as f:
for chunk in r.iter_content(chunk_size=1024):
if chunk: # filter out keep-alive new chunks
f.write(chunk)
f.flush()
return local_filename
@nickserv
nickserv / grep.go
Created February 25, 2014 06:09
A simple grep implementation in Go
package main
import(
"bufio"
"fmt"
"log"
"os"
"regexp"
)