[Samsung Galaxy SL i9003] blaqkarma:
Please clarify where's exacltly the difference between this scripts??

ALL IN ONE SCRIPT BY FUSS

#!/system/bin/sh
# This script is only edited by me to improve it for I9003, credits goes to
# Copyright© 2011 Juwe11
#Part below here by me

if [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ]
then
/system/xbin/echo "4096" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
fi;

if [ -e /sys/devices/virtual/bdi/179:8/read_ahead_kb ]
then
/system/xbin/echo "4096" > /sys/devices/virtual/bdi/179:8/read_ahead_kb;
fi;

if [ -e /sys/devices/virtual/bdi/default/read_ahead_kb ]
then
/system/xbin/echo "4096" > /sys/devices/virtual/bdi/default/read_ahead_kb;
fi;

#Part below here edited by me (changed values) Credits to Juwe11
if [ -e /sys/module/lowmemorykiller/parameters/adj ]; then
echo "0,1,2,4,6,15" > /sys/module/lowmemorykiller/parameters/adj
fi

if [ -e /sys/module/lowmemorykiller/parameters/minfree ]; then
echo "2560,4096,5632,10240,11776,14848" > /sys/module/lowmemorykiller/parameters/minfree
fi

if [ -e /proc/sys/vm/swappiness ]; then
echo "20" > /proc/sys/vm/swappiness
fi

if [ -e /proc/sys/vm/vfs_cache_pressure ]; then
echo "70" > /proc/sys/vm/vfs_cache_pressure
fi

if [ -e /proc/sys/vm/dirty_expire_centisecs ]; then
echo "3000" > /proc/sys/vm/dirty_expire_centisecs
fi

if [ -e /proc/sys/vm/dirty_writeback_centisecs ]; then
echo "450" > /proc/sys/vm/dirty_writeback_centisecs
fi

if [ -e /proc/sys/vm/dirty_ratio ]; then
echo "10" > /proc/sys/vm/dirty_ratio
fi

if [ -e /proc/sys/vm/dirty_background_ratio ]; then
echo "2" > /proc/sys/vm/dirty_background_ratio
fi

# Below here everything is Copyright© by
# Blockbuster Rom and Team Blockbuster!

LOG_FILE=/data/zipalign.log
ZIPALIGNDB=/data/zipalign.db

if [ -e $LOG_FILE ]; then
rm $LOG_FILE;
fi;

if [ ! -f $ZIPALIGNDB ]; then
touch $ZIPALIGNDB;
fi;

echo "Starting FV Automatic ZipAlign $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE

for DIR in /system/app /data/app ; do
cd $DIR
for APK in *.apk ; do
if [ $APK -ot $ZIPALIGNDB ] && [ $(grep "$DIR/$APK" $ZIPALIGNDB|wc -l) -gt 0 ] ; then
echo "Already checked: $DIR/$APK" | tee -a $LOG_FILE
else
zipalign -c 4 $APK
if [ $? -eq 0 ] ; then
echo "Already aligned: $DIR/$APK" | tee -a $LOG_FILE
grep "$DIR/$APK" $ZIPALIGNDB > /dev/null || echo $DIR/$APK >> $ZIPALIGNDB
else
echo "Now aligning: $DIR/$APK" | tee -a $LOG_FILE
zipalign -f 4 $APK /cache/$APK
busybox mount -o rw,remount /system
cp -f -p /cache/$APK $APK
busybox rm -f /cache/$APK
grep "$DIR/$APK" $ZIPALIGNDB > /dev/null || echo $DIR/$APK >> $ZIPALIGNDB
fi
fi
done
done

busybox mount -o ro,remount /system
touch $ZIPALIGNDB
echo "Automatic ZipAlign finished at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE

MODULES="ipv6"

for i in $MODULES;
do
modprobe $i;
done

sysctl -p /etc/sysctl.conf;

LOOP=`ls -d /sys/block/loop*`;
blk0=`ls -d /sys/block/mmcblk0`;
blk1=`ls -d /sys/block/mmcblk1`;
MMC=`ls -d /sys/block/mmc*`;

for j in $blk0 $blk1; do
echo "0" > $j/queue/rotational;
echo "4096" > $j/queue/read_ahead_kb;
done;

for k in $(busybox mount | grep relatime | cut -d " " -f3) ; do
sync;
busybox mount -o remount,noatime $k;
done;

for i in /sys/block/*/queue/scheduler ; do
echo "noop" > $i;
done;

for a in $blk0 $blk1 $MMC ; do
echo "512" > $a/queue/nr_requests;
done;

# Created by Einherjar Development Team
#

# Remount all partitions with noatime
for k in $(busybox mount | grep relatime | cut -d " " -f3) ; do
sync
busybox mount -o remount,noatime $k
done

# One-time tweaks to apply on every boot
STL=`ls -d /sys/block/stl*`
BML=`ls -d /sys/block/bml*`
MMC=`ls -d /sys/block/mmc*`

# Tweak deadline io scheduler
for i in $STL $BML $MMC $TFSR; do
echo 0 > $i/queue/rotational
echo 1 > $i/queue/iosched/low_latency
echo 1 > $i/queue/iosched/back_seek_penalty
echo 1000000000 > $i/queue/iosched/back_seek_max
echo 3 > $i/queue/iosched/slice_idle
echo 16 > $i/queue/iosched/quantum
echo 1 > $i/queue/iosched/fifo_batch
echo deadline > $i/queue/scheduler
done

# Tweak kernel VM management
echo 0 > /proc/sys/vm/swappiness
echo 10 > /proc/sys/vm/dirty_ratio
echo 4096 > /proc/sys/vm/min_free_kbytes

# Tweak kernel scheduler, less aggressive settings
echo 20000000 > /proc/sys/kernel/sched_latency_ns
echo 2500000 > /proc/sys/kernel/sched_wakeup_granularity_ns
echo 1000000 > /proc/sys/kernel/sched_min_granularity_ns

# Misc tweaks for battery life
echo "2000" > /proc/sys/vm/dirty_writeback_centisecs
echo "1000" > /proc/sys/vm/dirty_expire_centisecs

# Minfree Handler
# Values in MB = 10, 16, 24, 68, 76, 92
echo 2560,4096,6144,17408,19456,23552 > /sys/module/lowmemorykiller/parameters/minfree

# SD card Read-ahead set to 2048kb instead of default 128kb
if [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ]; then
/system/xbin/echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
fi

# Prop tweaks
setprop ro.telephony.call_ring.delay 1000
setprop ro.ril.disable.power.collapse 0
setprop pm.sleep_mode 1
setprop dalvik.vm.startheapsize 48m
setprop wifi.supplicant_scan_interval 180
setprop windowsmgr.max_events_per_sec 55

busybox mount -o remount,rw -t rootfs /
sh /system/bin/userinit.sh

# End EDT Tweaks - For Now

READ_AHEAD_KB="2049"

if [ -e /sys/devices/virtual/bdi/0:18/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/0:18/read_ahead_kb
echo "SD card read ahead kb SET to $READ_AHEAD_KB"
fi

if [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/179:0/read_ahead_kb
echo "SD card read ahead kb SET to $READ_AHEAD_KB"
fi

if [ -e /sys/devices/virtual/bdi/7:0/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:0/read_ahead_kb
echo "SD card read ahead kb SET to $READ_AHEAD_KB"
fi

mount -t debugfs none /sys/kernel/debug
echo NO_GENTLE_FAIR_SLEEPERS > /sys/kernel/debug/sched_features
echo ARCH_POWER > /sys/kernel/debug/sched_features
echo HRTICK > /sys/kernel/debug/sched_features
unmount /sys/kernel/debug

if [ -e /sys/devices/virtual/bdi/7:1/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:1/read_ahead_kb
echo "SD card read ahead kb SET to $READ_AHEAD_KB"
fi

if [ -e /sys/devices/virtual/bdi/7:2/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:2/read_ahead_kb
echo "SD card read ahead kb SET to $READ_AHEAD_KB"
fi

if [ -e /sys/devices/virtual/bdi/7:3/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:3/read_ahead_kb
echo "SD card read ahead kb SET to $READ_AHEAD_KB"
fi

if [ -e /sys/devices/virtual/bdi/7:4/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:4/read_ahead_kb
echo "SD card read ahead kb SET to $READ_AHEAD_KB"
fi

if [ -e /sys/devices/virtual/bdi/7:5/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:5/read_ahead_kb
echo "SD card read ahead kb SET to $READ_AHEAD_KB"
fi

if [ -e /sys/devices/virtual/bdi/7:6/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:6/read_ahead_kb
echo "SD card read ahead kb SET to $READ_AHEAD_KB"
fi

if [ -e /sys/devices/virtual/bdi/7:7/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:7/read_ahead_kb
echo "SD card read ahead kb SET to $READ_AHEAD_KB"
fi

if [ -e /sys/devices/virtual/bdi/default/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/default/read_ahead_kb
echo "SD card read ahead kb SET to $READ_AHEAD_KB"
fi

sysctl -p

CACHESIZE=$(df -k /cache | tail -n1 | tr -s ' ' | cut -d ' ' -f2)
if [ $CACHESIZE -gt 80000 ]
then
echo "Large cache detected, moving dalvik-cache to /cache"
if [ ! -d /cache/dalvik-cache ]
then
busybox rm -rf /cache/dalvik-cache /data/dalvik-cache
mkdir /cache/dalvik-cache /data/dalvik-cache
fi

busybox chown 1000:1000 /cache/dalvik-cache
busybox chmod 0771 /cache/dalvik-cache

# bind mount dalvik-cache so we can still boot without the sdcard
busybox mount -o bind /cache/dalvik-cache /data/dalvik-cache
busybox chown 1000:1000 /data/dalvik-cache
busybox chmod 0771 /data/dalvik-cache
else
echo "Small cache detected, dalvik-cache will remain on /data"

echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo "cfq" > /sys/block/mmcblk0/queue/scheduler

for i in \
`find /data -iname "*.db"`
do \
sqlite3 $i 'VACUUM;';
done

LOOP=`ls -d /sys/block/loop*`;
RAM=`ls -d /sys/block/ram*`;
MMC=`ls -d /sys/block/mmc*`;
for j in $LOOP $RAM
do
echo "0" > $j/queue/rotational;
echo "3072" > $j/queue/read_ahead_kb;
done

rm -f /cache/*.apk
rm -f /cache/*.tmp
rm -f /data/dalvik-cache/*.apk
rm -f /data/dalvik-cache/*.tmp

busybox rm -f /data/system/userbehavior.db
busybox chmod 400 /data/system/usagestats/
busybox chmod 400 /data/system/appusagestats/

busybox mount -o remount,rw,noatime,noauto_da_alloc,nodiratime,barrier=0,nobh /system
busybox mount -o remount,noatime,noauto_da_alloc,nodiratime,nodev,barrier=0,nobh /data
busybox mount -o remount,noatime,noauto_da_alloc,nodiratime,nodev,barrier=0,nobh /cache

export sampling_rate=10000
export up_threshold=65
export READ_AHEAD_KB=3072

if [ -n ${up_threshold} ];
then echo ${up_threshold} > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold
fi

if [ -n ${sampling_rate} ];
then echo ${sampling_rate} > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate
fi

if [ -e /sys/module/lowmemorykiller/parameters/adj ]; then
echo "0,1,2,4,7,15" > /sys/module/lowmemorykiller/parameters/adj
fi

if [ -e /sys/module/lowmemorykiller/parameters/minfree ]; then
echo "2560,4096,6144,12288,14336,18432" > /sys/module/lowmemorykiller/parameters/minfree
fi

if [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ]; then
echo "3072" > /sys/devices/virtual/bdi/179:0/read_ahead_kb
fi

# Set io scheduler tweaks for mmc
echo "deadline" > /sys/block/mmcblk0/queue/scheduler
echo "0" > /sys/block/mmcblk0/queue/rotational
echo "2048" > /sys/block/mmcblk0/queue/nr_requests
echo ${READ_AHEAD_KB} > /sys/block/mmcblk0/queue/read_ahead_kb

echo "deadline" > /sys/block/mmcblk1/queue/scheduler
echo "0" > /sys/block/mmcblk1/queue/rotational
echo "2048" > /sys/block/mmcblk1/queue/nr_requests
echo ${READ_AHEAD_KB} > /sys/block/mmcblk1/queue/read_ahead_kb

for i in \ `find /data -iname "*.db"` do \ sqlite3

$i 'VACUUM;'

done

echo "6144 87380 524288" > /proc/sys/net/ipv4/tcp_wmem
echo "6144 87380 524288" > /proc/sys/net/ipv4/tcp_rmem

setprop ro.telephony.call_ring.delay 0
setprop ring.delay 0
#setprop windowsmgr.max_events_per_sec 100
setprop windowsmgr.support_rotation_270 true
setprop ro.HOME_APP_ADJ 1
setprop ro.HOME_APP_MEM 2048
setprop dalvik.vm.heapsize 72m

# Copyright @ CRANIUM ROM
echo "500" > /proc/sys/vm/dirty_expire_centisecs
echo "1000" > /proc/sys/vm/dirty_writeback_centisecs

echo "0" > /proc/sys/net/ipv4/tcp_timestamps;
echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse;
echo "1" > /proc/sys/net/ipv4/tcp_sack;
echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle;
echo "1" > /proc/sys/net/ipv4/tcp_window_scaling;
echo "5" > /proc/sys/net/ipv4/tcp_keepalive_probes;
echo "30" > /proc/sys/net/ipv4/tcp_keepalive_intvl;
echo "30" > /proc/sys/net/ipv4/tcp_fin_timeout;
echo "404480" > /proc/sys/net/core/wmem_max;
echo "404480" > /proc/sys/net/core/rmem_max;
echo "256960" > /proc/sys/net/core/rmem_default;
echo "256960" > /proc/sys/net/core/wmem_default;
echo "4096,16384,404480" > /proc/sys/net/ipv4/tcp_wmem;
echo "4096,87380,404480" > /proc/sys/net/ipv4/tcp_rmem;

#End Cranium Tweaks

and with your script:

#!/system/bin/sh
# This script is writed by me to improve The I9003, #Part below here by me

if [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ]
then
/system/xbin/echo "4096" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
fi;

if [ -e /sys/devices/virtual/bdi/179:8/read_ahead_kb ]
then
/system/xbin/echo "4096" > /sys/devices/virtual/bdi/179:8/read_ahead_kb;
fi;

if [ -e /sys/devices/virtual/bdi/default/read_ahead_kb ]
then
/system/xbin/echo "4096" > /sys/devices/virtual/bdi/default/read_ahead_kb;
fi;

#Part below here edited by me (changed values) Credits to Juwe11
if [ -e /sys/module/lowmemorykiller/parameters/adj ]; then
echo "0,1,2,4,6,15" > /sys/module/lowmemorykiller/parameters/adj
fi

if [ -e /sys/module/lowmemorykiller/parameters/minfree ]; then
echo "2560,4096,5632,10240,11776,14848" > /sys/module/lowmemorykiller/parameters/minfree
fi

if [ -e /proc/sys/vm/swappiness ]; then
echo "20" > /proc/sys/vm/swappiness
fi

if [ -e /proc/sys/vm/vfs_cache_pressure ]; then
echo "70" > /proc/sys/vm/vfs_cache_pressure
fi

if [ -e /proc/sys/vm/dirty_expire_centisecs ]; then
echo "3000" > /proc/sys/vm/dirty_expire_centisecs
fi

if [ -e /proc/sys/vm/dirty_writeback_centisecs ]; then
echo "450" > /proc/sys/vm/dirty_writeback_centisecs
fi

if [ -e /proc/sys/vm/dirty_ratio ]; then
echo "10" > /proc/sys/vm/dirty_ratio
fi

if [ -e /proc/sys/vm/dirty_background_ratio ]; then
echo "2" > /proc/sys/vm/dirty_background_ratio
fi

# Below here Copyright© by
# Slaid480!

LOG_FILE=/data/zipalign.log
ZIPALIGNDB=/data/zipalign.db

if [ -e $LOG_FILE ]; then
rm $LOG_FILE;
fi;

if [ ! -f $ZIPALIGNDB ]; then
touch $ZIPALIGNDB;
fi;

echo "Starting FV Automatic ZipAlign $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE

for DIR in /system/app /data/app ; do
cd $DIR
for APK in *.apk ; do
if [ $APK -ot $ZIPALIGNDB ] && [ $(grep "$DIR/$APK" $ZIPALIGNDB|wc -l) -gt 0 ] ; then
echo "Already checked: $DIR/$APK" | tee -a $LOG_FILE
else
zipalign -c 4 $APK
if [ $? -eq 0 ] ; then
echo "Already aligned: $DIR/$APK" | tee -a $LOG_FILE
grep "$DIR/$APK" $ZIPALIGNDB > /dev/null || echo $DIR/$APK >> $ZIPALIGNDB
else
echo "Now aligning: $DIR/$APK" | tee -a $LOG_FILE
zipalign -f 4 $APK /cache/$APK
busybox mount -o rw,remount /system
cp -f -p /cache/$APK $APK
busybox rm -f /cache/$APK
grep "$DIR/$APK" $ZIPALIGNDB > /dev/null || echo $DIR/$APK >> $ZIPALIGNDB
fi
fi
done
done

busybox mount -o ro,remount /system
touch $ZIPALIGNDB
echo "Automatic ZipAlign finished at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE

MODULES="ipv6"

for i in $MODULES;
do
modprobe $i;
done

sysctl -p /etc/sysctl.conf;

LOOP=`ls -d /sys/block/loop*`;
blk0=`ls -d /sys/block/mmcblk0`;
blk1=`ls -d /sys/block/mmcblk1`;
MMC=`ls -d /sys/block/mmc*`;

for j in $blk0 $blk1; do
echo "0" > $j/queue/rotational;
echo "4096" > $j/queue/read_ahead_kb;
done;

for k in $(busybox mount | grep relatime | cut -d " " -f3) ; do
sync;
busybox mount -o remount,noatime $k;
done;

for i in /sys/block/*/queue/scheduler ; do
echo "noop" > $i;
done;

for a in $blk0 $blk1 $MMC ; do
echo "512" > $a/queue/nr_requests;
done;

# Created by Einherjar Development Team
#

# Remount all partitions with noatime
for k in $(busybox mount | grep relatime | cut -d " " -f3) ; do
sync
busybox mount -o remount,noatime $k
done

# One-time tweaks to apply on every boot
STL=`ls -d /sys/block/stl*`
BML=`ls -d /sys/block/bml*`
MMC=`ls -d /sys/block/mmc*`

# Tweak deadline io scheduler
for i in $STL $BML $MMC $TFSR; do
echo 0 > $i/queue/rotational
echo 1 > $i/queue/iosched/low_latency
echo 1 > $i/queue/iosched/back_seek_penalty
echo 1000000000 > $i/queue/iosched/back_seek_max
echo 3 > $i/queue/iosched/slice_idle
echo 16 > $i/queue/iosched/quantum
echo 1 > $i/queue/iosched/fifo_batch
echo deadline > $i/queue/scheduler
done

# Tweak kernel VM management
echo 0 > /proc/sys/vm/swappiness
echo 10 > /proc/sys/vm/dirty_ratio
echo 4096 > /proc/sys/vm/min_free_kbytes

# Tweak kernel scheduler, less aggressive settings
echo 20000000 > /proc/sys/kernel/sched_latency_ns
echo 2500000 > /proc/sys/kernel/sched_wakeup_granularity_ns
echo 1000000 > /proc/sys/kernel/sched_min_granularity_ns

# Misc tweaks for battery life
echo "2000" > /proc/sys/vm/dirty_writeback_centisecs
echo "1000" > /proc/sys/vm/dirty_expire_centisecs

# Minfree Handler
# Values in MB = 10, 16, 24, 48, 64, 92
echo 2560,4096,6144,17408,19456,23552 > /sys/module/lowmemorykiller/parameters/minfree

# SD card Read-ahead set to 4096kb instead of default 128kb
if [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ]; then
/system/xbin/echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
fi

# Prop tweaks
setprop ro.telephony.call_ring.delay 1000
setprop ro.ril.disable.power.collapse 0
setprop pm.sleep_mode 1
setprop dalvik.vm.startheapsize 48m
setprop wifi.supplicant_scan_interval 180
setprop windowsmgr.max_events_per_sec 55

busybox mount -o remount,rw -t rootfs /
sh /system/bin/userinit.sh

# End EDT Tweaks - For Now

READ_AHEAD_KB="2049"

if [ -e /sys/devices/virtual/bdi/0:18/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/0:18/read_ahead_kb
echo "SD card read ahead kb SET to $READ_AHEAD_KB"
fi

if [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/179:0/read_ahead_kb
echo "SD card read ahead kb SET to $READ_AHEAD_KB"
fi

if [ -e /sys/devices/virtual/bdi/7:0/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:0/read_ahead_kb
echo "SD card read ahead kb SET to $READ_AHEAD_KB"
fi

mount -t debugfs none /sys/kernel/debug
echo NO_GENTLE_FAIR_SLEEPERS > /sys/kernel/debug/sched_features
echo ARCH_POWER > /sys/kernel/debug/sched_features
echo HRTICK > /sys/kernel/debug/sched_features
unmount /sys/kernel/debug

if [ -e /sys/devices/virtual/bdi/7:1/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:1/read_ahead_kb
echo "SD card read ahead kb SET to $READ_AHEAD_KB"
fi

if [ -e /sys/devices/virtual/bdi/7:2/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:2/read_ahead_kb
echo "SD card read ahead kb SET to $READ_AHEAD_KB"
fi

if [ -e /sys/devices/virtual/bdi/7:3/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:3/read_ahead_kb
echo "SD card read ahead kb SET to $READ_AHEAD_KB"
fi

if [ -e /sys/devices/virtual/bdi/7:4/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:4/read_ahead_kb
echo "SD card read ahead kb SET to $READ_AHEAD_KB"
fi

if [ -e /sys/devices/virtual/bdi/7:5/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:5/read_ahead_kb
echo "SD card read ahead kb SET to $READ_AHEAD_KB"
fi

if [ -e /sys/devices/virtual/bdi/7:6/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:6/read_ahead_kb
echo "SD card read ahead kb SET to $READ_AHEAD_KB"
fi

if [ -e /sys/devices/virtual/bdi/7:7/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:7/read_ahead_kb
echo "SD card read ahead kb SET to $READ_AHEAD_KB"
fi

if [ -e /sys/devices/virtual/bdi/default/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/default/read_ahead_kb
echo "SD card read ahead kb SET to $READ_AHEAD_KB"
fi

sysctl -p

CACHESIZE=$(df -k /cache | tail -n1 | tr -s ' ' | cut -d ' ' -f2)
if [ $CACHESIZE -gt 80000 ]
then
echo "Large cache detected, moving dalvik-cache to /cache"
if [ ! -d /cache/dalvik-cache ]
then
busybox rm -rf /cache/dalvik-cache /data/dalvik-cache
mkdir /cache/dalvik-cache /data/dalvik-cache
fi

busybox chown 1000:1000 /cache/dalvik-cache
busybox chmod 0771 /cache/dalvik-cache

# bind mount dalvik-cache so we can still boot without the sdcard
busybox mount -o bind /cache/dalvik-cache /data/dalvik-cache
busybox chown 1000:1000 /data/dalvik-cache
busybox chmod 0771 /data/dalvik-cache
else
echo "Small cache detected, dalvik-cache will remain on /data"

echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo "cfq" > /sys/block/mmcblk0/queue/scheduler

for i in \
`find /data -iname "*.db"`
do \
sqlite3 $i 'VACUUM;';
done

LOOP=`ls -d /sys/block/loop*`;
RAM=`ls -d /sys/block/ram*`;
MMC=`ls -d /sys/block/mmc*`;
for j in $LOOP $RAM
do
echo "0" > $j/queue/rotational;
echo "3072" > $j/queue/read_ahead_kb;
done

rm -f /cache/*.apk
rm -f /cache/*.tmp
rm -f /data/dalvik-cache/*.apk
rm -f /data/dalvik-cache/*.tmp

busybox rm -f /data/system/userbehavior.db
busybox chmod 400 /data/system/usagestats/
busybox chmod 400 /data/system/appusagestats/

busybox mount -o remount,rw,noatime,noauto_da_alloc,nodiratime,barrier=0,nobh /system
busybox mount -o remount,noatime,noauto_da_alloc,nodiratime,nodev,barrier=0,nobh /data
busybox mount -o remount,noatime,noauto_da_alloc,nodiratime,nodev,barrier=0,nobh /cache

export sampling_rate=10000
export up_threshold=65
export READ_AHEAD_KB=3072

if [ -n ${up_threshold} ];
then echo ${up_threshold} > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold
fi

if [ -n ${sampling_rate} ];
then echo ${sampling_rate} > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate
fi

if [ -e /sys/module/lowmemorykiller/parameters/adj ]; then
echo "0,1,2,4,7,15" > /sys/module/lowmemorykiller/parameters/adj
fi

if [ -e /sys/module/lowmemorykiller/parameters/minfree ]; then
echo "2560,4096,6144,12288,14336,18432" > /sys/module/lowmemorykiller/parameters/minfree
fi

if [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ]; then
echo "3072" > /sys/devices/virtual/bdi/179:0/read_ahead_kb
fi

# Set io scheduler tweaks for mmc
echo "deadline" > /sys/block/mmcblk0/queue/scheduler
echo "0" > /sys/block/mmcblk0/queue/rotational
echo "2048" > /sys/block/mmcblk0/queue/nr_requests
echo ${READ_AHEAD_KB} > /sys/block/mmcblk0/queue/read_ahead_kb

echo "deadline" > /sys/block/mmcblk1/queue/scheduler
echo "0" > /sys/block/mmcblk1/queue/rotational
echo "2048" > /sys/block/mmcblk1/queue/nr_requests
echo ${READ_AHEAD_KB} > /sys/block/mmcblk1/queue/read_ahead_kb

for i in \ `find /data -iname "*.db"` do \ sqlite3

$i 'VACUUM;'

done

echo "6144 87380 524288" > /proc/sys/net/ipv4/tcp_wmem
echo "6144 87380 524288" > /proc/sys/net/ipv4/tcp_rmem

setprop ro.telephony.call_ring.delay 0
setprop ring.delay 0
#setprop windowsmgr.max_events_per_sec 100
setprop windowsmgr.support_rotation_270 true
setprop ro.HOME_APP_ADJ 1
setprop ro.HOME_APP_MEM 2048
setprop dalvik.vm.heapsize 48m

# Copyright @ Slaid480 "500" > /proc/sys/vm/dirty_expire_centisecs
echo "1000" > /proc/sys/vm/dirty_writeback_centisecs

echo "0" > /proc/sys/net/ipv4/tcp_timestamps;
echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse;
echo "1" > /proc/sys/net/ipv4/tcp_sack;
echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle;
echo "1" > /proc/sys/net/ipv4/tcp_window_scaling;
echo "5" > /proc/sys/net/ipv4/tcp_keepalive_probes;
echo "30" > /proc/sys/net/ipv4/tcp_keepalive_intvl;
echo "30" > /proc/sys/net/ipv4/tcp_fin_timeout;
echo "404480" > /proc/sys/net/core/wmem_max;
echo "404480" > /proc/sys/net/core/rmem_max;
echo "256960" > /proc/sys/net/core/rmem_default;
echo "256960" > /proc/sys/net/core/wmem_default;
echo "4096,16384,404480" > /proc/sys/net/ipv4/tcp_wmem;
echo "4096,87380,404480" > /proc/sys/net/ipv4/tcp_rmem;

#End Cranium Tweaks

and please note that its possible to clash with other script..specially in customROMs