Skip to content

Instantly share code, notes, and snippets.

@svanellewee
svanellewee / blind-sql-injection.sh
Last active June 15, 2021 20:37
Blind SQL Injection!
#!/usr/bin/env bash
# Copy the GET request, and insert the blind SQL in the TrackingId value...
# Then add a changing variable in the query
alpha=( {a..z} {A..Z} {0..9} \( \) % $ @ \& \# \* \& ^ \~ + _ / )
results=()
for index in {1..100}
do
@svanellewee
svanellewee / pipelines.go
Last active March 22, 2021 20:58
Go pipelines think
package main
import (
"fmt"
"sync"
"time"
)
func gen(vals ...int) <-chan int {
out := make(chan int)
@svanellewee
svanellewee / csr.conf
Created February 1, 2021 07:56
TLS on ingress-nginx for great justice.
# OpenSSL needs this.
# ingress-nginx needs the SANS info (CN only seems to be deprecated for this purpose)
# HOWEVER, when I create a CSR with all my SANS info and then self-sign it with my CA
# the new cert doesnt' have the SAN info I specified!
# This config seems to help
# Based on this https://kubernetes.io/docs/concepts/cluster-administration/certificates/
# updated my hosts file to make the hosts file whatever the loadbalancer field in the ingress said it was.
[ req ]
default_bits = 2048
prompt = no
@svanellewee
svanellewee / Dockerfile
Last active October 11, 2023 14:04
How to make a kubernetes cups server on a raspberry pi 3 using k3s.
# stole this basically from `https://github.com/lemariva/wifi-cups-server`
# creates a docker image `cups:stephan2`
FROM debian:buster
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"
RUN apt-get update && apt-get install -y \
@svanellewee
svanellewee / bleve-main.go
Created November 17, 2020 19:46
Bleve Bible
package main
import (
"bufio"
"encoding/json"
"fmt"
"os"
"github.com/blevesearch/bleve"
"github.com/sirupsen/logrus"
@svanellewee
svanellewee / another_test.go
Last active November 14, 2020 20:40
BoltDB/BBolt test code
package main_test
import (
"bytes"
"encoding/binary"
"fmt"
"os"
"testing"
"time"
@svanellewee
svanellewee / Vagrantfile
Last active November 9, 2020 19:09
kubernetes etcd backup and restoring...
Vagrant.configure("2") do |config|
#config.vm.provider "virtualbox" do |vb|
# vb.memory="512"
#end
config.vm.box_check_update = false;
# Provision Load Balancer Node
config.vm.define "loadbalancer" do |node|
@svanellewee
svanellewee / pki-notes.org
Last active June 19, 2020 06:50
PKI unittests copied from tutorial from the Blog post here https://ericchiang.github.io/post/go-tls/ Thanks Eric!

Making a CSR

You provide a Certificate Signing Request (CSR) by providing all the details that makes you a special little snowflake. You also provide your own public key as part of the package CSR.

In order to prove you’re one in a million though you also need to do something to the doc that only YOU can do.

That would be signing it digitially with YOUR private key:

  • Take cert request info bytes and hash it.
@svanellewee
svanellewee / orthis.sh
Last active February 12, 2020 11:54
WHen Tiller Complains about "kube-system:tiller" serviceaccount not being able to list "configmaps"
kubectl --namespace kube-system create serviceaccount tiller
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
helm init --service-account tiller --upgrade
https://devops.stackexchange.com/questions/8047/helm-cannot-get-resource-namespaces-in-api-group
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1