Skip to content

Instantly share code, notes, and snippets.

@joonassandell
Last active November 16, 2018 09:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joonassandell/d7b02abdc5268a0bfe68fb94dbf07b18 to your computer and use it in GitHub Desktop.
Save joonassandell/d7b02abdc5268a0bfe68fb94dbf07b18 to your computer and use it in GitHub Desktop.
Random OSX commands and stuff I usually forget
# Commands
**Show hidden files**:
`defaults write com.apple.Finder AppleShowAllFiles YES`
**Disable photos from auto-opening** (worked in El Capitan, http://bit.ly/2c6rVrX):
`defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool YES`
**Open Hosts**:
`sudo open -t /etc/hosts/`
**No notificationcenter** (http://bit.ly/YlXmQo):
```
launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist
killall NotificationCenter
```
(to load `launchctl load -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plis`)
**Change screenshot location** (http://bit.ly/1amt3PE):
```
defaults write com.apple.screencapture location /path/
killall SystemUIServer
```
**Show IP**:
`ipconfig getifaddr en1 (en2, en3... etc.)`
**Kill program** (http://bit.ly/1eOymj2):
```
ps -A | [grep name of the prog]
kill -9 [process id]
```
**Fix node/grunt/gulp errpr 'EMFILE: TOO MANY FILES OPEN'** (http://bit.ly/1kpF8P8):
`ulimit -n 9999`
**Useful & simple command which turns any OS X folder to a web server** (open localhost:8000 in browser):
`python -m SimpleHTTPServer 8000`
# Application settigns
**Allow local ajax files in Chrome**:
`open /Applications/Google\ Chrome.app --args --allow-file-access-from-files`
**Offline manifest settings location**:
`chrome://appcache-internals/`
# Various tricks and articles
**Tricks**:
http://mmb.pcb.ub.es/~carlesfe/unix/tricks.txt
**Setup Mac OS X Mountain Lion or Mavericks**:
https://gist.github.com/millermedeiros/6615994
**OSX for Hackers: Yosemite Edition**:
https://gist.github.com/brandonb927/3195465
**OSX for Hackers: El Capitan**:
https://gist.github.com/MatthewMueller/e22d9840f9ea2fee4716
**Hide only specific notification from App Store**:
http://bit.ly/1gO1QMO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment