forked from candyan/code_snippets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sh.txt
27 lines (27 loc) · 1.71 KB
/
sh.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
setpci -s 02:0.0 40.b=b3 41.b=a1 42.b=c2 # enable jmicron jmb363 sata/pata dual mode
defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1
rm ~/Library/Safari/History.db* # delete safari history
trimforce disable # speed up boot on old macbooks
pdfbooklet source.pdf destination.pdf
defaults write com.apple.screencapture type jpg # change default screenshot file type
defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1 # set update frequency
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
diskutil eject /dev/disk1s3 # remove disk
hdiutil chpass /path/to/the/diskimage # change the password on an encrypted disk image
hdiutil attach example.dmg -shadow /tmp/example.shadow -noverify # mount a read-only disk image as read-write
mount -t hfs /dev/disk1s1 /Volumes/Foo # mount a removable drive
defaults write com.apple.finder ShowAllFiles TRUE # show hidden files in MacOS Finder
mount -uw / # mount "/" read write
lsof -i|grep "LISTEN" # show all listening connections
dscacheutil -flushcache # flush out the DNS Cache
mkfile 10m 10MB.dat # create a file of a given size (all zeros)
hdiutil create -size 10m 10MB.dmg # create a file of a given size (all zeros)
qlmanage -p $FILE # open a file in MacOS Quicklook Preview
stty sane # restore terminal settings
open -a Finder ./ # open current directory in MacOS Finder
dsenableroot -d # disable root account
afsctool -c -l -k -v -i -9 /Library # transparent file compression
ditto –hfsCompression # transparent file compression
dscl . -append /groups/admin GroupMembership $USER # add user to the admin group on
dscl . -delete /groups/admin GroupMembership $USER # delete user from the admin group
caffeinate -i -t 3600 # prevent pc from going to sleep