Skip to content

Instantly share code, notes, and snippets.

View hfike's full-sized avatar

Harry Fike hfike

  • Maryland, United States
View GitHub Profile
@saniaky
saniaky / aws-s3-policy.json
Last active January 14, 2022 01:06
Backup and restore a ALL MySQL databases from a running Docker MySQL container.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowPolicy",
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:ListBucket"
#!/usr/bin/python
# Credit to frogor for the objc
from Foundation import NSBundle
import json
import objc
import os
import plistlib
import subprocess
@timsutton
timsutton / ausst_sync_diff.sh
Created September 18, 2016 13:21
Utility for doing an AUSST sync run with actual diff output
#!/bin/sh
#
# Dumb script to output an actual diff of a run of Adobe's AUSST software update mirror tool,
# which provides no helpful summary of what changed in its last sync operation. It also runs
# the command with `time`.
#
# Requires the 'tree' command, available from your favourite package manager:
#
# Homebrew: https://github.com/Homebrew/homebrew-core/blob/master/Formula/tree.rb
# pkgsrc: https://github.com/joyent/pkgsrc/tree/trunk/sysutils/tree
@calum-github
calum-github / configure_dock.sh
Created January 11, 2016 23:17
dockutil script
#!/bin/bash
################################################################################
# Author: Calum Hunter #
# Date: 12/01/2016 #
# Version: 1.91 #
# Purpose: Default dock settings for user accounts #
# Configured via Dockutil #
# This should be run as a initial login script via LauchAgent #
################################################################################
#!/bin/bash
LOCALADMIN="username"
kickstart=/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart
echo "Configuring Remote Management"
if id -u $LOCALADMIN >/dev/null 2>&1; then
echo "Defined local admin account exists"
# Deactivate ARD agent, deny all access
echo "Deactivating ARD agent"
@bruienne
bruienne / logoutwatcher.sh
Last active July 26, 2023 21:58
logout watcher
onLogout() {
# Insert whatever script you need to run at logout
exit
}
echo "INFO - Watching ${HOME}" >> /var/log/org.my.log
trap 'onLogout' SIGINT SIGHUP SIGTERM
while true; do
@bruienne
bruienne / org.my.logoutwatcher.plist
Last active November 3, 2023 23:04
logout watcher LA
<?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>Label</key>
<string>org.my.logoutwatcher</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/myorg/logoutwatcher.sh</string>
</array>
#!/usr/bin/python
import plistlib, os.path, os
# Based off of https://forums.developer.apple.com/message/6741
# and http://apple.stackexchange.com/a/136976
def jdk_info_plists():
# Find all the JDK Info.plist files
JDK_ROOT = "/Library/Java/JavaVirtualMachines"
if (os.path.exists(JDK_ROOT) and os.path.isdir(JDK_ROOT)):
@sheagcraig
sheagcraig / AdwareCheckExtensionAttribute.py
Last active November 27, 2021 23:51
Check for Adware per Apple Kbase article
#!/usr/bin/python
"""Identify or remove files known to be involved in Adware/Malware
infection.
Most of the code applies to building a list of malware files. Thus,
both extension attribute and removal handling are included.
Cleans files as a Casper script policy; thus, it expects four total
arguments, the first three of which it doesn't use, followed by
--remove
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>autoremove</key>
<true/>
<key>catalogs</key>
<array>
<string>testing</string>
</array>