Skip to content

Instantly share code, notes, and snippets.

View BoxedBrain's full-sized avatar

BoxedBrain

  • Netwrix
  • Germany
  • 09:13 (UTC +02:00)
View GitHub Profile
@BoxedBrain
BoxedBrain / MoveAllWindowsToMainMonitor.ps1
Created April 5, 2024 13:28
Move all open windows to the main monitor with PowerShell
# Load the necessary user32.dll functions
Add-Type @"
using System;
using System.Runtime.InteropServices;
public class User32 {
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool GetWindowRect(IntPtr hWnd, out RECT lpRect);
[DllImport("user32.dll")]
@BoxedBrain
BoxedBrain / nps_pki_mfa_self_signed.ps1
Created June 5, 2023 12:48
Create a new self signed certificate in the 'CurrentUser' certificate store to test the NPS PKI MFA second factor
# PKI MFA Test Script
# Create a new self signed certificate in the 'CurrentUser' certificate store
# to test the NPS PKI MFA second factor
#
# ------------------------- Password Secure User Settings -------------------------
# Certificate hash methods: SHA1
#
# Checking mode for certificate chains: No checking
# Only for testing, use trusted PKI certificate for productive use
#
@BoxedBrain
BoxedBrain / secs.sh
Last active June 1, 2023 16:48
Add publicly accessible GitHub user SSH public keys to 'authorized_keys'
#!/bin/bash
############################################################
# Script META #
############################################################
MetaName="secs.sh"
MetaDesc="Add publicly accessible GitHub user SSH public keys to 'authorized_keys'"
MetaVersion="2023.6.1"
@BoxedBrain
BoxedBrain / nps-cheat-sheet.ps1
Last active February 21, 2024 14:32
Netwrix Password Secure Cheat Sheet
# Some functions may require PS v6 or later - so let`s install it first
iex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI"
# add local service account
$username = "svc_passwordsecure"
$password = Read-Host -AsSecureString
New-LocalUser -Name $username -Password $password -FullName "Netwrix Password Secure" -Description "Service account"
Add-LocalGroupMember -Group Administrators -Member $username
@BoxedBrain
BoxedBrain / docker-compose.yaml
Created January 5, 2023 10:40
Mailpit docker compose
version: '3.7'
services:
mailpit-server:
image: axllent/mailpit:latest
container_name: mailpit-server
hostname: mailpit-server
restart: unless-stopped
volumes:
@BoxedBrain
BoxedBrain / borg-borgmatic.markdown
Last active July 18, 2022 08:37
Install Borg-Backup & Borgmatic

Install Borg-Backup & Borgmatic

update packages

sudo apt update

Borg installation

go to tmp folder

cd /tmp/
@BoxedBrain
BoxedBrain / docker-cleanup.markdown
Created June 5, 2020 09:09
Docker cleanup cheatsheet

Docker cleanup cheatsheet

Delete all existing containers:

sudo docker rm -f $(docker ps -a -q)

Delete all stopped containers:

sudo docker rm -f $(docker ps -a -f status=exited)