Skip to content

Instantly share code, notes, and snippets.

@atodev
Last active April 1, 2023 17:36
Show Gist options
  • Save atodev/f9b73ee8b21230cbf86aad0b39665502 to your computer and use it in GitHub Desktop.
Save atodev/f9b73ee8b21230cbf86aad0b39665502 to your computer and use it in GitHub Desktop.
[MAC]
brew update
brew upgrade
brew install 1term2
brew install bash
https://www.youtube.com/watch?v=mmkDyV59nRo
https://confluence.cc.lehigh.edu/display/LKB/macOS%3A++Create+a+Desktop+Alias+to+a+Network+Storage+Space
https://confluence.cc.lehigh.edu/display/LKB/macOS%3A++Automatically+Connect+to+Network+Storage
-- keep mac awake
caffeinate
-- screenshot
-- whole screen
cmd shft 3
-- part screen
cmd sft 4
--- to clipboard
cmd ctrl shift 4
-- default type
defaults write com.apple.screencapture type jpg
-- location
defaults write com.apple.screencapture location ~/Desktop/screenshots
-- all downloads
sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'select LSQuarantineDataURLString from LSQuarantineEvent'
-- to clear
sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'delete from LSQuarantineEvent'
-- password
passwd
security set-keychain-password
whoami
-- to get back one dir
cd [space]
-- like cp(copy)
ditto note ~/Documents/note
-- space on hd
df -h
-- ifconfig
ifconfig en0 | grep inet
ifconfig en0 | grep inet | awk '{ print $2 }'
traceroute <domain>
--dig into the dns
dig <hostname>
-- process
ps
ps -ax
top
top -o rsize
-- kill
ps -ax | grep thisisascript
kill -9 <proccess id>
--Shell
which $SHELL
-- shwith to bash
bash
uptime
-- flush DNS cache
sudo killall -HUP mDNSResponder; sudo killall mDNSResponderHelper; sudo dscacheutil -flushcache
-- compare files
diff one.txt two.txt
--curl
curl <URL> > <localNote.txt>
curl wttr.in/Waiheke
-- alrm
leave 1130
-- disable gatekeeper
sudo spctl --master-disable
-- install brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
-- Python server
python3 -m http.server
-- shutdown
shutdown -r now
-- sudo password on pro
sudo nano /etc/pam.d/sudo
add a line above auth
auth sfficient pam_tid.so
save
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment