Skip to content

Instantly share code, notes, and snippets.

View scriptsandthings's full-sized avatar

Scripts and Things scriptsandthings

  • Columbus, OH
View GitHub Profile
@stevekm
stevekm / pdf_conversions.md
Last active May 3, 2024 19:33
Commands to convert multi-page PDF to/from multiple PNG files with GhostScript & ImageMagick
@leeramsay
leeramsay / PSADT-Cheatsheet.ps1
Last active March 28, 2025 07:01
PSADT snippits/cheatsheet
## Commonly used PSADT env variables
$envCommonDesktop # C:\Users\Public\Desktop
$envCommonStartMenuPrograms # C:\ProgramData\Microsoft\Windows\Start Menu\Programs
$envProgramFiles # C:\Program Files
$envProgramFilesX86 # C:\Program Files (x86)
$envProgramData # c:\ProgramData
$envUserDesktop # c:\Users\{user currently logged in}\Desktop
$envUserStartMenuPrograms # c:\Users\{user currently logged in}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs
$envSystemDrive # c:
$envWinDir # c:\windows
@joshua-d-miller
joshua-d-miller / 802.1x System Fix.py
Last active February 4, 2022 14:42
This script will allow your 802.1x Configuration Profile to work on any other Ethernet interface at the System Level
#!/usr/bin/python
# pylint: disable=E0611, E1101, E0602
''''Fix 802.1x When Using Config Profiles and PEAP-MSCHAPV2 or EAP-TLS'''
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# This script will find the system profile that is attached to one ethernet
# interface from our configuration profile and then copy it to all other
# ethernet interfaces so that other ethernet interfaces can be used instead
# of just the FirstActiveEthernet at time of profile installation. This issue
# is still an issue as of 10.12.3
@mdelano
mdelano / kms_data_key.js
Created April 5, 2017 19:35
This is an example of creating encryption keys using AWS KMS
/**
* The following is an example of creating encryption keys using AWS KMS.
*/
var Q = require('q');
var AWS = require('aws-sdk');
var kms = new AWS.KMS({region: 'us-east-1'});
/**
* Example of create a "data" key with AWS KMS. Data keys are just encryption keys
@talkingmoose
talkingmoose / Wait for SSID.sh
Last active March 11, 2022 20:30
Delay script to verify current Wi-Fi SSID is set before continuing.
#!/bin/bash
setupProcess=$( /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | awk '/ SSID/ {print substr($0, index($0, $2))}' )
# specify SSID
while [[ "$setupProcess" != "TMI Wi-Fi" ]]
do
sleep 1
echo "Sleeping 1 second..."
setupProcess=$( /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | awk '/ SSID/ {print substr($0, index($0, $2))}' )
@masklinn
masklinn / cheatsheet.md
Last active March 21, 2025 05:07
launchctl/launchd cheat sheet

I've never had great understanding of launchctl but the deprecation of the old commands with launchctl 2 (10.10) has been terrible as all resources only cover the old commands, and documentation for Apple utilities is generally disgracefully bad, with launchctl not dissembling.

Mad props to https://babodee.wordpress.com/2016/04/09/launchctl-2-0-syntax/ which contains most details

domains

Internally, launchd has several domains, but launchctl 1 would only ask for service names,

@chusiang
chusiang / teams-chat-post-for-workflows.sh
Last active December 31, 2024 02:32
Post a message to Microsoft Teams with bash script.
#!/bin/bash
# =============================================================================
# Author: Chu-Siang Lai / chusiang (at) drx.tw
# Filename: teams-chat-post-for-workflows.sh
# Modified: 2024-07-22 11:44 (UTC+08:00)
# Description: Post a message to Microsoft Teams via "Post to a chat when a webhook request is received" workflows.
# Reference:
#
# - https://gist.github.com/chusiang/895f6406fbf9285c58ad0a3ace13d025
# - https://devblogs.microsoft.com/microsoft365dev/retirement-of-office-365-connectors-within-microsoft-teams/
@deergod1
deergod1 / pfSense config.md
Last active January 15, 2025 02:49
pfSense Easy Configuration Guide for HP t620 Plus

pfSense Simple Home Configuration - 2.4.3 / 2.4.4

Starting from Scratch

This is my personal guide for installing pfSense. Hope you find it useful. I made these notes to capture the details of my "install from scratch" to ensure I didn't miss important details. Also, I'm trying build my network with discrete "disposable" components that make the system mutable and less rigid. It does not cover installing any packages like Squid or Suricata as that's way beyond the scope of a basic, functional install.

I migrated from an environment that was at various times running Tomato Toastman 1.28 or Asuswrt-Merlin on Netgear and ASUS routers across four "access points" (one always acting as the firewall/gateway, the rest as APs). It was OK pre-gigabit, but had roaming problems, and I was using large Wifi routers with most of the features disabled. Also, I found that I could easily swamp the network and tank VOIP and Wifi Calling without even trying. The only fix was to throttle everything by using Bandwidth Limit

@talkingmoose
talkingmoose / Personal OneDrive Users.sh
Created February 6, 2019 05:07
Returns list of macOS users with active Personal OneDrive syncing.
#!/bin/bash
# get list of user home folders of users with UIDs over 500
userList=$( dscl . list /Users UniqueID | awk '$2 > 500 { print $1 }' )
# get current epoch time
rightNow=$( /bin/date "+%s")
# recurse through user list
for aUser in $userList
@talkingmoose
talkingmoose / Create Printer.sh
Last active March 11, 2022 04:07
Add this script to Jamf Pro and then assign to a policy. Fill in the printer details for the script parameters 4-9.
#!/bin/sh
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Written by: William Smith
# Professional Services Engineer
# JAMF Software
# [email protected]
# https://gist.github.com/c994139378083fea610affeca3c3f90c
#