Skip to content

Instantly share code, notes, and snippets.

View snobu's full-sized avatar

Adrian Calinescu snobu

View GitHub Profile
@snobu
snobu / app_manifest.json
Created April 28, 2019 16:58
MT3620 with SSD1306 OLED via i2c
{
"SchemaVersion": 1,
"Name" : "SeeedOLED_I2C",
"ComponentId" : "4595840c-94e8-48ea-9bd2-1b8167015973",
"EntryPoint": "/bin/app",
"CmdArgs": [],
"Capabilities": {
"AllowedConnections": [],
"AllowedTcpServerPorts": [],
"AllowedUdpServerPorts": [],
@snobu
snobu / gist:2d3d3b6f1ff2a36663c8dc6be697a647
Created March 14, 2019 13:21
Patch for prometheus-operator with Helm chart
# Error: release prometheus-operator failed: customresourcedefinitions.apiextensions.k8s.io
# "alertmanagers.monitoring.coreos.com" already exists
# https://github.com/coreos/prometheus-operator/issues/2229
kubectl delete crd prometheusrules.monitoring.coreos.com
kubectl delete crd servicemonitors.monitoring.coreos.com
kubectl delete crd alertmanagers.monitoring.coreos.com
@snobu
snobu / cleanup-k8s-terminating-namespace.sh
Last active May 10, 2021 11:33
cleanup-k8s-terminating-namespace.sh
#!/bin/bash
# Usage ./cleanup-k8s-terminating-namespace.sh <namespace>
NAMESPACE=$1
echo Cleaning up namespace $1
kubectl proxy &
kubectl get namespace $NAMESPACE -o json |jq '.spec = {"finalizers":[]}' > /tmp/temp.json
@snobu
snobu / gist:141cfb6f9bf9d3c46947325e2a6933af
Created March 13, 2019 08:53
Helm cleanup failed releases
helm ls | grep FAILED | awk '{print $1}' | xargs helm delete --purge --debug
$ openssl s_time -connect amisecure.azurewebsites.net:443 -www / -cipher 'RSA' -new
Collecting connection statistics for 30 seconds
*****************************************************************************************************************************
125 connections in 0.29s; 431.03 connections/user sec, bytes read 366875
125 connections in 31 real seconds, 2935 bytes read per connection
@snobu
snobu / Cargo.toml
Created February 26, 2019 11:46
Rust Iron minimal API
[package]
name = "iron"
version = "0.1.0"
authors = ["snobu <foo@snobu.org>"]
edition = "2018"
[dependencies]
iron = "*"
rustc-serialize = "*"
chrono = "*"
@snobu
snobu / code.fish
Created February 26, 2019 09:44
code.fish
# Launch VS Code with 'code' or 'code <path>' from Fish Shell
function code
set location "$PWD/$argv"
open -n -b "com.microsoft.VSCode" --args $location
end
@snobu
snobu / validation_parameters.md
Last active January 8, 2019 15:31
Default .AddJwtBearer TokenValidationParameters (.NET Core 2.2)
// .NET Core 2.2

  .AddJwtBearer(options =>
    {
        var vp = options.TokenValidationParameters;

vp is:

@snobu
snobu / notes.md
Last active December 19, 2018 21:20
OpenID Connect notes
@snobu
snobu / acquire_cognitive_services_bearer_token.py
Created November 27, 2018 14:11
acquire_cognitive_services_bearer_token.py
import requests
import base64
SUBSCRIPTION_KEY = ''
ISSUE_TOKEN_URL = ''
def get_bearer(SUBSCRIPTION_KEY, ISSUE_TOKEN_URL):
headers = {
'Ocp-Apim-Subscription-Key': SUBSCRIPTION_KEY,
}