Skip to content

Instantly share code, notes, and snippets.

@b0gdanw
b0gdanw / adblock_hosts.sh
Last active July 23, 2021 18:12 — forked from Dani3lSun/adblock_hosts.sh
Mac OS X adblock shell script using system hosts file (Block ads system wide)
#!/bin/sh
#
# Mac OSX Adblocker Script for IPv4
# Description: Blocks ads using system hosts file /private/etc/hosts, Ad-Domains would be redirected to 0.0.0.0
# Author: Daniel Hochleitner
# Created: 10.09.2015
# Use: sudo ./adblock_hosts.sh
# Get original hosts file from /private/etc/hosts
@b0gdanw
b0gdanw / osx-software-update-urls-10.3-to-14.txt
Last active March 23, 2024 21:57 — forked from deltakhan/osx-software-update-urls.txt
URLs of the index files used by the software update client on OS X
10.3 (Panther):
https://swscan.apple.com/scanningpoints/scanningpointX.xml
10.4 (Tiger):
https://swscan.apple.com/content/catalogs/index.sucatalog
https://swscan.apple.com/content/catalogs/index-1.sucatalog
10.5 (Leopard):
https://swscan.apple.com/content/catalogs/others/index-leopard.merged-1.sucatalog
OSX 10.9 Mavericks
https://apps.apple.com/app/id675248567
OS X 10.10 Yosemite
https://apps.apple.com/app/id915041082
OS X 10.11 El Capitan
https://apps.apple.com/app/id1147835434
macOS 10.12 Sierra
@b0gdanw
b0gdanw / iTunes.scpt
Created October 24, 2019 07:30
iTunes 12.6.5.3 on macOS Catalina 10.15
#iTunes 12.6.5.3 https://support.apple.com/HT208079
#iTunes 12.8.2 https://support.apple.com/kb/dl1977
set theDMG to choose file with prompt "Please select iTunes dmg file:" of type {"dmg"}
do shell script "hdiutil mount " & quoted form of POSIX path of theDMG
do shell script "pkgutil --expand /Volumes/iTunes/Install\\ iTunes.pkg ~/tmp"
do shell script "hdiutil unmount /Volumes/iTunes/"
do shell script "cd ~/tmp/iTunesX.pkg;" & "cat Payload | gunzip -dc |cpio -i;" & "ditto ~/tmp/iTunesX.pkg/Applications/iTunes.app ~/tmp/iTunes.app;"
do shell script "plutil -replace CFBundleGetInfoString -string 'iTunes 13.6.5.3' ~/tmp/iTunes.app/Contents/Info.plist"
do shell script "plutil -replace CFBundleShortVersionString -string 13.6.5 ~/tmp/iTunes.app/Contents/Info.plist"
@b0gdanw
b0gdanw / iTunes12.9.scpt
Created October 24, 2019 07:32
iTunes 12.9.5.5 on macOS Catalina 10.15
set theAPP to choose file with prompt "Please select iTunes app:" of type {"app"}
do shell script "mkdir ~/tmp"
do shell script "ditto " & POSIX path of theAPP & " ~/tmp/iTunes.app" with administrator privileges
do shell script "plutil -replace CFBundleGetInfoString -string 'iTunes 13.9.5.5' ~/tmp/iTunes.app/Contents/Info.plist" with administrator privileges
do shell script "plutil -replace CFBundleShortVersionString -string 13.9.5 ~/tmp/iTunes.app/Contents/Info.plist" with administrator privileges
do shell script "plutil -replace CFBundleVersion -string 13.9.5 ~/tmp/iTunes.app/Contents/Info.plist" with administrator privileges
do shell script "plutil -replace CFBundleVersion -string 'iTunes 13.9.5.5' ~/tmp/iTunes.app/Contents/version.plist" with administrator privileges
do shell script "plutil -replace CFBundleShortVersionString -string 13.9.5 ~/tmp/iTunes.app/Contents/version.plist" with administrator privileges
do shell script "pkgbuild --component ~/tmp/iTunes.app --install-location /Applications ~/Deskto
@b0gdanw
b0gdanw / Java.scpt
Created October 24, 2019 07:35
Java for OS X 2017-001 on macOS Catalina 10.15
# Download Java for OS X 2017-001 https://support.apple.com/kb/DL1572
set theDMG to choose file with prompt "Please select javaforosx.dmg:" of type {"dmg"}
do shell script "hdiutil mount " & quoted form of POSIX path of theDMG & " -noverify -nobrowse"
do shell script "pkgutil --expand /Volumes/Java\\ for\\ macOS\\ 2017-001/JavaForOSX.pkg ~/tmp"
do shell script "hdiutil unmount /Volumes/Java\\ for\\ macOS\\ 2017-001/"
do shell script "sed -i '' 's/return false/return true/g' ~/tmp/Distribution"
do shell script "pkgutil --flatten ~/tmp ~/Desktop/Java.pkg"
do shell script "rm -rf ~/tmp"
display dialog "Modified Java.pkg saved on desktop" buttons {"Ok"}
@b0gdanw
b0gdanw / DisableStartUsingiCloud.txt
Created October 24, 2019 07:41
Disable Start Using iCloud notification in macOS Catalina 10.15
mv /Volumes/Macintosh\ HD/System/Library/LaunchAgents/com.apple.followupd.plist /Volumes/Macintosh\ HD/System/Library/LaunchAgents/com.apple.followupd.bak
defaults delete com.apple.systempreferences AttentionPrefBundleIDs; killall Dock
@b0gdanw
b0gdanw / IgnoreCatalina.txt
Created October 24, 2019 07:46
Ignore macOS Catalina upgrade
sudo softwareupdate --ignore 'macOS Catalina'
defaults delete com.apple.systempreferences AttentionPrefBundleIDs
rm ~/Library/Preferences/com.apple.preferences.softwareupdate.plist
killall Dock
@b0gdanw
b0gdanw / GetSysInfo.scpt
Last active December 9, 2021 13:59 — forked from clburlison/get_sys_info.scpt
macOS Mojave - get current system information
# https://macadmins.slack.com/archives/general/p1449604450017318
# https://gist.github.com/clburlison/db6aaf4a717eb8ef3545
# https://www.jamf.com/jamf-nation/feature-requests/5158/built-in-inventory-fields-for-os-x-macos-security-and-malware-protection-systems
# https://www.jamf.com/jamf-nation/discussions/19111/xprotect-status-extension-attribute
set MacOSVers to do shell script "defaults read /System/Library/CoreServices/SystemVersion.plist ProductVersion"
set MacOSBuild to do shell script "defaults read /System/Library/CoreServices/SystemVersion.plist ProductBuildVersion"
set XProtectVers to do shell script "defaults read /System/Library/CoreServices/XProtect.bundle/Contents/Resources/XProtect.meta.plist Version"
set XProtectDate to do shell script "GetFileInfo -d /System/Library/CoreServices/XProtect.bundle/Contents/Resources/XProtect.meta.plist"
@b0gdanw
b0gdanw / GetSysInfo.scpt
Last active January 17, 2023 04:03
macOS Catalina - get current system information
# https://macadmins.slack.com/archives/general/p1449604450017318
# https://gist.github.com/clburlison/db6aaf4a717eb8ef3545
# https://www.jamf.com/jamf-nation/feature-requests/5158/built-in-inventory-fields-for-os-x-macos-security-and-malware-protection-systems
# https://www.jamf.com/jamf-nation/discussions/19111/xprotect-status-extension-attribute
set MacOSName to do shell script "defaults read /System/Library/CoreServices/SystemVersion.plist ProductName"
set MacOSVers to do shell script "defaults read /System/Library/CoreServices/SystemVersion.plist ProductVersion"
set MacOSBuild to do shell script "defaults read /System/Library/CoreServices/SystemVersion.plist ProductBuildVersion"
set XProtectVers to do shell script "defaults read /Library/Apple/System/Library/CoreServices/XProtect.bundle/Contents/version.plist CFBundleShortVersionString"