# Simple script for those interested(2/7/12)



## loonatik78 (Jul 24, 2011)

Thanks to the work of dwitherell, I've whipped up a little script to get rid of those useless memory management apps and overclocking apps. These settings are what worked for me on this particular device. Your results may vary. For those unfamiliar with scripts, please do NOT simply push this to your device.

To apply this script...

1) TEST your setting FIRST.
2) In a linux-friendly text editor (like Vim, NOT notepad in Windoze), copy the script and save it, NO file extension. 
3) Assuming you're familiar with ADB, push the file, named "S91voltctrl" (no quotes) to /system/etc/init.d
4) In the ADB shell, change permissions on it with the following command." chmod 777 /system/etc/init.d/S91voltctrl"
5 Rebooting or entering "sh /system/etc/init.d/S91voltctrl" in the ADB shell or terminal emulator will execute and apply it.

THIS IS CASE SENSITIVE

So... here's your script....


```
<br />
#!/system/bin/sh<br />
echo "smartassV2" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor<br />
echo "1300000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq<br />
echo 80 > /proc/sys/vm/swappiness<br />
echo deadline > /sys/block/mmcblk0/queue/scheduler<br />
echo 60 > /proc/sys/vm/vfs_cache_pressure<br />
echo "100,200,352,640,2570,5120" > /sys/module/lowmemorykiller/parameters/minfree<br />
echo "0,1,2,11,12,13" > /sys/module/lowmemorykiller/parameters/adj<br />
echo 30 > /proc/sys/vm/dirty_ratio<br />
echo 35 > /proc/sys/vm/dirty_background_ratio<br />
echo 5000 > /proc/sys/vm/dirty_expire_centisecs<br />
echo 1 > /proc/sys/vm/oom_kill_allocating_task<br />
echo 0 > /proc/sys/vm/oom_dump_tasks<br />
echo 1 > /proc/sys/kernel/sched_compat_yield<br />
echo 768 > /sys/block/mmcblk0/queue/read_ahead_kb<br />
```


----------



## knightcrusader (Oct 14, 2011)

Is this an init.d script? If not, where do you put it so it loads on boot?

And if you are running my CWM image, you'll have root adb access to the system when in recovery so you can undo the script if something goes wacky.


----------



## loonatik78 (Jul 24, 2011)

knightcrusader said:


> Is this an init.d script? If not, where do you put it so it loads on boot?
> 
> And if you are running my CWM image, you'll have root adb access to the system when in recovery so you can undo the script if something goes wacky.


init.d it is. I come from HTCland and Samsung is a little unfamiliar as far as bootloader/recovery goes. I wanted to play with voltages, but it looks like it's got HAVS and errors every time I try to change something.

So far the phone is running 1.3GHz, but if I could raise the voltage on 1.4 ,25v, it would be stable. It's getting about 1800 on Quadrant at 1.3GHz with the other odds and ends.


----------



## p_025 (Nov 13, 2011)

"Unable to chmod /system/etc/init.d/S91voltctrl: Not a directory"


----------



## loonatik78 (Jul 24, 2011)

p_025 said:


> "Unable to chmod /system/etc/init.d/S91voltctrl: Not a directory"


The StockTweak kernel doesn't feature a sysfs interface and will give you that error. If I'm wrong, please correct me.


----------

