Skip to content

Instantly share code, notes, and snippets.

View tobiasjwm's full-sized avatar

Tobias Morrison tobiasjwm

View GitHub Profile
@merlinmann
merlinmann / wisdom.md
Last active April 17, 2024 21:52
Merlin's Wisdom Project (Draft)

Merlin's Wisdom Project

Or: “Everybody likes being given a glass of water.”

By Merlin Mann.

It's only advice for you because it had to be advice for me.

@talkingmoose
talkingmoose / Match Version Number or Higher.bash
Last active May 6, 2024 20:13
Generates a regular expression (regex) that matches the provided version number or higher. Useful for Jamf Pro's "matches regex" operator in searches and smart groups where the results need to be the current version of an app or higher.
#!/bin/bash
<<ABOUT_THIS_SCRIPT
-------------------------------------------------------------------------------
Written by:William Smith
Professional Services Engineer
Jamf
bill@talkingmoose.net
https://gist.github.com/2cf20236e665fcd7ec41311d50c89c0e
@haircut
haircut / System - Software Updates.mobileconfig
Created October 10, 2017 01:02
Manage macOS Software Update settings via configuration profile (Jamf Pro)
<?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>PayloadContent</key>
<dict>
<key>com.apple.SoftwareUpdate</key>
@pudquick
pudquick / psu_hack_2017.py
Created July 14, 2017 12:56
Locking the screen of my Mac and playing a sound file with pyObjC
#!/usr/bin/python
approved_UUIDs = ['your-beacon-UUID-here'] # see line 64
path_to_lock_sound = '/Users/frogor/Desktop/car_lock.m4a'
path_to_warn_sound = '/Users/frogor/Desktop/viper_warning.m4a'
import time
import objc
from objc import NO
from Foundation import NSBundle, NSClassFromString, NSObject, NSRunLoop, NSDate, NSUUID, NSMakeRange, NSURL
from AVFoundation import AVAudioPlayer
@bradp
bradp / setup.sh
Last active June 17, 2024 10:09
New Mac Setup Script
echo "Creating an SSH key for you..."
ssh-keygen -t rsa
echo "Please add this public key to Github \n"
echo "https://github.com/account/ssh \n"
read -p "Press [Enter] key after this..."
echo "Installing xcode-stuff"
xcode-select --install
@tresf
tresf / create_apple_dmg.sh
Created March 31, 2014 05:20
create_apple_dmg.sh
#!/bin/bash
# by Andy Maloney
# http://asmaloney.com/2013/07/howto/packaging-a-mac-os-x-application-using-a-dmg/
# make sure we are in the correct dir when we double-click a .command file
dir=${0%/*}
if [ -d "$dir" ]; then
cd "$dir"
fi
@triti
triti / install-adobe-flash-player.sh
Created May 24, 2013 18:04
Absolute Manage install script for Adobe Flash Player Plugin on OS X
#!/bin/bash
SCRIPT="${0##*/}"
INSTALLPKG="${0%/*}/Install Adobe Flash Player.pkg"
MMSCFGDIR="/Library/Application Support/Macromedia"
MMSCFG="$MMSCFGDIR/mms.cfg"
# Print a message to the system log
@MagerValp
MagerValp / memorable_pwd.py
Created October 2, 2012 17:03
Generate memorable passwords
#!/usr/bin/python
import sys
import optparse
import random
rndgen = random.SystemRandom()
words = list(s.rstrip() for s in open("/usr/share/dict/words"))
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active June 13, 2024 02:39
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@triti
triti / gist:1364265
Created November 14, 2011 15:59
Bash: Absolute Manage FileVault 2 status script
#!/bin/bash
# Based on the FileVault 2 Encryption Check script by rtrouton
# https://github.com/rtrouton/rtrouton_scripts/blob/master/rtrouton_scripts/filevault_2_encryption_check/regular_script/filevault_2_encryption_check.sh
PATH='/usr/bin:/usr/sbin'
ST_NOTENABLED='Not Enabled'
ST_ENCRYPTING='Encrypting (%s%%)'
ST_ENCRYPTED='Encrypted'