Skip to content

Instantly share code, notes, and snippets.

@bartmeuris
bartmeuris / brol.sh
Last active November 20, 2023 16:00
Script to manage a bunch of garbage (=brol in dutch) projects in git without creating repos for every single one of them
#!/bin/bash
REPO=git@github.com:bartmeuris/brol.git
BRANCHNAME=
function abort() {
echo "ABORTING: $*"
exit 1
}
#!/bin/bash
##########################################################################
##
## Script to easily generate Wireguard client config and generate QR code
## displayed in the terminal for mobile devices.
##
##
##########################################################################
[ -z "$(which wg)" ] && {
@bartmeuris
bartmeuris / voron_24_printed_parts.md
Created December 27, 2022 23:20 — forked from cmidgley/voron_24_printed_parts.md
Printed parts list for the Voron 2.4 organized by assembly order

Voron 2.4 Printed Parts List

List of parts to print for Voron 2.4 organized by the Assembly Manuals order of assembly, allowing for just-in-time printing of parts while building the printer. Configuration is standard Voron 2.4 (Afterburner Direct Feed, DIN rail mounts) with choices for E3D, Dragon or Mosquito hot ends on a 250mm, 300mm or 350mm frame. No parts for the drag chain are included, as often these are purchased parts rather than printed.

Names of the sections (such as Gantry/X_Axis/XY Joints) match the name of the STL directory that contains the prints. Note that Voron Design uses filenames starting with [a]_ at the start of a filename to indicate parts that can be printed in an accent color.

_Credit to krobertson for maki

@bartmeuris
bartmeuris / upgradego.sh
Last active September 12, 2023 13:01
Script to get the latest version of Go
#!/bin/bash
## Script to upgrade go version
# Accepts the version to install as parameter, but will install the latest if not provided
# Installs a go version in the ~/bin/go-<version> directory and symlinks it to ~/bin/go
# Expects the path will be updated to include ~/bin/go/bin
VERSION=${1}
# BASEDIR=$(dirname $0)
BASEDIR=${HOME}/bin
#!/usr/bin/env osascript
#
# Applescript to to open a new fullscreen Terminal window,
# with a larger fontsize in the current working directory
#
# Mostly for presentation/demonstration use, can be buggy, use at own risk.
# Works for me on Mojave (10.14)
#
set current_path to POSIX path of ((path to me as text) & "::")
#!/bin/bash
KERNEL_LIST=`dpkg --list | grep "linux-image-[0-9]" | awk '{ print $2; }'`
REMOVE_LIST=
CURRENT_KERNEL="`uname -r`"
for K in $KERNEL_LIST; do
KV=`echo $K | sed -e "s/^linux-image-//"`
if [[ "$KV" = "$CURRENT_KERNEL" ]]; then
echo "Skipping $K"
elif [[ "$KV" > "$CURRENT_KERNEL" ]]; then
echo "Skipping $K"
<html>
<head>
<script>
function getIntIP(ip) {
return "" + ((ip >> 24) & 0xFF) + "." + ((ip >> 16) & 0xFF) + "." + ((ip >> 8) & 0xFF) + "." + (ip & 0xFF);
}
function getMask(bitsize) {
mask = 0;
if (bitsize > 32) {
@bartmeuris
bartmeuris / ZFS-Storage-Stats.json
Created November 16, 2016 14:23
Grafana zfs storage stats dashboard
{
"__inputs": [
{
"name": "DS_TELEGRAF",
"label": "telegraf",
"description": "",
"type": "datasource",
"pluginId": "influxdb",
"pluginName": "InfluxDB"
}
$ ./vsphere-influxdb-go -debug
2016/11/16 15:08:08 Starting : vsphere-influxdb-go
2016/11/16 15:08:08 connecting to vcenter: x.x.x.x
2016/11/16 15:08:08 Successfully connected to Influx
2016/11/16 15:08:08 Querying vcenter
2016/11/16 15:08:08 Setting up query inventory of vcenter: x.x.x.x
2016/11/16 15:08:08 connecting to vcenter: x.x.x.x
([]types.ManagedObjectReference) (len=40 cap=40) {
(types.ManagedObjectReference) HostSystem:host-163,
user@win10:~/proj$ time ./test.sh > /dev/null
real 2m17.271s
user 0m5.406s
sys 2m16.094s
user@win10:~/proj$