This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Hook main() using LD_PRELOAD, because why not? | |
* Obviously, this code is not portable. Use at your own risk. | |
* | |
* Compile using 'gcc hax.c -o hax.so -fPIC -shared -ldl' | |
* Then run your program as 'LD_PRELOAD=$PWD/hax.so ./a.out' | |
*/ | |
#define _GNU_SOURCE | |
#include <stdio.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let main_pubkey = base58'qweqwe' | |
let main_address = addressFromPublicKey(main_pubkey) | |
match tx { | |
case t:ExchangeTransaction => sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
case t:TransferTransaction => main_address == addressFromRecipient(t.recipient) | |
case t:SetScriptTransaction => sigVerify(tx.bodyBytes, tx.proofs[0], main_pubkey) | |
case _ => false | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def generate_keysets(n_shards, keys): | |
n_keys = len(keys) | |
shards = [] | |
shards.append(keys) | |
elements_required = n_keys | |
shard_to_pop = 0 | |
for step in xrange(1,n_shards): | |
need_count = n_keys // (step+1) | |
new_shard = [] | |
for i in xrange(0,need_count): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/usr/bin/env bash | |
$(readelf -V $1 |sed -n "/.gnu.version_r.*/,/#/p" | while read LINE; do | |
echo $LINE |grep -q 'File: '; | |
if [ $? -eq 0 ]; then | |
CURLIB=`echo $LINE |egrep -o "([a-zA-Z0-9\.]+?\.so(\.[a-zA-Z0-9\.]+?)?)"`; | |
else | |
echo $LINE |grep -q 'Version: '; | |
if [ $? -eq 0 ]; then | |
VER=`echo $LINE |egrep -o "Version: [0-9]+" |egrep -o "[0-9]+"`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <iterator> | |
#include <iostream> | |
#include "../ext/strtok.h" | |
using ext::strtok; | |
using ext::uniqtok; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef EXT_TOKH | |
#define EXT_TOKH | |
#include <string> | |
#include <vector> | |
#include <set> | |
namespace ext | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fix: | |
/usr/libexec/git-core/git-rebase--interactive | |
-git rev-list $merges_option --pretty=oneline --abbrev-commit\ | |
+git rev-list $merges_option --pretty=">%h (%an <%ae>) %s"\ | |
result: | |
1 pick 19f43c1 (Yuri Dyachenko <[email protected]>) add: gcrypt::noerr | |
2 pick 990a7e8 (Yuri Dyachenko <[email protected]>) add: gcrypt::throwif( err ) throw if err != noerr | |
3 pick cb03f3b (Yuri Dyachenko <[email protected]>) add: ext::move<T> move semantic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat .bin/ssh-sc | |
#!/bin/bash | |
RET=1 | |
PARAMS= | |
SESSION="auto-$RANDOM$RANDOM" | |
until [ -z "$1" ]; do | |
case "$1" in | |
'-S') | |
RET=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
N=0 | |
HOST=$1 | |
while [ 0 ]; do | |
START=`expr $N \* 33` | |
STOP=`expr $START + 16` | |
START2=`expr $STOP + 1` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#define BUFF_SIZE (4*1024) | |
void swap(char* buff, size_t count) | |
{ | |
char* begin = buff; | |
char* end = buff + count - 1; | |
while ( begin < end ) | |
{ |