Skip to content

Instantly share code, notes, and snippets.

@rrresistor
rrresistor / investigate AlwaysOn_health extended events.sql
Created September 3, 2025 07:00 — forked from EitanBlumin/investigate AlwaysOn_health extended events.sql
Investigate AlwaysOn_health extended events using T-SQL
/*
AlwaysOn Availability Group Error Events
========================================
Author: Eitan Blumin
Date: 2020-05-31
This alert check the contents of the AlwaysOn_Health extended events session for data suspension, role changes, and other errors.
For more info:
https://docs.microsoft.com/sql/database-engine/availability-groups/windows/always-on-extended-events
*/
@rrresistor
rrresistor / UnlockScheduledTask.ps1
Created July 24, 2025 18:49 — forked from withakay/UnlockScheduledTask.ps1
This Powershell script updates the security descriptor for scheduled tasks so that any user can run the task.
<#
.SYNOPSIS
This Powershell script updates the security descriptor for scheduled tasks so that any user can run the task.
Version 1.0 of this script only displays tasks in the root folder. I want to make sure that works first.
.DESCRIPTION
Earlier versions of Windows apparently used file permissions on C:\Windows\System32\Tasks files to manage security.
Windows now uses the SD value on tasks under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree to accomplish that.
@rrresistor
rrresistor / zipper.vbs
Created March 13, 2025 23:13 — forked from labbots/zipper.vbs
VBS script to create zip for file or folder in Windows using ONLY Windows' built-in capabilities
Set Args = Wscript.Arguments
source = Args(0)
target = Args(1)
tempDir = Empty
Function GetFullPath(path)
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
GetFullPath = fso.GetAbsolutePathName( path )
End Function
@rrresistor
rrresistor / Update-LastLogonTimestamp.ps1
Created January 10, 2025 12:43 — forked from joerodgers/Update-LastLogonTimestamp.ps1
Trick to force an update to the LastLogon Timestamp for an Active Directory account. This is sometimes necessary for the portal cache accounts if a companies AD team disables accounts based on the LastLogon timestamp of a user.
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
function Update-LastLogonTimestamp
{
[CmdletBinding()]
param
(
[parameter(Position=0, Mandatory=$true)][string]$UserName
)
@rrresistor
rrresistor / python-and-javascript.md
Created November 11, 2024 12:11 — forked from kissarat/python-and-javascript.md
JavaScript for Python developer

JavaScript for Python developer

Javascript is dynamically typed language (same as Python) with C/C++ compaterble syntax that look at the same for Java and C# also

Boolean data type

let trueValue = true
let falseValue = false
trueValue = True
@rrresistor
rrresistor / remap-keys-to-winkey.reg
Created July 26, 2024 11:25 — forked from fearthecowboy/remap-keys-to-winkey.reg
Registry settings to Remap CapsLock to Windows Key (import and reboot)
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,5b,e0,3a,00,00,00,00,00
@rrresistor
rrresistor / extract.py
Created July 18, 2024 14:29 — forked from neonfury/extract.py
Example of a local browser password extractor - Google Chrome, MS Edge
import os
import re
import sys
import json
import base64
import sqlite3
import win32crypt
import shutil
from Cryptodome.Cipher import AES
@rrresistor
rrresistor / haproxy.sh
Created May 3, 2024 10:01 — forked from ergoz/haproxy.sh
RabbitMQ cluster with HAProxy & Keepalived for high availability
# install haproxy
yum install -y haproxy
# config haproxy for rabbitmq
cat > /etc/haproxy/haproxy.cfg << "EOF"
global
log 127.0.0.1 local0 notice
maxconn 10000
user haproxy
@rrresistor
rrresistor / nginx.conf
Created November 19, 2023 16:53 — forked from morhekil/nginx.conf
Full request/response body logging in nginx
http {
log_format bodylog '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" $request_time '
'<"$request_body" >"$resp_body"';
lua_need_request_body on;
set $resp_body "";
body_filter_by_lua '