Skip to content

Instantly share code, notes, and snippets.

View a-h-abid's full-sized avatar
💭
So much work at office...

Ahmedul Haque Abid a-h-abid

💭
So much work at office...
View GitHub Profile
@a-h-abid
a-h-abid / Dockerfile
Last active April 29, 2025 06:04
Nginx v1.17.6 modules building for CentOS / RHEL 6
FROM centos:6.10
# Update to use vault repositories since CentOS 6 is EOL
RUN sed -i 's|mirrorlist=http://mirrorlist.centos.org|#mirrorlist=http://mirrorlist.centos.org|g' /etc/yum.repos.d/CentOS-Base.repo && \
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Base.repo
# Clean and update yum
RUN yum clean all && yum -y update
# Install build dependencies
@a-h-abid
a-h-abid / all-dir-git.sh
Last active September 26, 2024 16:48
Traverse across all directories in current path (excluding mentions) and run specified git command.
#!/usr/bin/env bash
# set -x
# Check if any arguments are passed
if [[ $# -eq 0 ]]; then
echo "No git commands provided."
exit 1
fi
@a-h-abid
a-h-abid / ubuntu-postinstall-scripts.txt
Last active April 12, 2025 15:46
New Ubuntu Post-Installation Command
# Apt Updates & Upgrades
sudo apt update
sudo apt upgrade -y
# Apt Installs
sudo apt install -y tlp apt-transport-https ca-certificates curl nala zip unzip make
# Installs with Snap
sudo snap install telegram-desktop android-studio postman vlc
@a-h-abid
a-h-abid / AppExceptionHandler.php
Created October 13, 2023 18:44
Laravel 10+ Validator Response with Rule Names
<?php
namespace App\Exceptions;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Illuminate\Validation\ValidationException;
class Handler extends ExceptionHandler
{
// ...
@a-h-abid
a-h-abid / DropAllTablesState.php
Created April 8, 2022 06:00
refresh module db
<?php
namespace Tests\Database;
class DropAllTablesState
{
/**
* Indicates if all tables have been dropped
*
* @var bool
@a-h-abid
a-h-abid / ScheduleListCommand.php
Last active February 14, 2022 18:27
To get scheduled tasks in system. Tested in Laravel 6+.
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Console\Scheduling\Schedule;
class ScheduleListCommand extends Command
{
/**
@a-h-abid
a-h-abid / example.lifecycle.json
Last active October 21, 2021 10:04
MinIO MC Commands Quick Sheet
{
"Rules": [
{
"Expiration": {
"Days": 1
},
"ID": "PublicTempUploads",
"Filter": {
"Prefix": "path/"
},
@a-h-abid
a-h-abid / ValidationResponseWithRuleName.php
Last active March 17, 2023 08:19
Laravel Validation Response for API with Rule Key
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
class ValidationResponseWithRuleName
{
/**
@a-h-abid
a-h-abid / env_helper.php
Created June 16, 2019 10:10
Enhanced ENV function mixing both Laravel & CakePHP's env()
<?php
if (!function_exists('eenv')) {
/**
* Enhanced ENV()
*
* Gets the value of an environment variable.
*
* @param string $key
* @param mixed $default