Skip to content

Instantly share code, notes, and snippets.

View karoltheguy's full-sized avatar

Carol Ouellet karoltheguy

View GitHub Profile
@karoltheguy
karoltheguy / SetRDPCertificate.ps1
Created April 19, 2023 03:04
Set Certificate for RDP
#Certificate has to be installed in Personal
#Subject is who it has been issued to
$certSubject = ""
$tp = (ls Cert:\LocalMachine\my | WHERE {$_.Subject -match $certSubject } | Select -First 1).Thumbprint
wmic /namespace:\\root\CIMV2\TerminalServices PATH Win32_TSGeneralSetting Set SSLCertificateSHA1Hash="$tp"
@karoltheguy
karoltheguy / GenCertSigningReq.ps1
Created January 17, 2023 19:04
Powershell script to generate a CSR SHA256 2048bit
<#
.SYNOPSIS
GenCertSigningReq.ps1
.DESCRIPTION
This powershell script can be used to generate a Certificate Signing Request (CSR) using the SHA256 signature algorithm and a 2048 bit key size (RSA). Subject Alternative Names are supported.
.PARAMETER
@karoltheguy
karoltheguy / stay away.ps1
Created November 18, 2022 21:37
Keep Windows awake and not idling
$wsh = New-Object -ComObject WScript.Shell
while (1) {
$wsh.SendKeys('+{F15}')
Start-Sleep -Seconds 59
}
@karoltheguy
karoltheguy / update_portainer.sh
Last active July 23, 2023 02:22
Update Portainer
sudo docker stop portainer
sudo docker rm portainer
sudo docker run -d -p 8000:8000 -p 9000:9000 -p9443:9443 --name=portainer --restart=always --pull=always -v /var/run/docker.sock:/var/run/docker.sock -v /containers/portainer:/data portainer/portainer-ee
@karoltheguy
karoltheguy / add_scrollbar.js
Created November 12, 2022 02:15
add scrollbar to paywall pages
var r="html,body{overflow:auto !important;}";
var s=document.createElement("style");
s.type="text/css";
s.appendChild(document.createTextNode(r));
document.body.appendChild(s);
void 0;
@karoltheguy
karoltheguy / FindGetLastShutdownReason.ps1
Created July 27, 2022 18:31
Find the last shutdown reason through event logs
Get-EventLog -LogName System |? {$_.EventID -in (6005,6006,6008,6009,1074,1076)} | ft TimeGenerated,EventId,Message -AutoSize –wrap
@karoltheguy
karoltheguy / gethuntmmr.psm1
Last active July 16, 2022 22:27
Hunt Showdown - Extract MMR
Function Get-HuntTeamMmr {
$HuntDir = "C:\Program Files (x86)\Steam\steamapps\common\Hunt Showdown"
$File = Get-Item "$HuntDir\user\profiles\default\attributes.xml"
$NameSuffix = "_blood_line_name"
$MmrSuffix = "_mmr"
$TeamSuffix = "_ownteam"
[xml]$Data = Get-Content $File
$FlatData = $Data.ChildNodes.selectNodes("*")
@karoltheguy
karoltheguy / custom_macvlan.sh
Last active June 5, 2022 20:13
macvlan seen by host
#!/usr/bin/env bash
#Change these variables!
NIC_NAME="eth0"
DOCKER_ROUTING_INTERFACE_NAME="mymacvlan"
DOCKERNETWORK_IP_ADDRESS="192.168.0.249/32"
DOCKERNETWORK_IP_RANGE="192.168.0.64/26"
sleep 15 #Do not rush things if executing during boot. This line is not mandatory and can be removed.
@karoltheguy
karoltheguy / portqury.ps1
Created May 6, 2022 18:20
Remote Port Query by Powershell
#$RemoteServer = Read-Host "Please provide destination to test"
$DestinationHost = ""
$SourceServers = "" #for multi servers: "server1", "server2", "server3"
$PortList = "443" #for multi ports: "80, 443, 566"
$PortType = "TCP"
$localportqry = "`"E:\RPA Tools\PortQryUI\PortQry.exe`""
$PortArray = @()
if ($PortType -eq "UDP") { $PortCmd = "-p UDP" } Else { $PortCmd = "-p TCP" }
@karoltheguy
karoltheguy / On Shutdown Event.xml
Created November 15, 2021 16:28
Task Scheduler action on Shutdown
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2021-11-15T11:01:07.6898855</Date>
<Author>Carol Ouellet</Author>
<URI>\Backup Files</URI>
<Description>Launch a task before rebooting/poweroff. This can be useful for task to be performed before Windows Update force reboot the PC</Description>
</RegistrationInfo>
<Triggers>
<EventTrigger>