Skip to content

Instantly share code, notes, and snippets.

View matiferrigno's full-sized avatar
🤯
Working from home

Matias Emanuel Ferrigno matiferrigno

🤯
Working from home
  • La Plata, Buenos Aires, Argentina
View GitHub Profile
@matiferrigno
matiferrigno / jwt.jq
Last active September 21, 2023 15:56
# ~/.jq/jwt.jq
#
# Ex.
# jq -R 'import "jwt" as jwt; jwt::decode' /tmp/jwt_to_decode
#
# this is a alternative to:
# jq -R 'split(".") | .[0],.[1] | @base64d | fromjson' /tmp/jwt_to_decode
#
# still possible to use an alias for either command but this appears to be more scalable.
F22B079A4CCD67A9DD5042BB394FFCC1E457DACC
@matiferrigno
matiferrigno / PHP - Test RO.md
Last active December 16, 2021 01:48
Check if volume is read-only and throw a http 500 response code.

Code

<?php
error_reporting(0);
try {
  $rc=200;
  if (!fopen("check_readonly.txt", "w+")) throw new Exception('File open failed');
  if (!fwrite($fp, "s")) throw new Exception('File write failed');
}