This file contains hidden or 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
| """ | |
| usage: python mine_demo.py ZEROES VALUE_TO_HASH | |
| Find a nonce that, when concatenated with VALUE_TO_HASH, results in an | |
| SHA256 hexdigest that starts with ZEROES number of zeroes. | |
| output: NONCE HASH | |
| Where NONCE is the solution that resulted in a HASH that the required | |
| number of zeroes at the start. |
This file contains hidden or 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 sh | |
| # nagsite.sh - ping a site until it comes back online | |
| RET_VAL=1; | |
| # | |
| # checksite - Check if a site is online | |
| # args - url to ping | |
| # returns - no returns, but modifies RET_VAL |
This file contains hidden or 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 sh | |
| # | |
| # clean-mess.sh - Convert a SQL text output to CSV, for when | |
| # someone sends you SQL text output of a table instead of a CSV... | |
| # | |
| # Beware, this will not properly handle double spaces in a column | |
| # because that wasn't an issue for the data I received. | |
| # | |
| # In this case, it just does every .mess file in a folder called data |
This file contains hidden or 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
| bash-3.2$ python sears-parts.py "door handle" | |
| WP8519336 Dryer door handle pad | |
| 8519373 Dryer door handle screw hole plug (graphite) | |
| 8519374 Dryer door handle screw hole plug (black) |
This file contains hidden or 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 sh | |
| # | |
| # netyet.sh - check a site every minute until it's back online | |
| # [email protected] | |
| # | |
| # usage: netyet.sh google.com | |
| # | |
| # Read the site as the only command line arg |
This file contains hidden or 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 requests | |
| import magic | |
| import mimetypes | |
| class Blob: | |
| def __init__(self, | |
| blob_id, | |
| base_url="http://www.newhavenct.gov/civicax/filebank/blobdload.aspx?blobid="): |
This file contains hidden or 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 | |
| # print a pseudorandom string of 40 integers from command line | |
| $(python -c "import random; print(''.join([str(random.randint(0,9)) for x in range(40)]))") |
This file contains hidden or 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
| while [ 1 = 1 ]; do if [ $(date +"%H") = "12" ]; then say LUNCH TIME; break; else echo NOT LUNCH TIME; sleep 60; fi; done |
This file contains hidden or 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
| # Download copies of illuminated texts from from Blake Archive | |
| import json | |
| import requests | |
| from PIL import Image | |
| from io import BytesIO | |
| import os | |
| from progress.bar import Bar | |
This file contains hidden or 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 numpy as np | |
| import cv2 | |
| # use the crop_image() function at the bottom. The rest are pretty much helpers. | |
| # works well enough with William Blake illuminated books that I didn't have to | |
| # try anything more sophisticated | |
| def read_image(path): | |
| return cv2.cvtColor(cv2.imread(path), cv2.COLOR_RGB2BGR) |