Add the decode_jwt script.
This commit is contained in:
@@ -14,6 +14,7 @@ let
|
|||||||
cleanup_temporary_files = (
|
cleanup_temporary_files = (
|
||||||
patchScriptBin "cleanup_temporary_files" (builtins.readFile ./files/cleanup_temporary_files.bash)
|
patchScriptBin "cleanup_temporary_files" (builtins.readFile ./files/cleanup_temporary_files.bash)
|
||||||
);
|
);
|
||||||
|
decode_jwt = (patchScriptBin "decode_jwt" (builtins.readFile ./files/decode_jwt.bash));
|
||||||
alias_rga = pkgs.writeShellScriptBin "rga" ''
|
alias_rga = pkgs.writeShellScriptBin "rga" ''
|
||||||
exec ${pkgs.ripgrep}/bin/rg -uuu "''${@}"
|
exec ${pkgs.ripgrep}/bin/rg -uuu "''${@}"
|
||||||
'';
|
'';
|
||||||
@@ -59,6 +60,7 @@ in
|
|||||||
nix-output-monitor # For better view into nixos-rebuild
|
nix-output-monitor # For better view into nixos-rebuild
|
||||||
# nix-serve-ng # Serve nix store over http
|
# nix-serve-ng # Serve nix store over http
|
||||||
cleanup_temporary_files
|
cleanup_temporary_files
|
||||||
|
decode_jwt
|
||||||
jq
|
jq
|
||||||
inetutils # For whois
|
inetutils # For whois
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#
|
#
|
||||||
# Delete temporary files on entire disk
|
# Delete temporary files on entire disk
|
||||||
find / -type f '(' -name '*.orig' -or -name '*~' -or -name '*.core' ')' -delete -print 2>/dev/null
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
|
||||||
|
exec find / -type f '(' -name '*.orig' -or -name '*~' -or -name '*.core' ')' -delete -print 2>/dev/null
|
||||||
|
|||||||
8
nix/configuration/roles/base/files/decode_jwt.bash
Normal file
8
nix/configuration/roles/base/files/decode_jwt.bash
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# Decode the contents of a JWT
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
exec jq -R 'split(".") | .[0],.[1] | gsub("-"; "+") | gsub("_"; "/") | gsub("%3D"; "=")| @base64d | fromjson'
|
||||||
Reference in New Issue
Block a user