Skip to content

Instantly share code, notes, and snippets.

View erkiesken's full-sized avatar

Erki Esken erkiesken

  • @StarshipRobots
  • Tallinn, Estonia
View GitHub Profile
@erkiesken
erkiesken / config.sh
Created April 13, 2023 06:44
Robot Cow
export COWPATH=~/.config/cowsay
alias botsay="cowsay -f robot"
Estonglish keyboard
/usr/share/X11/xkb/symbols/ee
partial alphanumeric_keys
xkb_symbols "estonglish" {
include "us(basic)"
name[Group1]= "Estonglish (English US, Estonian, Euro)";
@erkiesken
erkiesken / keyboard-toggle.sh
Created March 30, 2023 12:37
Toggle built-in laptop keyboard on/off on Linux while using external keyboard on top of laptop
#!/usr/bin/env bash
set -euo pipefail
# Map hostname to its internal keyboard name.
# Find name with: xinput list
declare -A keyboards=( ["my-hostname"]="AT Translated Set 2 keyboard" )
id=0
host=$(hostname)
@erkiesken
erkiesken / google-docs-zoom.sh
Created March 9, 2023 14:08
google docs zoom scripting
#!/usr/bin/env bash
unset x y w h id
eval $(xwininfo -id $(xdotool getactivewindow) |
sed -n -e "s/^ \+Absolute upper-left X: \+\([0-9]\+\).*/x=\1/p" \
-e "s/^ \+Absolute upper-left Y: \+\([0-9]\+\).*/y=\1/p" \
-e "s/^ \+Width: \+\([0-9]\+\).*/w=\1/p" \
-e "s/^ \+Height: \+\([0-9]\+\).*/h=\1/p" \
-e "s/^xwininfo: Window id: [^\"]*\(.*\)/id=\1/p"
)
@erkiesken
erkiesken / verify
Created November 15, 2022 11:18
keys.pub verification
BEGIN MESSAGE.
xaICELyEeVqB4cm xaXFhABS4OaaGW1 B6zR6XnrD7JplKl 6YLl0EmAVNwsomi
AJF3crh6zQJEP5n iun27SdAovFTCKq 6Xr2MZHgg4V25Zx NwYC3IeM0P5olyQ
a4QuSulD8D8CMUh Yn1G5RcjFWiZCnN f28Y2XLKapcIME3 2vlRJoEBTs2t0pU
GBIM63iWSkHkQtz w83EXK7PNogcvB5 Txhfs29HFxl.
END MESSAGE.
@erkiesken
erkiesken / channels.scm
Created September 13, 2022 08:58
guix channels
(list (channel
(name 'kanal-a)
(url "https://github.com/erkiesken/kanal-a")
(branch "main"))
(channel
(name 'flat)
(url "https://github.com/flatwhatson/guix-channel.git")
(introduction
(make-channel-introduction
"33f86a4b48205c0dc19d7c036c85393f0766f806"
#!/usr/bin/env bash
# <bitbar.title>UTC and local timezone</bitbar.title>
# <bitbar.version>v1.0.0</bitbar.version>
# <bitbar.author>Erki Esken</bitbar.author>
# <bitbar.author.github>erkiesken</bitbar.author.github>
# <bitbar.desc>Show the current time in local and UTC timezone.</bitbar.desc>
TIME_UTC=$(TZ="UTC" date "+%H:%M")
TIME_LOCAL=$(date "+%H:%M")
@erkiesken
erkiesken / pbcopy.sh
Created July 30, 2020 06:57
bitbar local and utc timezone
#!/usr/bin/env bash
echo "${1}" | pbcopy
@erkiesken
erkiesken / loader.js
Created August 10, 2018 09:42
ascii loader
a = ["Ooo","oOo","ooO","oOo"]; // like on the server listing screen of Minecraft
i = 0;
change = () => { document.querySelector("code").innerText = a[i % a.length]; i++; }
v = setInterval(change, 200)
// clearInterval(v);
// a = ["⦿⨀⨀⨀⨀","⨀⦿⨀⨀⨀","⨀⨀⦿⨀⨀","⨀⨀⨀⦿⨀","⨀⨀⨀⨀⦿","⨀⨀⨀⦿⨀","⨀⨀⦿⨀⨀","⨀⦿⨀⨀⨀"]
@erkiesken
erkiesken / ModAuthJWT.ex
Created December 30, 2017 11:09
JWT auth mock for ejabberd
defmodule ModAuthJWT do
use Ejabberd.Module
import Joken
def start(_host, _opts) do
info('Starting ejabberd module Auth JWT')
:ok
end
def stop(_host) do