Skip to content

Instantly share code, notes, and snippets.

View yifattih's full-sized avatar

yifattih yifattih

View GitHub Profile
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF # remove the space between << and EOF, this is due to web plugin issue
Usage: $(
@yifattih
yifattih / secure
Created April 19, 2025 04:56
Bash utility to encrypt/decrypt strings using GPG and Base64 with passphrase-based symmetric encryption.
#!/bin/bash
# Usage function
usage() {
echo "Usage:"
echo " $0 --encrypt --value <string> --passphrase <passphrase>"
echo " $0 --decrypt --value <encrypted_string> --passphrase <passphrase>"
exit 1
}
@yifattih
yifattih / nginx.conf
Created January 30, 2025 06:00 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@yifattih
yifattih / puerto_rico.svg
Created September 4, 2024 20:52
SVG map of Puerto Rico featuring each municipality labeled with its respective ID for easy identification and data integration.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.