Skip to content

Instantly share code, notes, and snippets.

View matburt's full-sized avatar
😄

Matthew Jones matburt

😄
View GitHub Profile
#!/usr/bin/python
"""
Criptosistema ACYMOS2 por Agustin, Kriptopolis
Notas:
"~" representa la "enye"
Los comentarios estan sin acentos y caracteres especiales
#include <stdio.h>
#include <stdint.h>
uint8_t* foo(){
static uint8_t out[2] = {1,2};
return out;
}
int main(int argv, char** argc){
uint8_t* bar = foo();
import time
test = []
for i in xrange(2500000):
test.append(dict())
for i in xrange(len(test)):
d = test.pop()
del test
test = [dict() for i in xrange(2500000)]
[test.pop() for i in xrange(len(test))]
@matburt
matburt / gist:742954
Created December 16, 2010 02:46
reverse lookup ip addresses as first field in logfile
for each in `tail -n 100000 logfile | grep pattern | tr -s " " | awk '{print $1}' | sort | uniq`; do dig +short -x $each; done
@matburt
matburt / mpd.sh
Created March 3, 2011 18:36
Colored mpd.sh for xmobar
MPD="$(mpc | head -n 2 | tr '\n' ' ' | sed 's/^\(.*\)\( \[.*\)/\1/')"
MPD_STATE="$(mpc | head -n 2 | tr '\n' ' ' | grep -oG '\[.*\]')"
if [ -z "$MPD" ]; then
echo "<fc=#ff5500>no music</fc>"
else
if [ "$MPD_STATE" = "[paused]" ]; then
echo "<fc=#ff5500>$MPD</fc>"
elif [ -z "$MPD_STATE" ]; then
echo "<fc=#ff5500>no music</fc>"
else
@matburt
matburt / dispcsv.sh
Created June 17, 2011 14:34
Display a CSV file on the command line in an awesome way
cat $1 | column -s, -t | less -#2 -N -S
@matburt
matburt / nodecreate.py
Created June 29, 2011 14:39
Create/Subscribe an xmpp node
import sys
from twisted.internet import reactor
from twisted.python import log
from twisted.words.protocols.jabber.jid import JID
from wokkel import client, pubsub
jid_publisher = JID("user@host")
secret = "test123"
@matburt
matburt / start-synergy.sh
Created November 3, 2011 14:35
Piggyback Synergy over SSH
echo "Starting Synergy SSH session on $1 with username $2"
ssh -l $2 -f -N -L localhost:24800:$1:24800 $1
synergyc localhost
@matburt
matburt / gitversion.sh
Created January 16, 2012 18:47 — forked from seanf/VERSION-GEN
Generate Git Versions/revisions
#!/bin/bash
VERNAME=`git describe --long | sed "s/-g.*//g"`
VERCODE=`git rev-list --all | wc -l`
# Do something with the verson number here.