Skip to content

Instantly share code, notes, and snippets.

@sanderbongers
sanderbongers / postman-renew-jwt-token-pre-request.js
Last active August 30, 2024 13:02
Automatically renew an expired JWT token in Postman on pre-request
// Put this into 'Collection name' -> Scripts -> Pre-request
const atob = require('atob');
const jwtToken = pm.variables.get("token");
const url = pm.variables.get("baseUrl") + "/jwt/token";
const decodeToken = (token) => {
try {
return JSON.parse(atob(token.split('.')[1]));
} catch (exception) {
@sanderbongers
sanderbongers / iraqi-arabic-phrase-list.md
Last active November 30, 2023 19:39
Iraqi Arabic phrase list
Arabic Translation Phonetic Context
شكو ماكو؟ What's up? SHAku MAku
أهلا شلونج؟ Hello. How are you? AHlen shLOANich? To a female
أهلا Hello ahLEN
شلونج How are you? shLOANich To a female
آني زينة I am alright. Anee ZAYna From a female
آني I ANEE
زينة alright ZAYna
آني زين I am good. AAni zain From a male
@sanderbongers
sanderbongers / lapt
Last active June 3, 2023 16:52
Apt install a package locally without having root privileges
#!/usr/bin/env bash
# lapt - install a package locally without needing root privileges
if [[ $# -ne 2 || $1 != 'install' ]]; then
echo "Usage: lapt install <package-name>"
exit 1
fi
# Set variables
package_name=$2
@sanderbongers
sanderbongers / regenerate-security-txt.sh
Created May 18, 2023 18:42
Auto-generated signed security.txt
#!/usr/bin/env bash
# GPG key ID/fingerprint
key_id="A054EA11BECF2BA9D23C16977B31C49FC4ED54AA"
# File paths
security_txt_path="/var/www/html/.well-known/security.txt"
signature_path="$security_txt_path.sig"
public_key_path="/var/www/html/.well-known/gpg.asc"