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
for idx in $(curl -sS https://${DOMAIN}:${PORT}/_cat/indices | awk '{print $3}'); do curl -XDELETE "https://${DOMAIN}:${PORT}/${idx}"; 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
import hashlib | |
from json import dumps | |
from collections import OrderedDict | |
# composerFileContents should be the dict version of the composer.json file | |
def getContentHash(composerFileContents): | |
relevant = OrderedDict((key, composerFileContents[key]) for key in composerFileContents.keys() if key in ['name','version','require','require-dev','conflict','replace','provide','minimum-stability','prefer-stable','repositories','extra']) | |
if 'config' in composerFileContents and 'platform' in composerFileContents['config']: | |
relevant['config']['platform'] = composerFileContents['config']['platform'] |
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 subprocess | |
from json import dumps | |
# NOTE: Files will be written to the current directory, without any checks to prevent overwriting. Archiving and/or version control are not considered here, but highly encouraged. | |
# get a list of all webtasks for the current user | |
list_request = subprocess.run(['wt', 'ls'], stdout=subprocess.PIPE, text=True) | |
# transform that output into a list of task names | |
tasks = [ ln.replace('Name:','').strip() for ln in list_request.stdout.split("\n") if 'Name:' in ln ] |
- To warm and froth milk:
Push the on button once
- blue indicator lights up
- To only warm milk:
Push the on button two time
- blue indicator lights up (not helpful)
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
from requests import get, post, put | |
from json import dumps, loads | |
from sys import argv | |
from math import ceil | |
commands = [] | |
def addShard(idx, shard): | |
commands.append({ | |
"allocate" : { |
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
curl https://codeload.github.com/mui-org/material-ui/tar.gz/v3.7.1 | tar -xz --strip=2 material-ui-3.7.1/examples/create-react-app |
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
openssl x509 -noout -dates -in cert.pem |
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
# NOTE: this updates the file in place, do you have a backup? | |
ssh-keygen -p -m PEM -f ~/.ssh/id_rsa |
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
brew update && brew upgrade && brew install openssl | |
cd /usr/local/Cellar/openssl/1.0.2*/lib | |
sudo cp libssl.1.0.0.dylib libcrypto.1.0.0.dylib /usr/local/lib/ | |
cd /usr/local/lib | |
sudo ln -s libssl.1.0.0.dylib libssl.dylib | |
sudo ln -s libcrypto.1.0.0.dylib libcrypto.dylib |