Skip to content

Instantly share code, notes, and snippets.

View ecliptik's full-sized avatar
🏠
Working from home

Micheal Waltz ☁️ ecliptik

🏠
Working from home
View GitHub Profile
Thu Feb 7 22:10:35 PST 2019
OpenBSD/arm64 (puffy.ecliptik.com) (console)
login:
@ecliptik
ecliptik / kubectl-trick.md
Last active June 11, 2019 17:57
Useful kubectl commands

kubectl tricks

Operations

Run a on-off debian container with interactive shell and remove on exit

kubectl run --generator=run-pod/v1 --image=debian debian --rm -i --tty -- /bin/bash

Forward a service port locally

@ecliptik
ecliptik / Dockerfile
Last active August 18, 2020 00:10
jenv inside Docker container image
#Build and run with a specific version of java within the build image
#eg Java 11: docker build --build-arg JAVA_VERSION=11 -t jenv .
#eg Java 8: docker build --build-arg JAVA_VERSION=1.8 -t jenv .
FROM debian:buster
RUN apt update && apt install -y ca-certificates wget
RUN wget -O- https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.8%2B10/OpenJDK11U-jdk_x64_linux_hotspot_11.0.8_10.tar.gz | tar -xz -C /opt/
RUN wget -O- https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u265-b01/OpenJDK8U-jdk_x64_linux_hotspot_8u265b01.tar.gz | tar -xz -C /opt/
@ecliptik
ecliptik / README.md
Last active January 27, 2021 20:02
statefulset label pattern

Tenant IPs

  • tenant IPs are stored in ips.txt
  • These are used to create the number of services and the number of replicas for a statefulset (1 tenantip = 1 pod)

Create Services

  • Running ./update-service.sh a for the first time will create the services
  • The files ips.txt contains the list of clusterIPs to set, which also creates a label and selector
  • Passing an a or b will update the selector to use the pods in group a or b
@ecliptik
ecliptik / phlogmap.sh
Last active January 31, 2021 21:37
phlogmap.sh
#!/bin/bash
#Create gophermap of last 10 posts
#Originally from: https://johngodlee.github.io/2019/11/20/gopher.html
#Use layout file for header on gophermap
cat _layouts/phlog > gophermap
all=(_posts/*.txt)
@ecliptik
ecliptik / md2gopher.sh
Last active January 31, 2021 21:37
md2gopher.sh
#!/bin/bash
#Convert a jekyll markdown post to plaintext suitable for gopher,
#converted to 70 columns
#usage: ./md2gopher.sh ../_posts/post-to-convert.md
#Take input and craft output file and directory vars for use later on
input=$1
outdir="_posts"
output="${outdir}/`basename -s .md ${input}`.txt"
@ecliptik
ecliptik / md2gopher.sh
Last active January 31, 2021 21:38
md2gophermap.sh
#!/bin/bash
#Convert a jekyll markdown post to a gophermap
#Will create a sub-directory with the name of the post and a gophermap
#converted to 70 columns with links. Tries to do basic http or gopher
#linking. May not work well, but works well enough.
# usage: ./md2gophermap.sh ../_posts/post-to-convert.md
#Know Bugs
#Pandoc does not wrap code blocks to the columns length and will get cut
@ecliptik
ecliptik / docker-compose.yaml
Created March 19, 2021 06:22
OpenVPN and Transmission in docker-compose
version: '3.8'
services:
openvpn:
build:
context: .
dockerfile: Dockerfile.openvpn
cap_add:
- NET_ADMIN
devices:
- "/dev/net/tun"
@ecliptik
ecliptik / aim_notify.pl
Created April 30, 2021 00:26
AIM Alerting Perl Script
#!/usr/local/bin/perl -w
#######################################################################################################
#Name: aim_notify.pl
#Date: 02/21/2006 - mwaltz@ucsd.edu
#Purpose: Send an instant message over AOL to a list of screen names and then sign off.
#Usage: aim_notify.pl "message you want to send"
#Description: This script is for admins who want a server to alert them via AOL IM. A screen name can have message forwarded to a mobile phone number, making it a pager like application.
#Requires: NET::Oscar - http://search.cpan.org/~matthewg/Net-OSCAR-1.925/lib/Net/OSCAR.pm
#######################################################################################################