Skip to content

Instantly share code, notes, and snippets.

Avatar

Russ Sayers russau

View GitHub Profile
@asukakenji
asukakenji / 0-go-os-arch.md
Last active Sep 23, 2021
Go (Golang) GOOS and GOARCH
View 0-go-os-arch.md

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android
@pgjones
pgjones / test_flask_cookie.py
Created Feb 12, 2017
Example of how to use the Flask `test_request_context` with a cookie set
View test_flask_cookie.py
@rondomondo
rondomondo / check_jwt_sig.py
Last active Sep 13, 2021
Two methods/examples of how to decode and verify the signature of AWS cognito JWT web tokens externally. This uses RSA key pair and alternatively PKCS1_v1_5. See https://gist.github.com/rondomondo/efff911f2c41c295e23415e94e12b8d3 for example of signing and verification by downloading an ISSUERS PKI SSL certificate from the signers website, and h…
View check_jwt_sig.py
#!/usr/bin/env python
import os
import time
import json
import base64
import requests
import argparse
from base64 import urlsafe_b64decode, b64decode
from Crypto.Hash import SHA256, SHA512
@sm-azure
sm-azure / application.py
Created Oct 3, 2016
Elastic beanstalk Python logging
View application.py
from flask import Flask, abort, request, jsonify, g, url_for, Response, json
from flask_sqlalchemy import SQLAlchemy
from model.billingmodel import db
from model.billingmodel import User, ManagedAccount, VPNTunnel
from flask_login import LoginManager, login_required, logout_user, login_user, current_user
import logging
from logging.handlers import RotatingFileHandler
import base64
logger = logging.getLogger(__name__)
@magnetikonline
magnetikonline / README.md
Created Jul 7, 2016
Python AWS CloudTrail parser class.
View README.md

Python AWS CloudTrail parser

A Python parser class for CloudTrail event archives, previously dumped to an S3 bucket. Class provides an iterator which will:

  • Scan a given directory for archive files matching the required pattern.
  • Decompress each archive in memory.
  • Parse JSON payload and return each event in turn.

Parser contained in cloudtrailparser.py, with timezone.py used as a simple datetime.tzinfo concrete class implement to provide UTC timezone.

Example

@maxivak
maxivak / _readme.md
Last active Aug 2, 2021
Vagrant with Ubuntu 16.04 in VirtualBox
View _readme.md

Setup Ubuntu 16.04 to be used with Vagrant and Virtualbox

Prepare Vagrant box with Ubuntu 16.04

We will use official box "ubuntu/xenial64" and modify it to work with Vagrant.

  • Vagrantfile
@kurokikaze
kurokikaze / gist:350fe1713591641b3b42
Created Oct 3, 2014
install chrome from powershell
View gist:350fe1713591641b3b42
(new-object System.Net.WebClient).DownloadFile('http://dl.google.com/chrome/install/375.126/chrome_installer.exe', 'c:/temp/chrome.exe');. c:/temp/chrome.exe /silent /install;rm c:/temp -rec
@soarez
soarez / ca.md
Last active Sep 20, 2021
How to setup your own CA with OpenSSL
View ca.md

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active Sep 21, 2021
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!
View whiteboardCleaner.md

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

View simple-https-server.py
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import BaseHTTPServer, SimpleHTTPServer
import ssl