Skip to content

Instantly share code, notes, and snippets.

@elvisciotti
Last active August 14, 2022 06:39
Show Gist options
  • Save elvisciotti/a70e2b1604a37516ba9edbf21d3a95cf to your computer and use it in GitHub Desktop.
Save elvisciotti/a70e2b1604a37516ba9edbf21d3a95cf to your computer and use it in GitHub Desktop.
Bash script to create ram disk to be used to speed up IntelliJ
#!/bin/bash
ramDiskCreate ()
{
if [ ! -d /Volumes/RAMDisk/intellij-cache/ ]; then
diskutil erasevolume HFS+ 'RAMDisk' `hdiutil attach -nomount ram://1024288`;
else
echo RAMDisk already created;
fi;
mkdir -p /Volumes/RAMDisk/intellij-caches;
}
@elvisciotti
Copy link
Author

elvisciotti commented Jun 21, 2018

And symlink with
mv ~/Library/Caches/PhpStorm2018.2/index/* /Volumes/RAMDisk/phpstorm-index/
rm -rf ~/Library/Caches/PhpStorm2018.2/index
ln -s /Volumes/RAMDisk/phpstorm-index/ ~/Library/Caches/PhpStorm2018.2/index

mv ~/Library/Caches/PhpStorm2018.2/caches/* /Volumes/RAMDisk/phpstorm-caches/
rm -rf ~/Library/Caches/PhpStorm2018.2/caches
ln -s /Volumes/RAMDisk/phpstorm-caches/ ~/Library/Caches/PhpStorm2018.2/caches

ls -la ~/Library/Caches/PhpStorm2018.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment