Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
if [ $# -ne 2 ]; then
echo "Usage: fuck you <programm>"
exit 1
fi
if killall -9 "$2"; then
echo
echo " (╯°□°)╯︵$(echo "$2"|toilet -f term -F rotate)"
echo
fi
@Nervengift
Nervengift / pentadactyl-mpv
Created February 9, 2015 18:19
Open videos (e.g. on youtube) in external player (mpv) in pentadactyl
:map ,m :silent execute "!mpv '" + buffer.URL + "'"<enter>
@Nervengift
Nervengift / yeganesh_run
Created February 15, 2015 14:55
yeganesh (dmenu wrapper) wrapper
#!/bin/sh
yeganesh -x | ${SHELL:-"/bin/sh"} &
@Nervengift
Nervengift / motd
Created April 11, 2015 21:54
Bastel-VM MOTD: BMO
 
▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄▄  Let's play
  ▄▄        sysadmin
  ▄    ▄ ▄     games!
   ▄    ▄     
  ▄▄       
  ▄▄   ▄ ▄▄▄▄▄   
▄▄▄▄▄▄   ▄▄ [38;5;
@Nervengift
Nervengift / build_nodemcu
Last active August 29, 2015 14:21
building (and flashing) nodemcu
git clone https://github.com/pfalcon/esp-open-sdk
cd esp-open-sdk
make
export PATH="$(pwd)/xtensa-lx106-elf/bin:$PATH"
cd ..
git clone https://github.com/nodemcu/nodemcu-firmware.git
cd nodemcu-firmware
# optional: edit app/include/user_modules.h and other configs
make
#make flash
@Nervengift
Nervengift / foo.service
Last active October 16, 2015 13:16
Simple template unit file for running daemons via systemd
[Unit]
Description=<description>
# Start after network (network may still not be online on start, see http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/)
#After=network.target
[Service]
# If the program forks to background
#Type=forking
ExecStart=<full path to program [with parameters and option]>
# Run as specific user
@Nervengift
Nervengift / post-receive
Last active February 25, 2016 15:45
Generate a signed timestamp for all git commits using openssl and the DFN server
#!/bin/bash
# install on central git repo as hooks/post-receive
# generates timestamp signatures for all commits
read oldrev newrev refname
mkdir -p timestamps
oldrev=$(git rev-parse $oldrev)
newrev=$(git rev-parse $newrev)
git rev-list "$oldrev..$newrev" | while read commit; do
echo "creating timestamp signature for $commit..."
@Nervengift
Nervengift / snd-dmenu
Last active May 18, 2016 21:06
dmenu/rofi menu for Entropia's sound board
#!/usr/bin/bash
# use sound effects at Entropia via a dmenu
# run "snd update" to load and update the local cache of available sounds
#
# by Nervengift
[[ "x$XDG_CACHE_HOME" == "x" ]] && CACHEDIR="$HOME/.cache" || CACHEDIR="$XDG_CACHE_HOME"
[[ "x$1" == "xupdate" ]] && ssh entropia@voellerei.club.entropia.de bash -c \'find /home/entropia/clubautomation/snd -type f -printf \"%P\\n\" \' | tee $CACHEDIR/snd_dmenu
@Nervengift
Nervengift / notmuch-notify.py
Created October 29, 2017 22:43
notification script for notmuch/afew
#!/usr/bin/env python3
# Send notifications for all mails with the "notify" tag via notify-send
#
# This is best used in combination with afew. To notify for all new messages just add
# the following filter to your ~/.config/afew/config just before [InboxFilter]:
#
# [Filter.0]
# message = notify
# query = tag:new AND NOT tag:killed AND NOT tag:spam
@Nervengift
Nervengift / apa102.js
Created March 23, 2019 10:34
apa102 LED driver for neonious one
// polyfill for Array.prototype.fill
if (!Array.prototype.fill) {
Object.defineProperty(Array.prototype, 'fill', {
value: function(value) {
if (this == null) {
throw new TypeError('this is null or not defined');
}
var O = Object(this);