Skip to content

Instantly share code, notes, and snippets.

View Kapott's full-sized avatar
🏠
Working from home

kapott Kapott

🏠
Working from home
View GitHub Profile
@Kapott
Kapott / proxmox-pve7.3-quirks.md
Created January 10, 2023 14:28
Install proxmox on system with Ryzen & Nvidia 3070

Make sure you're not using Ventoy. This sometimes prohibits accessing grub options in the proxmox installer. (7.3)

  • Boot into the 'install proxmox' screen.
  • Highlight 'install proxmox' and press 'e' to edit the boot options
  • On line #4 (the line starting with 'linux', which has 'quiet' in it), add 'nomodeset' at the end
  • F10 - save and exit
  • Proxmox installer will continue to boot, and then fail because of some framebuffer error
  • Ctrl-Alt-F1 to get root terminal
  • nano /usr/share/X11/xorg.conf.d/10-quirks.conf and add:
# When exporting data from ABN Amro, they use their own MT940 format, incompatible with things like GnuCash.
# This shellscript takes in a file, and exports it with the suffix "_fixed"
#!/usr/bin/env bash
if test -e "$1"; then
grep -vE '^ABNANL2A\s$|^940\s$' "${1}" > "${1/\.STA/_fixed\.STA}"
echo "Written: ${1/\.STA/_fixed\.STA}"
else
echo "Usage: $0 <filename>"
@Kapott
Kapott / ngram_scanner.js
Created January 11, 2021 13:05
Scans text for bigram, trigram...ngram frequency
const Tuple = (k, v) => ({
key: k,
val: v
})
const Ngram = n =>
({
n,
analyze: txt => {
const cleanText = txt.toLowerCase().replace(/[^0-9a-z]/gi,"")
@Kapott
Kapott / delete-orphaned-snapshots.sh
Created February 13, 2020 15:28
Delete snapshots of images, when the image is no longer available.
#!/bin/sh
# remove x if you don't want to see the commands
set -e
# Some variable initialisation with sane defaults
DRUN='--dry-run'
DO_DELETE=${1:-'no'}
REGION=${2:-'eu-west-1'}
ACCOUNTID=${3:-'self'}
@Kapott
Kapott / getDeep.js
Last active July 19, 2019 09:40
Get deeply nested object properties, ES5 compatible - good replacement for LoDash' .get()
/**
* getDeep(object, pathString, defaultValue)
*
* Tries to find the pathString inside the object. Returns defaultValue if any
* check along the way returns undefined.
*
* ES5 compatible, for when you need to support things like IOT toasters running IE6
* or shamefully out-of-date SAP/Citrix combinations.
*
* Replaces lengthy checks like this:
@Kapott
Kapott / C;\Windows\System32\drivers\etc\hosts
Created June 15, 2018 04:20
Microsoft telemetry host entries
127.0.0.1 localhost
127.0.0.1 localhost.localdomain
255.255.255.255 broadcasthost
::1 localhost
127.0.0.1 local
0.0.0.0 vortex.data.microsoft.com
0.0.0.0 vortex-win.data.microsoft.com
0.0.0.0 telecommand.telemetry.microsoft.com
0.0.0.0 telecommand.telemetry.microsoft.com.nsatc.net
0.0.0.0 oca.telemetry.microsoft.com
@Kapott
Kapott / keybase.md
Created May 31, 2018 09:18
Keybase identity proof

Keybase proof

I hereby claim:

  • I am kapott on github.
  • I am kapott (https://keybase.io/kapott) on keybase.
  • I have a public key ASAuy032OWATFbxOPOAUI0Tlqxxg68wfN9ppwL_sFeqJ0wo

To claim this, I am signing this object:

046f88cd252c07120a9204c4e92d1e3923c6f6ad93f2c429c5ecb98cc85dc181e2c1d439c06b0f7e2b8d1669e057a3f7c14f969b130cde9c8805b1c8abac07a1b4;davidsmits
@Kapott
Kapott / reset-git-repo.sh
Created December 22, 2017 13:23
Completely wipe a git repo's history. For those 'oh shit' moments.
#!/bin/bash
# remove git information
rm -rf .git
# re-initialize git with current state
git init
git add .
git commit -m "Initial commit"
@Kapott
Kapott / marktplaatsfixer.user.js
Last active June 6, 2020 07:46
Quick and dirty tampermonkey script for fixing marktplaats.nl which has turned into a useless pos due to all the spamvertisement.
// ==UserScript==
// @name Marktplaats fixer
// @namespace com.byteherder.tampermonkey.marktplaats
// @include *://www.marktplaats.*/*
// @grant none
// @version 1.0.1
// @description Remove all the crap that makes marktplaats unusable
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js
// ==/UserScript==