Skip to content

Instantly share code, notes, and snippets.

@adamz01h
adamz01h / mk_ram_cache.sh
Created June 3, 2025 03:15
makes a small ram drive for server cache
#!/bin/bash
##Ubuntu 24.04.2 LTS
CONF_FILE="/etc/apache2/conf-available/cache.conf" # Set your filename here
ramdrive=512M
a2enmod cache
a2enmod cache_disk
a2enmod headers
a2enmod expires
####RAM DISK caching
@adamz01h
adamz01h / install_apache2_waf.sh
Last active June 6, 2025 03:33
Installs apache ModSecurity dowloads the coreruleset and fixes configs
#!/bin/bash
##Ubuntu 24.04.2 LTS
##Install
apt update
apt install apache2 libapache2-mod-security2 curl unzip -y
security2="/etc/apache2/mods-enabled/security2.conf"
BACKUP_FILE="${security2}.bak"
@adamz01h
adamz01h / install_docker.sh
Last active April 1, 2025 01:23
install_docker.sh
echo "installing docker..."
# Add Docker's official GPG key:
sudo apt update
sudo apt install ca-certificates curl -y
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo \
@adamz01h
adamz01h / installPhp.sh
Created February 4, 2025 23:45 — forked from ankit1057/installPhp.sh
Install Lampp on termux
#!/bin/bash
# Update packages
apt update
apt upgrade -y
# Install Apache and PHP
apt install php-apache -y
# Install MySQL
@adamz01h
adamz01h / autoelvsnip.ps1
Created October 15, 2024 11:17
auto elevate powershell
#Run as administrator and stays in the current directory
if (-Not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
if ([int](Get-CimInstance -Class Win32_OperatingSystem | Select-Object -ExpandProperty BuildNumber) -ge 6000) {
Start-Process PowerShell -Verb RunAs -ArgumentList "-NoProfile -ExecutionPolicy Bypass -Command `"cd '$pwd'; & '$PSCommandPath';`"";
Exit;
}
}
# at least in deb/untu
sudo apt-get install libpam-google-authenticator
# for each user
google-authenticator
@adamz01h
adamz01h / lazydockerdownload.sh
Last active July 24, 2024 20:46
lazydockerdownload
# map different architecture variations to the available binaries
ARCH=$(uname -m)
case $ARCH in
i386|i686) ARCH=x86 ;;
armv6*) ARCH=armv6 ;;
armv7*) ARCH=armv7 ;;
aarch64*) ARCH=arm64 ;;
esac
# prepare the download URL
@adamz01h
adamz01h / NTLMV1.c
Created June 20, 2024 17:10
NTLMv1 Implementation in C GPT
#include <stdio.h>
#include <stdint.h>
#include <string.h>
// Simplified MD4 implementation
typedef struct {
uint32_t state[4];
uint32_t count[2];
unsigned char buffer[64];
} MD4_CTX;
@adamz01h
adamz01h / Process_folder.bat
Created April 21, 2024 02:07
Process a folder of Windows Media Playlists to export the list to folders with files.
@echo off
setlocal
:: Check if a folder path was provided as an argument
if "%~1"=="" (
echo No folder path was provided.
pause
exit /b
)
@echo off
setlocal
:: Check if a file path was provided as an argument
if "%~1"=="" (
echo No WPL file was dragged onto the script.
pause
exit /b
)