Skip to content

Instantly share code, notes, and snippets.

@umberto10
umberto10 / apply_mod.sh
Last active September 1, 2021 11:15
AmongUs TheOtherRoles linux mod updater :v
#!/usr/bin/sh
# update mod https://github.com/Eisbison/TheOtherRoles script
GDIR="${HOME}/.steam/steam/steamapps/common/Among Us" # steam game dir
WINPFX="${HOME}/.steam/steam/steamapps/compatdata/945360/pfx" # wine prefix for among us
JDIR="${WINPFX}/drive_c/users/steamuser/AppData/LocalLow/Innersloth/Among Us" # dir for regionInfo.json (custom server)
read -p "START THE GAME NORMAL BEFORE APPLYING THE MOD!"
@umberto10
umberto10 / kc_device_code_flow.sh
Last active September 8, 2022 14:45
Simple keycloak device code flow example with PKCE written in bash with jq, curl and openssl (optional)
#!/usr/bin/bash
CLIENT_ID="" # client id
REALM="" # realm name
KC_URL="" # keycloak url
# PKCE works from keycloak version 17.0.0+
code_verifier=$(openssl rand -hex 96)
code_challenge=$(echo -n "${code_verifier}" | sha256sum | cut -d ' ' -f 1 | xxd -r -p | basenc --base64url | tr -d '=')
@umberto10
umberto10 / icm.sh
Created April 1, 2022 12:14
choose city and get the current icm weather png
#!/usr/bin/bash
set -e
FN='/tmp/icm.png'
JSON=$(curl -s 'https://m.meteo.pl/ajax/0?weather_type=60&query=' -H 'Accept: text/plain, */*; q=0.01' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'X-Requested-With: XMLHttpRequest' -H 'Connection: keep-alive' -H 'Referer: https://m.meteo.pl/')
CITY=$(echo -e ${JSON}|jq -r '[.suggestions[].value] | join("\n")'|dmenu -i)
CITY_DAT=$(echo -e ${JSON} | jq -r ".suggestions[] | select(.value==\"${CITY}\") | .data")
@umberto10
umberto10 / sks.pl
Last active June 20, 2024 14:35
pwr sks-cli in py and perl
#!/usr/bin/env perl
use strict;
use warnings;
use LWP::UserAgent;
my $URL = 'https://sks.pwr.edu.pl/menu/';
my $oHTTPAgent = new LWP::UserAgent;
my $oRequest = HTTP::Request->new('GET');
$oRequest->url($URL);
my $sResponse = $oHTTPAgent->request($oRequest);