Skip to content

Instantly share code, notes, and snippets.

View tdewin's full-sized avatar

tdewin

View GitHub Profile
@tdewin
tdewin / kubernetes.vimrc
Last active July 23, 2024 11:01
VIM shortcuts
"when you use > or < on a V[isual] selected text, shift 2 spaces
set shiftwidth=2
"makes space no tabs
set expandtab
"put 2 spaces for a tab
set tabstop=2
"indicates lines and character location
set ruler
@tdewin
tdewin / Inkscape-to-pptxsvg.sh
Last active July 3, 2024 08:54
Convert Inkscape diagram "cloud*.svg" to a compatible svg for powerpoint. Put lines with connector in a group with id "connectorgroup" to stroke them to path. Converts font to paths to keep size the same (and also share even if the target party does not have the font)
#!/bin/bash
PPTX="pptxcompat"
PNGP="pngout"
# stamps so we dont process unmodified files over and over again
VERTRACK="vertrack"
mkdir -p $VERTRACK
mkdir -p $PPTX
SITEA: [
down
VA: box rad 10px "Veeam Agent" "100TB" color White fill 0x00d15f;move 0.1
VM: box rad 10px "VM vSphere" "100TB";move 0.1
ORA: box rad 10px "Oracle RMAN" "Plugin" "100TB" color White fill 0x00d15f;
PROXY: box rad 10px "Veeam Proxy" "100TB" at 1 right of VM color White fill 0x00d15f
REPO: cylinder rad 10px "Repo A" at 2 right of VA color White fill 0x00d15f
arrow from VA.e to REPO.w
@tdewin
tdewin / myaddr-google-dig.tf
Created April 18, 2024 08:20
myaddr-google-dig.tf
# you can use external.myaddr.result.myip
data "external" "myaddr" {
program = ["bash", "-c", "echo \"{\\\"myip\\\": $(dig -4 TXT o-o.myaddr.l.google.com @ns1.google.com +short) }\""]
}
@tdewin
tdewin / 7daysahead.sh
Created March 31, 2024 13:46
7daysahead.sh
echo $(date -r $(($(date +%s)+(3600*24*7))) '+%Y-%m-%d')
@tdewin
tdewin / veeam-cve-list.sh
Last active March 28, 2024 10:17
veeam-cve-list.sh
#!/bin/bash
curl -s -o sec.json 'https://www.veeam.com/services/kb-articles?product=&version=&type=security&fromModificationDate=&toModificationDate=&search=&offset=0&limit=10000'
jq '[.articles[] | {id:.id,title:.title,date:.date}] | sort_by(.date) | reverse' sec.json
@tdewin
tdewin / experimental-migrate-vsphere-proxmox.sh
Last active March 14, 2024 22:24
Experimental migration tool from vSphere to Proxmox using Veeam Instant VM Recovery
# MIT LICENSE
# EXPERIMENTAL RUN STEP BY STEP AND MAKE SURE YOU UNDERSTAND WHAT YOU ARE DOING
# EXPERIMENTAL RUN STEP BY STEP AND MAKE SURE YOU UNDERSTAND WHAT YOU ARE DOING
# EXPERIMENTAL RUN STEP BY STEP AND MAKE SURE YOU UNDERSTAND WHAT YOU ARE DOING
# EXPERIMENTAL RUN STEP BY STEP AND MAKE SURE YOU UNDERSTAND WHAT YOU ARE DOING
# EXPERIMENTAL RUN STEP BY STEP AND MAKE SURE YOU UNDERSTAND WHAT YOU ARE DOING
# By default vPowerNFS does not allow mounting by any host. You need to disable the vPowerNFS IP filter to do so
# https://www.veeam.com/kb1055 -> point 7
# Key Location: HKLM\SOFTWARE\WOW6432Node\Veeam\Veeam NFS\
@tdewin
tdewin / minimalem.xml
Last active March 6, 2024 10:34
Minimal silent install files
<?xml version="1.0" encoding="utf-8"?>
<unattendedInstallationConfiguration bundle="Em" mode="install" version="1.0">
<properties>
<property name="ACCEPT_EULA" value="1" />
<property name="ACCEPT_LICENSING_POLICY" value="1" />
<property name="ACCEPT_THIRDPARTY_LICENSES" value="1" />
<property name="ACCEPT_REQUIRED_SOFTWARE" value="1" />
<property name="VBREM_LICENSE_AUTOUPDATE" value="0" />
@tdewin
tdewin / govc-ubuntu-install.md
Created November 3, 2021 10:35
Install ubuntu via GOVC in a almost automated way

Automated install

You want to have a fresh copy instead of a template clone? Here you go

Set some variables

set GOVC_INSECURE=true
set GOVC_URL=login@vcenter.fqdn
set GOVC_PASSWORD=youguess
set GOVC_DATASTORE=mydatastore
@tdewin
tdewin / statserver.go
Last active January 5, 2024 14:20
very simple static file server for transporting big files easily
package main
import (
"encoding/json"
"sync"
"crypto/rand"
"crypto/tls"
"flag"
"fmt"
"io/ioutil"