Skip to content

Instantly share code, notes, and snippets.

@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"
Installing the Windows 32-bit version of iTunes 12.6.5.3 in Mojave using Wine
1. Install XQuartz - XQuartz-2.7.11.dmg from https://www.xquartz.org
2. Install only 32bit components of Wine Stable 5 winehq-stable-5.0.pkg from https://dl.winehq.org/wine-builds/macosx/download.html
3. Download Mono wine-mono-5.1.0-x86.msi from https://dl.winehq.org/wine/wine-mono/5.1.0/
and Gecko wine-gecko-2.47.1-x86.msi from https://wiki.winehq.org/Gecko
4. Launch /Applications/Wine Stable.app
5. In the Terminal window opened, install Mono & Gecko with
wine msiexec /i ~/Downloads/wine-gecko-2.47.1-x86.msi
wine msiexec /i ~/Downloads/wine-mono-5.1.0-x86.msi
6. Install iTunes 12.6.5.3 32-bit version for Windows from https://support.apple.com/en-us/HT208079 with
@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 / 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 / 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 / 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 / keybase.md
Created October 25, 2019 12:29
Keybase

Keybase proof

I hereby claim:

  • I am b0gdanw on github.
  • I am bogdanw (https://keybase.io/bogdanw) on keybase.
  • I have a public key ASBV3CBAxrkGpuOk4i2vEKKsHdc5ySKl5czwuggGpVCEcAo

To claim this, I am signing this object:

@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 / 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