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 | |
import os | |
import numpy as np | |
import galois | |
GF = galois.GF(2) | |
# This script works for any hash algorithm! | |
hash_algo = hashlib.sha256 |
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 | |
######################## REQUIRED ENVIRONMENT VARIABLES ######################## | |
# FARMER_PUBKEY | |
# The farmer public key used to generate the plots. | |
# POOL_PUBKEY | |
# The pool public key used to generate the plots. | |
# SCRATCH_DIR | |
# An existing directory where plotters put their temp files. | |
# WRANING: Everything under this directory will be deleted. |
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
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: httpy-files | |
data: | |
server.py: | | |
import http.server | |
import os | |
import socket | |
import json |
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
# Fetching the Destiny 2 manifest definition | |
api_key="" | |
if [[ -n "${api_key}" ]]; then | |
curl --compressed "https://www.bungie.net/Platform/Destiny2/Manifest/" -H "x-api-key: ${api_key}" -o "manifest.json" | |
# Extracting the name of the aggregated JSON asset database. | |
aggregate_path=$(jq --raw-output '.Response.jsonWorldContentPaths.en' "manifest.json") | |
else |
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 | |
set -e | |
FIRST_RUN=1 | |
BUILD_ARM=1 | |
BUILD_SDK=1 | |
BUILD_NACL=1 | |
NWJS_BRANCH="nw44" |
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 hvac | |
import pprint | |
import six.moves.urllib.parse as urllib | |
client = hvac.Client("http://localhost:8200") | |
def quote_path(path): | |
"""Returns a string that's safe to use as a path.""" | |
# Yes, safe = "/" is the default, but I pass it here just to make it obvious. |
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 hvac | |
import pprint | |
client = hvac.Client("http://localhost:8200") | |
# Make sure the test user doesn't exist | |
client.secrets.identity.delete_entity_by_name("clobber-demo") | |
# Create the user with a set of policies and metadata | |
client.secrets.identity.create_or_update_entity_by_name( |
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/bash | |
# Use bytewise locale, this provides performance benefits and prevents possible UTF8 warnings | |
export LC_ALL="C" | |
# `plains.txt` is the "found" list from Hashes.org | |
# https://hashes.org/leaks.php?id=515 | |
# `HIBP_hashcount.txt` is the Version 2 *ordered by hash* list from haveibeenpwned.com | |
# https://haveibeenpwned.com/Passwords | |
# This perl snippet regenerates the SHA1 hash from the plaintext. |
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
; NOTE: hotend must be preheated otherwise extruder retract is ignored! | |
; Monoprice Maker Select Plus/Wanhao Duplicator i3 Plus | |
; ========================================================= | |
; An extruder retract in relative positioning causes | |
; the X axis to no longer be able to home. | |
; Disabling the motors fixes the bug. | |
M117 Homing and moving to known position |
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
inches = 25.4; | |
module HexPack(rows, columns, spacing) { | |
// Assuming the circles are hexagonally packed, | |
// this is how far their center points are from each other. | |
// We can find the y spacing of the center points using the Pythagorean theorem because | |
// the center points between three adjacent circles will form an equilateral triangle. | |
function pythag(side, hypot) = sqrt(pow(hypot, 2) - pow(side, 2)); | |
hex_x_spacing = spacing; |
NewerOlder