Created
October 7, 2011 19:52
-
-
Save marugoshi/1271211 to your computer and use it in GitHub Desktop.
To Save MacBookAir SSD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
SIZE=262144 | |
MOUNT_POINT=/Volumes/ramdisk | |
RAM_DISK=`hdid -nomount ram://$SIZE` | |
newfs_hfs -v ramdisk $RAM_DISK | |
mkdir -p $MOUNT_POINT | |
mount -t hfs $RAM_DISK $MOUNT_POINT | |
chmod 0777 $MOUNT_POINT | |
CHROME_CACHE_DIR=/Users/tokuyama/Library/Caches/Google/Chrome/Default/Cache | |
rm -rf $CHROME_CACHE_DIR | |
ln -s $MOUNT_POINT $CHROME_CACHE_DIR | |
APACHE_LOG_DIR=/private/var/log/apache2 | |
rm -rf $APACHE_LOG_DIR | |
ln -s $MOUNT_POINT $APACHE_LOG_DIR | |
# place this file into directory like /usr/local/bin | |
# then execute command like below | |
# sudo defaults write com.apple.loginwindow LoginHook /usr/local/bin/ramdisk.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment