Skip to content

Instantly share code, notes, and snippets.

View gist:8f1db57c4d5127f9f282
#include <string.h>
#include <sys/fcntl.h>
#include <mdbm/mdbm.h>
#include <mdbm/mdbm_handle_pool.h>
#include <stdlib.h>
#include <pthread.h>
#include <thread>
#include <iostream>
#include <vector>
View plte2
color #0: 0b 41 77 |.Aw| used 4067089 times
color #1: ff b1 a2 |...| used 7200 times
color #2: 0b 41 77 |.Aw|
color #3: ff b1 a2 |...|
color #4: 0b 41 77 |.Aw|
color #5: ff 5b b3 |.[.| used 9000 times
color #6: 0b 41 77 |.Aw|
color #7: ff 5b b3 |.[.|
color #8: 0b 41 77 |.Aw|
color #9: ff 5b b3 |.[.|
View plte1
color #0: 0b 41 77 |.Aw| used 4067089 times
color #1: ff b1 a2 |...| used 7200 times
color #2: 0b 41 77 |.Aw|
color #3: ff b1 a2 |...|
color #4: 0b 41 77 |.Aw|
color #5: ff 5b b3 |.[.| used 9000 times
color #6: 0b 41 77 |.Aw|
color #7: ff 5b b3 |.[.|
color #8: 0b 41 77 |.Aw|
color #9: ff 5b b3 |.[.|
View gist:9439159
#!/usr/bin/env ruby
#coding: binary
require 'zpng'
require 'sugar_png'
require 'pp'
# !!! convert gif file to png first
# will get 8 frames
images = Dir["task*.png"].sort.map{ |fname| ZPNG::Image.load(fname) }
@zed-0xff
zed-0xff / gist:8181593
Created Dec 30, 2013
eventlogs compression
View gist:8181593
orig: 512M eventlogs file
gzip 51M 10s
bzip2 25M 120s
xz 15M 150s
pixz 16M 15s
pixz -7 15M 15s !!!
pixz -8 14M 22s
pixz -9 13M 40s
pxz 16M 18s
View bench-split.rb
#!/usr/bin/env ruby
N = 100000
s = "foobarbaz"
@results = []
SRC = File.readlines(__FILE__)
print "[.]"
def bench title = nil
@zed-0xff
zed-0xff / antiSiggen3.rb
Created Jan 17, 2012
script for decoding JPG / DOC / XLS / etc files that were encoded with Trojan.Siggen3.35000
View antiSiggen3.rb
#!/usr/bin/env ruby
#coding: binary
#
# script for decoding JPG / DOC / XLS / etc files that were encoded with
# Trojan.Siggen3.35000
# Trojan.Dropper-31300
#
#
# some useful links:
#
View rspec-bisect.rb
#!/usr/bin/env ruby
# this tool is similar to "git bisect" one, but for specs.
# it tries to find what spec from list of specs breaks execution of one specified spec.
#
# see more at http://zed.0xff.me/2010/01/28/rspec-bisect
#
# usage example:
# ./rspec-bisect.rb spec/**/*_spec.rb spec/controllers/spaces/tickets_controller_spec.rb
# [.] rspec runner: ./script/spec
You can’t perform that action at this time.