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 / setFavServers.sh
Created January 18, 2020 03:38 — forked from jacobsalmela/setFavServers.sh
Add unlimited servers to the Connect To... menu in OS X
#!/bin/bash
bud='/usr/libexec/Plistbuddy'
plist=$HOME'/Library/Preferences/com.apple.sidebarlists.plist'
servers=('afp://servername'
'smb://servername'
'vnc://servername'
'ftp://servername')
killall cfprefsd
@scriptsandthings
scriptsandthings / makeardlist.sh
Created February 1, 2020 15:43 — forked from acidprime/makeardlist.sh
Apple Remote Desktop List creator from CSV
#!/bin/bash
declare -x uuidgen="/usr/bin/uuidgen"
declare -x plistbuddy="/usr/libexec/PlistBuddy"
declare -x awk="/usr/bin/awk"
declare -x cat="/bin/cat"
declare -x cp="/bin/cp"
declare -x dscl="/usr/bin/dscl"
declare -x defaults="/usr/bin/defaults"
declare -x du="/usr/bin/du"
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:
@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
@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 / 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 / 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 / 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 / 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 / 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.