Skip to content

Instantly share code, notes, and snippets.

  • 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)
xcsrz /
Created Oct 10, 2020
This python script is used to increase the number of replicas in an ES cluster and force those new replicas to be allocated to a new host to enable a filesystem backup of the ES data directory.
from requests import get, post, put
from json import dumps, loads
from sys import argv
from math import ceil
commands = []
def addShard(idx, shard):
"allocate" : {
xcsrz /
Created May 8, 2020
When you need to jump start a material-ui project with the pre-hooks version of react. (react v16.7, material-ui v3.7.1)
curl | tar -xz --strip=2 material-ui-3.7.1/examples/create-react-app
xcsrz /
Created Apr 16, 2020
Print the dates from an SSL certificate
openssl x509 -noout -dates -in cert.pem
xcsrz /
Created Apr 5, 2020
This one command is so hard to track down every 3 years when I need it. So many posts incorrectly insist the private key is in PEM format already. In truth, it depends on how the key pair was created (openssl vs ssh-keygen).
# NOTE: this updates the file in place, do you have a backup?
ssh-keygen -p -m PEM -f ~/.ssh/id_rsa
xcsrz /
Created Mar 11, 2020
fix for when `macos catalina upgrade` makes random scripts bomb with `Abort trap: 6`
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
xcsrz /
Last active Mar 4, 2020
With atlassian falling apart and abandoning mercurial (the only reason to use bitbucket unless you're one of those anti-microsoft holdouts) you may find yourself looking to collect all your bitbucket repos to take elsewhere ... like ... github. This script is the first step. This is the first draft, only tested on mac running python 3.7 but shou…
from requests import get
from os import environ, getcwd, chdir, mkdir, system
from json import dumps
basedir = getcwd() + '/repos'
xcsrz /
Last active May 23, 2020
Does it irritate anyone else as much as me when you hit the back button and the video keep on playing but all you can see is the audio and it's not clear how to make the audio stop? This fixes that on FireTV+Kodi.

Run Directly

curl | bash
xcsrz /
Created Apr 24, 2019
Python function to wait for a recently published version of an npm package to become available. Too many times I've been bitten by npm publish returning but the package not becoming available for several seconds, minutes and sometimes even hours later. If you automate your deployment with python this can help you too.
import sys
import json
import time
# pip install npm
from npm.bindings import npm_run
def wait(package, version):
while True:
err, raw = npm_run('view','--json', package)