Skip to content

Instantly share code, notes, and snippets.

View ibraheem-ghazi's full-sized avatar

Ibraheem Ghazi Alnabriss ibraheem-ghazi

View GitHub Profile
@ibraheem-ghazi
ibraheem-ghazi / SeedGuard.php
Last active March 22, 2025 08:50
🌱 SeedGuard: Smart Seeding & Error Logging for Laravel — No Duplicate Data! (with support for Laravel 11+)
<?php /** @noinspection PhpUnhandledExceptionInspection */
namespace App\Support\Libraries\SeedGuard;
use Exception;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Schema;
use Psr\Log\LoggerInterface;
@ibraheem-ghazi
ibraheem-ghazi / cd_setup.sh
Created August 15, 2024 10:31
Setup a Bare Git repo, for auto deployment code to Ubuntu server, a Bare repo created with a new username at /home/$USERNAME/git/$REPO_NAME, once you push to it, the code will be copied to the target_dir. Not Fully tested for common cases, but its working. If you used this script, read it, and modify it as needed.
#!/bin/bash
# If you keep getting permission denied or something do the following:
# - sudo nano /etc/ssh/sshd_config
# - Uncomment and ensure the following lines are present:
# PubkeyAuthentication yes
# AuthorizedKeysFile .ssh/authorized_keys
# - sudo systemctl restart ssh.service
# To Remove (reverse) the user/repo setup
@ibraheem-ghazi
ibraheem-ghazi / install-redis.sh
Created December 5, 2019 12:46
Bash script to install Redis on Ubuntu server protected with OpenSSL password
#!/bin/bash
clear
#color the output of echo
COLOR='\033[1;32m'
RED='\033[0;31m'
WHITE='\033[1;37m'
NC='\033[0m' # No Color