Skip to content

Instantly share code, notes, and snippets.

@circulosmeos
circulosmeos / shadertoy_snapshots.pl
Created April 2, 2019 18:53
visualization.shadertoy v3.14 wiki - scripts to automatically obtain shaders' snapshots using webthumb.bluga.net and then, after cut images, produce the wiki listing at https://github.com/circulosmeos/visualization.shadertoy/wiki/Home
#!/usr/bin/env perl
#
# using presets_GLES.json from https://github.com/circulosmeos/visualization.shadertoy v3.14
# extract snapshots from urls to shadertoy.com using webthumb.bluga.net
# (by circulosmeos 2019-04)
#
use strict;
my $LIST_FILE = 'presets_GLES.json';
@circulosmeos
circulosmeos / blockchain_headers_to_csv.py
Created April 15, 2018 22:30
convert binary file //headers.electrum.org/blockchain_headers to CSV ASCII
#!/usr/bin/env python
# convert binary file http://headers.electrum.org/blockchain_headers
# to CSV ASCII
import binascii
STRUCT_OF_BLOCK = [ 4, 32, 32, 4, 4, 4 ] # blockchain_headers does not contain always "0x00" txn_count
BLOCK_SIZE = sum(STRUCT_OF_BLOCK)
FILE_OUT= open('blockchain_headers.csv','w')
@circulosmeos
circulosmeos / easy-litecoin-address-from-public-key.py
Last active November 25, 2023 17:20
Easily generate the litecoin address from the public key using Python (compatible with Python 2 and 3)
#!/usr/bin/env python
# patched from https://bitcoin.stackexchange.com/questions/56923/is-this-how-to-generate-a-bitcoin-address-with-python
# https://en.bitcoin.it/wiki/Protocol_documentation#Addresses
# Adapted to litecoin, following https://bitcoin.stackexchange.com/questions/65282/how-is-a-litecoin-address-generated
import hashlib
import base58
# ECDSA bitcoin Public Key
pubkey = '0450863ad64a87ae8a2fe83c1af1a8403cb53f53e486d8511dad8a04887e5b23522cd470243453a299fa9e77237716103abc11a1df38855ed6f2ee187e9c582ba6'
@circulosmeos
circulosmeos / easy-bitcoin-address-from-public-key.py
Last active August 6, 2023 15:20
Easily generate the bitcoin address from the public key using Python (compatible with Python 2 and 3)
#!/usr/bin/env python
# https://en.bitcoin.it/wiki/Protocol_documentation#Addresses
import hashlib
import base58
# ECDSA bitcoin Public Key
pubkey = '0450863ad64a87ae8a2fe83c1af1a8403cb53f53e486d8511dad8a04887e5b23522cd470243453a299fa9e77237716103abc11a1df38855ed6f2ee187e9c582ba6'
# See 'compressed form' at https://en.bitcoin.it/wiki/Protocol_documentation#Signatures
compress_pubkey = False
@circulosmeos
circulosmeos / triopsv9.0.tests.pl
Created August 31, 2016 16:58
Perl script to test 'triops' against multiple test generated files
#!/usr/bin/perl -w
#
# test triops against multiple test generated files
# random generated files with specified $INCREMENT length
# are encrypted with multiple options, and then decrypted
# and this output compared with the original file.
# Process stops when reaching $LOOPS or an error :-o
# Adjustments: $LOOPS, $INCREMENT, $INITIAL_FILE
#
# https://github.com/circulosmeos/triops