Skip to content

Instantly share code, notes, and snippets.

@waddles
waddles / README.md
Created November 4, 2022 02:06
Nginx reverse proxy to legacy device running TLSv1 server

Nginx reverse proxy to legacy server

Got an old legacy device that you can't upgrade?

Maybe an end-of-life network management card in your UPS or an old out-of-band management card that only supports TLS 1.0?

Modern browsers have deprecated support for older TLS versions so connecting to a server that only supports TLS 1.0 will not work.

@waddles
waddles / update_categories.py
Created August 3, 2020 03:25
Update Nutanix VM's categories (tags)
#!/usr/bin/python3
import requests, os, subprocess, platform, getpass, time
from requests.auth import HTTPBasicAuth
from requests.packages.urllib3.exceptions import InsecureRequestWarning
cluster_address = 'prism-central'
user = ''
passwd = ''
@waddles
waddles / BIND_statistics.ps1
Created June 24, 2020 09:39
PRTG EXE/XML Sensor for monitoring BIND nameserver statistics
[cmdletbinding()]
Param(
[ValidateNotNull()] [string]$NameServer
)
$curStats = New-Object System.Xml.XmlDocument
$curStats.Load( $("http://"+$NameServer+"/xml/v3/server") )
$output = "<prtg>`n"
@waddles
waddles / update_os.yml
Last active July 6, 2020 02:17
Ansible play to expand disk and upgrade Ubuntu
- block:
- name: Upgrade OS to latest LTS release
shell: |
test $(lsb_release -si) = Ubuntu || exit 0
parted /dev/sda unit s print | awk '
/^Disk \// {
total = substr($3,0,length($3)-1)
}
$5 == "extended" {
xpnum = $1
@waddles
waddles / Command line
Created January 22, 2020 00:05
Dtrace output of tracing calls from fuse2fs (part of e2fsprogs) to osxfuse
# dtrace -s macfuse_u_fuse_fs.d -c "fuse2fs /dev/disk2s1 /tmp/mnt -o rw,uid=$(id -u),gid=$(id -g),allow_other,debug -f"
and in another shell:
bash-5.0# cd /tmp/mnt/foo
bash-5.0# ls
bar.txt foo.txt zip.txt
bash-5.0# cat zip.txt
zip
bash-5.0# echo zip > zip.txt
@waddles
waddles / gist:0e121d46c0499eaaef9685eef06120f0
Last active July 25, 2016 07:19
Annoying etcd problem where sometimes fleet can submit a job, other times it fails with a 500 error from etcd
root@elf:~# /usr/local/sbin/etcd --version
etcd Version: 2.3.3
Git SHA: c41345d
Go Version: go1.6.2
Go OS/Arch: linux/amd64
root@tree:~# etcdctl --version
etcdctl version 2.3.3
root@tree:~# fleetctl --version
fleetctl version 0.11.5
@waddles
waddles / kodi.log
Created September 8, 2015 12:16
Nine MSN catchup addon failure
21:49:52 T:1475405976 NOTICE: special://profile/ is mapped to: special://masterprofile/
21:49:52 T:1475405976 NOTICE: -----------------------------------------------------------------------
21:49:52 T:1475405976 NOTICE: Starting Kodi (15.2-RC1 Git:2015-08-28-59716ca). Platform: Android ARM 32-bit
21:49:52 T:1475405976 NOTICE: Using Release Kodi x32 build
21:49:52 T:1475405976 NOTICE: Kodi compiled Aug 28 2015 by GCC 4.8.0 for Android ARM 32-bit API level 17 (API level 17)
21:49:52 T:1475405976 NOTICE: Running on samsung GT-I9305 with Android 4.3.0 API level 18, kernel: Linux ARM 32-bit version 3.0.101
21:49:52 T:1475405976 NOTICE: FFmpeg version: 2.6.4-kodi-2.6.4-Isengard
21:49:52 T:1475405976 NOTICE: Host CPU: ARMv7 Processor rev 0 (v7l), 4 cores available
21:49:52 T:1475405976 NOTICE: Product: m3xx, Device: m3, Board: smdk4x12 - Manufacturer: samsung, Brand: samsung, Model: GT-I9305, Hardware: smdk4x12
21:49:52 T:1475405976 NOTICE: External storage path = /storage/emulated/0; status = ok
@waddles
waddles / fibonacci-closure.go
Created February 12, 2015 03:45
Go Tour Exercise on Closures - a Fibonacci sequence generator - http://tour.golang.org/moretypes/22
package main
import "fmt"
// fibonacci is a function that returns
// a function that returns an int.
func fibonacci() func() int {
seq := []int{0,1}
i := 0
return func() int {
package main
import (
"code.google.com/p/go-tour/wc"
"strings"
)
func WordCount(s string) map[string]int {
m := make(map[string]int)
words := strings.Fields(s)
@waddles
waddles / pic.go
Created February 11, 2015 07:31
Go Tour Exercise on Slices - http://tour.golang.org/moretypes/14
package main
import "code.google.com/p/go-tour/pic"
func Pic(dx, dy int) [][]uint8 {
a := make([][]uint8, dy)
for y := 0; y < dy; y++ {
a[y] = make([]uint8, dx)
for x := 0; x < dx; x++ {
a[y][x] = uint8((x^y) * (x^y))