Skip to content

Instantly share code, notes, and snippets.

View joshes's full-sized avatar

Joshua Hansen joshes

View GitHub Profile
sudo SKIP_PACKAGE_UPDATE=1 /var/cache/kubernetes-install/nodeup --conf=/var/cache/kubernetes-install/kube_env.yaml --v=10
# Example of using etcdctl w/TLS
kubectl exec -it -n kube-system $(kubectl get pods -n kube-system | grep etcd-manager-main | awk '{print $1}') bash
CLUSTER=my-cluster.k8s.local
cd /opt/etcd-v3.2.18-linux-amd64
ETCDCTL_API=3 ./etcdctl \
--key /rootfs/etc/kubernetes/pki/kube-apiserver/etcd-client.key \
--cert /rootfs/etc/kubernetes/pki/kube-apiserver/etcd-client.crt \
@joshes
joshes / download-alexa-audio.sh
Created January 19, 2019 17:51
Downloads all of your Amazon Alexa audio files to disk
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Downloads all of your alexa audio files to `output_dir` with the filenames
# flattened (vs storing as sub-directories as implied by the file name).
#
# For example, the following id:
# - A3S5CH1HU6KAYF:1.0/2019/01/18/17/G090LF1174270LM2/39:31::TNIH_2V.6c04473c-3160-4012-9719-63ca63396288ZXK
# Will be saved to:
# - ${output_dir}/A3S5CH1HU6KAYF_1_0_2019_01_18_17_G090LF1174270LM2_39_31__TNIH_2V_6c04473c-3160-4012-9719-63ca63396288ZXK.wav
#
@joshes
joshes / command.yaml
Created March 27, 2018 22:11
Command to make container wait
command: ['/bin/bash', '-c', 'trap : TERM INT; sleep infinity & wait']
@joshes
joshes / distance.sql
Created March 21, 2017 20:53 — forked from aramonc/distance.sql
MySQL function to calculate the distance between two coordinates using the Haversine formula. Leaving it here for future reference.
DELIMITER $$
CREATE FUNCTION `haversine` (lat1 DECIMAL(8,6), lng1 DECIMAL(8,6), lat2 DECIMAL(8,6), lng2 DECIMAL(8,6)) RETURNS DECIMAL(8,6)
BEGIN
DECLARE R INT;
DECLARE dLat DECIMAL(30,15);
DECLARE dLng DECIMAL(30,15);
DECLARE a1 DECIMAL(30,15);
DECLARE a2 DECIMAL(30,15);
DECLARE a DECIMAL(30,15);
DECLARE c DECIMAL(30,15);
@joshes
joshes / springer-free-maths-books.md
Created December 29, 2015 00:22 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of maths books available for free, here are the direct links