This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check for active connection | |
while [ "$NETACTIVE" == 'FALSE' ]; do | |
# If block to test internet availability | |
if ping -nc 3 8.8.8.8 | grep '100.0%' >/dev/null 2>&1;then | |
/bin/echo $(date) "failed to connect to server" | |
exit 1 | |
else | |
/bin/echo $(date) "Success connecting to server" | |
# Do stuff here | |
NETACTIVE=TRUE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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>Disabled</key> | |
<false/> | |
<key>Label</key> | |
<string>com.foo.displaymirroring</string> | |
<key>LimitLoadToSessionType</key> | |
<array> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python | |
import os | |
# import subprocess | |
# import re | |
ProfileInstalled = False | |
getprofile='/usr/bin/profiles -C' | |
print("GetProfile: "+getprofile) | |
profileDump = os.popen("/usr/bin/profiles -C") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1"> | |
<dict> | |
<key>PayloadUUID</key> | |
<string>35956225-3AA0-4735-BA3B-68224F26381E</string> | |
<key>PayloadType</key> | |
<string>Configuration</string> | |
<key>PayloadOrganization</key> | |
<string></string> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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>edu.psu.clc.idlelogout</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>open</string> | |
<string>/Library/CLMshared/Startup Items/Idle Logout.app</string> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat preferences.js | |
pref("app.update.url", "http://url.com/update.xml"); | |
pref("app.update.url.manual", "http://url.com/manual"); | |
$ perl -i~ -pe 's{pref("app.update.url", "http://url.com/update.xml");}{pref("app.update.url", "http://custom.edu/update.xml");}g' preferences.js | |
$ cat preferences.js* | |
pref("app.update.url", "http://url.com/update.xml"); | |
pref("app.update.url.manual", "http://url.com/manual"); | |
pref("app.update.url", "http://url.com/update.xml"); | |
pref("app.update.url.manual", "http://url.com/manual"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Script credit: Jeremy Reichman <jjracc@rit.edu> | |
# VolumeCheck Exit Statuses are calculated by subtracting 32 | |
# E.G. exit 48 matches 16, exit 50 matches 18 in the VolumeCheck.strings file | |
# Check for minimum Mac OS X major version on the volume | |
SCRIPT_PATH="$0" | |
VOLUME_PATH="$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use Foundation; | |
my $NSASCIIStringEncoding = 1; | |
my $dscl = "/usr/bin/dscl"; | |
sub getGeneratedUID(){ | |
$name = shift; | |
my $command = "$dscl -plist . -read /Users/$name GeneratedUID"; | |
print "$command\n"; | |
my $output = `$command`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When you need to run a script against a volume that has not been restored first, you can set the $DS_LAST_RESTORED_VOLUME to the internal drive of the Mac. This allows a script to work with or without restoring in a workflow. | |
DS_LAST_RESTORED_VOLUME=`system_profiler SPSerialATADataType | awk -F': ' '/Mount Point/ { print $2}'|head -n1` |
OlderNewer