Giter Site home page Giter Site logo

bashrc's Introduction

Bashrc plus

INSTALLATION

source install.bash at the bashrc directory


COMPONENTS

This bashrc is gathered from: bashrc.bash : The entrance and some basic functions.

droid.bash : The android related tools.

local_env.bash : Not tracked by the git, customize user local script here, those modifyings will not be tracked by git.

ideas : Scripts in folder idea/, the functions is too 'young', just an idea, not common, or under researching. Dangerous or bad experience or unexpected result may occur. So put them into idea


FUNCTIONS

  • In bashrc.bash:

    bd : Back directory, against cd

          Usage:
                  bd [number]
    
                  number: Optional, how many directories you want to go back.
    
          Notice:
              It supports completion now, input bd and a space, then press TAB, you can see the target path,
              if you want to pop up more, press TAB continuely.
    

    psfgrep : Alias of ps -ef | grep

    sfind : Alias of find . | grep

    sfind-select : Acquire sfind results and use viewer to open it, if the results count is more than 1, select number (support multi-select) you prefer, otherwise open it directly. You can set DEFAULT_SFIND_SELECT_VIEWER as default viewer into local_env.bash, default is "vi".

    loop-do : Do something in dead loop

    proxy_set : Set the http_proxy https_proxy HTTP_PROXY HTTPS_PROXY in batch.

          Usage:
          proxy_set [proxy_address]
    
                  proxy_address: the proxy delegate addresss you set, empty means unset.
    

    ccd : cd and ls -alF

    getip : Get the IP(v4) address, default parameter is eth0. It is too simple now.

    drop_cache : Drop the memory cache, free the file cache to get more PSS.

    getremotecallerip : If you login the terminal into some remote PC, use this to try to get the caller IP.

  • In droid.bash:

    adb.bash : The bash completion from AOSP

    adbroot : Alias for root - wait-for-device - remount

    adb-restart-server : Restart adb server and run adb devices

    logcatee : Dump log until cancel, print to screen and save to the droid.logcatee.log

    logcatdump : Dump log oneshot, print to screen and saved to the droid.logdump.log at home dir.

    droid_dump : Alias of adb shell dumpsys

    droid_am_dump : Alias of adb shell dumpsys activity

    droid_am_focused : Find out the focused activity on device

    droid_proc_pid : Find the pid of the process name you pass. And cat the file in proc/[pid]/[file], file is optional parameter, if you put, the file will be cat. : Notice: Support completion!

    droid_proc_stat : Find the pid or process name stat, and parsed them with human-readable. second parameter is the one of the stat name or the position you want to query. See the man proc and find proc/[pid]/stat introduction. : Notice: Support completion!

    droid_proc_signal : Find the process by name you pass in param1, and send kill -SIGNAL to process you pass in param2. Support completion.

    droid_proc_kill : Find the process by name you pass and kill it (signal 9), support completion.

    droid_proc_quit : Find the process by name you pass and send signal 3, support completion.

    droid_build_init : Init the build environment, the parameter is the project you want to lunch, if pass nothing at : first time in current code project directory, you can choose one, and he will remember your : choice, we strongly recommended you use the [product]-[userdebug/user/eng] instead of a number. This function will try efforts as follow:

                      source build/envsetup.sh
                      lunch [the project] or read from .lunch_config
                      export TOP <- Can call mm and croot outside of current code space.
                      use c cache <- Recommended in source.android.com
                      raise jack server heap size <-  From AndroidN, raise the heap size for jack-server, default is 3/4
                                                      of total PSS in PC, you can override it by default use env
                                                      DEFAULT_JACK_SERVER_HEAPSIZE (ex. =6144m).
    

    droid_build_init7 : Use the openjdk7 to lunch the product

    droid_build_init8 : Use the openjdk8 to lunch the product

    droid_build_init_compat Recommended : lunch the product, let the scripts determine the java version

    After droid_build_init, you can use:

    pushapp : Auto detect the app and push them into device. Not complete yet.

    pushmodule : Not completed yet.

    pushinstall : Use mm | parallel pushinstall, and push everything in output starts with Install: out/

  • Idea:

    copy_repo : For AOSP repository, copy a new branch of code from original one, with most space saving functions. : Actually, the copy is fake, link .repo/project-objects .repo/projects .repo/repo .repo/manifests.git : to the new folder, copy .repo/manifests to it. And then, objects from remote will be shared, but : because of local branch is different, the new code and old one will not effect each other.

                  Usage:
                  copy_new_repo [from_folder] [new_branch_in_manifest]
    
                          from_folder: the old foler you want to copy from [**CAUTION: the old folder must not be deleted **]
                          new_branch_in_manifest: the branch you want to copy must come from .repo/manifests
    

gerrit NOT PUBLIC, you can try and learn gerrit shell port like ssh -p 29418 [email protected] gerrit

Finally, hope that this can be helpful to you.

bashrc's People

Contributors

yuntao90 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.