Skip to content

Instantly share code, notes, and snippets.

@zzsnzmn
zzsnzmn / .gitignore
Last active September 28, 2015 14:18
random wav file modifiers
*.pyc
snds
///// INCLUDING json2.js //////
/*
json2.js
2013-05-26
Public Domain.

ansible-playbook playbook.yml -e 'first_run=True'

uses second file

ansible-playbook playbook.yml

uses cli var

ansible-playbook playbook.yml -e foo=cli_variable

---
- hosts: localhost
tasks:
- shell: bash -lc "ansible-playbook yo_dog.yml"
Run flash.sh to load up the whitewhale firmware
@zzsnzmn
zzsnzmn / main.py
Last active January 2, 2018 23:42
Decrypt a KMS Encrypted SES Email in Python3
from base64 import b64decode
import json
import boto3
from Crypto.Cipher import AES
s3 = boto3.resource('s3')
kms = boto3.client('kms')
def get_email(bucket, key):
obj = s3.Object(bucket, key).get()
/* issues
- preset save blip with internal timer vs ext trig
*/
#include <stdio.h>
// asf
#include "delay.h"
@zzsnzmn
zzsnzmn / prepare_pxetools
Last active March 14, 2018 21:23
Set up PXE Booting on a Raspberry Pi
#!/bin/bash
set -e
sudo apt-get install -y python3 python3-pip ipcalc
sudo pip3 install tabulate
# Get network info
NAMESERVER=$(cat /etc/resolv.conf | grep nameserver | head -n 1 | cut -d " " -f2)
GATEWAY=$(ip -4 route | grep default | head -n 1 | cut -d " " -f3)
@zzsnzmn
zzsnzmn / NOTES.md
Created July 31, 2018 01:09
istio stuff

Request routing This task will first direct all incoming traffic for the Bookinfo application to the v1 version of the reviews service. It will then send traffic only from a specific test user to version v2, leaving all other users unaffected.

Fault injection We will now use Istio to test the resiliency of the Bookinfo application by injecting an artificial delay in requests between the reviews:v2 and ratings services. Observing the resulting behavior as the test user, we will notice that the v2 version of the reviews service has a bug. Note that all other users are unaware of this testing against the live system.

Traffic Shifting Finally, we will use Istio to gradually migrate traffic for all users from to a v3 version of the reviews service, one which includes the fix for the bug discovered in v2.