Now apple, mbp, mba, iphone, ipad ,...... The key is that there are more and more rogue software on windows, and work needs are added, so I switched to mac. Well, the starting mbp looks very beautiful. In fact, there are various cards. I can see little chrysanthemums all day. Well, diaosi can't afford to buy high-end products. It uses the lowest-end products. It's full of tears, but we have to continue our life. We can only find a solution for ourselves.
The first step of optimization speed is to add memory. Don't ask why I can add, old machine, not to mention, full of tears. When you buy a machine with rich children's paper, you can add memory. The general public is still tossing it on their own. The 4G memory that was added a long time ago is 250.
Step 2: Go to SSd. This is really good, but it's not cheap. I 'd like to skip this article if I can store ssd and hdd at will. I used BNS for development. The Mess occupied a lot of space, so I had to suspend ssd updates. But do we just give up? The sacred red scarf has always led us in front, and our life is endless ......
The point is, we can use the memory to speed up. This is already bad on windows, isn't it ramdisk. Come up with Gu Ge du Niang. After some OOXX, I found that it was useless, but I found that mac itself could be implemented. As a diaosi IT male, you have to make the effort on your own.
@#! @ ¥ # ¥ @ % # $ % A week has passed ........................)
Let's not talk about the tossing process. Let's get the result directly.
Let's talk about the general workflow:
1. at startup, the script is automatically called to create a memory disk and then load the required data.
2. When shutdown, the script is automatically called to write data from the memory disk back to the hard disk, and then shut down.
It's not complicated. Let's just get it. The following is a bit complicated:
First, how can I run the script when I start the instance.
First, create a directory in your eye-catching place to serve as the ramdisk script and the working directory for data backup.
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140207/215S0NN-0.jpg "title =" screen snapshot at noon 12.31.54.png "alt =" wKioL1LarJTSN_mXAAAjonvz3P4653.jpg "/>
In my directory, a ramdisk directory is created under/etc/. If your friends follow the instructions, pay attention to the permissions.
Next, create a login. sh script to automatically run the script when it is started.
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140207/215S02491-1.jpg "title =" screen snapshot at noon 12.44.31.png "alt =" wKiom1Lar7yjsyiYAAFdAW54I5Q171.jpg "/>
DISK_NAMESpecify the name of the memory disk.
DISK_SPACEIt is used to specify the memory disk size. This is the upper limit. Generally, you can use the memory as much as you want.
BAK_PATHUsed to specify the storage path of the memory disk
Create another logout. sh to be called during shutdown.
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140207/215S02619-2.jpg "title =" screen snapshot last noon 12.54.49.png "alt =" wKiom1Lash-RihhLAACbp1M8oNw115.jpg "/>
DISK_NAMESpecifies the name of the memory disk, which must be consistent with the previous script.
BAK_PATHSame as above
What about ramdisk? Of course, how is it used.
Run login. sh in the terminal first. If the permission is incorrect, use sudo. Then, go to the finder and check it out!
Nothing? Why? Well, I actually hid the memory disk in the script. Why should I add such a handsome operation? Are there any love cartoons in Japan. Because many of my friends are cheap, ramdisk will be a variety of tragedies after it is detached. Therefore, after hiding it in advance, you don't have to worry about it any more.
How can I access it? There is a magic way to find the path in the menu of the finder and choose to go to the folder.
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140207/215S0BB-3.jpg "title =" screen snapshot 2.167.35.20.png "alt =" wKiom1LbuMHgUmL2AAEu5e-rufI982.jpg "/>
Then, enter the memory disk loading path, that is,MOUNT_PATHThe next step is to witness the miracle ......
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140207/215S0B41-4.jpg "title =" screen snapshot 2.167.36.49.png "alt =" wKioL1LbuYOwOMNdAABdwY8kwVs120.jpg "/>
What should I put in a memory disk? Even for love action movies, you can put the cache in it to accelerate the running speed, or put directories that frequently require frequent operations, such as chrome configuration or something ......
First, process the cache:
First, move the system cache directory to the memory disk.
Then map the directory on the memory disk back to the original directory through the Symbolic Link
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140207/215S0O16-5.jpg "title =" screen snapshot 2014-01-19 1167.56.23.png "alt =" wkiom1lbvmddgu3taaaptj1__em037.jpg "/>=> 650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140207/215S04409-6.jpg "style =" float: none; "title =" screen snapshot 2.167.45.20.png "alt =" wKioL1LbuzqDtBAYAAAaXFw_dxo042.jpg "/>
No. Give a script.
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140207/215S04230-7.jpg "title =" screen snapshot 2.167.51.11.png "alt =" wKioL1LbvErD4-cGAABseX0QaMQ804.jpg "/>
The chrome directory is also processed
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140207/215S02S8-8.jpg "style =" float: none; "title =" screen snapshot 2.167.54.19.png "alt =" wKioL1LbvcOzxB3bAAAaV7PXaGE389.jpg "/> corresponds to 650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140207/215S032Q-9.jpg "style =" float: none; "title =" screen snapshot 2.167.54.32.png "alt =" wKiom1LbveaRK90MAAA2s-rx1mk766.jpg "/>
Then open the memory disk to see the cache and Chrome directories.
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140207/215S0OI-10.jpg "title =" screen snapshot 1128.01.35.png "alt =" wKioL1LbvrrRR0onAACI1vK7ZZQ098.jpg "/>
The script runs automatically. Run in the terminal
defaults write com.apple.loginwindow LoginHook /etc/RamDisk/login.shdefaults write com.apple.loginwindow LogoutHook /etc/RamDisk/logout.sh
Finally, restart the machine.
Postscript:
Pop, pop. Please refer to "omnipotent Script 2" in the next episode ramdisk Evolution under mac.
My daughter recently fell in love with "black cat police chief" and looked back and forth several rounds every day. When I was a child, I always felt that "black cat police chief" had a lot of sets. In fact, there were only four sets, so I tried it too ......)
This article from the "game Life" blog, please be sure to keep this source http://kingzeus.blog.51cto.com/8504664/1352956