Skip to content

Instantly share code, notes, and snippets.

View tdewin's full-sized avatar

tdewin

View GitHub Profile
@tdewin
tdewin / k10satoken.sh
Last active March 20, 2023 08:06
for vbr integration
#!/bin/sh
kubectl apply --namespace kasten-io -f - <<EOF
apiVersion: v1
kind: ServiceAccount
metadata:
name: vbr
namespace: kasten-io
secrets:
- name: vbr-secret
EOF
@tdewin
tdewin / minimal-vbr12-demo-install.ps1
Last active December 31, 2025 05:29
Minimal Veeam B&R 12 install + kasten plugin with local postgress; ready for lab usage only. For prod, make sure to have more secure password, better split up components as described in helpcenter
$drives = (Get-PSDrive -PSProvider FileSystem).Root
$isodrive = @($drives | ? { $_ -ne "${env:SystemDrive}\" })[0]
$links = @{
"pg"="Redistr\x64\PostgreSQL\15.1-1\postgresql-15.1-1-windows-x64.exe";
"catalog"="Catalog\VeeamBackupCatalog64.msi";
"sqlclr"="Redistr\x64\SQLSysClrTypes.msi";
"report"="Redistr\ReportViewer.msi";
"vbr"="Backup\Server.x64.msi";
@tdewin
tdewin / downloadgistscript.ps1
Last active March 17, 2023 10:36
Download a gist script in
$workdir = "c:\workdir"
$gistid = "38c41c34bda1c9faca86c8934775c164"
$gist = Invoke-RestMethod -Uri ("https://api.github.com/gists/{0}" -f $gistid)
$fname = @($gist.files | gm -MemberType NoteProperty)[0].Name
$gist.files."$fname".content | set-content (join-path $workdir $fname)
@tdewin
tdewin / downloadsgist.sh
Created March 17, 2023 14:04
curl jq download of gists
DL=$(curl "https://api.github.com/gists/766e78e248acd7308ce9e34ad490dd14")
FNAME=$(echo $DL | jq -r '[.files[] | .filename] | .[0]')
echo $DL | jq -r ".files[\"$FNAME\"].content"
@tdewin
tdewin / user-data.sh
Last active May 24, 2023 06:49
user data that downloads and install a script autoinstall.sh from a gist
cat <<EOF > user-data-gist.sh
#!/bin/sh
apt-get update -y
apt-get upgrade -y
DEBIAN_FRONTEND=noninteractive apt-get install jq -y
touch /tmp/didupgrade.txt
curl -o /tmp/gist https://api.github.com/gists/d6d158d9ade14bedb270199aa173a105
jq -r '.files."autoinstall.sh".content' /tmp/gist > /tmp/autoinstall.sh
@tdewin
tdewin / cleanup-aws.sh
Last active May 24, 2023 10:47
aws clean up script based on some tag val, eg key:owner,name:timothy => TAGVAL=timothy
#!/bin/sh
TAGVAL="somecommontag"
REGION="us-west-1"
RESTYPE="instances"
RES=$(aws --region=$REGION ec2 "describe-$RESTYPE" --filters "Name=tag-value,Values=$TAGVAL")
FILTEREDLIST=$(echo $RES | jq -r '[.Reservations[].Instances[] | {id:.InstanceId,name:(.Tags[] | select(.Key | contains("Name")).Value)}]')
L=$(echo $FILTEREDLIST| jq length)
for ((j=0;j<$L;j++)); do
@tdewin
tdewin / uitext.ps1
Created June 9, 2023 08:39
vbr ui text
$dw = [Microsoft.Win32.RegistryValueKind]::DWord
$str = [Microsoft.Win32.RegistryValueKind]::String
function Set-VBRReg {
param($n,$v,$p)
$regpath = 'HKLM:\SOFTWARE\Veeam\Veeam Backup and Replication'
New-ItemProperty $regpath -name $n -Value $v -PropertyType $p -Force | Out-Null
}
Set-VBRReg -n "UIClassifiedMode" -v 1 -p $dw
Set-VBRReg -n "UIClassifiedStripeBackgroundColor" -v "#005f4b" -p $str
@tdewin
tdewin / fakefull.sh
Created June 29, 2023 16:12
fakefull-1gb.sh
dd if=/dev/urandom of=activefull.vbk bs=1G count=1
@tdewin
tdewin / getgist.dart
Last active August 9, 2023 09:49
Get a github gist with dart (flutter)
import 'dart:convert';
import 'package:http/http.dart' as http;
class GistFile {
String name;
String rawurl;
String _content = "";
bool truncated;
@tdewin
tdewin / 0001-Vehicles.yaml
Last active August 9, 2023 10:07
Basic Russian Words
---
meta:
name: Russian - English Vehicles
description: List of vehicles in Russian English flash deck
license: MIT
author: "@tdewin"
data:
cards:
- q: машина
t: