Skip to content

Instantly share code, notes, and snippets.

View utaal's full-sized avatar

Andrea Lattuada utaal

View GitHub Profile
@utaal
utaal / Makefile
Created September 5, 2011 16:42
webserver using libuv
webserver: webserver.c libuv/uv.a http-parser/http_parser.o
gcc -I libuv/include \
-lrt -lm -lpthread -o \
webserver webserver.c \
libuv/uv.a http-parser/http_parser.o
libuv/uv.a:
$(MAKE) -C libuv
http-parser/http_parser.o:
@utaal
utaal / .bashrc
Created October 8, 2011 08:46
home ubuntu
source ~/.bashrc_local
@utaal
utaal / .bash_profile
Created October 10, 2011 08:56
home mac
PATH=$PATH:/Users/utaal/Applications/bin
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
@utaal
utaal / app.js
Created October 23, 2011 14:08
server health page (node & socket.io)
var http = require('http');
var connect = require('connect');
var socketio = require('socket.io');
var fs = require('fs');
var os = require('os');
var exec = require('child_process').exec;
var util = require('util');
var $ = require('underscore');
var load_data_in_mem_count = 3000;
@utaal
utaal / Makefile
Created January 4, 2012 01:21
steganography: hiding data inside images
lsbmessage: lsbmessage.cc
g++ -o lsbmessage lsbmessage.cc -O2 -L/usr/X11R6/lib -lm -lpthread -lX11
@utaal
utaal / s3-upload.py
Created January 17, 2012 21:49
generate a s3 upload form
import json
import base64
import hmac, sha
import datetime
html = """
<html>
<head>
<title>Upload</title>
</head>
@utaal
utaal / m68k-parser.scala
Created February 29, 2012 22:46
m68k asm parser w/ scala parser combinators
import scala.util.parsing.combinator.RegexParsers
object InputParser extends RegexParsers {
override val skipWhitespace = false
val WS = """[ ]+"""r
val CONST = """#([0-9]+|[A-Z]+)"""r
val const = CONST
val DATA_REG = """D[0-9]+"""r
val ADDR_REG = """A[0-9]+"""r
val register = DATA_REG | ADDR_REG
@utaal
utaal / .gitignore
Created March 28, 2012 14:01
m68k assembler parser and interpreter
project/target/
target/
{
"name": "test-vendor/test-project",
"type": "project"
}
#!/bin/bash
FILES=`git ls-tree --name-only HEAD .`
MAXLEN=0
for f in $FILES; do
if [ ${#f} -gt $MAXLEN ]; then
MAXLEN=${#f}
fi
done
for f in $FILES; do