Skip to content

Instantly share code, notes, and snippets.

@jflemer
jflemer / install-wine-addon.sh
Created April 8, 2023 15:13
Helper script to install wine-mono and wine-gecko msi files globally (in wine share dir)
#!/bin/bash
# usage: install-wine-addon.sh { mono | gecko }
# keywords: wine-mono wine-gecko msi share/wine/mono share/wine/gecko
go() {
local pkg="$1"
local wineexe=$(readlink /usr/bin/wine)
# e.g. /opt/wine-devel/bin/wine
@jflemer
jflemer / kubectl-copy-remote-config.sh
Created March 3, 2023 15:29
Quick and dirty setup remote access to kubernetes (k8s) cluster with kubectl
#!/bin/bash
# To rapidly setup remote access to a kubernetes cluster, dump the config from
# the master to the local system (e.g. your laptop or workstation)
#
# ssh master kubectl config view --show-managed-fields=true --raw=true | \
# sed "s/127.0.0.1/${CLUSTER}/g" > ~/.kube/config
# Tested against cluster created with k3s version v1.25.6+k3s1 (9176e03c)
#!/bin/sh
# Tested on ubuntu 22.04 w/ wine-stable 7.0.0
v="${1:-7.0.0}"
mkdir -p /opt/wine-stable/share/wine/mono
cd /opt/wine-stable/share/wine/mono
wget -N https://dl.winehq.org/wine/wine-mono/${v}/wine-mono-${v}-x86.tar.xz https://dl.winehq.org/wine/wine-mono/${v}/wine-mono-${v}-x86.msi
@jflemer
jflemer / ocr.sh
Created January 16, 2021 17:30
OCR for pdf/tiff/png/jpg (wrapper for GraphicsMagick and Tesseract OCR)
#!/bin/bash
##############################################################################
# OCR
#
# Usage:
# ocr.sh file.{png,pdf,jpg} ...
#
# Requires:
# * Tesseract
@jflemer
jflemer / run.sh
Last active August 7, 2020 04:41
FCEUX LUA script to automate capture of unique NES ROMs screenshots
#!/bin/sh
rm ~/.fceux/fceux.cfg
for i in *.nes; do
fceux --loadlua screenshot.lua "$i"
mv screen.01.png "$i".png
rm screen.??.png 2>/dev/null
done
@jflemer
jflemer / juniper-srx240h-12.1X46-D71-home-dual-stack.conf
Last active August 23, 2023 20:16
Juniper SRX240H Home/Office IPv6 dual stack (NAT)
## TRUST LAN on ge-0/0/0 (Private IPv4 & ULA IPv6 w/ Internet via NAT)
## GUEST LAN on ge-0/0/1 (Private IPv4 w/ Internet via NAT)
## ISP/INTERNET (Cable Modem) on ge-0/0/15 (Public IPv4 and Public IPv6)
## No IPv6 prefix delegation (PD) since SRX240H will not run JunOS 12.3
version 12.1X46-D71;
system {
host-name srx;
authentication-order password;
@jflemer
jflemer / solarized-color-table.sh
Created October 20, 2012 22:00
Convert solarized PuTTY colors to gnome-terminal colors
#!/bin/sh
# Print solarized color tables
solarized="base03 base02 base01 base00 base0 base1 base2 base3 yellow orange red magenta violet blue cyan green"
base03_xterm=234
base02_xterm=235
base01_xterm=239
base00_xterm=240