Skip to content

Instantly share code, notes, and snippets.

View bryanheinz's full-sized avatar

bryan heinz bryanheinz

View GitHub Profile
@bryanheinz
bryanheinz / csb_status_reset.sh
Last active May 1, 2018 22:17
Resets Synology Cloud Station Backup client backup status.
#!/bin/bash
if [ $(sw_vers -productVersion | awk -F. '{print $2}') -lt "11" ]; then
echo "This script only works on macOS 10.11 or newer."
exit
fi
# get user
theUser=$(/usr/bin/stat -f "%Su" /dev/console)
@bryanheinz
bryanheinz / xcode_builds++.sh
Last active February 4, 2017 07:09
A quick script to add to your build phases in Xcode to automatically increase your build numbers. Tested and working on OS X 10.12.3 and Xcode 8.2.1.
#!/bin/bash
a=$(/usr/bin/defaults read "$PRODUCT_SETTINGS_PATH" CFBundleVersion)
b=$(/bin/expr $a + 1)
/usr/bin/defaults write "$PRODUCT_SETTINGS_PATH" CFBundleVersion $b
c=$(/usr/bin/xcodebuild -project "$PROJECT_FILE_PATH" -target "$TARGETNAME" -showBuildSettings | /usr/bin/grep PRODUCT_SETTINGS_PATH)
d=${c%/*}
e=${d#* = *}
cd $e
@bryanheinz
bryanheinz / xcode_builds++.sh
Created December 27, 2015 08:41
A quick script to add to your build phases in Xcode to automatically increase your build numbers.
#!/bin/bash
a=$(/usr/bin/defaults read "$PRODUCT_SETTINGS_PATH" CFBundleVersion)
b=$(/bin/expr $a + 1)
/usr/bin/defaults write "$PRODUCT_SETTINGS_PATH" CFBundleVersion $b
@bryanheinz
bryanheinz / Crashplan
Created January 29, 2015 19:33
AppleScript to start/stop CrashPlan ProE Server
display dialog "Start or Stop Crashplan Server?" buttons {"Cancel", "Start", "Stop"} default button 1
copy the result as list to {buttonpressed}
if the buttonpressed is "Start" then
try
do shell script "launchctl load /Library/LaunchDaemons/com.crashplan.proserver.plist" with administrator privileges
end try
else if the buttonpressed is "Stop" then
try
do shell script "launchctl unload /Library/LaunchDaemons/com.crashplan.proserver.plist" with administrator privileges
end try
@bryanheinz
bryanheinz / Copy Safari URLs
Last active August 29, 2015 14:06
Copy Safari URLs
tell application "Safari"
set urlList to {}
repeat with _tab in tabs of front window
set end of urlList to URL of _tab
end repeat
end tell
set urlString to urlList as string
set quoteURL to quoted form of urlString
do shell script "python <<EOF
var = " & quoteURL & "