Skip to content

Instantly share code, notes, and snippets.

View anax32's full-sized avatar

ed grundy anax32

  • cardiff, wales, uk
View GitHub Profile
@anax32
anax32 / Dockerfile
Created March 9, 2021 23:52
Kubernetes deployment from inside a running pod
from python:3-slim
run pip install kubernetes
copy create-deployment.py /src/
copy nginx-deployment.yaml /src/
workdir /src
cmd python create-deployment.py
@anax32
anax32 / brute.py
Created January 22, 2021 01:09
Example brute force attack against SHA key
"""
Attempt brute force attack against an SHA256 encrypted value
The length of the key can be chosen as script parameter and
demonstrates how key length is crucial to security of the key.
run the script with a 6 bit private key:
> python brute.py 6
compare with a 12 bit private key:
@anax32
anax32 / monthly-archive.sh
Last active November 7, 2020 01:19
archive a directory of large files into tars grouped by month
#/bin/bash -u
#
# take a dir with a bunch of files
# and archive into a collection of tar.gz grouped by month
#
# i.e. get all your phone photos into
# a dir, run this script to create monthly
# tarballs and upload to S3
#
@anax32
anax32 / azure-devops-rest-api.py
Created October 8, 2020 08:13
Attempt to use the Azure Devops REST API to re-trigger a release.
"""
list and trigger releases from azure devops
API:
https://docs.microsoft.com/en-us/rest/api/azure/devops/?view=azure-devops-rest-6.0
https://docs.microsoft.com/en-us/rest/api/azure/devops/release/releases/create?view=azure-devops-rest-6.0
pypi:
https://github.com/microsoft/azure-devops-python-api
#!/bin/bash -u
#
# create a GKE cluster with
# + a windows node pool,
# + a linux node pool, and
# + a gpu node pool
#
CLUSTER_NAME="mixed-os-cluster"
@anax32
anax32 / cuda_kernel_rt.cpp
Last active October 4, 2017 11:54
CUDA kernal compile at runtime
#include <cuda.h>
#include <cuda_runtime_api.h>
#include <nvrtc.h>
#include <vector>
#include <iostream>
#include <iterator>
// simple kernel to compile and run
const char *cuda_kernel = " \n\