Skip to content

Instantly share code, notes, and snippets.

vi / Makefile
Last active Aug 29, 2015
I2P daily graph extraction framework
View Makefile
#wget '' -O 2014-03-01.png
DATE_NOW=$(date -u +'%Y-%m-%d')
vi / bupsplitfixup
Created Apr 8, 2014
bup: Script to convert a result of pre-"bup-split-to-vfs-file" `bup split` into a FUSE-accessible "data" file.
View bupsplitfixup
if [[ -z "$FROM" || -z "$TO" ]]; then
echo "bupslitfixup - convert \"bup split\"-generated content into a form suitable for \"bup fuse.\""
echo "Note: \"bup-split-to-vfs-file\" patch makes \"bup split\" to save content in such form automatically."
echo "Usage: bupsplitfixup treeish_to_be_fixed branch_name_to_create"
echo "Example: bup split -n qqq < something.dat; bupsplitfixup qqq qqq_fixed"
echo "Note: Existing ref with branch_name_to_create is overwritten"
vi /
Last active Aug 29, 2015
Simple Perl script for playing with formula from
#!/usr/bin/perl -wln
# Calculate lower and upper bounds of Wilson confidence interval based on upvotes and downvotes
# Based on SQL expression from
# Confidence parameter is hardcoded at 95%
# Each input line is two numbers: number_of_upvotes <whitespace> number_of_downvotes
# Each output line is two numbers: minimal_estimated_ratio_of_upvoters <space> maximal_estimated_ratio_of_upvoters
vi /
Created Jun 9, 2014
ImageMagick-based pseudo-HDR merger script
# Photos must be perfectly aligned
# Warning: slow
# Created by amateur, don't expect much.
vi / simple_debianize
Created Jun 29, 2014
Simple one-step crude debianizator for my sole-executable-file Github projects
View simple_debianize
if [ -z "$3" ]; then
echo "Usage: simple_debianize name initial_version executable_name"
exit 1
set -e
View cat_and_follow
if [[ -z "$1" || "$1" == "--help" ]]; then
echo "Ouput content of the file being appended to to stdout, continue outputting as more data appears in the file, exit when no processes write to the file for a while."
echo "Usage: cat_and_follow file | something"
exit 1
vi / gist:cc46cf95cd5b44f7964b
Last active Aug 29, 2015
Gdb backtrace of crashing Enki
View gist:cc46cf95cd5b44f7964b
This file has been truncated, but you can view the full file.
Thread 29 (Thread 0xe533db40 (LWP 24751)):
#0 0xf7e666b1 in poll () at ../sysdeps/unix/syscall-template.S:81
No locals.
#1 0xf71d413b in g_poll (fds=0xf1308090, nfds=2, timeout=-1) at /build/buildd-glib2.0_2.33.12+really2.32.4-5-i386-eISom6/glib2.0-2.33.12+really2.32.4/./glib/gpoll.c:132
No locals.
#2 0xf71c59f0 in g_main_context_poll (n_fds=2, fds=0xf1308090, timeout=<optimized out>, context=0xf13062f8, priority=<optimized out>) at /build/buildd-glib2.0_2.33.12+really2.32.4-5-i386-eISom6/glib2.0-2.33.12+really2.32.4/./glib/gmain.c:3440
poll_func = <optimized out>
#3 g_main_context_iterate (context=context@entry=0xf13062f8, block=block@entry=1, dispatch=dispatch@entry=1, self=<error reading variable: Unhandled dwarf expression opcode 0xfa>) at /build/buildd-glib2.0_2.33.12+really2.32.4-5-i386-eISom6/glib2.0-2.33.12+really2.32.4/./glib/gmain.c:3141
vi / gist:8c6ac53821fd74def0e0
Created Sep 30, 2014
Attempting to use a Haskell package in Nix
View gist:8c6ac53821fd74def0e0
# su -l nix
nix@vi-notebook:~$ nix-shell -p haskellPackages.ftphs --option use-binary-caches false
\[\][nix-shell:~]$\[\] ghci -v
GHCi, version 7.8.3: :? for help
Glasgow Haskell Compiler, Version 7.8.3, stage 2 booted by GHC version 7.4.2
Using binary package database: /nix/store/d3mchqnyysryxdyzfcgm24dn5kki6bx8-ghc-7.8.3/lib/ghc-7.8.3/package.conf.d/package.cache
Using package config file: /home/nix/.nix-profile/bin/../lib/ghc-7.8.3/package.conf.d/aeson-
Using package config file: /home/nix/.nix-profile/bin/../lib/ghc-7.8.3/package.conf.d/aeson-pretty-0.7.1.installedconf
Using package config file: /home/nix/.nix-profile/bin/../lib/ghc-7.8.3/package.conf.d/asn1-encoding-
vi /
Last active Aug 29, 2015
rRootage red-blue recolouring patch


Playing STG requires to consider two objects: projectiles and player. This patch changes colours of objects in rRootage: player is red, projectiles are blue. This way, using anaglyph glasses, each eye sees only one of two requires thigs, which adds a bit of difficulty.

Inspired by idea of Lazy Eye Tetris.


vi /
Created Nov 24, 2014
Generate regular expressions using genetic algorithm.
#!/usr/bin/perl -w
use strict;
if ($#ARGV != 3) {
print STDERR "Usage: file_with_passing_lines file_with_failing_lines {file_with_hints|''} {file_with_bans|''} \n";
print STDERR "Created by Vitaly '_Vi' Shukela, in 2014. License is LGPLv2+.\n";
exit 1;
You can’t perform that action at this time.