Skip to content

Instantly share code, notes, and snippets.

@codedot
codedot / Makefile
Last active January 2, 2016 14:29
One-way trapdoor permutation for 840 bits based on RSA
NEXT = openssl rsautl -decrypt -inkey key -raw
all: key
openssl dgst -sha -out id -sign key key
openssl dgst -sha -signature id -prverify key key
while sleep 1; do \
openssl base64 -in id; \
$(NEXT) -in id -out next; \
mv next id; \
@codedot
codedot / Makefile
Last active January 2, 2016 02:28
Hedging analyst for Bitstamp
LOGFILE = $$HOME/.bitstamp.log
all:
-while date; do \
$(MAKE) trace; \
sleep 60; \
done
trace:
sed -n -f log2json.sed $(LOGFILE) >spyhedge.json
@codedot
codedot / Makefile
Last active January 1, 2016 21:09
Hedging observer for Bitstamp
URL = https://www.bitstamp.net/api/order_book/?group=0
all:
-while date; do \
$(MAKE) spy; \
$(MAKE) clean; \
sleep 60; \
done
spy: orders.json
@codedot
codedot / Makefile
Last active December 29, 2015 21:59
Hedging client for Ripple
HEDGE = node riphedge
all:
npm install ripple-lib
hedge:
$(HEDGE) | tee hedge.txt
grep -q Ask hedge.txt
mailx -s "`grep Ripples hedge.txt`" me <hedge.txt
@codedot
codedot / Makefile
Last active December 28, 2015 19:09
Hedging client for Bitstamp
HEDGE = node bithedge
all:
npm install bitstamp
hedge:
$(HEDGE) old >|old.txt
cat old.txt
$(HEDGE) cancel `cat old.txt`
$(HEDGE) balance >|balance.txt
@codedot
codedot / Makefile
Last active December 19, 2015 10:19
Schönhage's storage modification machine on Verilog
all: smm
./smm
clean:
-rm -f smm
.SUFFIXES: .v
.v:
iverilog -Wall -DSIM -o $@ $<
@codedot
codedot / Makefile
Last active December 19, 2015 04:48
Bitcoin miner based on combinational logic for SHA-256
all: comb
./comb
clean:
-rm -f comb
.SUFFIXES: .v
.v:
iverilog -Wall -DSIM -o $@ $<
@codedot
codedot / Makefile
Last active December 18, 2015 10:59
Brain-like logic using Verilog
all: brain
base64 /dev/urandom | head | ./brain
clean:
-rm -f brain
.SUFFIXES: .v
.v:
iverilog -Wall -DSIM -o $@ $<
@codedot
codedot / Makefile
Last active December 18, 2015 07:49
Simulation of RAM0 using Verilog
all: ram0
./ram0
clean:
-rm -f ram0
.SUFFIXES: .v
.v:
iverilog -Wall -DSIM -o $@ $<
@codedot
codedot / Makefile
Last active December 16, 2015 15:18
Recompile a Bitcoin miner per Getwork
all: nonce
time ./nonce
nonce: nonce.c data.c
gcc -O3 -Wall -Werror nonce.c -o $@
data.c: parse.sed work.js
sed -n -f parse.sed work.js >$@
clean: