This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import-Module WebAdministration | |
# Add Custom Header - Server Level | |
Add-WebConfigurationProperty -PSPath MACHINE/WEBROOT/APPHOST ` | |
-Name . -Filter system.webServer/httpProtocol/customHeaders ` | |
-AtElement @{name = "X-Custom" ; value = 'value' } | |
#Remove Server: Microsoft-IIS/10.0 Header | |
Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' -filter "system.webServer/security/requestFiltering" -name "removeServerHeader" -value "True" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check WSL Version | |
wsl -l -v | |
# Set WSL Version to 2 | |
wsl --set-version Ubuntu-22.04 2 | |
# Fix WSL2 Networking (per https://stackoverflow.com/a/65325532) | |
rm /etc/resolv.conf || true | |
rm /etc/wsl.conf || true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo su -l gitlab-runner -s /bin/bash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Begin { | |
$retryCount = 0 | |
$retryMax = 5 | |
$retryPauseSeconds = 30 | |
} | |
Process { | |
do { | |
$retryCount++ | |
try { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt autoremove --purge | |
#Remove VSCode Server Space Hog Bullshit | |
rm -rf /home/jcefoli/.vscode-server | |
# Clean Journal BS | |
sudo journalctl --vacuum-size=100M | |
# Remove logs | |
sudo -s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
cp --no-preserve=mode,ownership /etc/sudoers /etc/sudoers.tmp | |
sed -i "s/%sudo\tALL=(ALL:ALL) ALL/%sudo\tALL=(ALL) NOPASSWD: ALL/g" /etc/sudoers.tmp | |
visudo -c -f /etc/sudoers.tmp | |
if [ "$?" -eq "0" ]; then | |
cp /tmp/sudoers.tmp /etc/sudoers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<system.webServer> | |
<urlCompression doStaticCompression="false" doDynamicCompression="false" /> | |
<caching> | |
<profiles> | |
<add extension=".html" policy="DisableCache" kernelCachePolicy="DisableCache" /> | |
<add extension=".php" policy="DisableCache" kernelCachePolicy="DisableCache" /> | |
<add extension=".txt" policy="DisableCache" kernelCachePolicy="DisableCache" /> | |
</profiles> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Helper script to manage SSM parameters | |
.PARAMETER name | |
SSM key name to set | |
.PARAMETER value | |
SSM key value to set |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Keeps you productive by spoofing activity to prevent GPO idle timeouts, RDP disconnects, sleep, etc. | |
.Description | |
This script creates a Scheduled Task that runs at login which uses Kernel SetThreadExecutionState to prevent GPOs | |
from disconnecting your RDP session. Will also prevent sleeping/screensavers/display timeouts | |
See the example below for a one liner that will download and execute this script directly from GitHub! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$host.ui.RawUI.WindowTitle = "Idle Keepalive" | |
$dotNetCode = @' | |
[DllImport("kernel32.dll", CharSet = CharSet.Auto,SetLastError = true)] | |
public static extern void SetThreadExecutionState(uint esFlags); | |
'@ | |
$ste = Add-Type -memberDefinition $dotNetCode -name System -namespace Win32 -passThru | |
$ES_CONTINUOUS = [uint32]"0x80000000" #Requests that the other EXECUTION_STATE flags set remain in effect until SetThreadExecutionState is called again with the ES_CONTINUOUS flag set and one of the other EXECUTION_STATE flags cleared. | |
$ES_AWAYMODE_REQUIRED = [uint32]"0x00000040" #Requests Away Mode to be enabled. |