Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Micheal Waltz ☁️ ecliptik

🏠
Working from home
View GitHub Profile
@ecliptik
ecliptik / aim_notify.pl
Created Apr 30, 2021
AIM Alerting Perl Script
View aim_notify.pl
#!/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
#######################################################################################################
@ecliptik
ecliptik / docker-compose.yaml
Created Mar 19, 2021
OpenVPN and Transmission in docker-compose
View docker-compose.yaml
version: '3.8'
services:
openvpn:
build:
context: .
dockerfile: Dockerfile.openvpn
cap_add:
- NET_ADMIN
devices:
- "/dev/net/tun"
@ecliptik
ecliptik / phlogmap.sh
Last active Jan 31, 2021
phlogmap.sh
View 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 Jan 31, 2021
md2gopher.sh
View 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 Jan 31, 2021
md2gophermap.sh
View md2gopher.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 / README.md
Last active Jan 27, 2021
statefulset label pattern
View README.md

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 / Dockerfile
Last active Aug 18, 2020
jenv inside Docker container image
View Dockerfile
#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 / kubectl-trick.md
Last active Jun 11, 2019
Useful kubectl commands
View kubectl-trick.md

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

View gist:a998b33cfd1a538d9a4404db23e17e74
Thu Feb 7 22:10:35 PST 2019
OpenBSD/arm64 (puffy.ecliptik.com) (console)
login:
@ecliptik
ecliptik / dockerrun.sh
Created Oct 2, 2018
arm64v8/tomcat image on raspberrypi
View dockerrun.sh
HypriotOS/arm64: pirate@tatl in ~
$ uname -a && docker run -it arm64v8/tomcat
Linux tatl 4.14.37-hypriotos-v8 #1 SMP PREEMPT Sun Apr 29 17:26:16 UTC 2018 aarch64 GNU/Linux
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /docker-java-home/jre
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
02-Oct-2018 21:50:17.270 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.5.34
02-Oct-2018 21:50:17.284 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Sep 4 2018 22:28:22 UTC