Skip to content

Instantly share code, notes, and snippets.

@rhemz
rhemz / alpine-public-ip
Created September 2, 2022 02:14
get public IP on alpine when you can't install anything
nslookup -type=txt o-o.myaddr.l.google.com ns1.google.com | grep "text = " | awk '{print $4}' | tr -d '"'
@rhemz
rhemz / k8s-mysqldump-do-spaces.yaml
Last active February 27, 2022 03:06
k8s mysqldump to digitalocean space
# just wrap this in a CronJob.
# this example uses https://github.com/schickling/dockerfiles/tree/master/mysql-backup-s3
# ideally you use a backup image you trust in your own CR
apiVersion: v1
kind: Pod
metadata:
name: mysqldump-to-spaces
namespace: db
spec:
apiVersion: batch/v1
kind: CronJob
metadata:
name: loadbalancer-add-port-forward
spec:
schedule: "*/10 * * * *"
concurrencyPolicy: Forbid
failedJobsHistoryLimit: 1
jobTemplate:
spec:
@rhemz
rhemz / gist:132ac99292a0fbd3a987e3eb756b13f1
Last active March 29, 2024 18:37
Install qbittorrent on Synology NAS
# first, install docker if it's not already w/ Synology Package Center, ensure SSH is enabled.
# it probably installed to /volume1/ but make sure. if it didn't, note the path.
# ssh in as user you want to run docker as and get the id/gid. should be a user that has R/W
# to the download location. don't run this as root (duh)
russ@russ-nas1:/$ id
uid=1026(russ) gid=100(users) groups=100(users),101(administrators)
@rhemz
rhemz / SynergyConfig.sgc
Created October 30, 2021 04:51
synergy config
section: screens
ISILDUR:
halfDuplexCapsLock = false
halfDuplexNumLock = false
halfDuplexScrollLock = false
xtestIsXineramaUnaware = false
switchCorners = none
switchCornerSize = 0
russ-mbp:
# alt = meta
@rhemz
rhemz / pod-from-tarball.yaml
Created October 18, 2021 01:59
no container repo available?
apiVersion: v1
kind: Pod
metadata:
name: pod-from-tarball
spec:
initContainers:
- name: doit
image: docker.io/library/docker:dind
command:
- sh
# Inserts a blank line between shell prompts
add_newline = true
# Replace the "❯" symbol in the prompt with "➜"
[character]
success_symbol = "[➜](bold green)"
# success_symbol = "[λ](bold green)"
[aws]
@rhemz
rhemz / mustMFA.json
Created August 16, 2021 14:24
Require MFA IAM Policy
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"iam:CreateVirtualMFADevice",
"iam:ListVirtualMFADevices",
"iam:DeactivateMFADevice",
"iam:DeleteVirtualMFADevice",
"iam:EnableMFADevice",
@rhemz
rhemz / gist:87b9a8ee53abdd223c19e3460576e6a6
Last active April 26, 2021 01:23
whatsapp desktop linux
cat /usr/share/applications/whatsapp-webapp.desktop
#!/usr/bin/env xdg-open
[Desktop Entry]
Name=WhatsApp
GenericName=WhatsApp
Comment=WhatsApp desktop webapp
#Exec=webapp-container --store-session-cookies --webappUrlPatterns=https?://*.whatsapp.com/* --user-agent-string='Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36' https://web.whatsapp.com %u
Exec=/opt/google/chrome/google-chrome --app=https://web.whatsapp.com/
@rhemz
rhemz / duckdns.yaml
Last active November 14, 2023 06:35
DuckDNS Kubernetes
---
apiVersion: v1
kind: Namespace
metadata:
name: duckdns
---
apiVersion: v1
kind: Secret
metadata:
name: secret-duckdns