Skip to content

Instantly share code, notes, and snippets.

View Drowze's full-sized avatar

R Gibim Drowze

View GitHub Profile
@Drowze
Drowze / create_jwt.sh
Created March 4, 2024 19:19 — forked from shu-yusa/create_jwt.sh
Generate private and public keys, and create JWT and JWKs
#!/bin/sh
## Requires openssl, nodejs, jq
pack() {
# Remove line breaks and spaces
echo "$1" | sed -e "s/[\r\n]\+//g" | sed -e "s/ //g"
}
generate_keys_and_token() {
local prefix=$1
@Drowze
Drowze / minix_tutorial.md
Last active February 26, 2024 09:00
MINIX: FROM ZERO TO ZERO+1: Setting SSH, adding system calls and system libraries to custom system calls in Minix 3.3.0; based on a University assignment. #minix #c #system_call #custom_library #c_library #library

Disclaimer

I take no responsability for any problems a user might have on following this gist. This includes university problems.

The motivation for this is to document, as dummy-oriented as possible, a way to setup and add a system call to Minix OS. This is a classic assignment at Operational Systems classes (and is pretty cool tbh)

Configuration:

ISO used: minix_R3.3.0-588a35b.iso

@Drowze
Drowze / 41-setup-plex-plugins
Last active November 27, 2023 10:46
Setup plug-ins on plexinc/pms-docker docker image startup
#!/usr/bin/with-contenv bash
PMS_PATH="/config/Library/Application Support/Plex Media Server"
SUBZERO_RELEASE="2.6.5.3268"
# If the first run completed successfully, we are done
if [ -e /.pluginsInstalled ]; then
exit 0
fi
{
"keyMappings": "map gc closeOtherTabs\n\n\" option-f on a mac\nmap <a-ƒ> LinkHints.activateModeWithQueue\n\n\" option-p on a mac\nmap <a-π> togglePinTab\n\n\" \\-esc should pass esc (to close a modal on a site)\nmap \\ passNextKey",
"newTabUrl": "pages/blank.html",
"searchEngines": "w: https://www.wikipedia.org/w/index.php?title=Special:Search&search=%s Wikipedia\ng: https://www.google.com/search?q=%s Google\ny: https://www.youtube.com/results?search_query=%s Youtube\ngm: https://www.google.com/maps?q=%s Google maps\nd: https://duckduckgo.com/?q=%s DuckDuckGo\naz: https://www.amazon.co.uk/s/?field-keywords=%s Amazon\n\n# More examples.\n#\n# (Vimium supports search completion Wikipedia, as\n# above, and for these.)\n#\n# g: https://www.google.com/search?q=%s Google\n# l: https://www.google.com/search?q=%s&btnI I'm feeling lucky...\n# y: https://www.youtube.com/results?search_query=%s Youtube\n# gm: https://www.google.com/maps?q=%s Google maps\n# b: https://www.bing.com/search?q=%s Bing\n# d: https://d
@Drowze
Drowze / github_org_track_users.fish
Created September 22, 2023 20:38
Track removed/added users in a GitHub organization
function __github_org_current_users \
--argument-names org_name
set -l users '[]'
for i in (seq 1000)
set -l page_users (gh api "/orgs/$org_name/members?page=$i" | jq 'map(.login)')
test "$page_users" = '[]' && break
set users (jq -n --argjson users "$users" --argjson page_users "$page_users" '[$users, $page_users] | add')
sleep 0.1
end
@Drowze
Drowze / rails-routes
Created November 22, 2022 14:53
bundle exec rails routes (with caching!)
#!/bin/sh
#
# bundle exec rails routes (with caching!) by Drowze
#
# Just make an executable out of this and move into your path
routes_sha=""
if [[ -f config/routes.rb ]]; then
routes_blob=$(cat config/routes.rb)
@Drowze
Drowze / datadog-mock.rb
Last active June 8, 2022 10:53
a datadog agent fake server to intercept ddtrace requests. NOT compatible with ddtrace v1
# frozen_string_literal: true
require 'roda'
require 'pry'
require 'msgpack'
require 'json'
require 'zlib'
require 'multipart_parser/reader'
require 'google/protobuf'
@Drowze
Drowze / Removing audio tracks from mkv.md
Last active March 21, 2022 09:52
#mkv #mkvmerge Remove audio/subtitle from a batch of mkv files

Get the ids of the tracks with mkvinfo <file name> e.g.:

video 0
audio_disliked 1 (default)
audio_liked 2
subtitles_disliked 3 (default)
subtitles_liked 4
@Drowze
Drowze / kimsufi checker
Last active February 23, 2022 18:39
Kimsufi checker
#!/usr/bin/env bash
if ! command -v jq &>/dev/null; then
echo "missing jq!"
exit 1
fi
TMP_FILE=/tmp/kimsufi_availability
SECONDS_TO_CACHE=60
HARDWARES=$@
@Drowze
Drowze / INSTRUCTIONS.md
Last active September 23, 2021 14:09
Setting up a Plex Media Server VM (tested with Virtualbox) with ubuntu server (tested on 16 LTS)

DISCLAIMER

Tested under Windows 10 Pro host (1709), Ubuntu server 16 LTS guest, VirtualBox 5.2.4.
Hardware: AMD FX 6300, 8GB Ram (VGA should not matter).

Step-by-step

  • Download Virtualbox and set up a VM with Ubuntu Server (I used 16 LTS). Take note of the VM name.
  • With the VM closed, configure the network adapter as bridged.
  • Install the Ubuntu server normally. Take note of your username (duh!).
  • Add the plex repositories and add the key as trusted: