Skip to content

Instantly share code, notes, and snippets.

View dedeibel's full-sized avatar

Benjamin Peter dedeibel

View GitHub Profile
@dedeibel
dedeibel / vcs_log
Created October 8, 2019 12:53
zsh widget that executes a git or svn log command and can be bound to a key combination
# 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 July 1, 2019 17:04
Remove unwanted entries from i3wm dmenu. Ugly hack, but working, I go wash my keyboard now.
#!/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 March 13, 2019 09:09
Update alternatives for installing oracle jdk 11 on debian and jinfo file
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
@dedeibel
dedeibel / lbb-extract-transactions-from-text.pl
Last active February 19, 2023 12:13
Kreditkarten Abrechnungen PDF von LBB Berlin Amazon Kreditkarte zu CSV konvertieren parse parsen BEST EFFORT
#!/usr/bin/perl -n
#
# Achtung: Das Skript ist ein fieser Hack, welcher vermutlich nicht in allen
# Faellen funktioniert. Fuer mich hat es fuer erste Experimente
# ausreichend gut funktioniert.
#
# Einzelne Ausgabe von "pdf2txt" einer einer einzelnen PDF Datei
# als Parameter oder via Pipe uebergeben.
#
@dedeibel
dedeibel / zram-savings.pl
Last active March 12, 2019 13:52
show usage of zram usages and compression ratio
#!/usr/bin/perl
use strict;
use Getopt::Long;
#
# zram-savings.pl -a - show for all zram blocks
# -v - show some verbose debug output
#
sub read_file {
@dedeibel
dedeibel / getmakemkvkey.sh
Created January 19, 2019 13:08
Get the latest linux beta makemkv key from the forum
#!/bin/sh
set -e
curl -s 'https://www.makemkv.com/forum/viewtopic.php?f=5&t=1053' | \
grep -Eo '<div class="codebox">.*</div>' | \
perl -pe 'next unless $_; s#.*<code>([^<]*?)</code>.*#$1#'
config
let g:ctrlp_map = '<c-r>'
map <C-a-n> :NERDTreeToggle<CR>
map <C-l> :NERDTreeFind<CR>
bundles:
https://github.com/mileszs/ack.vim.git
https://github.com/vim-scripts/bufexplorer.zip.git
@dedeibel
dedeibel / brightness
Created June 18, 2018 19:36
thinkpad t440p brightness control debian
#!/bin/bash
#
# t440p brightness control
# /etc/acpi/brightness
bl_dev=/sys/class/backlight/intel_backlight
bl=${bl_dev}/brightness
step=200
curval=`cat $bl`
@dedeibel
dedeibel / wait-for-url.sh
Created March 20, 2018 12:18
Waiting for URL to return a propert HTTP response
#!/usr/bin/env bash
URL="$1"
# 10 * (30 + 1) is 310s => ~5m
MAX=10
SLEEP_SECONDS=1
IT=0
@dedeibel
dedeibel / run.sh
Created March 7, 2018 13:42
git alias to show todays commits
git alias today 'git log --pretty=format:"%ad - %s" --date=format:"%H:%M:%S" --date-order --reverse --all --since=7:00 --author=CHANGEME'