[TOOL][ETC] Nice Value Checker - Android Software/Hacking General [Developers Only]

Well, this is just a simple script to view Nice Value/Niceness of processes and PIDs. I made this because i can't seem to find a simple and direct way to view niceness, so I'm sharing it with you.
Okay, What is Nice?
nice is a program found on Unix and Unix-like operating systems such as Linux. It directly maps to a kernel call of the same name. nice is used to invoke a utility or shell script with a particular priority, thus giving the process more or less CPU time than other processes. A niceness of −20 is the highest priority and 19 is the lowest priority. The default niceness for processes is inherited from its parent process and is usually 0.
Uses and effect
nice becomes useful when several processes are demanding more resources than the CPU can provide. In this state, a higher-priority process will get a larger chunk of the CPU time than a lower-priority process. Only the superuser (root) may set the niceness to a smaller (higher priority) value. On Linux it is possible to change /etc/security/limits.conf to allow other users or groups to set low nice values.
How to Install:
Download the pdf file linked below
This needs busybox so you gotta have one - tip: use @YashdSaraf's
Move it in '/system/bin' or '/system/xbin'
Rename to niceness (or anything you want)
Set permissions to 755
How to Use:
Open Terminal Emulator or adb shell
Code:
niceness (name of the running process/pid)
BOOM!
Download
https://www.androidfilehost.com/?fid=385035244224394124

reserved

same can be achieved with below command in terminal emulator -
busybox ps -o pid,nice,comm

JumboMan said:
same can be achieved with below command in terminal emulator -
busybox ps -o pid,nice,comm
Click to expand...
Click to collapse
i know, but I'm lazy to type all that stuff so I made it :silly:

Thanx, ll use it

Related

Ip route/mksh toast notification info

Lately these toast notes have been popping up. But what are they? Ive done some digging and this is what i've found.
First off ICS roms use mksh shell as default. In ICS, mksh use /system/etc/mkshrc as the default profile if we log into
android with adb shell.
So if you want to export some environment variable, you can change this file.
And you can change the default profile file path by changing MKSHRC_PATH
in Android.mk.
You should be able to run "adb shell cmd", then the mkshrc will not be used.
.
(ip route 224.0.0.0/4 toast)
What is it? Well thanks to XDA member phealy we have the real answer. 224.0.0.0/4 is the standard IP multicast range - this command just forces multicasting out of the wifi interface (since AFAIK cell carriers don't allow multicasting on their data connections). This prevents multicast traffic from attempting to use the mobile network connection and failing.
Source----> (http://en.wikipedia.org/wiki/Multicast_address)
(mksh toast)
mksh is a command interpreter intended for both interactive and shell script use. Its command language is a superset of the sh(C) shell language and largely compatible to the original Korn shell.
mksh is the MirBSD Korn Shell, largely similar to the original AT&T ksh, pdksh’s actively developed successor, portable. It includes bug fixes and improvements in order to produce a modern, robust shell good for interactive and especially script use. It has UTF-8 support and extended compatibility to other modern shells.
source of mksh info-----> http://lists.linaro.org/pipermail/linaro-dev/2011-November/008785.html
So as it seems both are not malicous,and don't cause any internal damage. Not 100% verified,it's yet to be fully determined.
I'd be interested in knowing if any progress has been made on this. Thanks.
Any progress
Is there any progress on authentication of this request. Is it totally safe?
nabeeldall said:
Is there any progress on authentication of this request. Is it totally safe?
Click to expand...
Click to collapse
It's safe.
Sent from my HTC One
42
Just in case someone digs out this thread while looking for this…
that thread has them answers! ☺

[Guide] [Dec.15] How to Tweak and Mod Android Using Init.d Scripts

Hello my fellow Android enthusiasts,
There are many apps that can be used to tweak kernel settings. However, I am a reductionist at heart and prefer to break things down to their essential parts. This guide was written for those who want to be rid of apps that dig into their kernel at every boot. It is a simple guide to writing init.d scripts that the average user should be able to implement.
Happy Tweaking,
Lucius
PS......ITS A CELEBRATION, *****ES!!!!!!!:victory:
Basics:
The android boot sequence is divided into 3 parts.
1) First stage bootloader
2) Kernel loads and prepares hardware
3) User space programs load - this is where init.d scripts are invoked
Init.d scripts execute commands as if they were entered into a terminal. These commands modify the value of parameters that influence our devices behaviour. They are much more flexible than tweaking apps and give end users the ability to tweak and optimize their device as they see fit. They are small, fast, clean... and awesome.
Requirements:
See my guide to modding and optimization for instructions on how to unlock, install TWRP, root, and install custom ROMs/kernels - http://forum.xda-developers.com/showthread.php?t=2232715
Unlocked: Needed to install custom recovery.
Custom Recovery: Needed to install custom ROMs and custom kernels.
Root Permissions: Needed to access /system partition - enabled when most custom ROMs are installed
Init.d Support: Needed to run init.d scripts at boot - enabled in every custom ROM/kernel I have come across.
Scripting Tool: Text editor or script manager - I use Android Tuner to create/test a script and AntTek File Explorer Ex's built in text editor to edit a script.
Root File Manager: I use AntTek Explorer Ex, it reminds me of my old linux setup, its very functional but clean as hell. Also has a built-in text editor.
Step #1: Acquire a Scripting Tool
I use Android Tuner for script creating/testing. You could also use a text editor. AntTek Explorer Ex has a built in text editor that works well. You could also use Notepad++, its a free linux based text editor. Just avoid windows-based editors, they leave extra spaces and invisible characters when enter is pressed.
Step #2: Begin Your Script
To create a script open your text editor or select "create new script" within the "script manager" in Android Tuner. Put your cursor at the very top left corner to begin writing. The first line of a script must invoke a compatible shell that will execute the script, which in our case is the following:
#!/system/bin/sh
Once this line is typed simply hit enter to start a new line. I usually put an empty line after the first line as it makes things easier to see. Extra lines for spacing purposes are fine so long as they are completely empty.
NOTE - Android tuner automatically appends the above line to the beginning of all scripts. It will not be displayed in the script creator but can be found in the final script you save.
TIP - Do not add spaces at the end of a line. Syntax must be exact.
TIP - Adding a "#" to the front of the line instructs the shell to avoid this line, which is essential for writing notes and keeping scripts organized.
Step #3: Write Your Tweaks
Now we can start writing tweaks. If written correctly each line that you enter will execute a command that changes a kernel or system level parameter. This seems daunting at first but it is really quite easy. Once you are finished typing a line simply hit enter to begin the next line. Here is an example of an executable command so you know what we are talking about going forward.
echo "SmartAssv2" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
NOTE - For some examples of useful tweaks see my guide to tweaking and optimization - http://forum.xda-developers.com/showthread.php?t=2232715
GENERAL FORMAT:
The tweaks that we are interested in typically begin by identifying the value to be written to the desired parameter:
echo "parameter value" >
The new parameter value is always followed by the directory tree locating the parameter of interest:
/sys/devices/system/cpu/cpu0/cpufreq/parameter file
In order to create:
echo "700" > /sys/devices/system/cpu/cpu0/cpufreq/gpu_oc
CPU/GPU TWEAKS:
To familiarize yourself with how tweaking is done I would start by opening up the following directory in your file manager:
/sys/devices/system/cpu/cpu0/cpufreq/
This is where cpu parameters, and often gpu parameters, are located. These files/parameters determine how our kernel controls our CPU. To modify our CPU's behaviour these parameters are modified at boot utilizing init.d scripts. Familiarize yourself with these files, open them up with a text editor - it's entirely safe so long as you don't start changing values. If the name of a parameter isn't self-explanatory, opening it up and examining the value it holds will typically explain its purpose. Here are some common parameters that are useful to know.
scaling_available_freq - lists the frequencies available to the cpu
scaling_available_governors - lists the cpu governors available for use
scaling_governor - sets the cpu governor
scaling_max_freq - sets the max freq
scaling_min_freq - sets the min freq
UV_mV_table - sets the voltage table for the cpu
GOVERNOR TWEAKS:
The CPU governor determines how our CPU behaves in response to changes in workload. Changing the governor will impact how our CPU scales through the freq steps available to our CPU. This has a significant impact on the time our CPU spends at different frequency steps, which influences efficiency, performance, battery life, and stability. For more info about the various governors available in android see post #1 at the following link - http://forum.xda-developers.com/showthread.php?t=1369817
Tweakable governor parameters are located in:
sys/devices/system/cpu/cpufreq/
Various interactive governor parameters can be accessed, such as:
go_hispeed_load - Go to hispeed_freq when cpu load at or above this value
hispeed_freq - freq to bump to once go_hispeed_load is passed
min_sample_time - minimum amount of time that can be spent at a frequency before scaling down
timer_rate - the interactive governor checks cpu load at regular intervals to determine whether frequencies should be increased when it comes out of idle. If the cpu is busy between exiting idle and the timer firing we assume the cpu is underpowered and ramp frequency up
HOTPLUG CONFIG:
The hotplug config in Hundsbuah's Kernel allows you to control how CPU cores are brought online as threads are processed. A thread is the smallest sequence of instructions that can be managed independently by a process scheduler. Threads are contained within a process. A process is the execution of instructions contained within a program. On a single processor system multi-threading (multitasking) is generally implemented by transmitting/sending signals over a common signal path; the processor switches between different threads. This switching generally happens frequently enough that the user perceives the threads or tasks as running at the same time. If the CPU is overloaded and a thread is queued up by the process scheduler then lag/stuttering is likely to occur because thread switching does not occur quickly enough to be hidden from the user. On a multi-core system threads can be truly concurrent, with every processor or core executing a separate thread simultaneously, which decreases the potential for lag/stuttering. If core 1 is busy processing a thread and another thread is queued up by the process scheduler we want an additional core to become active so that core 1 does not have to switch between threads. However, we also do not want to bring cores online needlessly. If a core is able to process multiple threads fast enough such that switching is unnoticeable then it would be inefficient to bring another core online. The hotplug config can be found in the following location:
/sys/kernel/rt_config/rt_config
I/O TWEAKS:
The I/O scheduler handles read/write requests from memory (RAM and storage). The I/O scheduler we use can significantly impact I/O (read/write) performance. For more info about the various I/O schedulers available in android see post #4 in the following thread - http://forum.xda-developers.com/showthread.php?t=1369817
The location of the I/O scheduler is:
/sys/block/mmcblk0/queue/scheduler
/sys/block/mmcblk1/queue/scheduler
Use the follIng lines to change the I/O scheduler:
echo "sio" > /sys/block/mmcblk0/queue/scheduler
echo "sio" > /sys/block/mmcblk1/queue/scheduler
KERNEL MODULES:
A kernel module is a file containing code that extends the functionality of our kernel. Modules allow our kernel to communicate with different types of hardware (ex - bluetooth), utilize various file systems (ex - NTFS), or system calls (ex - frandom.ko). Kernels do not automatically come with all available modules, loading only the most essential modules can reduce a kernels footprint and potentially improve performance. Simultaneously, loading improved modules can improve performance in some cases (ex - frandom.ko). For more info about various kernel modules see post #3 in the following thread - http://forum.xda-developers.com/showthread.php?t=1369817
NOTE - You cannot download and load kernel modules from the internet. They need to be compiled for kernel you are using.
To make a kernel module available make sure /system is mounted as rewritable, rather than read-only (see step #5 for further instructions). Copy the module .ko file (ex - tntfs.ko) to the following location:
/system/lib/modules
To check what modules are loaded at boot enter the following command in a terminal:
lsmod
To load a kernel module at boot add the following line to your init.d script:
insmod /system/lib/modules/module name
To unload a kernel module at boot add the following line to your script
rmmod module name
SYSCTL TWEAKS:
This section is currently under construction, more tweaks will be posted once I find them. Sysctl is an interface that is used to examine and dynamically change parameters within a linux based OS.
To change the TCP Congestion Algorithm add the following line to your script:
/system/xbin/sysctl -w net.ipv4.tcp_congestion_control=westwood
NOTE - For a brief explanation of TCP/IP protocols and network congestion algorithms see the following post - http://forum.xda-developers.com/showpost.php?p=48088128&postcount=1884
FINISHING YOUR SCRIPT:
Once all your tweaks are written go through the entire script and make sure syntax is exact - no extra spaces or characters. Save your first script as w/e you want (ill explain naming later) just make sure it doesn't have a file extension. I'm talking total absence of file extensions. WHOA! WHAT! WTF YO!
NOTE - Android Tuner saves scripts by default in the "at" folder in "sdcard0"
Example Script:
Code:
#!/system/bin/sh
#CPU Tweaks
echo "1350 1320 1280 1240 1200 1150 1100 1050 1000 950 900 860 820 780 750 720 700" > /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table
#Governor Tweaks
echo "40000" > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
#SD Tweaks
echo "vr" > /sys/block/mmcblk0/queue/scheduler
echo "vr" > /sys/block/mmcblk1/queue/scheduler
#Module Tweaks
insmod /system/lib/modules/ frandom.ko
rmmod tntfs.ko
rmmod texfat.ko
Step #4: Test Your Script
You can test your script using a root terminal shell (Android Tuner has a terminal). Open a terminal, type "su", and hit enter (or select the box beside "su" in AT). This will give you the ability to run commands as root. To test your script enter the following command:
sh directory of your script
EXAMPLE - sh /storage/sdcard0/at/scripts/01ZenKernelTweaks
Check the files that correspond to the tweaked parameters to see if the script worked. If the values were correctly modified then you have officially finished writing your first working init.d script.
Step #5: Enable Your Script
First, open your file manager, go to your root directory, and remount your /system partition as RW instead of RO. This is typically done by long-pressing the /system folder (ex - AntTek Explorer), file manager settings (ex - esFile Explorer), or through the overflow menu. Once the /system is mounted as RW we can move our script to the init.d folder and change our scripts permissions. The init.d folder is located here:
/system/etc/init.d
The name of your script determines the order in which it is executed. The first two characters determine the order of execution. The ordering is as follows - numbers from 0-99, then letters from A-Z. The first two letters of a script's name are typically numbers between 0-99, this is the standard method of script naming that most developers/tweakers use. Set the name of your script so that it is executed in the order that you wish. Mine is set to execute first because I want to get kernel tweaks done as early as possible.
Once you have named your script long-press it and select "Change Permissions" (or however this is done in your file manager). Give User, Group, and Other read, write, and execute permissions.
Your init.d script will now optimize your tablet quickly and efficiently at every boot. Don't get out of your chair too fast....Before doing anything else, I suggest revelling in your awesome new-found abilities for a significant period of time. Pat yourself on the back. Start referring to yourself as "a boss" if you like. You deserve it.
CAUTION:
Although init.d scripts are easy to make, a bad script may cause boot looping. However, a bad script does not necessarily = boot looping. I have yet to cause a boot loop and I have written many scripts that did not work. Everything typically boots normally, the bad lines in the script are simply not applied. Before enabling your script I strongly suggest taking a Nandroid backup in TWRP. To do so boot into TWRP and select "Backup" from the home screen. This will allow you to restore your entire system, which is done via the "Restore" tool in TWRP.
NOTE - Do not enable scripts to run at boot in a program like Android Tuner or others similar to it. If the script is bad it will cause boot looping because the app will keep trying to run it. If you put the script in the init.d folder and enable it yourself you will avoid this issue.
SUGGESTION:
If you want more examples of tweaks that can help you optimize your tablet see my guide to tweaking and optimization. It fills any gaps in this guide and contains many useful resources. You can find it here - http://forum.xda-developers.com/showthread.php?t=2232715
tweakalicous...
lucius.zen said:
HAPPY TWEAKING,
Lucius
PS......ITS A CELEBRATION, *****ES!!!!!
Click to expand...
Click to collapse
LOL ... great tut Zen ...
Very nice, thanks Zen.
I accidentally stated in Step #3 that "Android saves scripts by default in the 'at' folder in your internal storage"....However, I meant to write "Android Tuner saves scripts...". Changed the OP, just wanted to make sure anyone who has read it already isnt like "WTF ZEN! Where is my damn script! Derpa a derrrr".
Breaking News.....
***************IMPORTANT UPDATE - MUST READ BREAKING NEWS*****************
DEY TUK ARRRRR JEEEERRRRRRRBSSSSS!!!!!!!
.....watching too many episodes of SP lately
lucius.zen said:
How-To Write Init.d Scripts for the tf700
Click to expand...
Click to collapse
Great tutorial!
lucius.zen said:
The number, or letter, at the beggining of the init.d script determines its order of sexecution, beginning at 1 or A, and going up to 99 or Z.
Click to expand...
Click to collapse
The universal convention is to use a numeric prefix from 00 to 99, but in reality the name can be anything and the scripts are simply executed in alphanumeric order - digits come before "A". I recommend using two-digit prefixes as intended.
lucius.zen said:
Code:
#!/system/bin/sh
#CPU Tweaks
echo "1300 1200 1150 1125 1112 1100 1087 1075 1050 1037 1025 1012 987 975 962 950 925 912 900 887 875 862 850 837 825 812 800 775 762 750 737 725 712 700 687 675 650 637 625 600" > /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table
Click to expand...
Click to collapse
Note that the UV_mV_table has a completely different format when reading or writing the file - one reason why I hate this interface. But it's the "standard" that was established by whoever hacked the first implementation, and user mode apps expect it like this.
lucius.zen said:
Although init.d scripts are easy to make, you can potentially cause boot looping, please proceed with caution.
Click to expand...
Click to collapse
To repair this, boot into recovery, connect via adb shell, and do the following:
(if needed
mount -o remount,rw /system
chmod 0666 /system/etc/init.d/50myevilscript
This will remove "execute" permissions for the script, which will effectively disable it.
Say I tested and am currently using 10 scripts, how do I create a .zip recovery file so I can flash/install the scripts at once, every time I reflash or factory reset my rom?
Thanks for your awesome tuto ! But I've a question concerning the gpu governor: it's possible to set this governor with command line too ?
@lucius.zen
It is a nice write up and great tutorial. I am enjoy reading it and keep up the good work... :good:
LetMeKnow said:
@lucius.zen
It is a nice write up and great tutorial. I am enjoy reading it and keep up the good work... :good:
Click to expand...
Click to collapse
@LetMeKnow
Thanks a lot dude very much appreciated, makes me miss contributing to xda. I made a lot of promises and left too much work unfinished. I haven't been on for 6 months because I have been dealing with some pretty serious mental health issues. Apparently I am mildly schizophrenic with comorbid anxiety and attention issues. Been super fun times lol. Hoping to get back in the game this holiday season, would be sweet to share some tweaking/optimization ideas, I havent had much of a chance to check out your tweaks but I have heard great things.
All the best,
Lucius
lucius.zen said:
@LetMeKnow
Thanks a lot dude very much appreciated, makes me miss contributing to xda. I made a lot of promises and left too much work unfinished. I haven't been on for 6 months because I have been dealing with some pretty serious mental health issues. Apparently I am mildly schizophrenic with comorbid anxiety and attention issues. Been super fun times lol. Hoping to get back in the game this holiday season, would be sweet to share some tweaking/optimization ideas, I havent had much of a chance to check out your tweaks but I have heard great things.
All the best,
Lucius
Click to expand...
Click to collapse
Thanks for a kind word... It sounds like that you need to take of yourself a little better before worrying about the contributing to xda. You do a lot for the community already and hope you will get very soon. Please let me know whenever you have time to talk about tweaks and more than happy to share what I know.
Cheers and get well,
LMK
Missing Files
Hi,
Using the guide I came up with the following script:
Code:
#!/system/bin/sh
#CPU Tweaks
echo "1350 1320 1280 1240 1200 1150 1100 1050 1000 950 900 860 820 780 750 720 700" > /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table
echo "20000" > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
echo "1900000" > /sys/devices/system/cpu/cpufreq/interactive/max_boost
echo "1900000" > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
echo "85" > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
echo "85" > /sys/devices/system/cpu/cpufreq/interactive/go_maxspeed_load
echo "40000" > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
but I received an error for hispeed_freq and go_hispeed_load claiming "No such file or directory". When I checked the /sys/devices/system/cpu/cpufreq/interactive/ directory, the two files are missing. Are they supposed to be present on the TF700?
Thanks
00shakey00 said:
Hi,
Using the guide I came up with the following script:
Code:
#!/system/bin/sh
#CPU Tweaks
echo "1350 1320 1280 1240 1200 1150 1100 1050 1000 950 900 860 820 780 750 720 700" > /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table
echo "20000" > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
echo "1900000" > /sys/devices/system/cpu/cpufreq/interactive/max_boost
echo "1900000" > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
echo "85" > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
echo "85" > /sys/devices/system/cpu/cpufreq/interactive/go_maxspeed_load
echo "40000" > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
but I received an error for hispeed_freq and go_hispeed_load claiming "No such file or directory". When I checked the /sys/devices/system/cpu/cpufreq/interactive/ directory, the two files are missing. Are they supposed to be present on the TF700?
Thanks
Click to expand...
Click to collapse
Everything looks good in the script. Not sure why those parameters are missing. What kernel are you using?
lucius.zen said:
@LetMeKnow
Thanks a lot dude very much appreciated, makes me miss contributing to xda. I made a lot of promises and left too much work unfinished. I haven't been on for 6 months because I have been dealing with some pretty serious mental health issues. Apparently I am mildly schizophrenic with comorbid anxiety and attention issues... Lucius
Click to expand...
Click to collapse
Forgive the digression, I couldn't help wondering: I don't mean to slight the condition in any way, but zen couldn't tackle it so you had to go the physical route?
graphdarnell said:
Forgive the digression, I couldn't help wondering: I don't mean to slight the condition in any way, but zen couldn't tackle it so you had to go the physical route?
Click to expand...
Click to collapse
Sorry I am having trouble understanding what you are asking. Are you wondering if I medication is more effective than meditation?
lucius.zen said:
Sorry I am having trouble understanding what you are asking. Are you wondering if I medication is more effective than meditation?
Click to expand...
Click to collapse
Here we go off topic already ... but just had to throw in my 2 cents. I have many conditions that have been treated for 30+ years (I am in my 50's) I had Chronic Severe OCD that was almost debilitating in my mid 20's. I also have A.D.H.D. (A.D.D) along with boughts of narcolepsy and severe panic attacks (were I end up on the floor or in the ER) anyways, I am a mess or I use to be. I did ALL the drugs Adderall (Amphetamine, Dextroamphetamine Mixed Salts) / Ritalin / Zoloft / bupropion / Xanax all at MAX DOSE. They all relieved some of the systems, but caused other issues to arise (addiction being one). I got into TD and Zen Yoga 10 years ago. 90% of my symptoms went away the first year, and I only take medication for my high cholesterol now. I feel great and work 10 to 13 hours a day. What this has to do with Init.d scripts .... *shrug* .... Pharmaceuticals just suck .
Now back to the Init.d scripting. Great job on the guide !! if this is not pinned it should be !!
Thank you for creating it.
Thibor69
Thibor69 said:
Here we go off topic already ... but just had to throw in my 2 cents. I have many conditions that have been treated for 30+ years (I am in my 50's) I had Chronic Severe OCD that was almost debilitating in my mid 20's. I also have A.D.H.D. (A.D.D) along with boughts of narcolepsy and severe panic attacks (were I end up on the floor or in the ER) anyways, I am a mess or I use to be. I did ALL the drugs Adderall (Amphetamine, Dextroamphetamine Mixed Salts) / Ritalin / Zoloft / bupropion / Xanax all at MAX DOSE. They all relieved some of the systems, but caused other issues to arise (addiction being one). I got into TD and Zen Yoga 10 years ago. 90% of my symptoms went away the first year, and I only take medication for my high cholesterol now. I feel great and work 10 to 13 hours a day. What this has to do with Init.d scripts .... *shrug* .... Pharmaceuticals just suck .
Now back to the Init.d scripting. Great job on the guide !! if this is not pinned it should be !!
Thank you for creating it.
Thibor69
Click to expand...
Click to collapse
Thanks dude! They tried to prescribe me an antipsychotic for my schizophrenia but I try to avoide pharmaceuticals. I agree that meditation, yoga/exercise work really well, as does tailoring my diet, etc. Glad things are going well for you now.
All the best,
Lucius
lucius.zen said:
Sorry I am having trouble understanding what you are asking. Are you wondering if I medication is more effective than meditation?
Click to expand...
Click to collapse
Actually I was asking if Zen would not suffice that you need to take medication. I don't see that drugs would do anything other than suppressing symptoms. Nothing is done about the root-cause, and that's how they get you hooked for life.
My own experience is that body is a reflection of mind and vice versa. The dichotomy is simply false. However, given the ingrained ruts one needs to obliterate, diet for the body must be watched as much as mediation must be practiced for mental well-being. You ever studied Oshawa? Much more than just a regime, the way I see it.
Sorry, I won't digress any further.
lucius.zen said:
The name of your script determines the order in which it is executed. The first two characters determine the order of execution. The ordering is as follows - numbers from 0-99, then letters from A-Z. The first two letters of a script's name are typically numbers between 0-99, this is the standard method of script naming that most developers/tweakers use. Set the name of your script so that it is executed in the order that you wish. Mine is set to execute first because I want to get kernel tweaks done as early as possible.
Click to expand...
Click to collapse
Great guide, thanks for the tutorial. One question, regarding the order of execution of scripts, does it matter if two or more scripts share the same prefix (1st 2 characters), for example 99SuperCharger and 99Supersudaemon, and 98KickAssKernelizer and 98Fly-On, 94engineflush and 94governor, and etc.? I combine scripts from different devs by editing their code to arrest any conflicts when they get executed, though, I don't change the script's name. Never had any problems, just curious on the sequencing of init.d scripts.
iZLeeP said:
Great guide, thanks for the tutorial. One question, regarding the order of execution of scripts, does it matter if two or more scripts share the same prefix (1st 2 characters), for example 99SuperCharger and 99Supersudaemon, and 98KickAssKernelizer and 98Fly-On, 94engineflush and 94governor, and etc.? I combine scripts from different devs by editing their code to arrest any conflicts when they get executed, though, I don't change the script's name. Never had any problems, just curious on the sequencing of init.d scripts.
Click to expand...
Click to collapse
No it doesn't as they get executed alphabetically but it looks a mess and there is little room for ordering.

Terminal/Script/ADB Cheat Sheet

I made this for my own reference and would like some experienced users to critique it (please don't laugh) and help me add to it. This is a first draft replacing the "napkin" I've got tucked under my keyboard. Specifically simple for newbes like myself to just help us get started with Terminal, Scripting, ADB and have a command reference to follow.
Please chim in on the ADB section which I know needs some serious help. I have almost no experience with ADB but seek to learn and document more so its useful. Or if something already exists like this but way better please point me to it so I can take from it or use it to replace this.
Thanks in advance!
Edit1: Redline1, change to:
chmod octal...10 columns: 1 Type, 9 Permissions
Nice start.
Some comments from top to bottom:
You don't need semicolons after each line. Only if you want to write more than one command on the same line - e.g. "if some condition; then".
For the directory commands (cd, mkdir, ...), you can type directories with leading "/" if you want to specify the complete path starting from root, and without leading "/" to refer to subdirectories of the current directory. ".." is the parent directory of the current directory.
"which" scans your $PATH for the command you give it, so especially if it exists multiple times it shows you "which" will get run if you type it without specifying a path. It has nothing to do with directories.
The permission groups are usually called "u=user", "g=group" and "o=other" (not "everyone else)". And "s---------" is a socket, not a binary - the rest is correct. Read all you wanted to know about the output of ls and much more here: http://www.gnu.org/software/coreuti...ion-is-listed.html#What-information-is-listed
You confused "logwrapper" with "logcat". You use "logcat" to display the log and "logwrapper" to redirect the output of something in your script to logcat.
"sh script.sh" will execute a script even if it doesn't have the "executable" permission set. Use chmod 7xx to make it executable directly without "sh".
"adb command" doesn't exist - to run a single command, you need to say "adb shell xxx".
"adb fastboot" also doesn't exist, at least on my adb.
Some general tips:
Many or all commands in busybox have built-in help if you invoke them with "--help". Also adb shows a small manual if you invoke it without parameters.
You can use most basic reference material for Linux, e.g. guides about shell scripting. It's 95% the same on Android.
Always be very careful when running commands as root - the system assumes you know what you are doing. There is no safety net. For example, "rm -rf" will happily wipe your entire device (if mounted writable) if you add a space between the following "/" and the rest of the path.
Thanks oodels for the feedback and corrections. I will update and rev the document based on this feedback when I get the time.
Also thanks for always being the one who takes the time to reply in detail to my threads, give me guidance, and inspire me to learn more about the discussion topic while NEVER making me feel like I have asked a dumb question or am the newbe I am. I had a college professor that reminds me of you who told me the only dumb question I could ask was the one I didn't ask. I appreciate that more than I can express. You are a plethora of knowledge and a master instructor with a winning humble and tackful approach to education and inspiration; a rare gem.
_that said:
Always be very careful when running commands as root - the system assumes you know what you are doing. There is no safety net. For example, "rm -rf" will happily wipe your entire device (if mounted writable) if you add a space between the following "/" and the rest of the path.
Click to expand...
Click to collapse
Thanks for _that tip. Knowing this now I think I will remove that example from the newbe guide as someone could easily mistype it, add a space after /, and wipe their device from the root down. I will also add the -i option to the command(s) that are dangerous, requiring user intervention (permission) to proceed with the command as a newbe safety factor.

A few command line utilities for RT

So not to clutter up an 'apps' list, I am putting together pieces to enable my surface rt to have more functionality available for on device scripting and a put together a few utilities to fill some areas I think (?) were missing. I might use these from scripts, nodejs, powershell or anywhere else I might launch processes.
So for starters I made :
csnotify - A utility to simulate the toast notification banners (like what you see for weather or new mail alerts). Unfortunately the api used to actual system notifications are c++ sdk binaries which i can't use, so this is as close a clone as i could make. The options are many and explained in a readme file in the zip.
naudiocon - a simple console mp3 file player which i might use for sound effects but it plays a song just as well. There are many pieces to the open source NAudio library which could be useful for future audio media players.
wget - a simple way to download a file from a url via command line. not a true clone of wget but you can enter wget {url} or wget {url} newfilename. run without any params to see that usage syntax.
cryptocli - a simple command line file encryption and hashing utility. Possibly useful for email or sending between computers which has this utility installed. like most ports this runs on arm or intel windows.
speak - a simple text to speech utility to read text either from command line itself or from file specified in command line.
wscon - command line web server. spin up server on -p port and -d directory from command line or put shortcut to this app in 'shell:sendto' to send a -directory- to it (using default port or 8080)
The files are already signed, but if you download directly to your device you should probably right click the downloaded zip(s) and 'unblock' them on the file 'properties' page. This seems to be required when downloading to NTFS partitions, as it will flag the download as 'coming from an unsafe domain' (internet). If you save the file to non-ntfs sdcard/usb/nas you should not have to unblock.
nazoraios said:
So not to clutter up an 'apps' list, I am putting together pieces to enable my surface rt to have more functionality available for on device scripting and a put together a few utilities to fill some areas I think (?) were missing. I might use these from scripts, nodejs, powershell or anywhere else I might launch processes.
So for starters I made :
csnotify - A utility to simulate the toast notification banners (like what you see for weather or new mail alerts). Unfortunately the api used to actual system notifications are c++ sdk binaries which i can't use, so this is as close a clone as i could make. The options are many and explained in a readme file in the zip.
naudiocon - a simple console mp3 file player which i might use for sound effects but it plays a song just as well. There are many pieces to the open source NAudio library which could be useful for future audio media players.
wget - a simple way to download a file from a url via command line. not a true clone of wget but you can enter wget {url} or wget {url} newfilename. run without any params to see that usage syntax.
cryptocli - a simple command line file encryption utility. Possibly useful for email or sending between computers which has this utility installed. like most ports this runs on arm or intel windows.
The files are already signed, but if you download directly to your device you should probably right click the downloaded zip(s) and 'unblock' them on the file 'properties' page. This seems to be required when downloading to NTFS partitions, as it will flag the download as 'coming from an unsafe domain' (internet). If you save the file to non-ntfs sdcard/usb/nas you should not have to unblock.
Click to expand...
Click to collapse
Thanks definitely going to be using wget. If only we could make a port of bash...
Sent from my SGH-M919 using XDA Free mobile app
Qiangong2 said:
Thanks definitely going to be using wget. If only we could make a port of bash...
Sent from my SGH-M919 using XDA Free mobile app
Click to expand...
Click to collapse
Bash shell would be great, git-bash would be even better.
There's a lot of c++ projects that I haven't been able to set up visual studio to compile for arm. vs2013 and 2015 haven't been playing very well so far, I think mamaich successfully did some arm ports with vs2012. Then there's Win10 iot efforts which Microsoft may be more inclined to support officially. They seem to support console c++ apps on win10arm using vs2015 here :
http://ms-iot.github.io/content/en-US/win10/samples/ConsoleApp.htm
I have not even begun trying to set up MinGW/Cygwin which I believe is the toolchain required for cross compiling Linux source projects for win/arm.
nazoraios said:
Bash shell would be great, git-bash would be even better.
There's a lot of c++ projects that I haven't been able to set up visual studio to compile for arm. vs2013 and 2015 haven't been playing very well so far, I think mamaich successfully did some arm ports with vs2012. Then there's Win10 iot efforts which Microsoft may be more inclined to support officially. They seem to support console c++ apps on win10arm using vs2015 here :
http://ms-iot.github.io/content/en-US/win10/samples/ConsoleApp.htm
I have not even begun trying to set up MinGW/Cygwin which I believe is the toolchain required for cross compiling Linux source projects for win/arm.
Click to expand...
Click to collapse
Windows RT was probably coded using vs2012, that's why it's better to use vs2012. Also, Microsoft removed and changed lots of stuff in vs2013 and even more in vs2015 from vs2012. Vs2013 and 15 probably don't have the right commands built in
Sent from my SGH-M919 using XDA Free mobile app
hey i made batch file with sample commands for csnotify
p.s save the file with .bat
p.p.s i seek a bug, the -m text dont support long words
roxas22 said:
hey i made batch file with sample commands for csnotify
p.s save the file with .bat
p.p.s i seek a bug, the -m text dont support long words
Click to expand...
Click to collapse
since your parameter has spaces in it you should wrap it in quotes like :
Code:
csnotify -t "hi xda!!!" -m "i love xda!!!"
nazoraios said:
since your parameter has spaces in it you should wrap it in quotes like :
Code:
csnotify -t "hi xda!!!" -m "i love xda!!!"
Click to expand...
Click to collapse
Thanks, i have some problems with usising batch language
Well I finally figured out how to tap into speech libraries on windows rt, so I created a command line utility.
You can use it to speak some generic text by using this command line :
Code:
speak -t "hello world this is text to speech on windows rt"
Or you can pass in a filename :
Code:
speak "c:\some path to\filename.txt"
Or you can type "shell:sendto" into the address bar of windows explorer and create a shortcut to speak.exe in there and then you can then send text files to it and it will read them.
File should be attached for download.
I added a command line version of simplewebserver, which is called 'wscon' (webserver console).
bundled readme :
This is a console/parameter based version using much of the same code as SimpleWebServer program, but created for command line/script invocation.
The use case for this app is when you frequently change hosting directories and just want to spin up a server on some port and directory.
You can specify port and directory with -p and -d command line options or you can create a shortcut to this wscon program in your shell:sendto folder and right click a directory and 'send to' it.
If you use sendto it will use the default port set in wscon_settings.xml file, which is automatically generated in same folder as executable. Once this file exists you can override the default port of 8080 to be something else if you want.
If you launch from console with just -d option it will use default port in wscon_settings.xml also.
By default this application serves up only to local machine (localhost), if you run it as admin it will be visible to other computers (provided firewall allows).
Click to expand...
Click to collapse

I have an issue. I do not know if my code modification or my device is to blame.

Info:
my device is rooted (fully) and my phone consist of Supersu, Nethunter terminal, bcmon, Reaver.
(below are the codes i modified for my device)
The history
when I first started running reaver i would receive many errors; [...not found] [...can't enable] [...can't change permissions (appearently you can't change permissions within sdcard folder... anyways, moving on.)]
[...no internet connection found]
my point is after looking at the custom scripts I had installed (with notepad++) i noticed that the actual scripts were the big issue. so I started changing things one by one in-order to not mess-up everything. yeah sure, I made some errors that made things last longer- way longer than normal. Nevertheless, at some point I actually started making things better and slowly started knocking down those errors!! until i hit the 'test' button and sure enough
"Cannot link executable... libfake_driver.so is 32 instead of 64.... only PIE are supported."
Truth Be Told
as you might can tell from the kind of question I'm asking, I am not an expert.
And I understand these kind of questions comes with others looking at the questioner as annoying- and with the thought of 'these beginners just want everyone to give answers instead of learning themselves...' It's NOT COMPLETELY wrong, since now days a comment like such is ... pretty much true-
So i'll say this: Not Every One Is The Same.
I am a programmer. my programming is mostly within game design/ game development so if more coding is needed to solve my issue at hand, then let me know and please (at the lease) point me in the right direction.
if I need to google something, please clarify what to search. For I am just one person, so it is possible I haven't thought of something to type in- however, that does not mean I haven't type MANY searches in already.
The Question
Am I able to use Rfa and bcmon on nexus 5x, and if so, then what is needed to get my phone operating (the app(s)) correctly? This is the complete error i am receiving in RfA.
CANNOT LINK EXECUTABLE: "/system/app/bcmon/assets/libs/libfake_driver.so" is 32-bit instead of 64-bit page record for 0x7f98e8c010 was not found (block_size=64)
error: only position independent executables (PIE) are supported.
My Done Work
with the rfa settings you can choose to use custom scripts the following shows the scripts i used and it's placement.
these scripts i had to modify to get the device's errors fixed ( not all though )
Activation Script:
#!/bin/bash
svc wifi disable
LD_LIBRARY_PATH=/sdcard/bcmon/assets/libs
LD_PRELOAD=/data/sdcard/bcmon/assets/libs/libfake_driver.so sh
cd /sdcard/bcmon/assets/tools
./enable_bcmon
echo “rfasuccess”
exit
Warm-up Script
#!/bin/bash
LD_LIBRARY_PATH=/sdcard/bcmon/assets/libs
LD_PRELOAD=/sdcard/bcmon/assets/libslibfake_driver.so sh
cd /sdcard/bcmon/assets/tools
Stop Script
#!/bin/bash
svc wifi enable
echo “rfasuccess”
Will you care to help me?

Categories

Resources