Skip to content

Instantly share code, notes, and snippets.

@dedeibel
dedeibel / fahprogress.sh
Last active May 9, 2020
Simple script to print the work unit progress of the folding at home client
View fahprogress.sh
#!/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 Feb 13, 2020
Minimal reproduction example for JDK-8217953 NPE in TableCellSkin
View TableViewCellDisposeProblem.java
/*
* 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 Feb 13, 2020
Minimal reproduction example for JDK-8217953 NPE in TableCellSkin
View TableViewCellDisposeProblem.java
/*
* 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 Feb 5, 2020
Minimal test case for JDK-8150263 : ObservableListWrapper fires change notifications from sort() and sort(Comparator) even if list is not changed
View FXObservableListWrapperTest.java
/*
* 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 Nov 27, 2019
epoch - detect and print time value in various bases (ns us ms s) and format it as local and utc date
View epoch.sh
#!/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 Oct 25, 2019
Update audio albums cover art
View update_cover_art.sh
# 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 Oct 15, 2019
Find first broken jar (zip) file
View find_broken_jar.sh
find . -name "*.jar" -not -exec unzip -qt "{}" \; -quit
@dedeibel
dedeibel / vcs_log
Created Oct 8, 2019
zsh widget that executes a git or svn log command and can be bound to a key combination
View vcs_log
# Save as ~/.zsh/function/vcs_log
#
# In your ~/.zshrc
#
# fpath=(~/.zsh/function $fpath)
# autoload vcs_log
# zle -N vcs_log
# # Bind to Alt+g
# bindkey '\eg' vcs_log
@dedeibel
dedeibel / dmenu_filter_cache
Created Jul 1, 2019
Remove unwanted entries from i3wm dmenu. Ugly hack, but working, I go wash my keyboard now.
View dmenu_filter_cache
#!/bin/sh
# run this once in your .xsession or similar
(
while(true); do
grep -v keepass2 ~/.cache/dmenu_run | sponge ~/.cache/dmenu_run
sleep 60
done;
) &
@dedeibel
dedeibel / .jdk-11.0.2.jinfo
Created Mar 13, 2019
Update alternatives for installing oracle jdk 11 on debian and jinfo file
View .jdk-11.0.2.jinfo
name=jdk-11.0.2
priority=1200
section=main
hl java /usr/lib/jvm/jdk-11.0.2/bin/java
hl jexec /usr/lib/jvm/jdk-11.0.2/lib/jexec
hl keytool /usr/lib/jvm/jdk-11.0.2/bin/keytool
hl pack200 /usr/lib/jvm/jdk-11.0.2/bin/pack200
hl rmid /usr/lib/jvm/jdk-11.0.2/bin/rmid
hl rmiregistry /usr/lib/jvm/jdk-11.0.2/bin/rmiregistry
hl unpack200 /usr/lib/jvm/jdk-11.0.2/bin/unpack200