[Android Software/Hacking General [Developers Only]] dorimanx:
Hi,

Just stop by to give you my work of art! :)

you can use it, but please credit me in comments :)

here we gooo

sysctl.conf (place in /system/etc/)

# cat /etc/sysctl.conf

# Created by Dorimanx

kernel.panic=100
kernel.ctrl-alt-del=0
kernel.panic_on_oops=0
fs.lease-break-time=5
vm.overcommit_memory=0
vm.panic_on_oom=0
vm.oom_kill_allocating_task=0
vm.overcommit_ratio=80
vm.page-cluster=5
vm.dirty_background_ratio=35
vm.dirty_ratio=5
vm.dirty_writeback_centisecs=1000
vm.dirty_expire_centisecs=3000
vm.swappiness=60
vm.lowmem_reserve_ratio=100 100
vm.min_free_kbytes=3072
vm.min_free_order_shift=4
vm.laptop_mode=0
vm.vfs_cache_pressure=40
vm.mmap_min_addr=4096
vm.highmem_is_dirtyable=0
kernel.sched_compat_yield=1

#Network Scripts By ME!
net.ipv4.tcp_moderate_rcvbuf=1
net.core.rmem_default=110592
net.core.rmem_max=110592
net.core.wmem_default=110592
net.core.wmem_max=110592
net.ipv4.tcp_timestamps=0
net.ipv4.tcp_sack=0
net.ipv4.tcp_window_scaling=0
net.ipv4.tcp_fin_timeout=30
net.ipv4.tcp_keepalive_intvl=30
net.ipv4.tcp_keepalive_probes=5
net.ipv4.tcp_tw_recycle=1
net.ipv4.tcp_tw_reuse=1
net.ipv4.tcp_no_metrics_save=1
net.ipv4.tcp_wmem=4096 32768 110592
net.ipv4.tcp_rmem=4096 32768 110592
net.core.netdev_max_backlog=5000
net.ipv4.tcp_max_syn_backlog=10240
net.ipv4.tcp_syn_retries=5
net.ipv4.tcp_synack_retries=5

My core startup script! Damm good stuff!

# cat /system/etc/init.d/01MountAll

#!/system/bin/sh

L="log -p i -t cm"

$L "Welcome to Android `getprop ro.build.version.release` / `getprop ro.modversion`";
$L " ";
$L " DORIMANX SUPER FAST AND TWEAKED TO THE MAX ROM! ";
$L " ";
$L " ";

stop

echo "Removing Jornal from sd-ext partition to speed the access"
cat /proc/mounts > /etc/mtab
tune2fs -o journal_data_writeback /dev/block/mmcblk0p2
e2fsck -y /dev/block/mmcblk0p2
tune2fs -O ^has_journal /dev/block/mmcblk0p2
echo "DONE"

BB="logwrapper busybox";

echo "find SD Card"
for MMC_NUM in `seq 0 9`;
do
MMC_TYPE=`cat /sys/block/mmcblk$MMC_NUM/device/type`
if [ "$MMC_TYPE" = "SD" ];
then
# 2nd partition of sdcard should be the sd-ext if exist
SD_EXT_PART=/dev/block/mmcblk${MMC_NUM}p2
break
fi
done

if [ -b "$SD_EXT_PART" ];
then
log -p i -t mountsd "Checking filesystems..";

echo "fsck the sdcard filesystem first"
if [ -x `which e2fsck` ];
then
e2fsck -y $SD_EXT_PART
e2fsk_exitcode=$?
else
echo "executable e2fsck not found, assuming no filesystem errors"
e2fsk_exitcode=0
fi

# set property with exit code in case an error occurs
setprop cm.e2fsck.errors $e2fsk_exitcode;
if [ "$e2fsk_exitcode" -lt 2 ];
then
echo "mount and set perms"
$BB mount -o noatime,nodiratime,barrier=1 $SD_EXT_PART /sd-ext;
if [ "$?" = 0 ];
then
$BB chown 1000:1000 /sd-ext;
$BB chmod 777 /sd-ext;
log -p i -t mountsd "sd-ext successfully mounted";
else
log -p e -t mountsd "Unable to mount filesystem for /sd-ext!";
fi
else
log -p e -t mountsd "Unable to repair filesystem, disabling apps2sd";
fi
fi

echo "Enable Dalvik2SD"

if [ -e /dev/block/mmcblk0p2 ];
then
echo "move dalvik cache from internal memory to sdcard"
if [ ! -d /sd-ext/dalvik-cache ];
then
mkdir /sd-ext/dalvik-cache;
busybox chown 1000:1000 /sd-ext/dalvik-cache;
busybox chmod 777 /sd-ext/dalvik-cache
fi
echo "move dalvik to sd-ext"
busybox rm -rf /data/dalvik-cache;
echo "Create LINK to SD-EXT"
busybox ln -s /sd-ext/dalvik-cache /data/dalvik-cache;

echo "don't allow /data/data on sd because of upgrade issues - move it if possible"
if [ -d /sd-ext/data ];
then
busybox cp -a /sd-ext/data/* /data/data/;
busybox rm -rf /sd-ext/data;
fi;

echo "clean up old whiteouts in SD-EXT"
for i in local misc property system tombstones data;
do
if [ -h /sd-ext/$i ];
then rm -rf /sd-ext/$i;
fi

busybox rm -f /sd-ext/app/*.odex
setprop cm.dc2sd.active 1;

echo "+++ dalvik2sd enabled"
done;
else
echo "NO EXT Partition Detected!"
fi

DC2SD_ACTIVE=`getprop cm.dc2sd.active`

if [ "$DC2SD_ACTIVE" != 1 ];
then
# replace symlinks with directories so we can boot without sd
for i in dalvik-cache;
do
if [ -h /data/$i ];
then
rm -rf /data/$i;
mkdir /data/$i;
busybox chown 1000:1000 /data/$i;
busybox chmod 777 /data/$i;
fi;
done
fi

#
# Apps2SD using symlinks and bind mounts
# Original Apps2SD script by shade@chemlab.org (cyanogen)
# Adapted for Oxygen ROM by AdamG
# Fixed for slow detection of SD cards by _thalamus and output a bit more debugging info so we can see where problems are arising.

# execute any postinstall script then kill it

enablea2sd () {
echo "mount and set perms"
busybox chown 1000:1000 /sd-ext;
busybox chmod 777 /sd-ext;

echo "clean up any old symlinks, create data directories"
for i in data;
do
if [ -h /data/$i ];
then
rm /data/$i;
fi;
if [ ! -d /data/$i ];
then
mkdir /data/$i;
busybox chown 1000:1000 /data/$i;
busybox chmod 777 /data/$i;
fi;
done;

# don't allow /data/data on sd because of upgrade issues - move it if possible
if [ -d /sd-ext/data ];
then
busybox cp -a /sd-ext/data/* /data/data/;
busybox rm -rf /sd-ext/data;
fi;

echo "move apps from internal memory to sdcard"
for i in app app-private;
do
if [ ! -d /sd-ext/$i ];
then
mkdir /sd-ext/$i;
fi

busybox chown 1000:1000 /sd-ext/$i;
busybox chmod 777 /sd-ext/$i

if [ -d /data/$i ] && [ ! -h /data/$i ];
then
busybox cp -a /data/$i/* /sd-ext/$i/;
busybox rm -f /data/$i/*;
fi;
done;

# symlink app dirs - they must be on the same filesystem
for i in app app-private;
do
if [ -d /data/$i ] && [ ! -h /data/$i ];
then
busybox rm -rf /data/$i;
busybox ln -s /sd-ext/$i /data/$i;
fi;
done;

# clean up old whiteouts
for i in local misc property system tombstones data;
do
if [ -h /sd-ext/$i ]; then rm -f /sd-ext/$i; fi
done;

# please don't put odex files in the app directory people!
# it causes dexopt to crash when switching builds!
busybox rm -f /sd-ext/app/*.odex

setprop oxygen.a2sd.active 1;

echo "+++ Apps-to-SD successfully enabled";

}

disablea2sd() { # replace symlinks with directories so we can boot without sd
for i in app app-private;
do
if [ -h /data/$i ];
then
rm -rf /data/$i;
mkdir /data/$i;
busybox chown 1000:1000 /data/$i;
busybox chmod 777 /data/$i;
fi;
done;

setprop oxygen.a2sd.active 0;
}

if [ -e /dev/block/mmcblk0p1 ]; # We check for the presence of the FAT partition first to see if the SD has initialised.
then
echo "SD Card has been initialised...checking for ext partition.";
if [ -e /dev/block/mmcblk0p2 ]; # If false, it isn't there so we don't have to sleep the script and delay the boot.
then
enablea2sd;
else
echo "No ext partition present, apps2sd disabled";
disablea2sd;
fi;
else
sleep 4; #Enables time for a slow SD to be detected and populate the device nodes.
if [ -e /dev/block/mmcblk0p2 ];
then
echo "enablea2sd for slow SD card";
enablea2sd;
else
echo "No ext partition present after sleep, apps2sd disabled";
disablea2sd;
fi;
fi;

sync;

if [ ! -d /mnt/cache ]; then
mkdir /mnt/cache
fi
if [ ! -d /mnt/cache/recovery ]; then
mkdir /mnt/cache/recovery
fi
chmod 777 /mnt/cache/recovery

if [ -h /cache/recovery ]; then
rm -rf /cache/recovery
mkdir /cache/recovery
chown 1000:2001 /cache/recovery
chmod 777 /cache/recovery
fi

if [ ! -d /cache/dalvik-cache ]; then
mkdir /cache/dalvik-cache
fi
chown 1000:1000 /cache/dalvik-cache
chmod 777 /cache/dalvik-cache
mount -o bind /sd-ext/dalvik-cache /cache/dalvik-cache

echo "speeding the SD-EXT"
mount -o remount,nosuid,nodev,nobh,noatime,nodiratime,noauto_da_alloc,barrier=0 /sd-ext
echo "DONE"

echo "Fixing System Owners!"
busybox chown 0:2000 /system/etc/init.d/*
busybox chown 0:0 /cache
busybox chown 1000:2001 /cache/recovery
busybox chown 1000:1000 /cache/dalvik-cache
busybox chown 1000:2001 /cache/recovery
busybox chown 1000:1000 /dev/smd27
busybox chown 0:0 /dev
busybox chown 0:0 /system/lib/*
busybox chown 0:0 /system/lib/hw/*
busybox chown 0:2000 /dev/cpu_dma_latency

echo "Fixing System permissions!"
busybox chmod 777 /dev/smd27
busybox chmod 755 /dev
busybox chmod 777 /dev/cpu_dma_latency
busybox chmod 755 /system/etc/init.d/*
busybox chmod 644 /system/etc/gps.conf
busybox chmod 644 /system/etc/hosts
busybox chmod 644 /system/etc/sysctl.conf
busybox chmod 777 /system/lib/*
busybox chmod 777 /system/lib/hw/*
busybox chmod 644 /system/build.prop
busybox chmod 777 /cache/ -R
echo "DONE"

umount /sys/kernel/debug
mount -t debugfs none /sys/kernel/debug

echo "Starting the Android VM let the Power be with us!"
start

echo "ALL DONE! END OF FILE"

exit 1

My power system booster!

# cat /system/etc/init.d/07script

#!/system/bin/sh
# Created by Dorimanx

echo "Applying Kernel Tweaks and RAM Manipulations"
echo "1536,1536,4096,4096,4069,8192" > /sys/module/lowmemorykiller/parameters/minfree
echo "1536,1536,4096,4096,4069,8192" > /sys/module/lowmemorykiller/parameters/minfile
echo "-12,1,2,3,4,15" > /sys/module/lowmemorykiller/parameters/adj
echo 0 > /sys/module/lowmemorykiller/parameters/debug_level
echo 96 > /sys/module/lowmemorykiller/parameters/cost
echo "DONE"

echo "Tweaking the global I/O scheduler!"
MTD=`ls -d /sys/block/mtd*`;
MMC=`ls -d /sys/block/mmc*`;
LOOP=`ls -d /sys/block/loop*`;
for i in $MTD $MMC $LOOP
do
echo cfq > $i/queue/scheduler;
done
echo "DONE CFQ Activated!"

sleep 2

echo "Setting CPU governor to ondemand and tweking response!"
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 60000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
echo 60 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold

echo 25 > /proc/sys/vm/dirty_ratio

echo "Speeding the READ/WRITE speeds! And adds more controled write speed burst!"
MTD=`ls -d /sys/block/mtd*`;
MMC=`ls -d /sys/block/mmc*`;
LOOP=`ls -d /sys/block/loop*`;
for i in $MTD $MMC $LOOP
do
sync;
#GLOBAL partition Tweaks
echo 128 > $i/queue/read_ahead_kb;
echo 256 > $i/queue/nr_requests;

#SDCARD partition Tweaks
echo 512 > /sys/block/mmcblk0/queue/max_sectors_kb;
echo 512 > /sys/block/mmcblk0/queue/read_ahead_kb;
echo 1 > /sys/block/mmcblk0/queue/iosched/low_latency
echo 1 > /sys/block/mmcblk0/queue/iosched/back_seek_penalty
echo 32768 > /sys/block/mmcblk0/queue/iosched/back_seek_max
echo 0 > /sys/block/mmcblk0/queue/iosched/slice_idle
echo 32 > /sys/block/mmcblk0/queue/iosched/quantum
echo 4 > /sys/block/mmcblk0/queue/iosched/slice_async_rq
echo 1024 > /sys/block/mmcblk0/queue/iosched/fifo_expire_sync;
echo 1024 > /sys/block/mmcblk0/queue/iosched/fifo_expire_async;
echo 40 > /sys/block/mmcblk0/queue/iosched/slice_async
echo 40 > /sys/block/mmcblk0/queue/iosched/slice_sync

#DATA partition Tweaks
echo 1 > /sys/block/mtdblock5/queue/iosched/low_latency
echo 1 > /sys/block/mtdblock5/queue/iosched/back_seek_penalty
echo 32768 > /sys/block/mtdblock5/queue/iosched/back_seek_max
echo 0 > /sys/block/mtdblock5/queue/iosched/slice_idle
echo 32 > /sys/block/mtdblock5/queue/iosched/quantum
echo 4 > /sys/block/mtdblock5/queue/iosched/slice_async_rq
echo 1024 > /sys/block/mtdblock5/queue/iosched/fifo_expire_sync;
echo 1024 > /sys/block/mtdblock5/queue/iosched/fifo_expire_async;
echo 40 > /sys/block/mtdblock5/queue/iosched/slice_async
echo 40 > /sys/block/mtdblock5/queue/iosched/slice_sync

done
ROTATIONAL=`ls -d /sys/block/*`;
for g in $ROTATIONAL
do
echo 0 > $g/queue/rotational;
done;
echo "DONE"

echo "Unlimiting processes and open files for system"
ulimit -n 20480
ulimit -s unlimited
echo "DONE"

while [ ! -e /mnt/sdcard/phonePrioritizer/script.txt ]
do
sleep 10
echo "Waiting For SDCARD to be Mounted and file /sdcard/phonePrioritizer/script.txt to be located"
done
echo "Found SDCARD and /sdcard/phonePrioritizer/script.txt file"

echo "memory normalize for usb transfer"
echo 5 > /proc/sys/vm/dirty_ratio
echo "DONE"

echo "Install busybox at first time"
if [ -e /system/xbin/crond ];
then
echo "No need to install busybox again";
else
busybox --install -s /system/xbin;
fi
echo "DONE"

echo "Fixing Market download + Permissions!"
rm -rf /cache/download
if [ ! -d /mnt/sdcard/download-market ]; then
mkdir /mnt/sdcard/download-market
fi
ln -s /mnt/sdcard/download-market /cache/download
chmod 777 /cache/ -R
echo "DONE"

echo "Fix for radio hcitool permissions, Thanks to crawling and atoore"
chown 0:0 /system/xbin/hcitool
chmod 4755 /system/xbin/hcitool
echo "DONE"

echo "Fixing init.d permissions!"
chown 1000:2000 /system/etc/init.d/*
echo "DONE"

echo "Activating Swap EXT Partition!"
mount -o rw,remount /system
echo "#clean" > /system/etc/fstab
if [ -e /dev/block/mmcblk0p3 ]; then
mkswap /dev/block/mmcblk0p3 > /dev/null
echo "/dev/block/mmcblk0p3 swap swap" >> /system/etc/fstab
fi
if [ -e /sd-ext/swap ]; then
mkswap /sd-ext/swap > /dev/null
echo "/sd-ext/swap swap swap" >> /system/etc/fstab
fi
if [ -e /sdcard/swap ]; then
mkswap /sdcard/swap > /dev/null
echo "/sdcard/swap swap swap" >> /system/etc/fstab
fi
swapon -a
free
echo "DONE"

echo "FIXING Camera Link"
chmod 777 /sys/class/leds/flashlight/*
echo "DONE"

echo "Releasing CPU HALT"
kill `pidof com.android.vending`
kill `pidof com.android.settings`
kill `pidof com.cooliris.media`
sleep 5
kill `pidof com.android.vending`
kill `pidof com.android.settings`
kill `pidof com.cooliris.media`

sleep 10

sysctl -p

echo "Powering the SYSTEM and Sdcard!"
chrt -r -p 80 `pidof mmcqd`
chrt -r -p 80 `pidof flush-179:0`
renice -18 `pidof mmcqd`
renice -18 `pidof flush-179:0`
renice 19 `pidof kswapd0`
ionice `pidof mmcqd` rt 2
ionice `pidof flush-179:0` rt 2
ionice `pidof com.android.phone` rt 2
echo "DONE"

echo "Releasing CPU HALT"
kill `pidof com.android.vending`
kill `pidof com.android.settings`
kill `pidof com.cooliris.media`
sleep 6
echo "Releasing CPU HALT"
kill `pidof com.android.vending`
kill `pidof com.android.settings`
kill `pidof com.cooliris.media`
sleep 6
echo "Releasing CPU HALT"
kill `pidof com.android.vending`
kill `pidof com.android.settings`
kill `pidof com.cooliris.media`

sleep 10
echo "TWEAKS On Full Mount: remount all partitions with rw,noatime,nodiratime,norelatime";
SYSTEM=`mount | grep -v /acct | grep -v /dev/cpuctl | cut -d " " -f3`
for k in $SYSTEM
do
sync
mount -o remount,rw,noatime,nodiratime,norelatime $k
cat /proc/mounts > /etc/mtab
done
echo "DONE"
echo "This script was been fixed by vodkinagdan and me."

echo "Setting CPU governor to ondemand and tweking response!"
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 60000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
echo 60 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold

echo "Speeding the READ/WRITE speeds! And adds more controled write speed burst!"
MTD=`ls -d /sys/block/mtd*`;
MMC=`ls -d /sys/block/mmc*`;
LOOP=`ls -d /sys/block/loop*`;
DM=`ls -d /sys/block/dm*`;
for i in $MTD $MMC $LOOP $DM
do
sync;
#GLOBAL partition Tweaks
echo cfq > $i/queue/scheduler;
echo 128 > $i/queue/read_ahead_kb;
echo 256 > $i/queue/nr_requests;

#SDCARD partition Tweaks
echo 512 > /sys/block/mmcblk0/queue/max_sectors_kb;
echo 512 > /sys/block/mmcblk0/queue/read_ahead_kb;
echo 1 > /sys/block/mmcblk0/queue/iosched/low_latency
echo 1 > /sys/block/mmcblk0/queue/iosched/back_seek_penalty
echo 32768 > /sys/block/mmcblk0/queue/iosched/back_seek_max
echo 0 > /sys/block/mmcblk0/queue/iosched/slice_idle
echo 32 > /sys/block/mmcblk0/queue/iosched/quantum
echo 4 > /sys/block/mmcblk0/queue/iosched/slice_async_rq
echo 1024 > /sys/block/mmcblk0/queue/iosched/fifo_expire_sync;
echo 1024 > /sys/block/mmcblk0/queue/iosched/fifo_expire_async;
echo 40 > /sys/block/mmcblk0/queue/iosched/slice_async
echo 40 > /sys/block/mmcblk0/queue/iosched/slice_sync

#DATA partition Tweaks
echo 1 > /sys/block/mtdblock5/queue/iosched/low_latency
echo 1 > /sys/block/mtdblock5/queue/iosched/back_seek_penalty
echo 32768 > /sys/block/mtdblock5/queue/iosched/back_seek_max
echo 0 > /sys/block/mtdblock5/queue/iosched/slice_idle
echo 32 > /sys/block/mtdblock5/queue/iosched/quantum
echo 4 > /sys/block/mtdblock5/queue/iosched/slice_async_rq
echo 1024 > /sys/block/mtdblock5/queue/iosched/fifo_expire_sync;
echo 1024 > /sys/block/mtdblock5/queue/iosched/fifo_expire_async;
echo 40 > /sys/block/mtdblock5/queue/iosched/slice_async
echo 40 > /sys/block/mtdblock5/queue/iosched/slice_sync

done
ROTATIONAL=`ls -d /sys/block/*`;
for g in $ROTATIONAL
do
echo 0 > $g/queue/rotational;
done;
echo "DONE"

echo "DATABASE Cleaning and tunning!"
for i in \
`find /data -iname "*.db"`
do \
sqlite3 $i 'VACUUM;';
done
echo "DONE VACUUM DATABASE!"

echo 0 > /sys/devices/platform/leds-microp/leds/green/brightness
sleep 1
echo 1 > /sys/devices/platform/leds-microp/leds/green/brightness
sleep 1
echo 0 > /sys/devices/platform/leds-microp/leds/green/brightness
sleep 1
echo 1 > /sys/devices/platform/leds-microp/leds/green/brightness
sleep 1
echo 0 > /sys/devices/platform/leds-microp/leds/green/brightness
sleep 1
echo 1 > /sys/devices/platform/leds-microp/leds/green/brightness
sleep 1
echo 0 > /sys/devices/platform/leds-microp/leds/green/brightness

exit 1

Have fun!