Skip to content

Instantly share code, notes, and snippets.

View mikedhanson's full-sized avatar
🎯
Focusing

Michael Hanson mikedhanson

🎯
Focusing
View GitHub Profile
@mikedhanson
mikedhanson / code $profile
Created April 15, 2024 19:35
Windows powershell profile
<# PSREADLINE #>
if (Get-Module -Name PSReadLine) {
Import-Module PSReadLine
#Set-PSReadLineOption -EditMode Windows
Set-PSReadLineOption -PredictionSource History
Set-PSReadLineOption -PredictionViewStyle ListView
if ($host.Version.Major -eq 7) {
@mikedhanson
mikedhanson / ModernizingLogonScripts.md
Last active December 10, 2022 22:42
Modernizing Logon Scripts

Helped co-write two .net apps that map users to network resources. This process used two applications, the network drive manager and the network state monitor. The state monitor detects what the device is connected to and writes that state to the event logs. Meanwhile, the drive manager reads those event state changes and connects the user up to their desired network state.

@mikedhanson
mikedhanson / WordPressOnUnraid.md
Last active December 4, 2021 21:54
Overview of how to setup a WordPress site that is hosted through Unraid.
title date
WordPress and UnRaid
2019-11-11

High overview of how to setup a WordPress site that is hosted through Unraid.

This blog is something for me to look back at as a resource and to possibly help someone like you out. 

1. Domain Names

@mikedhanson
mikedhanson / fail2ban_le_nginx_wp.md
Last active February 13, 2022 21:16
Setting up fail2ban with LE/NGINX/WP
title date
Setting up fail2ban with LE/NGINX/WP
2019-12-27

NOTICE:

This tutorial is assuming that you are using the Swag docker container through UnRaid. If you are, then lets proceed.

1. Edit jail.local

@mikedhanson
mikedhanson / unraid_stuck_array.md
Last active December 27, 2020 03:10
UnRaid - Array stuck spinning down
title date
UnRaid - Array stuck spinning down
2020-01-30
  1. SSH into unraid as root
    1. ps -ef | grep /mnt/user

2. You are now going want to kill those processes

@mikedhanson
mikedhanson / piholedns.md
Created December 27, 2020 03:05
Custom Pihole DNS Settings
title date
Custom DNS Names in PIhole
2020-04-24

Adding Custom DNS Entries into Pihole

Assuming you already have Pihole up and running, create a new .conf file in the following directory: /etc/dnsmasq.d/yourname.conf

  1. nano or vim into "yourname.conf"
@mikedhanson
mikedhanson / GrayCord.py
Last active November 11, 2020 15:34
Graylog alerts to discord.
import requests # for api calls
import json # json
import argparse
import os
import platform # For getting the operating system name
import subprocess # For executing a shell command
import time # for time, dummy
import datetime # for time, dummy
import discord # For discord bot
import asyncio # for muiltithreading
@mikedhanson
mikedhanson / MenuTest.ps1
Created November 16, 2018 14:28 — forked from HumanEquivalentUnit/MenuTest.ps1
PowerShell + Windows Forms dynamic dropdown menu from filesystem example
# These are the starting folders
$documentRoots = 'C:\Users\', 'C:\Program Files\'
# Load Windows forms assemblies
[void][Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
[void][Reflection.Assembly]::LoadWithPartialName("System.Drawing")