[Desire HD Android Development] a user:
a user's cm 10.1 tweaks script package v1.0

THERE IS AN UPDATE:

http://xdaforums.com/showpost.php?p=36867531&postcount=244

ooooooookkkkkkkkkkkkk...

looks good so far. hence i decided to release a first version.

scripts:

00setdtm

:

This one patches your build.prop only if the current active value of the ro.ril.enable.dtm property is not

the value you desire. What value you wish it to have can be configured within the script (explained at the beginning of the script).

Note: a reboot is required after this script modified your build.prop. It will tell you so in the log file (see below).

00tcptweaks

:

This adjusts the tcp buffer sizes for each network type (currently some conenction types are not configured yet, but the most important are) and some other network parameters to improve performance especially on higher bandwidth networks (like wlan).

01cron

:

This one starts and configures cron (the linux taks scheduler).It installs a default crontab (this is how the file is called defining the jobs to be periodically run). What jobs are preconfigured will be explained later down and also some other informations about it.

02memtweaks

:

Well, this applies my lowmemorykiller settings. I can't tell for sure if it will provide a visible improvement but from my logic point of view it should improve behavior when memory get's very low due to many apps switching in a short period of time.

99dbcleaning

:

You probably already know that each app (ans also system apps) have their own sqlite database for storing various things. Well if an entry gets deleted it actually only gets marked as deleted within the database file. This is due to performance reasons. The downfall to this is that the database files increase over time and also searching performance etc. can degrade.

This script finds all such databases and cleans them up. This is done once booting, though not the first boot after you have wiped the cache partition. The reason is to not hassle with a rom flash first boot which usualy comes together with a wipe cache and dalvik cache ;)

It is also run periodically via cron (see below).

99snd

:

My sound settings for speakers and headphones. Feel free to change them to your likes.

The cron jobs

The initial cron job description file is found in /data/local/ called initial_root_crontab. At every boot the above cron script will install this file as the root's crontab (job file). So if you want to add/modfy jobs it would be the best to modify this file and reboot.

The working directory for cron is set to /data/local/cron.d . Actually you shouldn't touch this one. It's cron's place and not yours :P

Well, there are two jobs configured:

Cleaning sqlite DBs

It just calles the above mentioned 99dbcleaning script. I set it to be run every sunday at 5 in the morning.

Updating hosts file

Now this has a little more to say. What it does? It checks at a configured location (and filename) for a new hosts file. New means that its content differs from the one of the current systems hosts file. If this is the case then it will update the system one with the new one.

It will be executed every day at 13:00 (01:00 pm).

You have some options here, in the script /data/local/scripts/updatehosts.sh :

1. It allows to add blocking of flurry.com servers which are used by apps using the flurry sdk to collect "statistics". I don't like it when people are doing this without my knowledge and persmission. But you can disable this feature.

2. You can configure the script to delete the source hosts file if it was copied into your system. Default is off, meaning it leaves it where it is.

NOTES: The script actually will install the hosts file in /data/local and will create a symbolic link in /system/etc. So it needs not to remount your /system partition writeable every time for an update. It checks on it's own if this is needed or not.

Well, finally there is some simple logging about has been done, The log file is /data/local/userinit.log

Upon boot the old one will be renamed to userinit.log.1 thus allowing you to view what was done before last reboot.

Except in two cases there is no real error handling/logging. It is only informational about what has been (tried to be) done.

So i would like to get some feedback about issues, positive effects and if you have ideas or improved the scripts somehow let me know. You can modify or give it to others like you wish but it would be nice if you give credits to me and leave my comment within the scripts.

Have fun!

EDIT

: P.S Just forgot to mention that you do NOT need to reflash this everytime you flash a new version of the rom because all what is needed is kept within /data/local which survives a rom reflash.