Skip to content

Instantly share code, notes, and snippets.

View m-rey's full-sized avatar
🏳️‍⚧️
Hack the planet!

Mæve Rey m-rey

🏳️‍⚧️
Hack the planet!
  • Nuremberg, Germany
View GitHub Profile
#!/bin/sh
# change $server to ssh server
# if you are using the terminal emulator "kitty", try:
kitty +kitten ssh $server
# if you are not using kitty or the command above somehow doesn't work, try:
infocmp -a $TERM | ssh myserver tic -x -o \~/.terminfo /dev/stdin
# if it still doesn't work, try:
@m-rey
m-rey / urlcheck.sh
Last active November 13, 2020 17:07
script to check if list of urls is reachable (2xx HTTP response)
#!/bin/bash
while read line; do url_return=($(curl -s -o /dev/null -IL -m 10 -w "%{http_code} %{url_effective}" "$line")); if [ ${url_return[1]} -ge 200 ] && [ ${url_return[1]} -lt 300 ] ; then echo "${url_return[@]:1}">>"url_reachable.txt"; else echo "${url_return[@]:1}">>"url_failed.txt"; fi; done<url.txt
@m-rey
m-rey / covid_test_pw.sh
Created October 15, 2020 11:41
get the password of password protected covid-19 test result pdf by EcoCare
#!/bin/sh
# NAME
# covid_test_pw.sh - get the password of your password protected covid-19 test result pdf by EcoCare
#
# SYNOPSIS
# covid_test_pw.sh FILE
#
# DESCRIPTION
# Normally the password is sent via SMS to your phone.
@m-rey
m-rey / add_ovpn_conf_to_nm.sh
Created October 21, 2020 13:06
Add OpenVPN config to NetworkManager
#!/bin/sh
sudo nmcli connection import type openvpn file $OPENVPN_CONF
@m-rey
m-rey / fix_virt-manager_no_polkit_agent.sh
Created November 13, 2020 17:05
virt-manager: authentication unavailable: no polkit agent available to authenticate action 'org.libvirt.unix.manage'
#!/bin/sh
# source: https://bugzilla.redhat.com/show_bug.cgi?id=1437933#c2
# add current user to libvirt group
sudo usermod --append --groups libvirt `whoami`
#!/bin/bash
# Copyright 2021 Martin Rey
# REQUIREMENTS
# bash, xargs, gpg2, ffmpeg, jq
#
# USAGE
# cryptocam_decrypt.sh INPUT_DIR OUTPUT_DIR
#
@m-rey
m-rey / fix_url.sh
Last active March 28, 2021 04:28
script to remove inaccessible urls. In cases of a permanent redirect it replaces the url with the one it redirects to. I recommend using it on a file like this way: `parallel --ungroup --jobs 0 --arg-file "INPUT_FILE" "./fix_url.sh" >> OUTPUT_FILE`
#!/bin/bash
set -o errexit
set -o pipefail
set -o nounset
# set -o xtrace
# USAGE
# ./fix_url.sh URL
# parallel --ungroup --jobs 0 --arg-file URL_LIST_FILE './fix_url.sh' >> FILTERED_URL_LIST_FILE
@m-rey
m-rey / waybar_minecraft.json
Created April 14, 2021 21:02
waybar minecraft module
"custom/minecraft": {
"format": "⬢ {}",
"interval": 10,
"exec": "printf '\\x06\\x00\\x00\\x00\\x00\\x00\\x01\\x01\\x00' | nc -N $SERVER_IP $SERVER_PORT | tr -cd '[:print:]' | jq -r '.players.online, .players.max'| xargs printf '%d/%d'",
"on-click": "printf '\\x06\\x00\\x00\\x00\\x00\\x00\\x01\\x01\\x00' | nc -N $SERVER_IP $SERVER_PORT | tr -cd '[:print:]' | jq -r '.players.sample[] | .name' | xargs -0 notify-send 'online users'",
"on-click-right": "flatpak run org.tlauncher.TLauncher"
}
#!/bin/bash
fonts_dir="${HOME}/.local/share/fonts"
if [ ! -d "${fonts_dir}" ]; then
echo "mkdir -p $fonts_dir"
mkdir -p "${fonts_dir}"
else
echo "Found fonts dir $fonts_dir"
fi