Skip to content

Instantly share code, notes, and snippets.

View beargolightly's full-sized avatar
🦊
I AM A JEDI! I AM A JEDI!

Bear Golightly beargolightly

🦊
I AM A JEDI! I AM A JEDI!
View GitHub Profile
@beargolightly
beargolightly / DamewareWithLAPSPassword.ps1
Created April 11, 2019 21:59
Call from PDQ Inventory to connect to the remote system with LAPS credentials
# Attempts to read the LAPS password for $Hostname from Active Directory,
# then open a Dameware mini-remote session using that password
# To use in PDQ Inventory, create a custom tool (PowerShell) called e.g. "Dameware with LAPS Password" and use e.g.
#
# C:\code\PDQ-POSH-Utilities\DamewareWithLAPSPassword.ps1 -Hostname $(Computer:TARGET)
#
# as the Command. Make sure to set Shell to "No Shell - Ignore Output"
[CmdletBinding()]
@beargolightly
beargolightly / dbf_reader.ps1
Created October 11, 2018 00:39
extremely dirty Powershell script to read data from a free-tables DBF
# this is a quick and dirty proof-of-concept of reading our specific DBF files from Powershell
# WARNINGS:
# 1. you have to have the foxpro OLE DB 32-bit version installed
# 2. you have to run this w/ the 32-bit version of powershell
# 3. 'exclusive=no' may not be right for you
# 4. 👏 DONT 👏 USE 👏 FOXPRO 👏 ANYMORE 👏
# I don't know what Powershell will do will all those emojis and I'm not going to find out
$ConnString = "Provider=vfpoledb;Data Source=h:\;Extended Properties=dBASE IV;exclusive=no"
$Conn = new-object System.Data.OleDb.OleDbConnection($ConnString)
@beargolightly
beargolightly / Fallout4Mods.md
Last active March 7, 2018 02:27
Fallout 4 Mods

Fallout 4 mods I like and/or use. Warning: While most of the mods I like just change some minor bits or automate parts I don't want to do (but still want to enjoy, e.g. Sim Settlements), many of these mods are ridiculously unbalanced (double perks, brutal melee, brutal guns, permanent fusion cores) and will ruin the game experience for you if you just load them all up before you've played a bunch of FO4.

Fixes

  • Unofficial Fallout 4 Patch - Fixes for various FO4 bugs

Questing

  • Radiant Quest Marker (Complete) - puts an [R] next to quests that are radiant (i.e. randomly assigned, from one of the factions) quests, vs story or side quests

Sim Settlements

$script_library = "C:\ps_profile_scripts\" # path ending with \
$env:path += ";C:\Program Files (x86)\Microsoft VS Code"
$modules = "posh-git","psake","pester"
# disable terminal bells and beeps
Set-PSReadlineOption -BellStyle None -MaximumHistoryCount 1000
# load named modules, if they exist, and show a version table
foreach ($module in $modules) {
@beargolightly
beargolightly / F5 LTM pool member control for Powershell.ps1
Last active February 13, 2019 04:45
F5 LTM pool member control for Powershell.ps1
[CmdletBinding()]
param(
[string]$LTMName,
[string]$Username,
[string]$Password,
[string]$ApplicationName,
[string]$MemberIP,
[int]$MaxDisableWaitTime,
[int]$MaxOfflineWaitTime,
@beargolightly
beargolightly / gist:23c2409e9015997880f5c929de022a1d
Created November 29, 2016 02:05
Generate Palo Alto object/group creation script from AWS regions/services
#requires the AWS Toolkit for get-awspublicipaddressrange
$iprange = (Get-AWSPublicIpAddressRange -Region us-east-1 -ServiceKey ec2)
$iprange.ipprefix | % {write-host "set address AWS-$($_.Split('/')[0]) ip-netmask $_" ; write-host set address-group AWS_useast_ec2 static AWS-$($_.Split('/')[0]) }
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon