This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'time' | |
def die(str) | |
$stderr.puts str | |
exit | |
end | |
def usage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# usage: n=$(pwd); cd ~/.weechat/logs; cp $n/{plot,activity} .; ./plot *math.weechatlog | |
# Be aware that if your client's not receiving messages 24/7, | |
# some hours will not receive coverage or some might be underrepresented. | |
# Furthermore, using a bouncer with a long scrollback will create pikes. | |
! [ -z "$1" ] && (tail -n100000 "$1" | ./activity > data) | |
[ -e data ] && gnuplot -p -e \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while sleep 0.5; do vim --startuptime "$@" >(./startup-info) +qall; done | |
# usage: ./collect-times | |
# Running this will collect startup times in `times' directory. | |
# It will run it multiple times so that the averages start converging. | |
# Whenever you remove a plugin, it gets stored as a different version, | |
# which will be shown at 'watch ./watcher'. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'json' | |
if ARGV.length == 0 | |
puts "usage: $0 '?folder=$FOLDERID'" | |
exit | |
end | |
key = %x{grep -Po '(?<=<apikey>)[^<]+' ~/.config/syncthing/config.xml}.strip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
if %x{type xprintidle &> /dev/null; echo $?}.strip == '1' | |
raise 'xprintidle not found' | |
end | |
def idle | |
%x{xprintidle}.to_i | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
more="$@" | |
saved="$EUID" | |
if [ "$EUID" = "0" ]; then | |
echo "don't run as root" | |
exit | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# diff /usr/bin/checkupdates ~/downloadupdates | |
107,108c107,108 | |
< fakeroot -- pacman -Sy --dbpath "$CHECKUPDATES_DB" --logfile /dev/null &> /dev/null | |
< pacman -Qu --dbpath "$CHECKUPDATES_DB" 2> /dev/null | grep -v '\[.*\]' | |
--- | |
> pacman -Sy --dbpath "$CHECKUPDATES_DB" --logfile /dev/null &> /dev/null | |
> pacman -Suw --dbpath "$CHECKUPDATES_DB" --noconfirm | |
# crontab -l | grep downloadupdates | |
* * * * * ~root/downloadupdates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dist | |
.stack-work |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
### BEGIN INIT INFO | |
# Provides: dockercompose | |
# Required-Start: $docker | |
# Required-Stop: $docker | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Docker Services | |
### END INIT INFO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# recursive chown uid/guid mapping for migrating files' owners to | |
# the new LDAP ids by matching users' duplicate names in /etc/passwd and | |
# treating the upper ones (from `getent passwd` list) as the real ones | |
# Created around January, 2017 | |
# raitis.veinbahs.lv | |
# This file may be freely used, modified, copied and repurposed. Public domain. |