Skip to content

Instantly share code, notes, and snippets.

View calebrob6's full-sized avatar

Caleb Robinson calebrob6

View GitHub Profile
@calebrob6
calebrob6 / hahing2.c
Created October 3, 2014 15:21
Hashing sha256 for lowest value using implementation from http://nayuki.eigenstate.org/page/fast-sha2-hashes-in-x86-assembly
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void sha256_hash(const uint8_t *message, uint32_t len, uint32_t hash[8]);
extern void sha256_compress(uint32_t state[8], const uint8_t block[64]);
static const char alphabet[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
@calebrob6
calebrob6 / hashing1.py
Created October 14, 2014 17:00
Hashing competition python implementation
'''
Created on Oct 2, 2014
@author: dcrobins
'''
import hashlib
import time
import string
import random
@calebrob6
calebrob6 / DoWork.java
Created October 14, 2014 20:21
Java hashing program for the SHA-256 challenge
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Random;
/**
@calebrob6
calebrob6 / spamsAway.py
Created January 14, 2015 17:28
Sends a random spam message to someone else
import smtplib
import imaplib
import getpass
import random
imapAddress = 'imap.googlemail.com'
smptAddress = 'smtp.gmail.com'
username = raw_input("Username:")
password = getpass.getpass("Password:")
toAddress = raw_input("Who to:")
@calebrob6
calebrob6 / bf.py
Created March 17, 2015 18:35
Brainfuck Interpreter in Python
#!/usr/bin/env
def bfInterpreter(code,i):
dP = 0
iP = 0
cP = 0
iTape = bytearray(i)
dTape = bytearray([0 for _ in range(1000)])
@calebrob6
calebrob6 / chromeMemoryQuery.sh
Created April 9, 2015 15:33
How much memory (%) is Chrome using
#!/bin/bash
ps -aux | grep chrome | tr -s ' ' | cut -d' ' -f4 | awk '{ SUM += $1} END { print SUM }'
@calebrob6
calebrob6 / gist:9e294edd2bb9fd401f87
Created August 28, 2015 02:58
linearThresholdModel
def diffusionStepLinearThreshold(G, sources):
newSources = set()
possibleTargets = []
for node in sources:
G.node[node]["active"] = True
for node2 in G.neighbors(node):
if not G.node[node2]["active"]:
possibleTargets.append(node2)
possibleTargets = set(possibleTargets)
#!/bin/bash
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install -y build-essential libatlas-base-dev libatlas-dev libatlas3gf-base gfortran libpng12-dev libfreetype6-dev python-gtk2-dev libgtk2.0-dev python2.7 python-pip python2.7-dev mercurial libffi-dev libssl-dev libhdf5-dev libnetcdf-dev libgeos-dev libgdal-dev openjdk-7-jdk vim git libhdf5-dev libnetcdf-dev libhdf5-dev libnetcdf-dev python-opencv libgeos-dev libgeos++-dev libncurses5-dev htop jabref texstudio texlive-latex-extra openssh-server libzmq3-dev texlive-fonts-recommended
sudo apt-get build-dep -y python-mpltoolkits.basemap
sudo -H pip install --upgrade requests[security]
<?php
shell_exec("python sports.py '".file_get_contents("php://input")."'");
$f = fopen("test.txt", "a");
fwrite($f,"PHP - ".file_get_contents("php://input")."\n");
fclose($f);
?>
#!/usr/bin/env python
import sys
import json
import urllib
import urllib2
import random
f=open("test.txt","a")
if len(sys.argv)>1:
fullArgs = " ".join(sys.argv[1:])