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 zsh | |
# create or use ncdu's output from cache, then open ncdu | |
set -eu | |
sanit-path() { echo "$(tr / : <<< "$1" | tr -cd '0-9a-z\-.:')"; } | |
cache="$HOME/data/cache/ncdu" # RUN mkdir yourself! | |
dir="$1"; shift |
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 | |
script = <<-EOF | |
ccurl() { | |
curl -b cookie.txt -c cookie.txt "$@" | |
} | |
ccurl 'https://www.ss.com/lv/real-estate/flats/riga/agenskalns/filter/' -H 'authority: www.ss.com' -H 'cache-control: max-age=0' -H 'origin: https://www.ss.com' -H 'upgrade-insecure-requests: 1' -H 'content-type: application/x-www-form-urlencoded' -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36' -H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3' -H 'referer: https://www.ss.com/lv/real-estate/flats/riga/agenskalns/' -H 'accept-encoding: gzip, deflate, br' -H 'accept-language: en-GB,en-US;q=0.9,en;q=0.8' &> /dev/null || exit | |
ccurl 'https://www.ss.com/lv/real-estate/flats/riga/agenskalns/filter/fDgSeF4belI=.html' -H 'authority: www.ss.com' -H 'cache-control: max-age=0' -H 'origin: https://www.ss.com' -H 'upgrade-insecure-requests: 1' -H 'conte |
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. |
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
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
# 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
#!/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
#!/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
#!/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
#!/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'. |