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 / setup.sh
Last active April 28, 2023 06:12
uTorrent Server (utserver) on Centos 7 (x86_64)
#!/bin/bash
# Took me awhile to figure out how to install utserver on Centos 7 x86_64... Especially with the new systemd subsystem. None of the builds I saw support it - but it will work with a couple symlinks and compatibility packages.
yum install glibc libgcc openssl krb5-libs libcom_err zlib keyutils-libs libselinux glibc glibc.i[36]86 libgcc libgcc.i[36]86 openssl openssl.i[36]86 krb5-libs krb5-libs.i[36]86 libcom_err libcom_err.i[36]86 zlib zlib.i[36]86 keyutils-libs keyutils-libs.i[36]86 libselinux libselinux.i[36]86 openssl098e-0.9.8e-29.el7.centos.2.i686 -y
ln -s /usr/lib/libssl.so.0.9.8e /lib/libssl.so.0.9.8
ln -s /usr/lib/libcrypto.so.0.9.8e /lib/libcrypto.so.0.9.8
mkdir /var/utserver
wget -O /var/utserver/utorrent-server-3.0-25053.tar.gz http://download.utorrent.com/linux/utorrent-server-3.0-25053.tar.gz
cd /var/utserver/
tar zxf utorrent-server-3.0-25053.tar.gz
mv /var/utserver/utorrent-server-v3_0/* /var/utserver/
@integrii
integrii / RaZberry API Command Examples
Last active November 22, 2022 13:03
RaZberry API ZAutomation/ZAPI Examples
# I had a LOT of trouble finding working examples of the ZAutomation API for RaZberry API. I eventually figured out what exactly to use by combining information from multiple sources and sniffing requests from the 'Expert UI'. Some areas I found information:
- http://docs.zwayhomeautomation.apiary.io/
- http://wiki.micasaverde.com/index.php/ZWave_Command_Classes
- https://www.npmjs.org/package/mqtt-zway
- The included PDFs
- The expert API area on the device web UI
- https://chrome.google.com/webstore/detail/postman-interceptor/aicmkgpgakddgnaphhhpliifpcfhicfo?hl=en (Postman POST/GET sniffer)
# Some general RaZberry API commands:
@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();
}
}