Skip to content

Instantly share code, notes, and snippets.

View dedeibel's full-sized avatar

Benjamin Peter dedeibel

View GitHub Profile
@dedeibel
dedeibel / tmux.conf
Last active October 5, 2021 09:34 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever (v3.1c compatiblity)
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
set-option -g display-time 4000
#set -g default-terminal screen-256color
set -g default-terminal screen-256color
@dedeibel
dedeibel / dns-bench.sh
Last active September 27, 2021 20:21
Compare some DNS response times
#!/bin/bash
DOM=scalzi.com
if [[ -n "$1" ]]; then
DOM="$1"
fi
echo $DOM
# parallel -j 10 -N 2 --tagstring '{2} ({1})' "dig @{1} a "${DOM}" | egrep time" \
parallel -j 10 -N 2 --tagstring '{2} ({1})' "dig @{1} a "${DOM}" +noauthority +noadditional | grep -Po 'A.*(\.[^.]+){3}|(?:time: )(.*)' | tac | paste -sd '\t'" \
::: \
9.9.9.9 quad9 \
@dedeibel
dedeibel / zoonikeys.js
Last active September 25, 2021 15:50
Zooniverse Active Asteroids optimized key control - use a browser addon to automatically load js
/**
* Copyright 2021 Benjamin Peter
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@dedeibel
dedeibel / fahprogress.sh
Last active May 9, 2020 10:46
Simple script to print the work unit progress of the folding at home client
#!/bin/bash
if [[ $1 == "-f" ]]; then
self=${0/[[:space:]]* -f/}
exec watch -n 5 $self
fi
systemctl status FAH\* \
| grep Active \
| sed -Ee 's/^\s+//'
FAHClient --send-command queue-info \
@dedeibel
dedeibel / TableViewCellDisposeProblem.java
Created February 13, 2020 10:46
Minimal reproduction example for JDK-8217953 NPE in TableCellSkin
/*
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
* In jurisdictions that recognize copyright laws, the author or authors
@dedeibel
dedeibel / TableViewCellDisposeProblem.java
Created February 13, 2020 10:46
Minimal reproduction example for JDK-8217953 NPE in TableCellSkin
/*
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
* In jurisdictions that recognize copyright laws, the author or authors
@dedeibel
dedeibel / FXObservableListWrapperTest.java
Created February 5, 2020 07:52
Minimal test case for JDK-8150263 : ObservableListWrapper fires change notifications from sort() and sort(Comparator) even if list is not changed
/*
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
* In jurisdictions that recognize copyright laws, the author or authors
* of this software dedicate any and all copyright interest in the
@dedeibel
dedeibel / epoch.sh
Created November 27, 2019 18:17
epoch - detect and print time value in various bases (ns us ms s) and format it as local and utc date
#!/bin/bash
#FORMAT="--iso-8601=ns"
FORMAT="+%Y-%m-%d %H:%M:%S"
TZ=`date ${UTC} +%z`
NANO=1000000000
MICRO=1000000
MILLI=1000
MIN_SECONDS=1000000000
@dedeibel
dedeibel / update_cover_art.sh
Created October 25, 2019 21:05
Update audio albums cover art
# delete all images and other stuff - make sure you check the filter
find . -type f -not -iname "*.mp3" -delete
# do some name cleaning
find . -name "*MP3" -exec rename "s/(.*)\.MP3$/\$1.mp3/" "{}" \;
# find new cover art
sacad_r . 300 AlbumArt.jpg 2>&1 | tee /tmp/coverlog.txt
# remove old embedded images
@dedeibel
dedeibel / find_broken_jar.sh
Created October 15, 2019 11:44
Find first broken jar (zip) file
find . -name "*.jar" -not -exec unzip -qt "{}" \; -quit