Tuesday, August 2, 2016

To grant all permission to android app


To grant all permissions to app, use -g as argument while installing with adb
 adb install -g myapp.apk 

Cross Compiling Linux kernel for ARM

  • Get latest stable kernel source code
     git clone https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
    To get kernel-next branch clone
     git clone https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 
  • Get toolchain, e.g you can download linaro toolchain from Linaro toolchain for arm
  • set your path variable /path/to/linaro/binary/linaro/aarch64-unknown-linux-gnu_4.9-2014.05-01/bin
     export PATH=$PATH:/path/to/linaro/binary/linaro/aarch64-unknown-linux-gnu_4.9-2014.05-01/bin 
  • Setup defconfig file
     make ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- O=output defconfig 
  • Make kernel image
     make ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- O=output -j8 
  • To modify kernel configuration use
  •  make ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- O=output menuconfig 
  • To save your modified defconfig file
     make ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- O=output savedefconfig 
    This will create defconfig file in output directory. Copy this file to your arch/arm64/configs directory

  • Friday, August 7, 2015

    Adb over wifi, no USB cable required

    Assumption is you are connected to device using UART for smoething similar so that you can run few commands on device
  • Find out the IP address of the Android device: Settings -> About tablet -> Status -> IP address. Remember the IP address, of the form #.#.#.#.
  • Steps on device
    su
    stop adbd
    setprop service.adb.tcp.port 5555
    start adbd
  • Steps on host
    adb kill-server
    sudo adb start-server
    adb -a connect 192.168.1.64:5555

  • Monday, December 29, 2014

    Dump audio to wav format using mplayer

    mplayer input.mp4 -vc null -vo null -ao pcm:fast:waveheader:file=audio.wav
    

    Play raw audio using mplayer

    To play raw pcm file using mplayer use below command, which plays a pcm file "audio.pcm" whose sample rate is 192000 KHz, 32 bit, stereo
    mplayer -rawaudio rate=192000:channels=2:samplesize=4 -format s32le -demuxer rawaudio audio.pcm
    

    Friday, December 19, 2014

    How to use bash function defined in .bashrc file into bash script

    First define function in .bashrc and then export it
    d2h(){
      echo "obase=16; $@"|bc
    }
    export -f d2h
    
    Above function converts decimal to hex and then export it, so that it can be used from other bash scripts

    Wednesday, April 2, 2014

    Rescue and Recovery software


    Trinity rescue kit is good software for recovery. It can reset password also. This can be run directly from usb drive using http://www.pendrivelinux.com/universal-usb-installer-easy-as-1-2-3/
    http://trinityhome.org/