Skip to content

Instantly share code, notes, and snippets.

View jessegoodier's full-sized avatar

Jesse Goodier jessegoodier

View GitHub Profile
@jessegoodier
jessegoodier / grafana-app-dashboard.json
Last active April 15, 2024 14:05
Grafana dashboard for visualizing the most common resource concerns
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
@jessegoodier
jessegoodier / proxy-logger.yaml
Last active April 28, 2024 15:11
Kubernetes proxy-logger using nginx to log requests to a json file
# This proxy can help you understand what requests a container is making.
# You'll need to point that container to this and this to what ever the container really wanted to make the request to.
# Alternatives to this are to use a system proxy/service mesh (istio)
# kubectl logs deployments/proxy-logger --tail -1|grep {|jq -r .request_query
# a use vscode extension to decode querystrings: https://marketplace.visualstudio.com/items?itemName=sryze.uridecode
# to use that, pipe the output to a file and then use that extension to decode uri as URI Component
---
apiVersion: apps/v1
kind: Deployment
metadata:
@jessegoodier
jessegoodier / hourly-helm-upgrade-cronjob.yaml
Created August 27, 2023 16:48
Kubernetes cronjob to run helm upgrade
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: update-nightly-helm-sa
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: cluster-admin-binding
server {
listen 443 ssl http2;
server_name rainmachine.xyz;
ssl_certificate /etc/nginx/fullchain1.pem;
ssl_certificate_key /etc/nginx/privkey1.pem;
location / {
@jessegoodier
jessegoodier / aliases.ps1
Last active March 4, 2022 16:01
powershell_profile
Set-Alias -Name h -Value ALLHISTORY
Set-Alias -Name history -Value ALLHISTORY
Set-Alias -name which where.exe
Set-Alias -name curl -value http.exe # pip install httpie or choco install httpie
Set-Alias -Name ll -Value Get-ChildItem
@jessegoodier
jessegoodier / nginx-echo-deployment.yaml
Created September 22, 2021 21:32
non-root nginx container that will echo uri and host header
apiVersion: v1
kind: Namespace
metadata:
name: demo-app1
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: demo-app1
namespace: demo-app1
@jessegoodier
jessegoodier / vcsa.conf
Created July 16, 2021 11:01
vmware vcsa 6.7 nginx basic config (fix for HTTP Status 400 – Bad Request)
server {
# server_name your.host.lan # use this if not the only proxy for 443
listen 443 ssl http2 default_server; # the default_server may break other servers listening on 443, and there can only be one.
ssl_certificate /etc/ssl/letsencrypt/fullchain.pem;
ssl_certificate_key /etc/ssl/letsencrypt/privkey.pem;
location / {
proxy_pass https://xxx; #IP or fqdn
proxy_set_header Host $http_host; # the magic
@jessegoodier
jessegoodier / install-nextcloud-snap-zfs-dedupe-compression
Last active September 30, 2022 16:49
Steps to install nextcloud on ubuntu using snap and moving the data to a new disk using zfs compression and deduplication
# sample code, use at your own risk
# script to install zfs, nextcloud using snap and moving the data to the new volume with compression and deduplication enabled.
# Do your own research as to pros and cons of zfs dedupe and compression.
# Short advice is that compression works well unless you're mostly storing compressed file formats like media.
# install and configure zfs, assuming 2nd disk is where you want your data stored.
sudo apt install zfsutils-linux
sudo zpool create nextcloud /dev/sdb
sudo zfs create nextcloud/data
sudo zfs set compression=lzjb nextcloud/data