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
from __future__ import print_function, division | |
""" | |
Example of how calculations on the secp256k1 curve work. | |
secp256k1 is the name of the elliptic curve used by bitcoin | |
see http://bitcoin.stackexchange.com/questions/25382 | |
""" | |
## the prime modules used in the elliptic curve coordinate calculations | |
p = 2**256 - 2**32 - 977 |
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
from __future__ import print_function, division | |
""" | |
By Willem Hengeveld <[email protected]> | |
ecdsa implementation in python | |
demonstrating several 'unconventional' calculations, | |
like finding a public key from a signature, | |
and finding a private key from 2 signatures with identical 'r' | |
""" |
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
from bsddb.db import * | |
import sys | |
import struct | |
# by Willem Hengeveld <[email protected]> | |
# usage: python dumpwallet path_to_your/wallet.dat | |
# note: you need to have the bsddb package installed | |
def getcompact(k, i): | |
b= ord(k[i]) ; i+=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
#!perl -w | |
# by Willem Hengeveld <[email protected]> | |
# license: http://en.wikipedia.org/wiki/Beerware | |
use strict; | |
$|=1; | |
# this script decodes raw smsses, as used with the | |
# AT+CMT, or AT+CMGR, or AT+CMGS commands | |
# either parses hex strings on the commandline, or from stdin. |
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/local/bin/python | |
""" | |
Reads message from stdin, pgp encrypts, launch mailto: url to send with mail app. | |
I use this to send pgp messages from within vim. | |
First i type a message like this: | |
---- | |
Subject: test | |
To: [email protected] |
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 | |
bkdir= | |
while [[ -n "$1" ]]; do | |
cd $(dirname "$1") | |
realpath=$(pwd -P) | |
case "$realpath" in | |
/Volumes/*) | |
realpath=${realpath: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
#!/bin/bash | |
if [[ $(id -u) -ne 0 ]]; then | |
sudo $0 "$@" | |
exit $? | |
fi | |
diff <(sleep 1 ; lsof -n -P| grep -v "^\(sleep\|lsof\|grep\|diff\|bash\)" ) <(lsof -n -P| grep -v "^\(sleep\|lsof\|grep\|diff\|bash\)" ) |
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/sh | |
tr -d "\r" | tr "\n\\" "\0/" | xargs -0 "$@" |
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/sbin/dtrace -s | |
syscall::open*:entry { | |
this->exe= execname; | |
this->file= copyinstr(arg0); | |
this->mode= arg1; | |
} | |
syscall::open*:return { | |
printf("%4d (%4d) %-20s\tM%07o %s",arg0, errno, this->exe, this->mode, this->file); | |
} |
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/sbin/dtrace -s | |
#pragma D option quiet | |
syscall::exec*:entry | |
{ | |
printf("exec %s -> %s\n", execname, copyinstr(arg0)); | |
} | |
proc:::exec-failure |
OlderNewer