Skip to content

Instantly share code, notes, and snippets.

View gkatev's full-sized avatar

George Katevenis gkatev

  • CARV, ICS FORTH
View GitHub Profile
@gkatev
gkatev / xkb-restore-ctrl-alt-kp-add-sub.hook
Created August 12, 2023 02:23
Pacman hook: Modify XKeyboard Map, restore Ctrl + Alt + Keypad Add/Sub, reserved by default for XF86_Next/Prev_VMode (contributions welcome)
[Trigger]
Operation = Install
Operation = Upgrade
Type = Package
Target = xkeyboard-config
[Action]
Description = Restore Ctrl+Alt+KP_{Add,Subtract} (instead of XF86 VMode)
When = PostTransaction
Depends = sed
@gkatev
gkatev / speedport-reboot.py
Last active April 21, 2022 19:23
Script to reboot Cosmote Speedport Entry 2i
#!/usr/bin/python3
import requests
import hashlib
import sys, re
modem_user = MY_USER
modem_password = MY_PASSWORD
modem_addr = "http://" + MY_ADDR
@gkatev
gkatev / arp-reply.py
Last active June 24, 2022 06:31
ARP Server (legitimately answer ARP requests for hosts that might be unable to)
#!/usr/bin/python3
import sys
from scapy.all import send, ARP, conf
s = conf.L3socket(promisc=False)
for line in sys.stdin:
p = line.strip().split(' ')
@gkatev
gkatev / html-refresh.sh
Last active October 10, 2022 20:01
Linux/X11 script to refresh a browser window that is rendering a local HTML file. You could append it to a build command or pair it with inotifywait.
#!/bin/bash
if [ ! "$1" ]; then
echo "Usage: html-refresh <html file>"
exit 1
fi
title="$(xmllint --html "$1" --xpath "//html/head/title/text()" \
| perl -MHTML::Entities -pe 'decode_entities($_);')"
@gkatev
gkatev / ssl_c_pem.lua
Last active September 22, 2021 20:31 — forked from bzed/ssl_c_pem.lua
haproxy pem formatted ssl client cert fetch - ssl_c_pem & ssl_c_pem_escaped - like ssl_c_der
local basexx = require("basexx")
core.register_fetches("ssl_c_pem", function(txn)
local der = txn.f:ssl_c_der()
if not der then return "" end
local envelope = "-----BEGIN %s-----\n%s\n-----END %s-----"
local typ = "CERTIFICATE";
local wrap = ('.'):rep(64)
@gkatev
gkatev / geanywl
Last active November 23, 2022 12:19
Geany editor: Wrapper for per-workspace instances, opening in most recently focused window, and more
#!/bin/bash
GEANY_PATH="/usr/bin/geany"
if [ -z "$XDG_RUNTIME_DIR" ]; then
[ -z "$XDG_CACHE_HOME" ] &&
XDG_CACHE_HOME="$HOME/.cache"
XDG_RUNTIME_DIR="$XDG_CACHE_HOME"
fi