Skip to content

Instantly share code, notes, and snippets.

View jevinskie's full-sized avatar

Jevin Sweval jevinskie

View GitHub Profile
################################# HELPERS ###################################
###############################################################################
## Function : unmarshal ( )
## ----------------------------------------------------------------------------
## Description :
## unserialize transform array into hash, but keys are not ordered anymore
## unmarshal does the unserialize, reorder and return an array
## Parameters :
## Return :
package XXX::Role::Logger;
use Moose::Role;
with 'MooseX::Log::Log4perl::Easy' => {
-aliases => {
log => '_log',
log_info => '_log_info',
},
-excludes => [qw( log log_info )],
#!/usr/bin/env python
import argparse
import sys
import re
import csv
import tempfile
import shutil
import subprocess
import math
Reading symbols from /home/jevin/jb/greenpois0n_x64...(no debugging symbols found)...done.
(gdb) r
Starting program: /home/jevin/jb/greenpois0n_x64
[Thread debugging using libthread_db enabled]
Program received signal SIGSEGV, Segmentation fault.
QMetaObject::cast (this=0x7ffff7752c60, obj=0x7fffffffe1e0) at kernel/qmetaobject.cpp:300
300 kernel/qmetaobject.cpp: No such file or directory.
in kernel/qmetaobject.cpp
Current language: auto
0 --1-- 1 --1-- 2 --1-- 3
| \ | \ | \ |
| \ | \ | \ |
1 6 9 10 8 10 1
| \ | \ | \ |
| \ | \ | \ |
7 --5-- 6 --4-- 5 --8-- 4
\ / |
\ / |
10 11 1
socket.on('connection', function(client){
console.log('got client: ' + client);
var stream = fs.createReadStream('starwars.txt', {encoding: 'utf8'});
framer(stream, 14); // 14 lines per frame
stream.on('frame', function(frame, repeat){
console.log('got frame!');
client.send(frame);
});
});
#!/usr/bin/env node
require.paths.unshift(__dirname + '/modules');
var fs = require('fs');
var framer = require('framer');
var stream = fs.createReadStream(process.argv[2], {encoding: 'utf8'});
framer(stream, 14); // 14 lines per frame
@jevinskie
jevinskie / wakeonlan.conf
Created November 30, 2010 06:06
an upstart script to enable wake-on-lan for all adaptors
start on started network
script
for interface in $(cut -d: -f1 /proc/net/dev | tail -n +3); do
logger -t 'wakeonlan init script' enabling wake on lan for $interface
ethtool -s $interface wol g
done
end script
#!/usr/bin/env python
def count_ones(n):
res = 0
while n > 0:
if n % 10 == 1:
res += 1
n /= 10
tar xvaf foo.tar.bz2
cd foo
mkdir -p ~/base/foo
./configure --prefix=$HOME/base/foo
make install
echo 'export PATH="$PATH:$HOME/base/foo/bin"' >> ~/.bashrc