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 | |
set -euo pipefail | |
# This script will remove automatic association for all networks not listed in the whitelist | |
# passed as the first argument. Passwords will NOT be removed from the Keychain. | |
# | |
# Alternatively, you can untick "Remember networks" in Network Preferences > Wi-Fi > Advanced, | |
# but then you won't be able to auto-join networks even temporarily, and you might already | |
# have a long list to go through. | |
# |
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
$ bitcoin-cli -testnet getblockhash 7777 | |
0000000007b52c4ff25443ab5a07cea530bb6981aad956116239e9c060bda368 | |
$ bitcoin-cli -testnet getblock 0000000007b52c4ff25443ab5a07cea530bb6981aad956116239e9c060bda368 | |
{ | |
"hash": "0000000007b52c4ff25443ab5a07cea530bb6981aad956116239e9c060bda368", | |
"confirmations": 1118426, | |
"strippedsize": 191, | |
"size": 191, | |
"weight": 764, |
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
{u'merkleroot': u'064d68e9b8eb27b6db3a1f993cf8c1fefd4acc86721e30a062abac17de3b2638', | |
u'nonce': 2057802261, u'previousblockhash': u'00000000010876fecdc6f59b34a95ba790e5140ef694986e4b7ac9aadde3415b', | |
u'hash': u'0000000007b52c4ff25443ab5a07cea530bb6981aad956116239e9c060bda368', u'version': 1, u'weight': 764, | |
u'chainwork': u'0000000000000000000000000000000000000000000000000000995099509950', u'mediantime': 1338180889, | |
u'height': 7777, u'difficulty': 16, u'nextblockhash': u'000000000a14868100bb1cb9cbf25fa853df56c56392556ba66aecc6de0af641', | |
u'confirmations': 1118429, u'time': 1338180890, u'versionHex': u'00000001', u'strippedsize': 191, | |
u'tx': [u'064d68e9b8eb27b6db3a1f993cf8c1fefd4acc86721e30a062abac17de3b2638'], u'bits': u'1c0ffff0', u'size': 191} |
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 | |
import time, requests, json | |
class RPCHost(object): | |
def __init__(self, url): | |
self._session = requests.Session() | |
self._url = url | |
self._headers = {'content-type': 'application/json'} | |
def call(self, rpcMethod, *params): | |
payload = json.dumps({"method": rpcMethod, "params": list(params), "jsonrpc": "2.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
# Default port for the bitcoin testnet is 18332 | |
# The port number depends on the one writtein the bitcoin.conf file | |
rpcPort = 18555 | |
# The RPC username and RPC password MUST match the one in your bitcoin.conf file | |
rpcUser = 'Alice' | |
rpcPassword = 'test' | |
#Accessing the RPC local server | |
serverURL = 'http://' + rpcUser + ':' + rpcPassword + '@localhost:' + str(rpcPort) |
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
import hashlib | |
class FeistelSHA1: | |
rounds = 4 # 4 rounds is sufficient as long as the round function is cryptographically secure | |
split = 1 / 2 | |
def __init__(self, key, rounds=rounds): | |
self.subkeys = [hashlib.sha1(bytes((i,)) + key).digest() for i in range(rounds)] |
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 | |
#Stop all containers | |
docker stop $(docker ps -a -q) | |
# Force kill the presistant one | |
docker kill $(docker ps -a -q) | |
# Delete all containers | |
docker rm $(docker ps -a -q) | |
# Delete all images | |
docker rmi $(docker images -q) |
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
/* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. | |
*/ | |
#include <arpa/inet.h> | |
#include <linux/if_packet.h> | |
#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
for keyfile in ~/.ssh/id_*; do ssh-keygen -l -f "${keyfile}"; done | uniq |
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
VBoxManage setextradata mac "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3" | |
VBoxManage setextradata mac "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0" | |
VBoxManage setextradata mac "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple" | |
VBoxManage setextradata mac "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" | |
VBoxManage setextradata mac "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1 |
OlderNewer