Skip to content

Instantly share code, notes, and snippets.

View gradle-linting.md

Gradle Linting Plugins

Gradle Dependency Linting

Install

Add the following to the plugins section of build.gradle

id 'nebula.lint' version '16.17.0'

Add the following for gradle dependency linting

@kjivan
kjivan / create-self-signed-cert-and-pkcs12.bash
Last active Jul 2, 2021
Creates Self Signed Cert and PKCS12
View create-self-signed-cert-and-pkcs12.bash
#!/usr/bin/env bash
set -euo pipefail
if [ $# -ne 3 ]
then
echo ""${0##*/}" CN OU FILE_NAME"
exit
fi
# Certificate Attributes
View splunk-queries.md

Splunk Queries

Getting Errors

index=<index>
AND sourcetype="fluentd"
AND kubernetes.namespace_name="<k8-namespace>"
AND kubernetes.pod_name="<pod-prefix>*"
AND CASE("ERROR")
@kjivan
kjivan / kubectl-reference.md
Last active Apr 2, 2021
Kubectl Reference
View kubectl-reference.md

Extract Truststore from secret

kubectl get secret <secret> \
-o json \
| jq --raw-output '. | .data."<trust-store>.jks"' \
| base64 -D > <trust-store>.jks

Patch Secret with TrustStore

Bash

@kjivan
kjivan / shell-prompt-customization.md
Last active Mar 29, 2021
Shell Prompt Customization
View shell-prompt-customization.md
@kjivan
kjivan / openssl-reference.md
Last active May 16, 2021
OpenSSL Reference
View openssl-reference.md

OpenSSL Reference

Cert Info

Get Sites SSL Info

echo | openssl s_client -showcerts -connect jivan.cc:443

Get Certificate From Site

@kjivan
kjivan / add-prod-banner.js
Last active Jan 30, 2021
Adds a banner to help indicate prod environment
View add-prod-banner.js
var d = document.createElement("div");
d.style.position = "sticky";
d.style.top = "0px";
d.style.zIndex = "16777271";
d.style.width = "100%";
d.style.height = "30px";
d.style.padding = "2px";
d.style.fontSize = "20px";
d.style.backgroundColor = "red";
d.style.color = "black";
@kjivan
kjivan / java-keytool-reference.md
Last active May 6, 2021
Java Key Tool Reference
View java-keytool-reference.md

Java Key Tool Reference

Most Useful Commands

List Key Store Certs

keytool -list \
-keystore example.p12
@kjivan
kjivan / create-self-signed-cert
Created Dec 14, 2020
Create self-signed cert and p12 private cert
View create-self-signed-cert
#!/usr/bin/env bash
set -e
# https://stackoverflow.com/a/41366949
openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes \
-keyout example.key -out example.crt -extensions san -config \
<(echo "[req]";
echo distinguished_name=req;
echo "[san]";
echo subjectAltName=DNS:example.com,DNS:www.example.net,IP:10.0.0.1