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
#!/bin/bash | |
# Usage: ./get_k8s_secret_plaintext SECRET_NAME SECRET_KEY | |
kubectl get secret $1 -o json | jq -r '.data[$2]' | base64 --decode |
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
<html> | |
<head> | |
<script type="text/javascript" src="webcrypto.js"></script> | |
<title>Web Crypto Hello World</title> | |
</head> | |
<body> | |
<p>This is a super simple example of trying to get Web Cryptography working</p> | |
</body> | |
</html> |
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
#!/bin/bash | |
sendToStream(){ | |
local EVENT_UUID=`uuidgen` | |
echo "Sending $1 event with shared ID $2" | |
AUTH="-u admin:changeit" | |
curl $AUTH -i -d "{\"type\":\"$1\", \"foo$1\":\"we did a $1 kind of thing.\",\"id\":\"$2\"}" "http://127.0.0.1:2113/streams/$1-$2" -H "Content-Type:application/json" -H "ES-EventType: $1-event" -H "ES-EventId: $EVENT_UUID" | |
echo "Curl return value $?" | |
} | |
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 python:3 | |
WORKDIR /usr/src/app | |
#COPY requirements.txt ./ | |
#RUN pip install --no-cache-dir -r requirements.txt | |
COPY . . | |
CMD [ "python", "./long_logger.py"] |
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/python3 | |
# NOTE: If running on Ubuntu you need to install the "libmysqlclient-dev" package from apt and the "mysql" package through pip | |
# apt install libmysqlclient-dev | |
# pip3 install mysql | |
import MySQLdb | |
import time | |
NUM_ITERATIONS = 100 |
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
foo: | |
bar: | |
baz: something | |
anotherfoo: | |
secondbar: otherthing |
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/python3 | |
def catch(function): | |
def wrapper(*args, **kwargs): | |
try: | |
return function(*args, **kwargs) | |
except Exception as error: | |
return {'error': error} | |
return wrapper |
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 ubuntu:19.10 | |
RUN apt update && apt install -y python3 python3-dev python3-pip vim wget | |
RUN pip3 install numpy plotly pandas | |
RUN pip3 install fbprophet | |
RUN pip3 install jupyter | |
RUN mkdir /fbprophet | |
WORKDIR /fbprophet | |
RUN wget https://raw.githubusercontent.com/facebook/prophet/master/examples/example_wp_log_peyton_manning.csv | |
ENTRYPOINT jupyter notebook --ip=0.0.0.0 --port=8888 --allow-root |
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
#!/bin/bash | |
KUBECOMMAND="kubectl --kubeconfig ~/.kube/mycluster --namespace dev" | |
for each in $($KUBECOMMAND get deployments -o jsonpath="{.items[*].metadata.name}" | tr " " "\n" | grep -v tiller-deploy); | |
do | |
#kubectl delete ns $each | |
echo "Deleting deployment $each" | |
$KUBECOMMAND delete deployment $each | |
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 base64 | |
import json | |
import time | |
import requests | |
import os | |
def push_to_github(filename, repo, branch, token): | |
url="https://api.github.com/repos/" + repo + "/contents/" + filename | |
fileContents = """Last timestamp: """ |