Skip to content

Instantly share code, notes, and snippets.

View relative's full-sized avatar
🔥

relative

🔥
View GitHub Profile
@odzhan
odzhan / rdp_pack.cpp
Last active March 27, 2024 17:27
Compression using RDP API
/**
Compression using undocumented API in rdpbase.dll
RDPCompressEx supports four algorithms : MPPC-8K, MPPC-64K, NCRUSH and XCRUSH.
This code supports all except NCRUSH.
The MPPC compression ratio is very similar to LZSS, so this could be quite useful for shellcode trying to evade detection.
NCRUSH compression appears to work but fails for decompression.
@april
april / git-log-json.sh
Last active September 10, 2024 07:12
pure shell function for git log as JSON
# attempting to be the most robust solution for outputting git log as JSON,
# using only `git` and the standard shell functions, without requiring
# additional software.
# - uses traditional JSON camelCase
# - includes every major field that git log can output, including the body
# - proper sections for author, committer, and signature
# - multiple date formats (one for reading, ISO for parsing)
# - should properly handle (most? all?) body values, even those that contain
# quotation marks and escaped characters
@rbreaves
rbreaves / quaketerminal.ahk
Created January 16, 2022 19:45
QuakeTerminal & hide all other Apps while using VSCode
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetTimer, HideTerminal, 1000 ;
return
WinMatcher := "ahk_class CASCADIA_HOSTING_WINDOW_CLASS"
HideTerminal:
@webtroter
webtroter / Invoke-WireGuardRoutingHelper.ps1
Last active May 23, 2024 16:56
WireGuard Windows Routing Helper Script
[CmdletBinding(DefaultParameterSetName = "PreDown")]
param (
[Parameter(ParameterSetName = "Setup")]
[switch]
$Setup,
[Parameter(ParameterSetName = "Setup")]
[switch]
$RestartWGService,
# WireGuard Interface
[Parameter(Position = 0)]
@telmogoncalves
telmogoncalves / vscode.json
Created February 3, 2021 11:58
Auto Fix ESLint
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"editor.formatOnSave": true
}
@mattifestation
mattifestation / BasePolicyAllowWindows.xml
Last active July 21, 2021 13:20
Final WDAC policy files used for Microsoft Surface Gen. 1 Laptop "Windows-only" configuration
<?xml version="1.0" encoding="utf-8"?>
<SiPolicy xmlns="urn:schemas-microsoft-com:sipolicy">
<VersionEx>10.0.1.0</VersionEx>
<PolicyID>{A244370E-44C9-4C06-B551-F6016E563076}</PolicyID>
<BasePolicyID>{A244370E-44C9-4C06-B551-F6016E563076}</BasePolicyID>
<PlatformID>{2E07F7E4-194C-4D20-B7C9-6F44A6C5A234}</PlatformID>
<Rules>
<Rule>
<Option>Enabled:Unsigned System Integrity Policy</Option>
</Rule>
@jaw-sh
jaw-sh / haproxy.conf
Last active September 30, 2022 12:13
Zero trust haproxy ssl-over-tcp config
##
# zero trust haproxy ssl-over-tcp config
# this config can be put down on any small VPS to transfer traffic over to a trusted service
##
global
log /dev/log local0
log /dev/log local1 notice
# change to www on FreeBSD
user haproxy
group haproxy
@namuol
namuol / INSTALL.md
Last active July 24, 2023 11:53
rage-quit support for bash

rage-quit support for bash

HOW TO INSTALL

Put flip somewhere in your $PATH and chmod a+x it.

Copy fuck into ~/.bashrc.

@denji
denji / nginx-tuning.md
Last active September 20, 2024 06:44
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.