Skip to content

Instantly share code, notes, and snippets.

@martin2844
martin2844 / cloudflare.sh
Created October 6, 2025 17:56
Update cloudflare IPs from remote server
#!/bin/bash
# === CONFIG ===
CF_API_TOKEN="token"
CF_ZONE_ID="id"
CF_RECORD_ID="record_id"
CF_RECORD_NAME="el_name"
# === GET IPs ===
CURRENT_IP=$(curl -s https://ipv4.icanhazip.com | tr -d '\n')
@jhngrant
jhngrant / postgresql-debugger-install-ubuntu
Last active January 17, 2025 22:54
Installing the PL/pgSQL Debugger Extension (pldbgapi) for pgAdmin III on PostgreSQL 9.4 and Ubuntu 14.10
# PostgreSQL can be on a remote server but you'll need root privileges in Linux and superuser in PostgreSQL.
# First install build tools
sudo su
aptitude install build-essential
aptitude install postgresql-server-dev-9.4
# Clone and build the PL/pgSQL server-side debugger
@esfand
esfand / NginxRedirect.md
Last active May 25, 2025 19:42
Nginx Redirect

Redirect: Temporary and Permanent

Source

What is an HTTP Redirect?

HTTP redirection, or URL redirection, is a technique of pointing one domain or address to another. There are many uses for redirection, and a few different kinds of redirection to consider.

As you create content and administrate servers, you will often find the need to redirect traffic from one place to another. This guide will discuss the different use-cases for these techniques, and how to accomplish them in Apache and Nginx.

$items = Get-ItemProperty -Path 'Registry::HKey_Local_Machine\Software\Microsoft\Windows NT\CurrentVersion\ProfileList\*'
Foreach ($item in $items) {
$objUser = New-Object System.Security.Principal.SecurityIdentifier($item.PSChildName)
$objName = $objUser.Translate([System.Security.Principal.NTAccount])
$item.PSChildName = $objName.value
}
Write-Output $items | Select-Object -Property PSChildName, ProfileImagePath
@raspi
raspi / enable-all-advanced-power-settings.ps1
Last active November 29, 2026 02:19
Enable all advanced power settings in Windows.
# List all possible power config GUIDs in Windows
# Run: this-script.ps1 | Out-File powercfg.ps1
# Then edit and run powercfg.ps1
# (c) Pekka "raspi" Järvinen 2017
$powerSettingTable = Get-WmiObject -Namespace root\cimv2\power -Class Win32_PowerSetting
$powerSettingInSubgroubTable = Get-WmiObject -Namespace root\cimv2\power -Class Win32_PowerSettingInSubgroup
Get-WmiObject -Namespace root\cimv2\power -Class Win32_PowerSettingCapabilities | ForEach-Object {
$tmp = $_.ManagedElement
@AndrewBucklin
AndrewBucklin / win11-upgrade.ps1
Last active November 29, 2026 02:15
Windows 11 - Upgrade
<#
win11.ps1 - Windows 11 25H2 upgrade helper
Run via: [Net.ServicePointManager]::SecurityProtocol='Tls12'; iex (irm '<raw-url>')
Designed to be FETCHED, not pasted directly into a console.
#>
$ScriptVersion = '2026.09.16.1'
# ---------- Settings (override by setting these BEFORE the iex line) ----------
if (-not (Test-Path variable:LaunchUpgrade)) { $LaunchUpgrade = $true } # $false = monitor only
@AndreUltrasi
AndreUltrasi / passwordCracker.py
Last active November 28, 2026 02:49
Password Cracker in Python
references = {}
dictionary = []
def randomized(x, y):
from random import randint
return randint(x, y)
def cracker_per_digit(x):
@Scumtron
Scumtron / 99-sysctl.conf
Last active November 29, 2026 01:45
/etc/sysctl.d/99-sysctl.conf
# Kernel sysctl configuration file for Linux
# Version 1.11 - 2015-07-07
# Aysad Kozanoglu Aysad K.
# This file should be saved as /etc/sysctl.conf and can be activated using the command:
# sysctl -e -p /etc/sysctl.conf
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and sysctl.conf(5) for more details.
#
# Tested with: Ubuntu 14.04 LTS kernel version 3.13
# Debian 7 kernel version 3.2