Key Points
- a modified version of Linux with it's own GUI
- 2 versions: macos Intel, Apple Silicon
- package installers can help w some software package installs
- SDKMAN only supports a limited list of apps to install
- Apple Catalina created a security problem in the shell for sudo
References
Key Concepts
Apple Laptops
https://www.macrumors.com/guide/m2-macbook-pro-vs-14-and-16-inch-macbook-pro/
mac-laptops-2022-macrumors.com-M2 MacBook Pro vs 14- and 16-Inch MacBook Pro Buyers Guide.pdf file
mac-laptops-2022-macrumors.com-M2 MacBook Pro vs 14- and 16-Inch MacBook Pro Buyers Guide.pdf link
MAC Air setup
https://support.apple.com/guide/macbook-air/set-up-your-mac-apd831707cb3/mac
initial setup
- open laptop
- select language, country, WIFI network connection
- signin or create appleid
- after appleid signin
- create a local computer account
- >> rowxn#262xnn
- 11
- after optional Siri setup you login using your local id, password
- setup fingerprint access ( as option to enter password ) to access admin features
Ensure Google Chrome and Google Drive are accessed for your local account
- Validate access to KEY apps including Google Chrome Browser, Google Drive, DuckDuckGo Browser
- IF Chrome or Drive are NOT installed, then use the Safari browser to download them ( search "Google Chrome Browser")
- Download and Setup KEY apps including Google Chrome Browser, Google Drive, DuckDuckGo Browser
- Validate access to KEY apps including Google Chrome Browser, Google Drive, DuckDuckGo Browser
From Apple App store IF POSSIBLE - Setup other apps - GIMP and ?
MACOS system console app
https://www.howtogeek.com/356942/how-to-view-the-system-log-on-a-mac/#:~:text=%E2%80%9C~Library%2FLogs%E2%80%9D%20is,for%20low%2Dlevel%20system%20services.
Your Mac keeps system logs, which can help diagnose and troubleshoot problems with macOS and your installed applications. These logs are stored as plain-text log files on your Mac’s system drive, and macOS also includes an app for viewing them.
To view your Mac system logs, launch the Console app. You can launch it with Spotlight search by pressing Command+Space, typing “Console,” and then pressing Enter. You’ll also find it at Finder > Applications > Utilities > Console.
The Console app, also known as Console.app, is like a Windows Event Viewer for Mac.
More logs are available under Reports. To see application crash and freeze logs, click either “System Reports” for system applications or “User Reports” for user applications. You’ll see a variety of logs with file extensions like .crash, .diag, and .spin. Click them to view them in the Info pane.
Admin user account mgt
The admin user can add other new accounts to the local system
When adding a new account, you create the new account name, password
set the user type to standard or admin based on the authority you want the new user have to manage the local computer
after that, have the new user login and go through normal account setup
User account vs Login Keychain passwords
https://support.apple.com/en-us/HT201609
The password of your macOS user account might not match the password of your login keychain. Either create a new login keychain or update it with your new password.
After you or your Mac administrator resets the password of your macOS user account, your Mac might ask you to update your keychain password or enter the password of your login keychain. It might also tell you that the system was unable to unlock your login keychain. That's because your login keychain is still using your old password.
If you don't know your old password
If you don't know your old password, the solution is to create a new login keychain.
If you know your old password
If you know your old password, use that password to update your existing login keychain:
Open the Keychain Access app, which is in the the Utilities folder of your Applications folder.
From the list of keychains on the left side of the window, select "login."
From the Edit menu in the menu bar, choose “Change Password for Keychain 'login.'”
Enter the old password of your user account in the Current Password field. This is the password you were using before the password was reset.
Enter the new password of your user account in the New Password field. This is the password you're now using to log in to your Mac. Enter the same password in the Verify field.
Manage users from CLI with DSCL
To change Mac OS X's users and groups from the command line you want to use a command called dscl
.
To create a new group (change groupName to your group name - avoid spaces, shortusername should be your short user name):
dscl . -create /Groups/groupName
dscl . -create /Groups/groupName name groupName
dscl . -create /Groups/groupName passwd "*"
dscl . -create /Groups/groupName gid 33
dscl . -create /Groups/groupName GroupMembership shortusername
If you want to use Workgroup Manager; you need to open the application and login onto localhost using your username and password. (This all assumes you're a local administrator). Once in the program:
- Click on the Groups tab on the left side. The icon with multiple people.
- Click New Group from the toolbar
- Enter a name, and set the Group ID: to 33
- Click on the Members tab, and then press the '+' button and drag and drop your user name into the list.
- Press Save, then quit the program.
Install and Configuration
java-macos-2019-Working with multiple Java versions in MacOS - Bruno Frascino - Medium.pdf
Application Install Problems
https://gadgetstouse.com/blog/2021/04/08/fix-macos-cannot-verify-app-is-free-from-malware/#:~:text=Open%20the%20Apple%20menu%20and,tried%20opening%20the%20blocked%20app.
Open the Apple menu and go to System Preferences. Head to Security & Privacy and tap the General tab. Here, you'll see an “Open Anyway” button for the app that's giving issues. The button would only be available for an hour after you tried opening the blocked app.
Configuration Issues
issue> run Intel software on Macbook with Apple processors ( M1, M2)
- Rosetta driver ( free Apple download ) install to map Intel binaries to Apple MX processors
- may work
Issue> Apple Catalina created a security problem in the shell for sudo with access restrictions
https://appletoolbox.com/seeing-error-operation-not-permitted-in-macos-mojave/
Error: “Operation not permitted?”
Working with your Mac’s Terminal Utility but getting the error message “Operation not permitted?” Are Terminal commands that used to work in macOS High Sierra and Sierra not working?
this error on advanced commands like super-user sudo and change ownership chown commands but also on simple commands like the list directory command ls and others. What a mess!
easy to fix–we just need to update some of your Mac’s security and protection settings!
SIP still allows access to some directories, like ~/Applications, but totally locks down others like ~/System or ~/usr.
Granting Terminal or An App Full Disk Access
Default MAC Key functions
__keys___ | _function. . . . .. |
---|
cmd + tab | rotate apps |
cmd + tilde | rotate app windows |
cmd + alt + esc | force quit apps menu |
bottom center of key pad | open pop up menu in a browser |
cmd + alt + i | open dev tools in a browser |
shift + cmd + 5 | set folder for screen shots |
opt + cmd + power | goes to sleep |
ctl + cmd + power | force restart |
|
|
|
|
Managing screenshots on MAC
https://www.macrumors.com/how-to/change-screenshots-folder/
MAC Keyboard shortcuts
https://support.apple.com/en-us/HT201236#:~:text=Option%E2%80%93Command%E2%80%93Power%20button*,Put%20your%20displays%20to%20sleep.
Bash commands
process mgt
ps -ax
ps -ax | egrep -i '.*chrome.*' | cut -d \t -f 1
The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`
## get the pid for all Chrome processes and kill them
ps -A | grep 'Chrome' | kill -9 $(cut -c 1-5)
executing bash in CLI from another shell ( rshell or ? )
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
how to disable itunes permanently
https://superuser.com/questions/88614/is-it-possible-to-uninstall-or-disable-itunes-in-os-x
If you want to just disable it, run sudo chmod -x /Applications/iTunes.app
It won't work anymore.
If you want it back, just sudo chmod +x /Applications/iTunes.app
On more recent versions of macOS, you may need to disable SIP:
- Power off your device
- Power on your device while maintaining ⌘ and R pressed
- Once you reach the recovery system, select Terminal from the Utilities menu
- Type
csrutil disable
and then reboot
If you want to revert that back to the original protection, run the same steps but replace with csrutil enable
at step 4.
Check the current status with csrutil status
in any terminal window.
#find - find command examples
find ./ -iregex '.*' -mtime 150d 2>/dev/null -exec ls -l {} \; | more
jim-macbook:Google Drive (not syncing) jimmason$ find ./ -iregex '.*doc.*' -mtime -250d 2>/dev/null -exec ls -l {} \; | more
-rw-r--r-- 1 jimmason staff 121 Jul 20 21:58 .//_save/.~lock.__IBMSDP3_contacts-v2.docx#
-rw-------@ 1 jimmason staff 188927 Jul 20 21:58 .//_save/__IBMSDP3_contacts-v2.docx
Homebrew install & docs
doc
https://brew.sh/
install
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
<< creates folders - opt/homebrew
==> Installation successful!
==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
https://docs.brew.sh/Analytics
==> Next steps:
- Run these two commands in your terminal to add Homebrew to your PATH:
(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/jimmason/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
- Run brew help to get started
- Further documentation:
https://docs.brew.sh
zshell - updated bash environment for terminal windows
zshell user profile script updated above. ( ~/.zprofile )
vim ./.zprofile
Terminal and iTerm2
man screen
By default, each command
begins with a control-a (abbreviated C-a from now on), and is followed by one other keystroke.
Screen does not understand the prefix "C-" to mean control. Please use the caret notation ("^A" instead of "C-a") as arguments to e.g. the escape command or the -e option
managing terminal windows
split >> CMD - D
change >> CMD - ] or CMD - [ // switches terminal instances, NOT terminal panes
close split >> SHFT - CMD - D
Use cmd + d
for vertical split and cmd + shift + d
for horizontal split
To navigate between the vertical splits in left/right or up/down fashion use cmd + [
and cmd + ]
I recommended iTerm 2 because of these features.
Also, I like the autocomplete feature which occurs when you press cmd + ;
Features in short include the following:
- Split Panes
- Hotkey Window
- Search
- Autocomplete
- Mouseless Copy
- Paste History
- Instant Replay
- Configurability
- Full Screen
- 256 Colors
- Unix-like
- Readability
- Mouse Reporting
- Growl Support
- Exposé Tabs
- Tagged Profiles
- Multi-Lingual
using 2 terminal window instances together
If you like to work with your terminal windows in fullscreen, you can use macOS' built in screen splitting feature like so:
- Open two terminal windows
- Toggle one of the terminal windows fullscreen
- Activate 'Mission Control' (default: F3)
- Drag the second terminal window onto the first's fullscreen space
- Enjoy your vertically split fullscreen terminal windows
You can switch keyboard focus between terms with ⌘-[ and ⌘-]
vim cheatsheet
https://phoenixnap.com/kb/vim-commands-cheat-sheet
Vim Commands Cheat Sheet pdf link
Other vim guides
https://github.com/sk3pp3r/cheat-sheet-pdf/blob/master/pdf/vim-cheat-sheet.pdf
https://www.cs.cmu.edu/~15131/f17/topics/vim/vim-cheatsheet.pdf
SDKMan installed to manage software installs
https://sdkman.io/install
curl -s "https://get.sdkman.io" | bash
JDKs to install w SDKMAN
SDKs to install as candidates |
---|
|
Install a specific Groovy version in a specific location
sdk install groovy 3.0.4 /Users/jimmason/_dev/groovy30
Applications
Finder Utility - keyword search
https://support.apple.com/guide/mac-help/narrow-search-results-mh15155/mac
Finder video
https://www.youtube.com/watch?v=yIUz6y_4A6A
Finder keyword search
https://support.apple.com/guide/mac-help/narrow-search-results-mh15155/mac
Configuration files for Developer apps
Path = ~/_dev/scripts
jim-macbook:~ jimmason$ ls _dev/scripts
RunJdbcTester1.groovy
RunJdbcTester4.groovy
setDerbyPath.sh
RunJdbcTester2.groovy com
setGroovy.sh
RunJdbcTester3.groovy
gtest1a.groovy
setMysqlPath.sh
setDerbyPath.sh
setGroovy.sh
setMysqlPath.sh
settings-jmason.txt
takes 30 GB
Xcode is Apple's integrated development environment (IDE) for macOS, used to develop software for macOS, iOS, iPadOS, watchOS, and tvOS. ... Xcode includes Command Line Tools (CLT), which enable UNIX-style development via the Terminal app in macOS. They can also be downloaded and installed without the main IDE.
the CLT can be downloaded separately
Manage Disk Space
https://support.apple.com/guide/disk-utility/welcome/mac
apple > about this mac > storage > manage
Find and free up files
https://support.apple.com/guide/system-information/find-and-delete-files-syspf5a64aa6/mac
free up storage space
https://support.apple.com/en-us/HT206996
Removal opportunities
Downloads
Documents
Old apps
Library ??? Mail reviews to archive and ???
Other users
Windows options?
Vbox
Crossover ??
Wine ??
myadm
- drop gdrive link in backup ( use web access to gdrive on myadm
- move agithub admx to g.archive
- clear Documents folder
Manage file permissions as admin ( zip and other )
https://www.howtogeek.com/669095/how-to-set-file-permissions-on-mac/
https://appuals.com/fix-unable-to-expand-zip-file-on-mac/
https://www.digitaltrends.com/computing/how-to-make-a-zip-file-on-a-mac/
Potential Value Opportunities
Apple Preview App edits PDF docs
https://support.apple.com/en-us/HT201740
https://pdf.wondershare.com/pdf-editor-mac/add-image-to-pdf-preview.html
You can set a signature image in the app to add anywhere on a doc
Potential Challenges
After Catalina upgrade, Bash man, info cmds missing
https://apple.stackexchange.com/questions/221597/os-x-el-capitan-man-command-not-found
step 1 - upgrade xcode to latest version from app store
Apple publishes the source code for the open source parts of OSX. So the source for "man" is retrievable from https://opensource.apple.com/tarballs/man/ . The latest version (as of this writing) is v1.6c. Provided you have at least the Command Line Tools installed (you can run xcode-select --install
to get them if you don’t):
curl -LORf 'https://opensource.apple.com/tarballs/man/man-16.tar.gz'
tar -xzvf man-16.tar.gz
cd man-16/man
# Undo an Apple patch that adds a dependency on 'xcselect.h',
# which is something that Apple doesn't appear to distribute.
patch -R -p0 <../patches/PR11291804-xcode.diff
./configure --prefix=/usr/local
make
make install
That done, the man
binary should be available at /usr/local/bin/man
. Also note that you might need to run hash -r
to clear the hash table of any instances of /usr/bin/man
that may be lingering there from the last time you ran man
before the addition to /usr/local/bin/
will be picked up.
Manage MACOS disk space
Reconnect HP Wifi Printers to MAC
https://support.hp.com/us-en/document/c06184808
https://drive.google.com/file/d/1fs-Bg-RrexFzD5fUobTFQFwt6bJ1tLst/view?usp=sharing
HP Printers - Troubleshoot a Wi-Fi Printer Connection _ HP® Customer Support.pdf
Candidate Solutions
How to show or hide the MAC desktop with other windows open
CMD + F3 > will either show or hide the MAC desktop based on whether the desktop is showing now
Run Windows apps on MACOS - Options
https://www.howtogeek.com/187359/5-ways-to-run-windows-software-on-a-mac/
windows-apps-on-mac-2020-howtogeek-5 Ways to Run Windows Software on a Mac.pdf
- VirtualBox — need valid Windows software license though
- Crossover - free but some compatibility issues
- Wine - free emulator but need to see how well an app is supported
- maybe better option ? virtualbox w ubuntu and wine there where compatibility is higher than macos
- remote desktop to windows system - use Windows or Chrome remote desktop
Screen Shots - copy to file or copy to clipboard
Take a screen shot - copy to file
https://support.apple.com/en-us/HT201361
SHFT + CMD + 4
Take a screen shot - copy to clipboard for paste
CTL + CMD + SHFT + 4
Crop a circle image clip using Apple Preview App
https://www.youtube.com/watch?v=9l30Ewrq6zM
- Open image in preview
- View >> Show Markup Toolbar
- Markup Toolbar >> Far Left Drop down >> Select Elliptical selection
- hold shift key while draging to ensure the crop stays in a circle shape
- press CMD + K to create a crop
- paste the image into a target document
QuickTime - record, play videos
we recorded a screen video on the problem of switching between confluence sites and the related user accounts to log in to those sites
good video on how to use QuickTime
https://www.youtube.com/watch?v=prUVS0HF2gU
QuickTime bugs in catalina
- the .mov file will ALWAYS be saved to the Desktop when you stop the video ( the setting for video folder is ignored )
record a screen movie
https://support.apple.com/en-us/HT208721
quicktime-record-play-movies-How to record the screen on your Mac.pdf
how to trim, cut, delete clips in iMovie
https://www.youtube.com/watch?v=rR2Nym2glGI
- Cut clip and delete
- create project
- add media file
- open in timeline by double-clicking on the opened movie ( x to close timeline )
- OR drag a movie from the top left on to the timeline to replace the existing movie
- find start and end of points to clip in timeline
- cmd B to mark start and end
- cursor over split clip
- select delete to delete clip
- save as new video file to a folder
time and edit clips in timeline
https://www.youtube.com/watch?v=W9wRxmTlKCA
save a timeline clip to a file
you can select/edit/copy a clip in the timeline, and edit/paste it into a newly created project, that you can share out
complete iMovie tutorial
https://www.youtube.com/watch?v=XjgkMt0wP7w
Save a movie to a file
Exporting Your Video From iMovie
- To export your video, start by clicking on File in the menu bar, hover over Share and then click File.
- The Exporting options dialog box will open. ...
- The size, or resolution, will effect how big your exported file is and how long it takes to export.
Error export a clip to a file with the share option
https://www.saintlad.com/imovie-wont-export/
Let’s get started.
Step-by-step guide for Example
sample code block
Recommended Next Steps
Related articles