Skip to content

Instantly share code, notes, and snippets.

View scriptsandthings's full-sized avatar

Scripts and Things scriptsandthings

  • Columbus, OH
View GitHub Profile
@lazymacadmin
lazymacadmin / sync_jcds_local_dp.zsh
Created February 22, 2024 18:48
A script to sync an on-premise distribution from your JCDS
#!/bin/zsh
## Bits shamelessly borrowed from Graham Pugh - https://gist.github.com/grahampugh/836547859c18fefe1dba6ba8c093accc
## Then reversed to only pull down files which either do not exist in the DP or whose md5 doesn't match
##
## This script relies on a Jamf API role/client and a local identity file of the following format:
## {"client_name":"test_for_screenshot","client_id":"a7682e67-a276-448b-83af-9c83be5e02f4","client_secret":"ubPrXqRRyc0jRLFOY9iJYGpCjHiJc1M-tRLlCFb9aWZhtqf7iC9UpQG_dO1ZkvNF","grant_type":"client_credentials"}
##
## This is most easily obtained by creating an api client, enabling it and copying the data from the popup, then pasting it into a file
##
##
@Kapujino
Kapujino / migrateAdlistToAdguard.py
Last active December 23, 2024 15:58
This script adds a plain list of adlists to the adguard configuration AdGuardHome.yaml
#!/usr/bin/python3
import yaml
# load AdGuardHome.yaml
with open('AdGuardHome.yaml', 'r') as file:
data = yaml.load(file, Loader=yaml.FullLoader)
# load file with adlist sources
with open('adlists.txt', 'r') as file:
@haydenmc
haydenmc / update-porkbun-dns.sh
Created July 30, 2023 23:57
Porkbun DNS Record Update Script for my Synology Router
API_KEY=PORKBUNAPIKEYHERE
API_SECRET=PORKBUNAPISECRETHERE
IP4_ADDR=$(ip -4 addr show eth0 | grep -oE '([0-9]{1,3}\.){3}([0-9]{1,3})')
IP6_ADDR=$(ip -6 addr show eth0 | grep -oE '([0-9a-f]{1,4}\:){7}([0-9a-f]{1,4})')
curl --header "Content-Type: application/json" \
--request POST \
--data '{
"apikey" : "'"$API_KEY"'",
"secretapikey" : "'"$API_SECRET"'",
@scriptsandthings
scriptsandthings / README.md
Created May 25, 2023 01:36 — forked from tomdaley92/README.md
Proxmox - SPICE Client setup for MacOS

Proxmox - SPICE client setup for MacOS

  1. Install a working (and compiled) version of virt-viewer. You may view the homebrew package's upstream source on GitHub.

    brew tap jeffreywildman/homebrew-virt-manager
    brew install virt-viewer
  2. Once that's installed should be able make a call remote-viewer with a pve-spice.vv file downloaded from proxmox web interface

@Lamercho
Lamercho / odbc_on_mac.md
Last active April 14, 2023 17:10 — forked from erikvw/odbc_on_mac.md
mysql, ODBC, STATA 16 on MAC (M1 Silicon)
@talkingmoose
talkingmoose / Speed Dating for Mac Admins.md
Last active May 5, 2023 19:53
Resources for my Penn State 2022 MacAdmins Campfire presentation on June 2

Speed Dating for Mac Admins

Terminal Login Banner

Last login: Wed Jun  1 23:03:39 on ttys000


                        'c.            Logged in as: bill.smith
                     ,xNMM.            ---------------------------------
@talkingmoose
talkingmoose / RemoveApplication.zsh
Created May 27, 2022 15:39
Remove a drag-and-drop application before performing another task such as a software update.
#!/bin/zsh
<<ABOUT_THIS_SCRIPT
-----------------------------------------------------------------------
Written by:William Smith
Professional Services Engineer
Jamf
[email protected]
https://gist.github.com/bd4abab222685c4e3781967a4d0491f6
#!/bin/sh
# Get PrivilegesDemoter version
version=$( grep Version /usr/local/mostlymac/checkPrivileges.sh | cut -f2 -d ":" )
# If version is present, set result
if [ "$version" ]; then
RESULT=$version
fi
@talkingmoose
talkingmoose / RemoveUsersFromAdmin.zsh
Last active October 24, 2022 21:01
Removes all users with UIDs greater than 500 from local admin group.
#!/bin/zsh
# these local accounts will not be removed from admins
# one account name per line; keep the beginning and closing quotes
exceptionsList="talkingmoose
bill.smith
oszein
jamfadmin"
@talkingmoose
talkingmoose / Download macOS Monterey in Background.zsh
Last active October 6, 2022 12:04
Creates a launch daemon and script on target Macs in a Jamf Pro policy to download the specified macOS installer and update Jamf Pro's inventory. This is preferable to running a command directlt in policy, which can take 30+ minutes to complete, preventing other policies from running. The script self destructs once it sees the installer in the A…
#!/bin/zsh
:<<ABOUT_THIS_SCRIPT
-------------------------------------------------------------------------------
Written by:William Smith
Partner Program Manager
Jamf
[email protected]
https://gist.github.com/6b78ba3fc4a6623dbc8225e2df38d570