Skip to content

Instantly share code, notes, and snippets.

@9999years
9999years / Enable-ANSIEscapes.ps1
Last active February 5, 2020 11:42
Powershell enable ANSI / VT100 escape sequences
# This is a total of 5 logical LOC, but the API is... well hidden and highly opaque
# (magic numbers everywhere!) so it warrents a few dozen lines of comments
function Enable-ANSIEscapes {
# Enable ANSI / VT100 16-color escape sequences:
# Original discovery blog post:
# http://stknohg.hatenablog.jp/entry/2016/02/22/195644
# Esc sequence support documentation
# https://msdn.microsoft.com/en-us/library/windows/desktop/mt638032(v=vs.85).aspx
@jbe2277
jbe2277 / AssemblyAnalyzer.cs
Created July 2, 2017 17:52
AssemblyAnalyzer via System.Reflection.Metadata
using System;
using System.Collections.Immutable;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Metadata;
using System.Reflection.PortableExecutable;
using System.Security.Cryptography;
@halkyon
halkyon / cleanup-win10.ps1
Last active February 17, 2026 20:09
Cleanup Windows 10 Powershell script
##
## Windows 10 cleanup script.
## Remove dodgy tracking settings, unneeded services, all apps, and optional features that come with Windows 10. Make it more like Windows 7.
## NOTE: this was tested on Creators Update (1703) and Fall Creators Update (1709). Some of this may not work as expected on newer versions.
##
## Instructions
## 1. Run this script (under Powershell as Administrator):
## powershell -ExectionPolicy Bypass .\cleanup-win10.ps1
## 2. Let it run through, you may see a few errors, this is normal
## 3. Reboot
@stchar
stchar / erlang20.1-fips.md
Last active September 5, 2019 10:45
erlang20.1-fips.md

Erlang OTP 20.1 with openssl fips mode

Openssl with fips

Erang opt 20.1 contains crypto-4.1 with openssl-1.0.2d. So I was using the same version set.

Reqruried Software

I used chocolatey.org to install depdencies

  • Git
@makelariss
makelariss / popshellslikeitsatuesday.py
Last active August 17, 2025 03:17
NT AUTHORITY\SYSTEM through Handle Inheritance using Python
# -*- coding: UTF-8 -*-
import enum, os, sys
# https://twitter.com/highsenburger69
from ctypes.wintypes import *
from ctypes import *
# These libraries have the APIs we need
kernel32 = WinDLL('kernel32', use_last_error=True)
advapi32 = WinDLL('advapi32', use_last_error=True)
shell32 = WinDLL('shell32', use_last_error=True)
psapi = WinDLL('psapi.dll', use_last_error=True)
@Scumtron
Scumtron / 99-sysctl.conf
Last active July 8, 2023 16:03
/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
@romiras
romiras / dictionary-gnu-sort-bd.txt
Last active July 31, 2025 15:55 — forked from klauspost/dictionary-sorted.txt
Brotli dictionary - printed escaped - sorted with "sort -bd" (with dictionary order, ignoring blanks), a tool from GNU coreutils
"<!--"
"><!--"
"||[];"
"--><!--"
"--></"
"----"
"!--<"
"//--></"
"//-->"
"...</"
@PlagueHO
PlagueHO / Enable-TLS12.ps1
Created February 27, 2018 20:52
Enable TLS 1.2 support in PowerShell
if (-not ([Net.ServicePointManager]::SecurityProtocol).ToString().Contains([Net.SecurityProtocolType]::Tls12)) {
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol.toString() + ', ' + [Net.SecurityProtocolType]::Tls12
}
@aplaice
aplaice / readermode_userContent.css
Last active November 21, 2021 07:35
Customise appearance of Firefox's reader mode
@-moz-document url-prefix("about:reader") {
/*
Auto-hide reader sidebar (it re-appears only when hovering over it)
source:
https://www.reddit.com/r/firefox/comments/39tcie/how_do_i_hide_the_sidebar_in_reader_view/cs6dmqb
*/
.reader-toolbar,.reader-toolbar .button:not(:hover) {
background-color:transparent !important;
@xCONFLiCTiONx
xCONFLiCTiONx / Notepad3.ini
Last active June 1, 2023 00:04
Notepad3 VSCode Dark Theme (import)
[Custom Colors]
01=#000000
02=#B5E2F5
03=#A2C5D4
04=#89ACEC
05=#006633
06=#B2D766
07=#648000
08=#F6B05B
09=#FFFFFF