Macos

From Halfface
Jump to navigation Jump to search

install macos under kvm

https://github.com/foxlet/macOS-Simple-KVM

create user with admin privilages

dscl . -create /Users/abjorklund
dscl . -create /Users/abjorklund UserShell /bin/bash
dscl . -create /Users/abjorklund RealName "Andreas Bjorklund"
dscl . -create /Users/abjorklund UniqueID 1001
dscl . -create /Users/abjorklund PrimaryGroupID 1000
dscl . -create /Users/abjorklund NFSHomeDirectory /Users/abjorklund/
dscl . -passwd /Users/abjorklund password
dscl . -append /Groups/admin GroupMembership abjorklund

add group

Find free gid.

dscl . list /Groups PrimaryGroupID | tr -s ' ' | sort -n -t ' ' -k2,2
dscl . create /Groups/sudopasswordno
dscl . create /Groups/sudopasswordno RealName "User who are tired of writing password each time running sudo"
dscl . create /Groups/sudopasswordno passwd "*"
dscl . create /Groups/sudopasswordno gid 799

which version of macos are you running

sw_vers
ProductName:	Mac OS X
ProductVersion:	10.13.5
BuildVersion:	17F66a

which version of macos exist

List of Mac OS versions
OS X 10 beta: Kodiak - 13 September 2000
OS X 10.0: Cheetah - 24 March 2001
OS X 10.1: Puma - 25 September 2001
OS X 10.2: Jaguar - 24 August 2002
OS X 10.3 Panther (Pinot) - 24 October 2003
OS X 10.4 Tiger (Merlot) - 29 April 2005
OS X 10.4.4 Tiger (Chardonnay)]
OS X 10.5 Leopard (Chablis) - 26 October 2007
OS X 10.6 Snow Leopard - 28 August 2009
OS X 10.7 Lion (Barolo) - 20 July 2011
OS X 10.8 Mountain Lion (Zinfandel) - 25 July 2012
OS X 10.9 Mavericks (Cabernet) - 22 October 2013
OS X 10.10: Yosemite (Syrah) - 16 October 2014
OS X 10.11: El Capitan (Gala) - 30 September 2015
macOS 10.12: Sierra (Fuji) - 20 September 2016
macOS 10.13: High Sierra (Lobo) - 25 September 2017
macOS 10.14: Mojave (Liberty) - 24 September 2018
macOS 10.15: Catalina - 7 October 2019

list usb devices (lsusb)

ioreg -p IOUSB -l -w 0

wifi management

Create a symlink to the AirPort command in Terminal

ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /Usr/bin/airport

Network connections list

networksetup -listallhardwareports

View available Wi-Fi networks

airport -s

Delete a Wi-Fi network profile

networksetup -removepreferredwirelessnetwork en0 SSID_OF_NETWORK

Remove all stored Wi-Fi network profiles

networksetup -removeallpreferredwirelessnetworks en0

List of wifi networks computer can connect too.

networksetup -listpreferredwirelessnetworks en0

Wipe these files to forget connections.

\rm /Library/Preferences/SystemConfiguration/{com.apple.airport.preferences.plist,com.apple.network.identification.plist,com.apple.wifi.message-tracer.plist,NetworkInterfaces.plist,preferences.plist}
reboot

update software

List software to update

softwareupdate -l

Install update

softwareupdate --install 'macOS High Sierra 10.13.6 Update- '

Install all updates

softwareupdate -i -a

upgrade macos

https://github.com/munki/macadmin-scripts/blob/master/installinstallmacos.py

manage keychain from cli

https://apple.stackexchange.com/questions/170431/accessing-keychain-access-from-terminal-osx

show routes

netstat -rn