Skip to content

Instantly share code, notes, and snippets.

View tylermenezes's full-sized avatar
🌵
Hello

Tyler Menezes tylermenezes

🌵
Hello
View GitHub Profile
@tylermenezes
tylermenezes / gist:1022293
Created June 13, 2011 03:50
PCBC Private-encrypted Signing Code
<?php
// You can generate keys with:
// key=$(openssl genrsa 128);echo "$key" | sed '{:q;N;s/\n/\\n/g;t q}';echo "$key" | openssl rsa -pubout | sed '{:q;N;s/\n/\\n/g;t q}' 2>/dev/null
/**
* Signs text with your private key, using PCBC.
* @author Tyler Menezes tylermenezes@gmail.com
*/
function Sign($toEncrypt){
$priv = openssl_pkey_get_private ("-----BEGIN RSA PRIVATE KEY-----\nMGQCAQACEQDEb/R70eBav9AmgH1GBvgZAgMBAAECEQCbMBNGyszjA2eKArxL3shN\nAgkA/O8v+KfoBc8CCQDG0XeJzSmFlwIJAIejmT0mheW/AghMu9+VEdfqtQIJAI16\nVWlE29KX\n-----END RSA PRIVATE KEY-----");
@tylermenezes
tylermenezes / gvextract.js
Created October 30, 2011 23:11
Extract messages from Google Voice
(function() {
  var el=document.createElement('div'),
      b=document.getElementsByTagName('body')[0],
      otherlib=false,
      msg='';
  el.style.position='fixed';
  el.style.height='32px';
  el.style.width='220px';
  el.style.marginLeft='-110px';
  el.style.top='0';
@tylermenezes
tylermenezes / split.py
Created November 11, 2011 03:23
Splits GCode
#!/usr/bin/python
import sys
if len(sys.argv) < 2:
print "Usage: split.py [filename]"
quit()
with open(sys.argv[1], 'r') as f:
data = f.readlines()
@tylermenezes
tylermenezes / gist:1895600
Created February 23, 2012 23:06
Code for finding enviroment variable location
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[]) {
char *ptr;
if(argc < 3) {
printf("Usage: %s <envvar> <program>\n", argv[0]);
exit(0);
@tylermenezes
tylermenezes / gist:1895672
Created February 23, 2012 23:23
Stripe CTF Level 3 Hints
What are all the numbers less than 4. There are a lot of them.
//IRMusicPlayer
//Jennifer Schumaker
//22.Feb.12
// PIND is an Arduino command that gets a byte containing the input
// status of bytes 0 through 7. In our case we want the bit
// corresponding to pin 2.
// NOTE: If you are seeking input from ports 8 - 15 use PINDB.
// For analong pins 0 - 5 use PINC
//
@tylermenezes
tylermenezes / hideShow.js
Created March 21, 2012 16:47
Script for extracting proxies from HideMyAss
(function(){
$.fn.hasAttr = function(name) {
return this.attr(name) !== undefined;
};
$("*").filter(function(e){
return $(this).hasAttr("style") && $(this).attr("style").indexOf("none") != -1;
}).each(function(e,s){
$(this).remove();
});
$("#listtable tr").each(function(e,s){
@tylermenezes
tylermenezes / index.php
Created March 29, 2012 00:44
Stripe Example for Leland
<?php
// ________ ___________ _________ ________ ________ ____ __ ______ ____ ___ ____ ______
// /_ __/ / / / _/ ___/ / _/ ___/ /_ __/ / / / ____/ / __ \/ / / / __ \ / __ \/ | / __ \/_ __/
// / / / /_/ // / \__ \ / / \__ \ / / / /_/ / __/ / /_/ / /_/ / /_/ / / /_/ / /| | / /_/ / / /
// / / / __ // / ___/ / _/ / ___/ / / / / __ / /___ / ____/ __ / ____/ / ____/ ___ |/ _, _/ / /
// /_/ /_/ /_/___//____/ /___//____/ /_/ /_/ /_/_____/ /_/ /_/ /_/_/ /_/ /_/ |_/_/ |_| /_/
// This is what gets executed whenever the page is submitted.
// Standard stuff:
@tylermenezes
tylermenezes / async_helpers.js
Created May 6, 2012 07:50
Javascript Async Helpers
(function(window) {
var delegates = {};
var getId = function(milli) {
return (new Date()) + "+" + milli + "-" + Math.floor(Math.random());
}
var returningLater = function(id, noGc) {
return function(){
delegates[id]();
@tylermenezes
tylermenezes / mapkeys.sh
Last active August 21, 2016 12:44
Add natural scroll for horizontal scrolling
#!/bin/bash
echo "remove Mod1 = Alt_L
remove Mod1 = Alt_R
remove Control = Control_L
remove Control = Control_R
keycode 135 = Super_R
keysym Control_L = Alt_L
keysym Alt_L = Control_L