macOS
Resources
purgehttps://github.com/emred/osx-hack/blob/master/hack.sh
https://gist.github.com/brandonb927/3195465#file-osx-for-hackers-sh
https://archive.is/20150913113549/http://osxnotes.net/
https://github.com/herrbischoff/awesome-osx-command-line
Self-hosting Apple Software Updates https://github.com/wdas/reposado
Time Machine
Informations
(Using AFP only) These presumably allow the disk image engine to force disk image journal data to write out all the way to the disk. Without such features, a network interruption can result in a corrupted filesystem on the disk image despite journaling. Remember, journaling relies on the journal being written all the way to disk before the changes take place. If you can't guarantee that (e.g., because of network/NAS buffering) then the journal is useless. Time Machine appears to rely heavily on disk journaling to deal with network drop-outs, interrupted backups, and the like. Take this away and your data is at risk.
(association between backupbundle and the machine via UUID) Snow Leopard Time Machine Tweaks | Missives
sudo log stream --predicate 'subsystem=="com.apple.TimeMachine"' --info(to exit: enterexit+ return)automount remote disk at
/Volumes/.timemachine/{remote-machine-name}TM process name:
com.apple.backupd.Open
system.logwith Console.app, search forbackupdignore disk to be a TM target:
touch ".com.apple.timemachine.donotpresent"in the root of the disk.com.apple.timemachine.supportedif the folder must be backup by Time Machinecurrent files used by Time Machine
sudo fs_usage -w -f filesys backupdfiles ignored by TM with extended attribute
sudo mdfind "com_apple_backup_excludeItem = 'com.apple.backupd'"Consolation, T2M2, Ulbow and log utilities – The Eclectic Light Company - T2M2 (TheTimeMachineMechanic) summarise TM logs, Mints
Time Machine backup reliability:
Similar tools
Time Machine for every Unix out there - IMHO
.snapshots/daily.0/
See also Easy Automated Snapshot-Style Backups with Rsync
How to install & compile rsync on Mac OSX - Install rsync 3.x on macOS without macport or brew
In Win 8+ use File History. It use Shadow Copy Service and backupd to VHD format. See also Backup and Restore and File History
Fake Time Machine - "Fake Time Machine, a way to duplicate the functionality of Apple's Time Machine using rsync, which also might make it cross-platform, but also lets you run it to any remote server "
samdoran/rsync-time-machine: Backup mimicking Time Machine from Mac OS X using rsync (see also https://github.com/samdoran/rsync-time-machine/commit/3610f7c73c2b1f8617c7462d880e12e73611d6b4#commitcomment-13078199 and https://github.com/minolasoft/rsync-time-machine)
GUI for rsync
arRsync (for the source code, see
arrsync-X.X.X.tar.gzandarrsync-X.X.X.tar.bz2)https://github.com/mileswu/arrsync
Include files and folders
Included by default:
From $IBACKUP_APP/Contents/Resources/System Settings/ iBackup
Address Book (Cards, Groups, Plug-Ins)
Dashboard
Desktop Pictures
Fonts
Keychains
Mail (Accounts, Mailboxes, Messages)
Printers
Safari (Bookmarks, History, Preferences)
Screen Savers
System Preferences (Bluetooth, Dock, Services ...)
iCal (Alarms, Events, To Do, Calendars)
iChat (Accounts, Preferences)
iMovie (Preferences)
iPhone
iPhoto
iPod
iTunes
Exclude drives, folders and files
By default some folder/files are excluded. But some are not to allow a full restoration of a viable system (ex: /private/var/log/ and its folders are kept but not their files).
How to:
Fixed path exclusions System Preferences > Time Machine > Options, similar to
sudo tmutil addexclusion -p <drive, dir or file>(but it's not the same). See also/Library/Preferences/com.apple.TimeMachine.plistand/System/Library/CoreServices/backupd.bundle/Contents/Resources/StdExclusions.plistSticky exclusions
tmutil addexclusion <drive, dir or file>same asxattr -w com.apple.metadata:com_apple_backup_excludeItem com.apple.backupd <filename>.This not work forfiles inside packages(Spotlight don't index files in packages)find /path/to/projects -type d -path '*node_modules/*' -prune -o -type d -name 'node_modules' -exec xattr -w com.apple.metadata:com_apple_backup_excludeItem com.apple.backupd '{}' \;files ignored by Spotlight still backup by Time Machine
Find sticky excluded files/folders sudo mdfind "com_apple_backup_excludeItem = 'com.apple.backupd'"
See also
Inspect bytecode of CCleanerLib, contains debug symbols
General
~/Download/Applications/Install OS X Yosemite.appFolder of Dropbox, Box, Google Drive, iCloud (
~/Library/Mobile Documents/) etc.
System
(not adviced)
/private/var/folders/%random%/%random%/0/com.apple.LaunchServices-134$(id -u).csstoreSometime this file is updated too often (< 1h) (after each Time Machine backup?) Maybe a rebuild is necessary:find /System/Library/Frameworks -type f -name "lsregister" -exec {} -kill -seed -r \;orfind /System/Library/Frameworks -type f -name "lsregister" -exec {} -kill -r -domain local -domain system -domain user \;Launch Services Database file is per user file 134 on OSX 10.11, an other number on other OSX version) contains software file type/protocol association and maybe Login Items too See com.apple.LaunchServices-014501.csstore keeps r... | Official Apple Support Communities(can break restoration of the system, contains small files)
/private/var/db/BootCaches/and/private/var/db/systemstats~/.bash_sessions
By exploring Time Machine backups delete backup of content of /private/var/folders/ and files /private/var/log/ (but keep folders tree intact)
Steam
~/Library/Application Support/Steam/config/htmlcache~/Library/Application Support/Steam/appcache
Virtual Machines and simulators
VMware, Parallels, VirtualBox, etc.
Virtual Machines.localizedVMware Fusion/Library/Developer/CoreSimulator/Profiles/RuntimesiOS simulator/Library/Android/sdk/system-imagesAndroid SDK (depends installed location)
If possible, enable option to split vitual machine hard disk into small chunks. (VMWare Player: New Virtual Machine Wizard > Specify Disk Capacity > Split virtual disk into multiple files)
or use sparse bundle to store VMs disks
Adobe Creative Suite
~/Library/Preferences/Adobe/After Effects/11.0/Adobe After Effects Disk Cache - XXXXX.noindex(should be already ignored by Spotlight, but seem not work)Photoshop scratch disk's temp files (where ?)
Lightroom
~/Pictures/Lightroom/Lightroom 5 Catalog Previews.lrdata~/Pictures/Lightroom/Lightroom 5 Catalog Smart Previews.lrdata
Xcode
/Applications/Xcode.app~/Library/Developer/Shared/Documentation/DocSets~/Library/Developer/Xcode/DerivedData
Google Chrome (see also Canary)
~/Library/Application Support/Google/Chrome/Default/Application Cacheand https://code.google.com/p/chromium/issues/detail?id=25959~/Library/Application Support/Google/Chrome/Default/GPUCache~/Library/Application Support/Google/Chrome/ShaderCache~/Library/Application Support/Google/Chrome/Default/Extension Rules/XXXXXX.log~/Library/Application Support/Google/Chrome/Default/Extension Rules/LOG~/Library/Application Support/Google/Chrome/Default/Extension Rules/LOG.old~/Library/Application Support/Google/Chrome/Default/Extension State/XXXXXX.log~/Library/Application Support/Google/Chrome/Default/Extension State/LOG~/Library/Application Support/Google/Chrome/Default/Extension State/LOG.old~/Library/Application Support/Google/Chrome/Default/Session Storage/XXXXXX.log~/Library/Application Support/Google/Chrome/Default/Session Storage/LOG~/Library/Application Support/Google/Chrome/Default/Session Storage/LOG.old
Spotify
~/Library/Application Support/Spotify/PersistentCache(by default) or the path of Spotify Preferences > Advanced > Memory Cache
jDownloader
/Applications/jDownloader.app/Contents/java/app/tmp(use fixed path exclusion)/Applications/jDownloader.app/Contents/java/app/logs(use fixed path exclusion)
Firefox
In ~/Library/Application Support/Firefox/Profiles/%ff_profile_id%/ files likes places.sqlite, cookies.sqlite, content-prefs.sqlite and webappsstore.sqlite can be quite big (N * 10MB) and often updated. Clean history and clean cookies or change places.history.expiration.max_pages and or places.history.expiration.interval_seconds. Could be safely deleted (a new file will be created when it is needed). Clean up sqlite DB (reduce size): echo "VACUUM;" | sqlite3 places.sqlite. See https://wiki.mozilla.org/Firefox/Projects/Places_Vacuum
~/Library/Application Support/Firefox/Profiles/%ff_profile_id%/weave/logs could be excluded too
Thunderbird
See Firefox for places.sqlite, cookies.sqlite, content-prefs.sqlite and webappsstore.sqlite
use maildir format in Thunderbird (store each email as individual file instead of a big file containing all emails)
~/Library/Thunderbird/Profiles/%tb_profile_id%/global-messages-db.sqlite~/Library/Thunderbird/Profiles/%tb_profile_id%/global-messages-db.sqlite-journal~/Library/Thunderbird/Profiles/%tb_profile_id%/panacea.dat(Mail folder cache. It can be safely deleted)
MySQL
Use "InnoDB File-Per-Table Tablespaces":
In my.cnf
sparsebundle
Explore sparsebundle
Mount *.sparsebundle / *.backupbundle first: hdiutil attach My.sparsebundle
tmutil(withcompare,uniquesizeorcalculatedrift):tmutil compare /Volumes/MyBackupVolume/Backups.backupdb/$COMPUTE_NAME%/2016-02-18-090818 /Volumes/MyBackupVolume/Backups.backupdb/$COMPUTE_NAME/2016-02-18-102050.+added file,-removed file,!changed filediskutil umount force /Volumes/com.apple.TimeMachine.TM_Prime-DA16D91F-3320-4834-91ED-2902CE57E46DBackupLoupe - Explore version (compare changes, size)
TimeTracker by CharlesSoft - Not work well with network drives
find /path/to/your/latest/backup -type f -links 1 -print(Time Machine use hardlinks for unmodified files). But not realy usefull since some folder use hardlink too (and you can't exlude file in hardlinked folders)
Create or resize sparsebundle
Aka specify a size
Sparsebundle are use on network drives.
Create a sparsebundle of 320GiB or use 320000000000b (= 320GB)
To create dynamic sparsebundle, create it without partition scheme.
Sparsebundle will increase by it's content
You can shrink sparseimage directly (should not be used). Could require a compact before
reclaim unused bands (free space)
sudo hdiutil compact -verbose image.sparsebundle(could be executed multiple times) orhdiutil resize -verbose -sectors min image.sparseimage.To fix
hdiutil: compact failed - internal errorsee:hdiutil returns error trying to resize sparsebu... | Apple Support Communities If the image is large, try to resize in stages (2TB -> 1,5TB -> 500GB -> 10GB) or will there an error:
hdiutil: resize failed - Cannot allocate memoryhttp://java.dzone.com/articles/shrink-your-time-machine
http://www.readynas.com/?p=253
Change sparsebundle band size
If "Time Machine must recreate a new copy" occure too often, or if after few month of TM use, back is slow, or if the host of the sparsebundle don't support well lot of file in one dir (ex: ext4 <40000)
By default Time Machine use band in sparsebundle with size of 8MiB. It's can be problematic when the size of the backup is > 300GB. 16MiB (32768 blocks) could be a good compromise.
Note: Increase band size only for unencrypted backups. Large bands could be problematic with encrypted backups (take lot of time): download band, decrypt, update, encrypt then finally upload
The sparse-band-size parameter is the number of 512-byte sectors (chunks), not the number of bytes. Since 512 is 1/2 1,024, then 262,144 B / 2 = 128 KiB.
Where 262144 equals 128MiB bands/byte sectors (128 MiBytes == 128*1024*1024 bytes == 128*1024*1024/512 blocks = 262144 blocks, 262144 / 2 / 1024 = 128MiB)
Read it (for mounted sparsebundle):
https://gist.github.com/Agiley/b3e9af8a641df1dc73c0
Backup into a sparsebundle file
This format is often created to backup on a shared network volume (that is not HFS+)
Mount it (db click in Finder) and
SparseBundle sould be at the root of the volume. A workaround is to create a symbolic link ln -s /volume1/backups/subfolder/subfolder/BackupImage.sparsebundle BackupImage.sparsebundle, but only supported on OSX (Unix folder symlink are forbidden)
Can be required
http://pondini.org/TM/18.html#id18
Control when to backup
More control, by can impact performances (battery, powernap, integrity, etc.)
Change:
(before 10.8)
sudo defaults write /System/Library/LaunchDaemons/com.apple.backupd-auto StartInterval -int 7200(7200 in seconds eq. 2 hours)(10.8+) update
BackupIntervalin/System/Library/LaunchDaemons/com.apple.backupd-auto.plist
Or use an app:
Time Machine Destination Manager: https://github.com/dustinrue/Tedium and Tedium for Mac | MacUpdate
TimeMachineScheduler - set the backup interval of Time Machine or TimeMachineEditor or update
sudo defaults write /System/Library/LaunchDaemons/com.apple.backupd-auto StartInterval -int 3600(for 1 hours, 7200 = 2 hours, etc.)Use cron task By controling when enable/disable/start it:
sudo tmutil enable|disableordefaults write /Library/Preferences/com.apple.TimeMachine AutoBackup -boolean YES|NOortmutil startbackup --auto --block
Restore from a Time Machine backup
You can't restore this backup because it was created by a different model of Mac
Could restore from a Time Machine Backup with Migration Assistant.
Restore from a Time Machine backup should restore all files, but few things are not:
System Preferences > Keyboard > Keyboard Shortcuts (key mapping, "open terminal here", etc.)
Few softwares require to re-enter licencies credentials (which depends on hardware finger print?)
Some login credentials
System Preferences > Security & Privacy
scanners and printers drivers and configurations
file type/protocol association
Character map recent and favs
Also don't erase immediatly all TM snapshots, some are not complete due to concurency with software that also write on disk in same time (or use large files)
Change harddrive
Local snapshots
In folder /.MobileBackups
http://pondini.org/TM/30.html
http://apple.stackexchange.com/questions/80183/any-way-to-change-the-location-of-time-machine-local-backups-mobilebackups-t
http://support.apple.com/kb/HT4878
Remove specific file from Time Machine backup
cd "/Volumes/Time Machine Backups/Backups.backupdb/<machinename>"ls -li *"/<drivename>/<path>/"*,sudo bypass rm -rf *"/<drivename>/<path>/"*ls -li *"/<drivename>/<file>",sudo bypass rm -f *"/<drivename>/<path>/<file>"
Reduce size
Troubleshooting
Catalina have issue with SMB (often disconnected and sometimes can't reconnect). Force to use AFP mounted disk instead. See Time Machine in Catalina 10.15.3 has serious bugs – The Eclectic Light Company and Catalina - no longer access NAS via Finder? Time Machine not working. | Synology Community
Stuck on "Preparing backup..."
It's often related to spotlight indexing (can't backup when spotlight is indexing)
The backup is already in use
Aka "Failed to unmount disk mounted at [...]" on the server
On the server, disconnect the user or restart the AFP service
Time Machine backup is very slow
Disable low priority process throttle: sudo sysctl -w debug.lowpri_throttle_enabled=0. Check before if it's happend with sudo fs_usage -w -f filesys backupd
See also if it use SMB Shares, it could be slow itself (due to protocol version use or signing).
Other Time Machines errors
https://github.com/jamespayne/time-machine-sparse-bundle-fix and https://github.com/Parkcomm/time-machine-sparce-bundle-fix
https://gist.github.com/dipdi/fedb28652f8e7de2b11b
micxer/time-machine-sparse-bundle-fix: Time Machine Sparsebundle Fix - "Time Machine completed a verification of your backups. To improve reliability, Time Machine must create a new backup for you." fix
Time Machine Volume on Network
Via AFP (depreciated) or SMB protocols
Sparsebundle disk images cannot, however, be saved on SMB volumes and a handful of other filesystems due to their lack of support for "F_FULLFSYNC", which is a filesystem command that instructs the disk to write data from cache to media.
If you are using Netatalk version 2.0.5 or better, this has the special new features added to avoid Time Machine disk corruption. If you have a version of Netatalk earlier than 2.0.5 (e.g. Ubuntu 9.10 currently has 2.0.4) [..]
If you have Netatalk 2.0.5 installed, you should add the option “tm” to any share you use for Time Machine, in the AppleVolumes.default config file.
— Using Ubuntu for Time Machine in Snow Leopard – Delivering Quality
sudo tmutil setdestination -p smb://user@Server._smb._tcp.local./Mount or sudo tmutil setdestination -p afp://user@Server.local/Mount
10.11
tmutil version 4.0.0 (built Oct 3 2015)appears to not support SMB but only AFP. 10,13tmutil version 4.0.0 (built Jul 15 2017)doesTime Machine use an SMB extension
F_FullfSyncavailable in SMB3 (SAMBA 4.1 implement it) to ensure that data is actually written to disk. See MacOS Sierra support Time Machine via SMB- but how? : appledefaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1 && killall Finder(apparently it's ignored with OSX 10.11, SIP?)Why can't I use a sparsebundle disk image on a filesystem that does not support the F_FULLFSYNC file control? Backing up to a disk image | Carbon Copy Cloner | Bombich Software
vfs_fruit - "The vfs_fruit module provides enhanced compatibility with Apple SMB clients and interoperability with a Netatalk 3 AFP fileserver."
macOS Monterey have issues with TimeMachine to mount volume over SMB. Try use AFP instead.
add
.localtoafp://machinenamecould be required (for local network)in Finder connect first to the server and choose the right share (where sparsebundle will be), go to Time Machine settings and select the share. Unmount the share.
iSCSI initiator
But how to restore, since iSCSI is not supported natively?
Quota
Limit per client:
vfs_fruit - "fruit:time machine max size = SIZE [K|M|G|T|P]" "But I would discourage this, as it recalculates the share free space on every df call by the client" - Implement Time Machine quota setting · Issue #910 · openmediavault/openmediavault · GitHub
Large modified files
Since TM it's a file level not block level backup, these files can be corrupted (not include all updates), because rewritten (partially or not) when backup, all changes are not backup. That means this files are backup corrupted.
Ex: Virtual Machine disk
Ex: MySql DB files. Solution: cron mysqldump hourly (or less if large DB) + exlude DB files
OS
OpenCore Legacy Patcher - "breathe new life into Macs no longer supported by Apple, allowing for the installation and usage of macOS Big Sur and newer on machines as old as 2007"
Install macOS
Use Option-Command (⌘)-R at startup to reinstall lastest version of the OS: How to reinstall macOS - Apple Support For clean install, erase the drive with Disk Utility (macOS Recovery) first
Create ISO installer:
Install on Virtual Machine
GitHub - paolo-projects/auto-unlocker: Unlocker for VMWare macOS - Allow macOS to be selected during VM creation + other fixes
Bootable USB
macOS on Bootable USB
On an HFS+ (Journaled) formatted USB drive
http://arstechnica.com/apple/2014/10/how-to-make-your-own-bootable-os-x-10-10-yosemite-usb-install-drive/#image-9
Bootloader
Migration Assistant
Migration Assistant doesn’t overwrite new versions of applications with older ones [...] won’t overwrite an account with the same name by default. Migration Assistant prompts you about whether you want to rename the account from the old computer or overwrite the account on the new computer with the files from the old Mac [...] Files stored outside user accounts won’t be overwritten, but they could be merged, so a folder might contain a collection of old and new files.
Applications (
/Applicationsand/Library/Application)User accounts and groups (reset UserShell and NFSHomeDirectory for created users) For macports, see:
if FileVault is enabled after macports has been installed (check it with
sudo fdesetup list | grep macports), it could be necessary to disallow the user to decrypt the disk. Else it's visible on FileVault login window (even if it's a non interactive user). To disallow it:sudo fdesetup remove -user macportsdscacheutil -q user -a name macports
For Wireshark, see:
create user group
access_bpfhttps://code.wireshark.org/review/gitweb?p=wireshark.git;a=blob;f=packaging/macosx/Scripts/chmodbpf-postinstall.sh;hb=HEAD - postinstall script of Wireshark installer package
Other files and folders, which covers the Shared folder in the Users folder and folders you created at the top level of a drive
Computer & Network Settings
Setup Assistant (from clean install) or via /Applications/Utilities/Migration Assistant.app (could be problematic when migrate already exist accounts).
but doesn't migrate:
/etc/hostsTime Machine configuration (destination and exclude list)
hostname (Settings > Share)
ByHost preferences
/Library/Logs/SystemMigration.logor/private/var/log/system.log(sender MigrateTool)
Cleanup from previous upgrades
Use the Recovery System (restart and hold CMD+R)
Generate a list of files:
Compare 2 version (before and after clean upgrade):
After OS update some config files are replaced, where then previous one are kept and renamed as *~orig or *~previous
Note dirname command is not available in Recovery System
Before remove, backup unwanted files:
Files can be removed in 10.13.6:
Reset Setup Assistant
Integrate features of Migration Assistant.
Remove /var/db/.AppleSetupDone:
reboot
hold
command + sin Terminal:
or:
reboot
hold
command + rin Terminal ("Mackintosh HD" is the default name of the main disk, depends what has been defined when macOS was installed):
Boot Camp
Start up your Mac in Windows or macOS with Boot Camp - Apple Support - hold the Option key
Windows: Configuration pannel > System & Security > Power management > Choose when the screen close (works only in native, not in a VM)
Windows:
Compact.exe /CompactOS:alwaysto compact (Compact.exe /CompactOS:neverto restore);powercfg /h /type reducedto reduce hibernation file size (powercfg /h /size 100to restore)macOS: Sytem preferences > Startup > Choose the disk you want to use at each startup (you still can use opt key to Start up to Startup Manager)
Windows boot INACCESSIBLE_BOOT_DEVICE error (after Windows Updates):
How to install Windows:
/System/Applications/Utilities/Boot Camp Assistant.appHow it's work, Boot Camp Assistant automatically create 2 partition:
OSXRESERVED(Microsoft Basic Data / ExFAT, ~10GB, contains WinPE files, plus drivers in\$WinPEDriver$and installer in\Bootcamp), which will be removed after the install of Windows is completeBOOTCAMP(Microsoft Basic Data) partition where Windows is installed of the size the user gave
Use USB drive to install Windows could not work with recent macbook because the USB3 is used, and Windows 10 (at least) don't support keyboard and pad in same time (which use USB 3 too) (WinPE will load, but couldn't use the keyboard or mouse): If your keyboard or trackpad stop responding while installing Windows 8 on your Mac - Apple Support
Drivers:
open Boot Camp Assistant > Action (menu) > Download Windows Support Software
timsutton/brigadier: Fetch and install Boot Camp ESDs with ease. -
brigadier -m MacBookPro11,1 -o Bootcamp-MBP11.1if you can start bootcamp OS (ex mounted in a Virtual Machine), install manually (download first: Download and install Windows support software on your Mac - Apple Support) by right click on each INF files, then "Install" (
*\WindowsSupport\$WinPEDriver$\*\*.inf) (driver files will be copied inC:\WINDOWS\inf\*.inf,C:\WINDOWS\System32\drivers\*.sysandC:\WINDOWS\System32\DriverStore\FileRepository\*\*.*)D:\$WinPEDriver$Limitations of $WinPeDriver$ - Windows Client | Microsoft Docsinject in WIM images
D:\sources\boot.wimandD:\sources\install.wim: Inject Drivers into a Winclone Image – Twocanoes Software. See also Create a Windows 10 Bootable USB Flash Drive on a Mac – Twocanoes Softwareinject product key by create a file
D:\sources\ID.txtthat contains:
Partitions:
Install on external drive:
set
HKLM\SYSTEM\HardwareConfig\{...uuid...}\BootDriverFlagsto0x14: Booting unmodified Windows 10 over USB
Keyboard:
to connect bluetooth Apple keyboard, tap on the keyboard the PIN code the OS provide, then tap enter
reboot if necessary (if the OS doesn't provide a PIN code but ask the one the device should provide)
Bluetooth dual boot:
Releases · headkaze/Hackintool - Tab "Utilities" > Button (at bottom with a Bluetooth logo) "Generate Windows Bluetooth Registry File", the import in Windows the file from regedit
psexec -s -i regedit(psexecfrom PsTools - Windows Sysinternals | Microsoft Docs) See https://github.com/headkaze/Hackintool/blob/279644d917bd45241c85d13198a7ca4bacb320fd/Hackintool/AppDelegate.m#L10825-L10954 and https://github.com/headkaze/Hackintool/blob/279644d917bd45241c85d13198a7ca4bacb320fd/Hackintool/AppDelegate.m#L10713-L10755/Library/Preferences/com.apple.Bluetooth.plist,HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\KeysBluetooth Classic use Link Key (LK)
Bluetooth Low Energy (4.0 & 4.1), LE legacy pairing
use Short Term Key (STK), Identity Resolving Key (IRK), Encrypted Diversifier (EDIV), Random Number (RAND)
Bluetooth Low Energy (4.2), LE Secure Connections use Long Term Key (LTK)
sudo pkill bluetoothd/Library/Bluetooth/Library/Preferences/com.apple.MobileBluetooth.devices.plist/private/var/root/Library/Preferences/com.apple.bluetoothd.plist(High Sierra +)/private/var/root/Library/Preferences/blued.plistsudo /usr/bin/defaults read com.apple.Bluetoothd.plist LinkKeys/Library/Preferences/com.apple.Bluetooth.plist/Library/Preferences/com.apple.airport.bt.plist
Change ownership
Network
What causes some Network Drives using SMB no longer connect to macOS Catalina? - Ask Different - SMB and NetBIOS (
/etc/nsmb.conf) troubles
Bandwidth limiter
Use "Network Link Conditioner" (but not work for localhost/127.0.0.1) or use a proxy instead (for HTTP/HTTPS)
Install:
download "Additional Tools for Xcode" from https://developer.apple.com/download/more/?q=Additional%20Tools
from DMG, double click to install
Network Link Conditioner.prefPane
http://nshipster.com/network-link-conditioner/
https://developer.apple.com/downloads/index.action?q=Network%20Link%20Conditioner
VPN
Local TLD
Use *.localhost instead of *.local. It's a reserved, internal TLD too.
http://www.justincarmony.com/blog/2011/07/27/mac-os-x-lion-etc-hosts-bugs-and-dns-resolution/
Hosts files
Fake DNS records
Require root access to update the content:
Create link to Network Utility
Moved in CoreServices in 10.9
Flush DNS cache
Share network connection
UI
Finder, desktop, menus, etc.
Reveal Libray folder
Show hidden files
Or use the combination of Shift ⇧ Cmd ⌘ . or Fn Shift ⇧ Cmd ⌘ . (for French NUM? keyboards)
Hide specific file on desktop
If hidden files are not visible:
Else :
Copy a transparent image (in preview: select image pixel area then copy)
Past it as icon of targeted file
Move to outside of desktop viewport
Reload "Open With" menu entries
Menulets / Menu extra
Menulets are of small icons located at the upper right corner of the Menu Bar
/System/Library/CoreServices/Menu Extras/*.menu
Services
Aka quick actions
Located at ~/Library/Services/ and /System/Library/Services, packages *.workflow
Preferences > Extensions panel
To test a workflow with files, insert "Get Specified Finder Items" at the beginning
To assign a keyboard shortcut, in 10.6:
open System Preferences > Keyboard > pane Keyboard Shortcuts
select "Services" in the left pane
scroll down to General in the right pane
double-click to the right of the Automator workflow you just created
press the keys you want to use, and switch panes to ensure the new shortcut is saved
/usr/bin/automator "/path/to/some action.workflow"
For "Create a new file" quick action:
delay 0.1is required to let Finder create a new file and later hit return key to edit it's name
Convert :
use builtin quick action "Convert Image" (from macOS 12): file context menu > Quick Actions > Convert Image
Shortcuts
An PList file
Shortcuts.app
Finder view preferences System-wide
Close all Finder windows
find ~ -name ".DS_Store" -depth -exec rm -f {} \;Kill finder: Force Quit → Finder
Open a Finder window, edit Folder View Options show and click on "Use as default"
Localizable resource name
That use short language ISO code (ISO639).
Dans les fichiers .strings les retours à la ligne sont marqué \n. Voir aussi """, "\". Le commentaires supporté (/* ... */ et // ...). Ces fichiers doivent être enregistré en UTF-16
https://developer.apple.com/library/mac/documentation/FileManagement/Conceptual/FileSystemAdvancedPT/LocalizingtheNameofaDirectory/LocalizingtheNameofaDirectory.html
System (default)
Edit following file (require root's right)
Add or update
.localized is an empty file (0 bytes)
Folder
In fr.strings:
/Applications/VMware Fusion.app/Contents/ResourcesVirtual Machines.localized/.localized/*(VMware Fusion 7.0)
Bundle
In Stuff/Info.plist, we found:
It's not required but I we want localizable bundle, we need it.
We can found also NSHumanReadableCopyright (copyright) and CFBundleName (display app name in menu bar) which are also localizable.
In Stuff/Resources/fr.lproj/InfoPlist.strings, we found:
Kiosk mode
Keyboard layout
macOS on a MacBook (without special keys like page up/down keys):
Page up : fn + up
Page down : fn + down
Home : fn + left
End : fn + right
Del : fn + backspace
Enter (num) : fn + return
Apple keyboard layout on Windows
See also Keyboard layout
Useful when you use a remote desktop connection. The host doesn't have the Apple keyboard layout.
DLL files are in %SystemRoot%\System32, copy them from Boot Camp drivers
Keyboard with Mac layout: Settings > Time & language > Region & language > select current language > Options > Add keyboard > select the same language layout but with "(Apple)" > optionaly you can remove the previous layout or a keyboard layout selector in taskbar will appears
Pointer
Aka mouse
Mouse acceleration
USB Overdrive works if you change system mouse speed to 0 (or -1)
©1999-2017 Alessandro Levi Montalcini - USB Overdrive
System mouse speed
killmouseaccel:
Doesn't work with High Sierra due to depreciation of IOHID API.
Restart Dock
Will restart Dock, Mission Control, Spaces, etc.
For menubar
Or Finder
Spaces in dock
Media keys start Music.app
Music.appAka media keys start iTunes.app, remote control daemon (RCD), play/pause keys (or bluetooth) auto-starting Music/iTunes, apple remote, connecting bluetooth headset/headphone
Note: looklike the side effects is media keys (of the keyboard or touchbar) stop working
Continuity with Android
Disk, file system and paths
disk path:
/dev/diskXwhere X is a number (start with 1)mounted in
/Volumes/XXXX
See FileVault
Extended attribute
Aka quarantine, icons, thumbnail, xattr
com.apple.FinderInfo, which sets some general flags for Finder, and can be used to assign a single Finder Tag;
com.apple.metadata:_kMDItemUserTags, which contains Finder Tag settings;
com.apple.metadata:kMDItemDownloadedDate, which contains the datestamp for when this item was downloaded;
com.apple.metadata:kMDItemFinderComment, which contains the text from the Finder Comment but does not actually set it;
com.apple.metadata:kMDItemWhereFroms, which contains the URL of the location from which the item was downloaded;
com.apple.quarantine, which forms the quarantine flag to determine if Gatekeeper should perform a full check when an app is first run.— Where did that metadata come from? – The Eclectic Light Company
See also Spotlight and Uniform Type Identifier
Extended attribute com.apple.FinderInfo (same/similar binary format as resource fork):
com.apple.FinderInfo (XATTR_FINDERINFO_NAME, ATTR_CMN_FNDRINFO getattrlist(2)) 32 bytes of data for use by the Finder. Equivalent to the concatenation of a FileInfo structure and an ExtendedFileInfo structure (or, for directories, a FolderInfo structure and an ExtendedFolderInfo structure). These structures are defined in <CarbonCore/Finder.h>.
This attribute is not byte swapped by the file system. The value of multibyte fields on disk is always big endian. When running on a little endian system (such as Darwin on x86), you must byte swap any multibyte fields.
Other:
Icons and Cursors
Sounds
AFPS
Does Apple File System support directory hard links?
Directory hard links are not supported by Apple File System. All directory hard links are converted to symbolic links or aliases when you convert from HFS+ to APFS volume formats on macOS. — Frequently Asked Questions
NTFS
Read only
Use NTFS-3G or use exFAT instead (supported natively)
WebDav
Mount unsupported file system
Home - macFUSE (successor of osxFUSE)
Mount AFP share online
Don't do that! It's not secure (same for NFS, SMB/CIFS, iSCSI, etc.). Use it over a VPN (or a SSH tunnel) or use a secured protocol like SFTP (use https://github.com/osxfuse/osxfuse/wiki/SSHFS)
Can contains Time Machine backups.
Mount afp://ip_address/timemachine_share
Port 548 should be open (and forwarded (TCP) to the target if the server is behind a router). Don't allow guest access
System links
Preference and help links
Open an pref
Open an app:
Home (help:anchor=%27access%27%20bookID=com.apple.machelp) Index (help:anchor=%27xall%27%20bookID=com.apple.machelp)
System paths
Yelp/osxcollector: A forensic evidence collection & analysis toolkit for OS X - A forensic evidence collection & analysis toolkit for OS X
Re-add staff premission
staff premissionUniform Type Identifier
Aka UTI
Metadatas: kMDItemContentType and kMDItemContentTypeTree (hierarchical content type); CFBundleDocumentTypes, UTImportedTypeDeclarations and UTExportedTypeDeclarations
Get UTI from metadata server:
For the same extension, mutliple UTI definitions could exist. But the last definition will be used. Exemple: Adobe Flash use .as for ActionScript files (source code), but .as is declared instead as "AppleSingle archive" (UTI: com.apple.applesingle-archive). Installing Adobe Flash should override the default declaration. See uti - Revert Filetype Association - Ask Different
/System/Library/CoreServices/CoreTypes.bundle/Contents/Info.plisthttps://github.com/schwa/UTI-Types/tree/master/Types - List of common UTI
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/Current/Support/lsregister -dump- list all registered UTI/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/Current/Support/lsregister -kill -r -domain local -domain system -domain user- ro rebuild the Launch Services registry to fix a wrong attribution (after an App Upgrade)filesystem - Change file kind / kMDItemContentType - Ask Different - for bash script
UTI Property List Helper - generate UTI definition (plist) from existing UTI
Fragmentation
Aka defragmentation
Ten Things Apple Did To Make Mac OS X Faster - On-the-fly Defragmentation
Ten Things Apple Did To Make Mac OS X Faster - Hot File Clustering
Disk image
Create a disk image from a disk or connected device[...]
Sparse bundle disk image: Same as a sparse disk image (below), but the directory data for the image is stored differently. Uses the .sparsebundle file extension.
Sparse disk image: Creates an expandable file that shrinks and grows as needed. No additional space is used. Uses the .sparseimage file extension.
Read/write disk image: Allows you to add files to the disk image after it’s created. Uses the .dmg file extension.
DVD/CD master: Changes the size of the image to 177 MB (CD 8 cm). Uses the .cdr file extension.
[...]
Create a disk image from a folder or connected device[...]
Read-only: The disk image can’t be written to, and is quicker to create and open.
Compressed: Compresses data, so the disk image is smaller than the original data. The disk image is read-only.
Read/write: Allows you to add files to the disk image after it’s created.
DVD/CD master: Can be used with third-party apps. It includes a copy of all sectors of the disk image, whether they’re used or not. When you use a master disk image to create other DVDs or CDs, all data is copied exactly.
— Create a disk image using Disk Utility on Mac - Apple Support
Split disk image
Will generate files *.XXX.dmgpart and *.dmg
Folder action
See Automator
Test disk speed
aka test USB thumb speed
Clone to disk image
Startup and login
Startup chime
Not work with OSX 10.10+
Mute
Restore
http://apple.stackexchange.com/questions/168092/disable-yosemite-startup-sound
https://discussions.apple.com/message/28013107#28013107
Lock message
Aka login screen text
If found, please contact XXXX XXXX at YYYYYYYYYYY or at ZZZZZZ@ZZZZZZ.ZZZZ
Control+Command+Q
How to set a lock message on the login window of your Mac - Apple Support - Settings > Security and privacy > (unlock with padlock) > Show a message when the screen is locked
Onyx - Settings > Session > Login screen message
See also Change the language used at the login screen on your Mac - Apple Support
Reset NVRAM
And PRAM.
How to Reset NVRAM on your Mac - Apple Support - restart and hold Option, Command, P, R keys for 20 seconds
Start up item
With crontab -e:
With a shell script (as login item only):
In mystartupitem.command (why as *.command?)
An add it to login items (System Preferences → Users and Groups → Login items)
With a plist:
Create in /Library/LaunchDaemons (see also What are the differences between LaunchAgents and LaunchDaemons?) a file called like local.mydaemon.plist contains:
Note: Label must reflect filename without plist extension. Note: binary can be an executable (chmod +x /path/to/shellscript) shell script
Change/fix login keyboard layout
See you current keyboard layout: ~/Library/Preferences/com.apple.HIToolbox.plist
Security
System Integrity Protection
Aka SIP
/System/usr/bin/sbinapps that are pre-installed with OS X
Some specific softwares require to disable it
in Terminal:
csrutil statusto check statusrestart
hold down command-R to boot into the Recovery System
in Utilities > Terminal
csrutil disable; rebootorcsrutil enable; rebootbased on what you want
SIP only applies to the volume you're currently booted from, so [one can] boot from the backup volume to delete [files] CCC updated for El Capitan | Carbon Copy Cloner | Bombich Software
just boot into "Recovery" mode by pressing "CMD+R" while rebooting.
open Terminal
your disk will be mounted in
/Volumes/Macintosh HD(based on your drive name)update files (ex: delete files via
rm): you have absolute control in that terminal
/Library/SystemMigration/History/Migration-[some UUID]/QuarantineRoot/
Terminal access error
If a command return an error like Operation not permitted, or cat: ~/Library/path/to/file: Operation not permitted, a SIP protected file is read.
Lift the restriction for Terminal: Operation not permitted - Mojave security?
App Sandbox
Downloaded file quarantine
or
Disable
Certificats
Delete Known Government-Linked Certificate Authorities: https://github.com/sammcj/delete-unknown-root-ca
FileVault
FileVault display a loginwindow at startup hask the user to decrypt the disk with its password.
FileVault is not allowed for all users
To select which user can decrypt FileVault disk:
login as admin local account
open System Preferences
open Security & Privacy
select FileVault
click on "Allow Users" (bottom of the window)
sudo fdesetup listsudo sysadminctl -adminUser <adminUser> -adminPassword <adminPassword> -secureTokenOn <managementToken> -password <managmentPassword>sudo fdesetup add -usertoadd <username> -keychainSet a FileVault recovery key for computers in your institution - Apple Support - Use same master key
Firmware password
Users
Handled by OpenDirectory
UIDs < 500 are reserved.
auto login user
defaults read /Library/Preferences/com.apple.loginwindow | grep autoLoginUser | awk '{ print $3 }' | sed 's/;//'dscl . -read /Users/<username>dscl . list /Users | grep -v '_'(prefixed user are daemons, etc.)dscacheutil -q user/var/db/dslocal/nodes/Default/users/*.plistdata of OpenDirectorysudo dscl . create /Users/<username> IsHidden 1, hide user on loginwindow and fast user switching: Hide a user account in macOS - Apple Supportdisable guest user:
ppen System Preferences
go to "Users & Groups" and click the unlock icon
click on “Guest User”
uncheck the box for "Allow guests to log in to this computer"
hide a user from login screen:
sudo defaults write /Library/Preferences/com.apple.loginwindow HiddenUsersList -array-add <username>, to remove that config:sudo defaults delete /Library/Preferences/com.apple.loginwindow HiddenUsersList
Non interactive user
loginwindow UI will consider a user as one that can't be logged in if the following occur
the shell is /usr/bin/false
or
the AuthAuthority has ;disableduser; in it.
or
the AuthAuthority doesn't exist or contains ;basic; and the password is missing or is a single asterisk.
or
the record name is missing or blank [RealName?]
or
the uid is missing
loginwindow UI doesn't care about the UIDs number.
But the user still appears in System Preferences > Sharing > File Sharing | Screen Sharing | etc. > Add User dialog.
macports-base/portutil.tcl at 1d1bcde3157908ef4ee58e72425f42d2265cdff3 · macports/macports-base - How macports in
adduserfunction set the user as non interactive user
Applications
Self-signed application
Create a self signed certificate MyCertificateName with Keychain and trust it for all the system
That fix the issue with macOS open the alert popup "Do you want to the application MyAppName.app to accept incoming network connections?"
Define PATH globaly
PATH globalySet export PATH=/my/path:$PATH in ~/.profile for command line, but not used by launched application (by spotlight, dock, finder, start restored windows)
A security update could break/change something:
it seems SIP strips env variables if an application is launched from another application
Open application (twice and so on)
Or add this as Automator script
Pass command line arguments to Application
Automator application
Automator > create an Application with Library/Utilities/Run Shell Script
Replace app icon: Get Info on original App, select icon, Cmd+C -> Get Info on target App, select icon, Cmd+V
Application bundle
See Create new application bundle. Not work anymore
Edit /Applications/Firefox.app/Contents/Info.plist, change for CFBundleExecutable or Executable File the value to firefox-bin-with-args.sh (the original is firefox-bin)
In /Applications/Firefox.app/Contents/MacOS/, create a file firefox-bin-with-args.sh (called like change in Info.plist)
http://superuser.com/questions/271678/how-do-i-pass-command-line-arguments-to-dock-items
Create new application bundle
Script app (bash script) can't start anymore with OSX 10.10: "Can’t open the application %s because PowerPC applications are no longer supported."
xattr -d com.apple.quarantine /Applications/My\ App.app
Allow Apps from Anywhere in Gatekeeper
"Allow apps downloaded from" "Anywhere" (from macOS Sierra)
"%s can’t be opened because it is from an unidentified developer"
Crtl + Click on the App > click on "Open" button to add the app to the approved list Right click > Open
Build-in Apache
Conf: /etc/apache2 Extensions: /usr/libexec/apache2 HTTPD_ROOT httpd -V
Restart Apache:
or
FileMerge
Xcode
"Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo."
Accept for this account:
Accept for all accounts:
Install Xcode Command Line Tools:
Macports
Why use Macports instead of Homebrew: El Capitan and Homebrew | Hacker News TLDR: because it place packages in /opt/local and require sudo
Macports install in /opt/local where Homebrew install in /usr/local.
/usr/local, for self, inhouse, compiled and maintained software./optis for non-self, external, prepackaged binary/application bundle installation area
Macports is installed as root and uses its own account macports for some things.
Update and upgrade ports:
MacPorts Guide - Common Tasks
Install ports:
How to fix "Failed to build osxfuse: command execution failed":
install builded version then create a symlink to
fuse.pc:sudo ln -s /usr/local/lib/pkgconfig/fuse.pc /opt/local/lib/pkgconfig/fuse.pc
App store
Aka MAS (macOS App Store)
Preference pane
Right click to remove prefpane
jlongman/speedlimit: Network bandwidth limiter for testing iphone apps - Network banwidth limiter
MySQL :: MySQL 5.7 Reference Manual :: 2.4.4 Installing and Using the MySQL Preference Pane - MySQL Preference Pane
hschmidt/EnvPane: EnvPane - An OS X preference pane for environment variables - Change environment variables
specialunderwear/Hosts.prefpane: a Cocoa GUI for /etc/hosts - Change hosts files (works with SIP enabled)
(old, replace by SwiftDefaultApps) Rubicode - RCDefaultApp - "allows a user to set the default application used for various URL schemes, file extensions, file types, MIME types, and Uniform Type Identifiers / UTIs"
Arcana Research - StartupSound.prefPane - "controls the volume of the startup sound of your Macintosh computer"
/System/Library/CoreServices/Applications/Archive Utility.app/Contents/Resources/Archives.prefPane
Quicklook generators
Aka QLGenerator
To view handle types:
Precedence :
The order is currently (from the less important to the most important):
System generators (in
/System/Library/QuickLook- for Apple only)Local (in
/Library/QuickLook)Home (in
~/Library/QuickLook)Embedded in apps. (usally
./Contents/Library/QuickLook)
It's impossible to desactivate a QLGenerator for same level or above other than juste rename it folder or update it's Info.plist to reflect only wanted format support How to disable auto preview for *.doc *.docx in finder? - Ask Different http://lists.apple.com/archives/quicklook-dev/2010/Jun/msg00011.html
Spotlight
Aka Metadata Server (mds)
See also Extended attribute
Once the macOS does kick-off the extraction of metadata from a file, it does so through a Spotlight Importer. Spotlight Importers are plug-ins for the Mac OS that a developer provides specifically for helping files created by their applications to be searchable within Spotlight. Spotlight crawls through its list of changed files, handing each one to the appropriate importer. The importers then read the files, compile a list of metadata, and then hand the metadata back to Spotlight. At this point, the changed file is available for searching within Spotlight.
/System/Library/Spotlight/Library/Spotlight~/Library/SpotlightApp
./Content/Library/Spotlight/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Versions/A/Support/mdworker/System/Library/LaunchDaemons/com.apple.metadata.com.apple.metadata.mds.scan.plist/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Support/mds/System/Library/PrivateFrameworks/SpotlightDaemon.framework/Versions/A/SpotlightDaemon/System/Library/Frameworks/CoreSpotlight.framework/CoreSpotlightService/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Support/corespotlightd
Turn off:
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plistSystem Preferences > Spotlight > Privacy
(need to be verified) ignore files and directories ends with
.noindex(and.build) and all (hidden) files start with..sudo defaults read /.Spotlight-V100/VolumeConfiguration.plist Exclusions(that depends the filesystem)sudo defaults write /.Spotlight-V100/VolumeConfiguration.plist Exclusions -array-add 'path/to/exclude'sudo defaults write /.Spotlight-V100/Store-V1/Exclusions Exclusions -array-add 'path/to/exclude'sudo defaults write /System/Volumes/Data/.Spotlight-V100/VolumeConfiguration.plist Exclusions -array-add 'path/to/exclude'sudo /usr/libexec/PlistBuddy -c "Add :Exclusions: string path/to/exclude" /System/Volumes/Data/.Spotlight-V100/VolumeConfiguration.plistsudo find / -type d -exec defaults write /.Spotlight-V100/VolumeConfiguration.plist Exclusions -array-add {}sudo launchctl stop com.apple.metadata.mds && sudo launchctl start com.apple.metadata.mdsput in
~/Library/,/System/.metadata_never_indexat the root of a volume, directory / folder (see also.metadata_never_index_unless_rootfs)
Note: extended attribute com.apple.FinderInfo doesn't have any impact, chflags hidden /path/to/file, touch folder-to-exclude/.metadata_never_index too
Reindex drive
Reindex (eq. Finder's Search not work properly): find . -name "*.md" -exec mdimport {} \; or sudo mdutil -E / (where / affect the whole volume, or all volumes)
List file indexing (where PID is pid of process of mdworker, use ps -e | grep mdworker):
Erase all Spotlight data (all volumes):
Queries:
Metadata importer
Aka Spotlight importers
Add to /System/Library/Spotlight/RichText.mdimporter/Contents/info.plist (get file format mdimport -n -d1 somefile.ext) to search inside source code:
Markdown to Spotlight Mac OSX Spotlight Enhancement
Printer & scanner
Most post 2013 printers implement IPP Everywhere. AirPrint is based on IPP
VueScan Scanner Software for Windows, macOS Catalina and Linux - scanner application support old scanners
Printer and scanner drivers for Mac - Apple Support - list of old devices that don't implement IPP that macOS can auto install required drivers
Print on Windows shared printer
Will ask username / password for shared printer, use Windows auth credentials or guest for the username and password. If not asked, delete the entry of password in keychain app
macos - How to add a network printer on mac that requires authentication - Ask Different - Add advanced network printer via smb://someaddress/Some%20printer%20name URLs
Calendar and contact accounts
CardDav, CalDav
SQLite3 with principalInfo binary PropertyList (plutil -convert xml1 -o - - < data.plist) (ZVALUE)
Old (not used to store accounts config):
Howto: CardDAV in Mac OS X Addressbook with owncloud - Page 2 - ownCloud Forums and https://github.com/owncloud/documentation/blob/stable6/user_manual/pim/sync_osx.rst
See also the possibility to create configuration profiles:
Clipbload CLI
Simulate UI clicks from CLI
Corrupted executable script
Create a bash script and execute give:
bad interpreter: Operation not permitted
Scanning
VueScan Scanner Software for Windows, Mac OS X and Linux - Support of old scanners
SANE:
chrspeich/SaneNetScanner: A Mac OS X Scanner Driver for sane net devices - This allow to use network scanner that support SANE with Image Capture, Preview See also Possible bridge for TWAIN scanner: Image Capture → SaneNetScanner → localhost/saned → Scanner · Issue #13 · chrspeich/SaneNetScanner
Install SANE drivers – BeagleScan - Install SANE drivers on macOS (
sane-find-scanner,scanimage -L,TWAINBridge.appreinstall,open /System/Library/Image Capture/Devices/TWAINBridge.app, SANE > Open Scanner)SwingSane - Java SANE client
phpSANE download | SourceForge.net - SANE frontend in PHP
SimulPiscator/AirSane: Apple AirScan compatible SANE web frontend. - Install that frontend on the device where SANE backend are used (where the USB scanner is connected) to share the scanner over AirScan See also David Poole: Scanning from Apple AirPrint + AirScan`
TWAIN Scanners in OS X Maverick (and Yosemite) | janegil.net - TWAINBridge Maverick Fix, not useful on macOS 10.11 due to SIP
Axel-Erfurt/Sane-OSX-Xojo: Sane Scanner GUI with Xojo - SANE frontend written in Xojo include support of tesseract (OCR lib)
Automator
Delete core dump files
In /cores folder
Only deletes core files older than 24 hours.
Use cron or launchd
Screens and monitors
waydabber/BetterDummy: Software Dummy Display Adapter for Apple Silicon/Intel Macs to Have Custom HiDPI Resolutions. - also useful for headless Macs (servers)
Custom screen resolution or HiDPI
OSCAR LCD Panel 1024 × 768 (HiDPI) fix
Find screen DisplayVendorID and DisplayProductID
Or in IORegistryExplorer (/Developer/Applications/Utilities/IORegistryExplorer.app) or IOJones, something like IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/P0P2@1/IOPP/GFX0@0/NVDA,Display-B@1/NVDA/display0/AppleDisplay
IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/P0P2@1/IOPP/GFX0@0/NVDA,Display-A@0/NVDA/display0/AppleBacklightDisplay is for built-in screen on Macbook Pro.
Map to /System/Library/Displays/Overrides/DisplayVendorID-XXXXX/DisplayProductID-YYYYY where XXXXX and YYYYY are 1 to N hexa char
http://www.opensource.apple.com/source/IOKitUser/IOKitUser-120.4/graphics.subproj/IOGraphicsLib.c
Icon can be change be changed in /System/Library/Displays/Overrides/Icons.plist.
EDID can be override with IODisplayEDID. See [HOW TO] Advanced EDID Injection - Graphics Cards - InsanelyMac Forum
Problems
In log org.freedesktop.dbus-system Service exited with abnormal code: 1
org.freedesktop.dbus-system Service exited with abnormal code: 1Shutdown
pmset -glog show --predicate 'eventMessage contains "Previous shutdown cause"' --last 24h
DSLR as a webcam
Aka camera as webcam
Cam Link 4K | elgato.com - Hardware HDMI-to-USB Webcam
For Linux use gphoto2 -> ffmpeg -> v4l2loopback. See How to use your DSLR from 2008 as a webcam in 2022 (NixOS) (see also this post on Hacker News)
Old, use Camtwist and Syphon or an OBS plugin:
Java
Java 8 is the only supported version which runs applets
/System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/javais Apple's Java version. Keep it. (/usr/libexec/java_homeand/usr/bin/javapoint to it). See "Do NOT remove any content in the JavaVM.framework"/System/Library/Java/JavaVirtualMachines/is JDK location where Apple's Java 6 is installed (still the case?)/Library/Java/JavaVirtualMachines/default location of JDK installs/usr/libexec/java_home -Vget list of installed installed JVMs
Install JDK with sudo port install openjdk14 or download it from JDK Builds from Oracle. See also:
Uninstall Oracle Java by deleting the plug-in file (JRE, for applets):
Uninstall Oracle Java JDK:
macOS is Unix
And mostly POSIX-compatible
Screen capture
Aka screen cast, screenshot
Virtualization
See also:
Interoperability
WineBottler (Abandonware)
Wineskin
Troubleshooting
ANS2 Recoverable Panic
Last updated
Was this helpful?