Skip to content

Instantly share code, notes, and snippets.

View scriptsandthings's full-sized avatar

Scripts and Things scriptsandthings

  • Columbus, OH
View GitHub Profile
@scriptsandthings
scriptsandthings / Add Computer to Static Group.bash
Created March 11, 2022 04:04 — forked from talkingmoose/Add Computer to Static Group.bash
Prompts an administrator to choose a Jamf Pro static group and provide a computer serial number to add to that group.
#!/bin/bash
# server connection information
URL="https://talkingmoose.jamfcloud.com"
userName="API-Editor"
password="P@55w0rd"
httpErrorCodes="200 Request successful
201 Request to create or update object successful
400 Bad request
@scriptsandthings
scriptsandthings / jssdistrorepair.sh
Created March 2, 2022 21:15 — forked from shurkin18/jssdistrorepair.sh
JSS distribution point share folder permissions and accounts repair
#!/bin/bash
#################################################################################################################
# This script assumes, JSS is using default read and write usernames: jamf, jamfadmin
# This script also assumes that local administrator account used on the mac is named: administrator
#################################################################################################################
#Ask user to point to the share folder, browse to it via "cd"
FOLDER_TO_PROCESS=$(/usr/bin/osascript << EOD
tell application "System Events"
@scriptsandthings
scriptsandthings / encrypt text with openssl.md
Created March 6, 2020 17:45 — forked from Wartz/encrypt text with openssl.md
encrpt text with openSSL for use in Jamf script paramters.

Encrypt text or files with OpenSSL

This has been very useful for Jamf policy / script parameters that contain passwords. It's not perfect because the passphrase and salt must be transferred as well, but at least it's not in cleartext...

Salt and passphrase

You can use OpenSSL to generate psuedo-random text which is more than enough for this tbh considering all the other problems this solution has. I believe the salt cant be more than 8 characters long cuz it's a hexidecimal value. Or it could be that both the salt and the passphrase need to be a valid hex string which means they could be longer just have to be a specific length. (Idk I could be entirely wrong on this).

Just do 8 and 12, I know that works.

@scriptsandthings
scriptsandthings / clear-font-cache.md
Created March 3, 2020 18:09 — forked from jaredhowland/clear-font-cache.md
Clear Mac OS X Font Caches
@scriptsandthings
scriptsandthings / casper.md
Created February 19, 2020 02:20 — forked from motleytech/casper.md
Deal with casper

Unofficial Guide to JAMF Casper

This page documents the external/internal behavior of Casper.

Files

Casper installed itself into the following directories:

  • /Library/Application Support/JAMF
    • ManagementFrameworkScripts - a set of scripts that runs on certain events
      • StartupScript.sh - Activated when jamf is started
      • loginhook.sh - Activated when user login
  • logouthook.sh - Activated when user logout
@scriptsandthings
scriptsandthings / ubuntu-hardening.md
Created February 17, 2020 06:31 — forked from lokhman/ubuntu-hardening.md
List of things for hardening Ubuntu

System Updates

http://bookofzeus.com/harden-ubuntu/initial-setup/system-updates/

Keeping the system updated is vital before starting anything on your system. This will prevent people to use known vulnerabilities to enter in your system.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get autoremove
sudo apt-get autoclean
@scriptsandthings
scriptsandthings / osx_setup.md
Created February 14, 2020 22:31 — forked from millermedeiros/osx_setup.md
Mac OS X setup

Setup Mac OS X

Edit: I've done the same process every couple years since 2013 (Mountain Lion, Mavericks and High Sierra).

I just replaced the hard drive of my mbp and decided to do a clean install of Mountain Lion (10.8.5) since I was still using Snow Leopard (10.6.8).

I kinda regret for not using Boxen to automate the process, but TBH I have this laptop for almost 3yrs and this is the first

@scriptsandthings
scriptsandthings / Example_App.exe.manifest
Created February 13, 2020 12:17 — forked from leeramsay/PSADT-Cheatsheet.ps1
PSADT snippits/cheatsheet
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0"
processorArchitecture="X86"
name="Example_App.exe"
type="win32"/>
<description>elevate execution level</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
@scriptsandthings
scriptsandthings / merge.py
Created February 8, 2020 17:35 — forked from korylprince/merge.py
Modify 10.13 (SFL2) Server Favorites list
#!/usr/bin/python
"""
Merges add_servers into current favorites and removes remove_servers.
Run as root to update all users or as normal user to update just that user.
"""
import os
import getpass
import subprocess
Mac Network Commands Cheat Sheet
After writing up the presentation for MacSysAdmin in Sweden, I decided to go ahead and throw these into a quick cheat sheet for anyone who’d like to have them all in one place. Good luck out there, and stay salty.
Get an ip address for en0:
ipconfig getifaddr en0
Same thing, but setting and echoing a variable: