Skip to content

Instantly share code, notes, and snippets.

@kanchudeep
Last active June 20, 2023 20:10
Show Gist options
  • Save kanchudeep/03c4fc356659a3689786502c59f2282e to your computer and use it in GitHub Desktop.
Save kanchudeep/03c4fc356659a3689786502c59f2282e to your computer and use it in GitHub Desktop.
Clear Terminal History
1. For current session history:
history -c
2. For all history:
rm ~/.bash_historys
Create Install ISO (10.9 Mavericks onwards):
After downloading installation, execute:
# Create blank disk image
hdiutil create -o /tmp/HighSierra.cdr -size 5200m -layout SPUD -fs HFS+J
* Size:
El Capitan: 5985m
High Sierra: 5175m
# Mount blank image
hdiutil attach /tmp/HighSierra.cdr.dmg -noverify -mountpoint /Volumes/install_build
# Create install media
sudo /Applications/Install\ macOS\ High\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/install_build --applicationpath /Applications/Install\ macOS\ High\ Sierra.app
# Move disk image to desktop
mv /tmp/HighSierra.cdr.dmg ~/Desktop/InstallSystem.dmg
# Unmount the image:
hdiutil detach /Volumes/Install\ macOS\ High\ Sierra
# Convert image to ISO:
hdiutil convert ~/Desktop/HighSierra.cdr.dmg -format UDTO -o ~/Desktop/HighSierra.iso
# Remove DMG image:
rm ~/Desktop/InstallSystem.dmg
# Correct extension of ISO image:
mv ~/Desktop/HighSierra.iso.cdr ~/Desktop/HighSierra.iso
Create Install USB:
After downloading installation, execute (with appropriate value for
<volume> as the target volume to create in):
sudo /Applications/Install\ macOS\ High\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/<volume> --applicationpath /Applications/Install\ macOS\ High\ Sierra.app
Disable Journaling:
diskutil disableJournal /Volumes/TheVolumeName
Disable Verbose Boot
sudo nvram boot-args=
Disabling System Integrity Protection and Removing System Applications
1. For actual Macs:
a. Start/restart your Mac.
b. Immediately hold down Command+R to boot into recovery.
2. For Virtual Machines:
a. Enter Virtual Machine EFI BIOS by pressing F12 while booting.
b. Select Boot Maintenance Manager > Boot From File > <Third item>.
c. This will present you with a very simple file manager like interface.
d. Open 'com.apple.recovery.boot'. Select 'boot.efi'.
3. Launch 'Utilities > Terminal' and execute the commmand:
csrutil disable
4. Restart system.
5. sudo rm -fr /Applications/<Application>
Download El Capitan:
https://itunes.apple.com/app/os-x-el-capitan/id1147835434?mt=12
JRE home:
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/
* Place JCE files in the sub folder of above:
lib/security/
Location of user preferences:
Canonical location:
~/Library/Preferences
Location of system applications:
/System/Library/CoreServices/Applications
Open JAR files from unknown publisher(s):
Right click on the JAR file and select 'Open'/'Open with'.
or
Hold 'Control' and click on file.
Resize Partition
diskutil resizeVolume /path/to/volume <size>
* Note: Does not seem to work for unjournaled HFS+
Secure Erase
sudo diskutil secureErase freespace 0 "/Volumes/<Volume>"
Set Dock Height in Pixels
defaults write com.apple.Dock tilesize -int X && killall -HUP Dock
* where X = desiredDockHeight / 2 - 11 (try 21)
Show Hidden Files in Finder
defaults write com.apple.finder AppleShowAllFiles YES
System Unresponsive/Hung
1. For 03 seconds press & hold 'Command + Shift + Options + Esc'.
2. If the screen was not locked, then that action will Force Quit the
front-most application (the Force Quit Applications window is not required).
3. If, after releasing keys force quite fails, proceed with second round,
third round and so on...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment