Skip to content

Instantly share code, notes, and snippets.

<?php
// Set exit code to 0 by default
$exitCode = 0;
// Function to load environment variables from .env file
function loadEnv($path) {
if (!file_exists($path)) {
fwrite(STDERR, "Error: Environment file (.env) not found at {$path}\n");
exit(1);
# Try first in terminal
PS1='\[\e[48;5;178m\] \[\e[48;5;179m\] \[\e[0;38;5;179m\]__\[\e[0m\] \[\e[38;5;208m\]\u\[\e[0m\]@\[\e[38;5;43m\]\h\[\e[0m\] \[\e[38;5;179m\]__\[\e[0;48;5;179m\] \n\[\e[0;38;5;215m\][\w]\[\e[0m\]\$ '
# 1. Backup your current file
cp /etc/bash.bashrc /etc/bash.bashrc.bak-final-$(date +%F)
# 2. Replace /etc/bash.bashrc with the bullet-proof version
cat > /etc/bash.bashrc <<'EOF'
[geany]
default_open_path=
cmdline_new_files=true
notebook_double_click_hides_widgets=false
tab_close_switch_to_mru=false
tab_pos_sidebar=2
sidebar_pos=0
symbols_sort_mode=0
msgwin_orientation=1
highlighting_invert_all=false
# Digital Ocean IPv6 Ranges
2400:6180::/32
2400:6180:0::/40
2400:6180:100::/40
2400:6180:200::/40
2400:6180:300::/40
2400:6180:400::/40
2400:6180:500::/40
2400:6180:600::/40
2400:6180:700::/40
@mehargags
mehargags / IPv4-BAN-LIST
Last active February 24, 2025 12:22
IP-BAN-LIST
# DigitalOcean IPv4 Ranges
5.101.96.0/21
5.101.104.0/21
5.101.112.0/21
5.101.120.0/21
24.199.64.0/20
24.199.80.0/20
24.199.96.0/20
24.199.112.0/20
37.44.200.0/21
@mehargags
mehargags / Swap-Check-Make.sh
Created February 18, 2025 12:21
Swap-Check-Make.sh
#!/bin/bash
# Check if swap is enabled
if swapon --show | grep -q "swap"; then
echo "Swap is already enabled."
else
echo "Swap is not enabled. Creating a swap file..."
# Create a 2GB swap file using fallocate
fallocate -l 2G /swapfile
@mehargags
mehargags / VNC-BG-Wallpaper-Creator.sh
Last active February 23, 2025 12:03
VNC-BG-Wallpaper-Creator
#!/bin/bash
### HOW TO RUN ####
### GISTURL="https://gist.github.com/mehargags/5f94ae0ac896bcf85ee13015c2909595/raw"
### echo ${GISTURL}
### curl -s -L ${GISTURL}| bash
### or
### bash <(curl -s -L $GISTURL)
###