Skip to content

Instantly share code, notes, and snippets.

View darth-veitcher's full-sized avatar

James Veitch darth-veitcher

View GitHub Profile
@darth-veitcher
darth-veitcher / Plex.yaml
Last active May 25, 2024 11:31
Plex on Kubernetes
apiVersion: v1
kind: Secret
metadata:
name: plex-claim-token
namespace: media
type: Opaque
data:
token: ${API_TOKEN_OPAQUE}
---
apiVersion: v1
@darth-veitcher
darth-veitcher / public.ip.sh
Created February 17, 2020 21:06
Get public IP address
#!/bin/bash
dig -4 TXT +short o-o.myaddr.l.google.com @ns1.google.com | awk -F'\"' '{ print $2}'
@darth-veitcher
darth-veitcher / stuck-namespace.md
Last active January 15, 2020 22:18
Kubernetes Force Delete a Terminating Namespace
export NS=stucked-namespace
kubectl get namespace $NS -o json \
            | tr -d "\n" | sed "s/\"finalizers\": \[[^]]\+\]/\"finalizers\": []/" \
            | kubectl replace --raw /api/v1/namespaces/$NS/finalize -f -
@darth-veitcher
darth-veitcher / error.md
Created November 5, 2019 15:25
opendatacube error
WARNING: The ODC_ACCESS_KEY variable is not set. Defaulting to a blank string.
WARNING: The ODC_SECRET_KEY variable is not set. Defaulting to a blank string.
2019-11-05 15:24:34,971 INFO Starting the index process
2019-11-05 15:24:34,977 INFO Starting the conversion from ll to pathrow for area: [146.3, 146.83, -43.54, -43.2]
2019-11-05 15:24:35,059 INFO Usion bbox filter: { "type": "Polygon", "coordinates": [ [ [ 146.3, -43.54, 0.0 ], [ 146.3, -43.2, 0.0 ], [ 146.83, -43.2, 0.0 ], [ 146.83, -43.54, 0.0 ], [ 146.3, -43.54, 0.0 ] ] ] }
2019-11-05 15:24:35,170 INFO Found 2 features.
2019-11-05 15:24:35,182 INFO Found 2 pathrows to handle
2019-11-05 15:24:35,182 INFO Loading pathrows
[91, 90]
@darth-veitcher
darth-veitcher / secure-docker.md
Last active June 14, 2021 11:16
Secure (TLS) remote docker daemon

Configure Docker daemon for TLS

For a number of reasons we'll enable access to our docker daemon (can also limit this to just from the VPN subnet by replacing 0.0.0.0 with the subnet address to listen on).

As discussed in the docs the best way to do this is to use a systemd drop-in file. In addition we'll use a CA, server and client keys with OpenSSL.

sudo -s
export HOST=my.domain
mkdir -p /root/.docker && cd /root/.docker
@darth-veitcher
darth-veitcher / .prettierrc.js
Created September 22, 2019 21:05
.prettierrc.js
module.exports = {
bracketSpacing: false,
jsxBracketSameLine: true,
singleQuote: true,
trailingComma: 'all',
};
@darth-veitcher
darth-veitcher / .eslintrc.js
Created September 22, 2019 21:04
.eslintrc.js
module.exports = {
root: true,
extends: '@react-native-community',
};
@darth-veitcher
darth-veitcher / create-expo.sh
Created September 22, 2019 14:01
create expo boilerplate shortcut
# create a react-native project
create_expo(){
npx expo-cli init -t blank --yarn --name "$@" "$@"
cd "$@"
expo-cli install react-navigation react-native-gesture-handler react-native-reanimated react-navigation-stack axios react-native-json-tree
}
@darth-veitcher
darth-veitcher / ejecting-from-expo.md
Created September 16, 2019 21:04
Ejecting from Expo - notes on maintaining ReactNative

Ejecting from Expo

Remember to change app.json to have the iOS bundle and Android package definitions first before ejecting.

expo eject

# select ExpoKit

Now install pods

@darth-veitcher
darth-veitcher / docker-compose.yaml
Created September 9, 2019 13:26
Traefik v2.0 with Cloudflare Wildcard and OpenVPN
version: "3"
services:
traefik:
image: "traefik:v2.0"
container_name: "traefik"
command:
# Globals
- "--log.level=DEBUG"
- "--api=true"