Skip to content

Instantly share code, notes, and snippets.

View integrii's full-sized avatar
🇺🇸
Remember that LED stop lights failed because they didn't melt snow.

Eric Greer integrii

🇺🇸
Remember that LED stop lights failed because they didn't melt snow.
View GitHub Profile
@integrii
integrii / paperless.yaml
Last active November 14, 2023 05:37
Kubernetes specs to bootstrap paperless-ngx including dependent services.
# Once you apply this and your containers come online, you need to exec into the web service and run `./manage.py createsuperuser`.
# Change the postgresql password in this spec.
# This spec assumes you want NodePort services and not LoadBalnancer services.
# This spec assumes that you want to mount all your volumes under a hostPath of /data/paperless.
# This spec assumes that you want all pods on a node called k8s-worker5.
apiVersion: v1
kind: Namespace
metadata:
name: paperless
@integrii
integrii / restic-backup-cronjob-synapse.yaml
Last active May 18, 2022 04:05
Backup host directory with Kubernetes cronjob to rysnc.net with rustic
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: restic-backup-synapse
namespace: synapse
spec:
schedule: "0 4 * * *"
concurrencyPolicy: Forbid
successfulJobsHistoryLimit: 3
failedJobsHistoryLimit: 3
@integrii
integrii / REDME.md
Last active February 4, 2022 08:04
Run Oregon Trail Deluxe with DOSbox on MacOS

(Find and download Oregon Trail Deluxe into a ~/Games directory)

brew install dosbox
dosbox
mount c ~/Games
c:
cd Games
@integrii
integrii / go.mod
Created July 21, 2020 18:52
Kubernetes Go Module Pinning
module example.com/mymodule
require (
k8s.io/api v0.18.2
k8s.io/apimachinery v0.18.2
k8s.io/client-go v0.18.2
)
@integrii
integrii / http.go
Last active February 13, 2020 17:53
Custom Go HTTP client with custom transport and dialer example
&http.Client{
Transport: &http.Transport{
TLSClientConfig: &tlsConfig,
Proxy: http.ProxyFromEnvironment,
Dial: (&net.Dialer{
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
}).Dial,
TLSHandshakeTimeout: 10 * time.Second,
ExpectContinueTimeout: 1 * time.Second,
# Include a clusterrole for the kube-controllers component,
# and bind it to the calico-kube-controllers serviceaccount.
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: calico-kube-controllers
rules:
# Pods are monitored for changing labels.
# The node controller monitors Kubernetes nodes.
# Namespace and serviceaccount labels are used for policy.
@integrii
integrii / instructions
Last active November 8, 2018 04:52
Create a Google Image Host Secret
You can create the file with the following script. The script creates the necessary Google Cloud Platform (GCP) service account and gives it access to the registry.
# create a GCP service account; format of account is email address
SA_EMAIL=$(gcloud iam service-accounts --format='value(email)' create k8s-gcr-auth-ro)
# create the json key file and associate it with the service account
gcloud iam service-accounts keys create k8s-gcr-auth-ro.json --iam-account=$SA_EMAIL
# get the project id
PROJECT=$(gcloud config list core/project --format='value(core.project)')
# add the IAM policy binding for the defined project and service account
gcloud projects add-iam-policy-binding $PROJECT --member serviceAccount:$SA_EMAIL --role roles/storage.objectViewer
@integrii
integrii / sleep.js
Created September 23, 2017 22:58
Sleep in javascript
// https://stackoverflow.com/questions/14226803/javascript-wait-5-seconds-before-executing-next-line
function wait(ms){
var start = new Date().getTime();
var end = start;
while(end < start + ms) {
end = new Date().getTime();
}
}
@integrii
integrii / 2mtcp.sh
Created July 17, 2016 09:00
This systemctl chain can take the TCP stack up to 2M connections.
sysctl -w fs.file-max=12000500
sysctl -w fs.nr_open=20000500
ulimit -n 20000000
sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000'
sysctl -w net.ipv4.tcp_rmem='1024 4096 16384'
sysctl -w net.ipv4.tcp_wmem='1024 4096 16384'
sysctl -w net.core.rmem_max=16384
sysctl -w net.core.wmem_max=16384

Keybase proof

I hereby claim:

  • I am integrii on github.
  • I am eg (https://keybase.io/eg) on keybase.
  • I have a public key whose fingerprint is CFE7 48DD D2EC AEEF 828A 98B6 353C 6078 36AA 0511

To claim this, I am signing this object: