Skip to content

Instantly share code, notes, and snippets.

View bluPhy's full-sized avatar
🏠
Working from home

bluPhy bluPhy

🏠
Working from home
View GitHub Profile
# Install NerdFont (or any fonts) using the command line in Debian (or other Linux).
# https://medium.com/@almatins/install-nerdfont-or-any-fonts-using-the-command-line-in-debian-or-other-linux-f3067918a88c
wget -P ~/.local/share/fonts https://github.com/ryanoasis/nerd-fonts/releases/download/v3.3.0/JetBrainsMono.zip \
&& cd ~/.local/share/fonts \
&& unzip JetBrainsMono.zip \
&& rm JetBrainsMono.zip \
&& fc-cache -fv
@bluPhy
bluPhy / Security_Search_Engines.md
Last active March 25, 2025 11:45
Security_Search_Engines
@bluPhy
bluPhy / linux-update-cleanup.sh
Last active November 26, 2024 19:42
Script to keep Linux updated and basic clean-up
#!/usr/bin/env bash
# Function to check if a command exists
command_exists() {
if command -v "$1" &>/dev/null; then
#msg "Command $1 exists\n" "success"
return 0 # Command exists
else
msg "Command $1 does not exist\n" "danger"
return 1 # Command does not exist
@bluPhy
bluPhy / kaliGPGkeys_fix-up.sh
Last active April 29, 2025 01:00
Old Kali Linux GPG keys to aptitude fix
#!/bin/bash
#
# This script downloads and installs the Kali Linux archive GPG key to standard
# APT key locations, verifies the installation, optionally checks for another specific
# key's presence, and runs apt-get update.
#
# --- Configuration ---
set -euo pipefail # Exit on error, unset var, pipe failure is an error
@bluPhy
bluPhy / list-all-projects-in-org.sh
Last active August 27, 2024 16:48
List all Google Cloud GCP projects in Organization
#!/usr/bin/env bash
# Google Cloud script
# This script checks in an organization for all the projects and list them
#
# Usage examples:
# list-all-projects-in-org.sh --organization 123456789
#
# Notes:
# To run this script, you need the required IAM permissions
@bluPhy
bluPhy / exif_datetime_setter.sh
Last active December 27, 2022 20:37
exif_datetime_setter.sh
#!/bin/bash
# Orginal script from pirafrank https://gist.github.com/pirafrank/9970c15fec0fa6e49be5363ef6ed1cf3
# Simple script to parse JPG photo filename and set exif datetime,
# creation date and file modification date accordingly.
# Timezone is taken by your PC.
# exec this script by searching for .JPG and .jpg files in given folder
# find . -type f -name "*.JPG" -o -name "*.jpg" -exec /path/to/exif_datetime_setter.sh {} \;
# Force update of all files based on exif info -> exiftool '-FileModifyDate<Exif:CreateDate' -overwrite_original *
@bluPhy
bluPhy / AddingUserWithPassword_Linux.sh
Last active April 1, 2023 17:04
Adding user with password Linux
#!/bin/bash
# Purpose - Script to add a user to Linux system including passsword
# Original Author - Vivek Gite <www.cyberciti.biz> under GPL v2.0+
# Updated by - Alejandro Leal @bluPhy
# ------------------------------------------------------------------
# Am i Root user?
if [ $(id -u) -eq 0 ]; then
read -p "Enter username : " username
while true; do
read -p "Provide the password for default username (kali):" -s -r password
@bluPhy
bluPhy / gcp_iam_policy-export.sh
Last active April 1, 2023 17:06
Script to retrieve GCP IAM roles, users and serviceaccounts and export it to yaml files
#!/bin/bash
# Script to retrieve GCP IAM roles, users and serviceaccounts
# and export it to yaml files that can be used to import back
# with gcloud projects set-iam-policy <project> <policy.yaml>
#
# You can manually remove the etag and version lines in the resulting yaml file
# but do so at your own risk.
#
# Author - Alejandro Leal [email protected]
@bluPhy
bluPhy / iam-json-reformat.py
Last active November 4, 2023 20:55
iam-json-reformat.py
#!/usr/bin/env python3
# Python script to reformat IAM json data
# Author: Rajathithan Rajasekar - 03/03/2020
import json,ast,sys
data = []
project = ""
def hello(jdata, project):
@bluPhy
bluPhy / gcp_iam_user_list-extraction.sh
Last active December 27, 2022 20:34
Script to retrieve GCP IAM roles, users and serviceaccounts, must be used in conjunction with iam-json-reformat.py
#!/bin/bash
# Script to retrieve GCP IAM roles, users and serviceaccounts
# Author - Alejandro Leal [email protected] (Originally from Rajathithan Rajasekar)
echo 'project-id,roles/rolename,user:username-and-serviceaccounts' > iamlist.csv
prjs=( $(gcloud projects list | awk '/PROJECT_ID/{print $2}') )
for i in "${prjs[@]}"
do
echo "------------------------------------------------------------"
echo "Collecting IAM roles & users for Project: $i"