Skip to content

Instantly share code, notes, and snippets.

@Vye
Vye / signed-jwt-in-python.md
Created May 4, 2021 23:00 — forked from jpf/signed-jwt-in-python.md
JWTs signed with RS256 in Python: A demonstration of org-babel

Introduction

This is a guide to using pyjwt to sign and validate a JWT using RS256.

The trickiest part of doing this is knowing what the proper OpenSSL commands are to generate the RSA keypair. I demonstrate that below.

Generating RSA keys

@Vye
Vye / ReadingHelmResources.md
Created October 20, 2020 20:42 — forked from DzeryCZ/ReadingHelmResources.md
Decoding Helm3 resources in secrets

Helm 3 is storing description of it's releases in secrets. You can simply find them via

$ kubectl get secrets
NAME                                                TYPE                                  DATA   AGE
sh.helm.release.v1.wordpress.v1                     helm.sh/release.v1                    1      1h

If you want to get more info about the secret, you can try to describe the secret

$ kubectl describe secret sh.helm.release.v1.wordpress.v1
@Vye
Vye / extended-cleanup-rancher2.sh
Created February 21, 2020 15:46 — forked from superseb/extended-cleanup-rancher2.sh
Extended Rancher 2 cleanup (backup your data, use at your own risk)
#!/bin/sh
# Backup your data
# Use at your own risk
# Usage ./extended-cleanup-rancher2.sh
# Include clearing all iptables: ./extended-cleanup-rancher2.sh flush
docker rm -f $(docker ps -qa)
docker rmi -f $(docker images -q)
docker volume rm $(docker volume ls -q)
for mount in $(mount | grep tmpfs | grep '/var/lib/kubelet' | awk '{ print $3 }') /var/lib/kubelet /var/lib/rancher; do umount $mount; done
cleanupdirs="/etc/ceph /etc/cni /etc/kubernetes /opt/cni /opt/rke /run/secrets/kubernetes.io /run/calico /run/flannel /var/lib/calico /var/lib/etcd /var/lib/cni /var/lib/kubelet /var/lib/rancher/rke/log /var/log/containers /var/log/pods /var/run/calico"
@Vye
Vye / SSLPoke.java
Created December 10, 2019 18:13 — forked from 4ndrej/SSLPoke.java
Test of java SSL / keystore / cert setup. Check the comment #1 for howto.
import javax.net.ssl.SSLParameters;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import java.io.*;
/** Establish a SSL connection to a host and port, writes a byte and
* prints the response. See
* http://confluence.atlassian.com/display/JIRA/Connecting+to+SSL+services
*/
public class SSLPoke {
@Vye
Vye / Dockerfile
Created May 30, 2019 19:11
Consul RPM spec
FROM centos:centos7
USER root
RUN yum install -y vim gcc rpm-build rpm-devel rpmlint make python bash coreutils diffutils patch rpmdevtools
CMD ["/bin/bash"]
@Vye
Vye / notify.py
Last active February 19, 2016 17:15
Hacked PARAM_RECIPIENTS support for CheckMK RAW 1.2.6p16 (NOT FOR PROD)
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
# | | |___| | | | __/ (__| < | | | | . \ |
# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
# | |
# | Copyright Mathias Kettner 2014 [email protected] |
@Vye
Vye / yum.sls
Last active August 29, 2015 14:05
Detect unapproved YUM repos and dynamically create a state (only if they exist) to remove them.
# I was keeping track of typical YUM repos that are not
# permitted on our prod machines (like EPEL, etc.)...
# Then I realized there was a better way. This state will
# find repos that are not approved and generate a state
# to remove them. This works well because if you run
# highstate test=True you can preview the change, but it
# doesn't waste resources (or spew a huge list) constantly verifying
# your ever growing list of repos that shouldn't exist on each state run.
{% set approved_repos = [
@Vye
Vye / 0001-some-temporary-changes-to-build-2014.7-packages.patch
Last active August 29, 2015 14:05
quick and dirty changes to get nightly builds of 2014.7 working
From 7442fd01b4a33cbd3f2ba389feb86493484671aa Mon Sep 17 00:00:00 2001
From: Vye Wilson <[email protected]>
Date: Sat, 20 Sep 2014 14:20:26 -0700
Subject: [PATCH] some temporary changes to build 2014.7 packages
---
pkg/rpm/salt.spec | 16 ++++++++++------
salt/version.py | 1 +
2 files changed, 11 insertions(+), 6 deletions(-)