Skip to content

Instantly share code, notes, and snippets.

Avatar

Shawn Maddock smaddock

View GitHub Profile
@smaddock
smaddock / fileKiller.sh
Last active Jul 10, 2018 — forked from bwmorales/fileKiller.sh
List files that you want to assasinate in every user's home directory, as well as some system files, on macOS.
View fileKiller.sh
#!/bin/bash
SYSTEM_FILES=(
'/Applications/Google Chrome.app'
)
USER_FILES=(
'~/Library/Application Support/Google/Chrome'
'~/Library/Caches/Google/Chrome'
)
@smaddock
smaddock / SSH4Admins.sh
Created Aug 9, 2018
Enable Remote Login for Administrators group - macOS
View SSH4Admins.sh
#!/bin/bash
if sudo systemsetup -getremotelogin | grep -q Off; then
sudo systemsetup -setremotelogin on;
fi
if ! dseditgroup com.apple.access_ssh &> /dev/null ; then
dseditgroup -o create -q com.apple.access_ssh;
fi
sudo dseditgroup -o edit -a admin -t group com.apple.access_ssh
View webcontract.md

Between Shawn Maddock

And [customer name].

Summary:

I will always do my best to fulfill your needs and meet your expectations, but it is important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you will not find any complicated legal terms or long passages of unreadable text. I have no desire to trick you into signing something that you might later regret. What I do want is what is best for both parties, now and in the future.

So in short;

@smaddock
smaddock / udp.php
Created Apr 13, 2016
send basic UDP messages from PHP
View udp.php
<?php
$serverIP = '192.168.0.1';
$serverPort = 5000;
if ($_REQUEST['cmd']) {
$socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
if (!$socket) {
error_log("Could not open socket");
} else {
socket_sendto($socket, $_REQUEST['cmd'], strlen($_REQUEST['cmd']), 0, $serverIP, $serverPort);
socket_close($socket);
@smaddock
smaddock / NoSoftwareUpdateBadges.mobileconfig
Created Oct 7, 2019
Disable the badges in the Apple Menu, on System Preferences and on the Software Update Preference Pane related to available updates
View NoSoftwareUpdateBadges.mobileconfig
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>AttentionPrefBundleIDs</key>
<dict>
<key>com.apple.preferences.softwareupdate</key>
View mdm-reenroll.sh
#!/bin/bash
### IMPORTANT NOTICE ###
### BEFORE USING THE SCRIPT MAKE SURE THAT YOU HAVE YOUR OWN APPLE PUSH CERTIFICATE AND MDM PROFILE SET UP IN YOUR ADDIGY ENVIRONMENT ###
# Best practice is to use this Script for devices that are in a Policy with the MDM Profile configured correctly
# This script is made with the intention of streamlining the migration from an expired APN/Apple Push Certificate to a new one
MDMProfileIdentifier="com.github.addigy.mdm.mdm"
majorVersion=$(sw_vers -productVersion | awk -F. '{print $2}')
minorVersion=$(sw_vers -productVersion | awk -F. '{print $3}')