Sunday, July 7, 2024

How to get Dividend, interest income from Form26AS

  1. Download FORM26AS from incometax site or bank site in txt format.
  2. Use this command to get entries: grep ^[0-9] AXXXX848XX-2024.txt  >a.txt 
  3. Use this command to get csv file: 
         awk -F"^" '/^[0-9]/ {printf("%d, \"%s\", %s, %0.2f, %0.2f, %0.2f\n", $1, $2, $3, $8, $9, $10) } ' a.txt
 
    4. You may need to delete some irrelevant rows.
 

Friday, November 26, 2021

Procedure to renew driving license in Maharashtra

  • Visit below link to fill the form online
  • https://sarathi.parivahan.gov.in/sarathiservice/sarathiHomePublic.do
  • Select option "Apply for DL Renewal", Follow instructions on the screen to fill the form
  • After filling all the form, download all the forms. Also download the Form1-A (if you are above 40) and get it certified from medical practioner.
  • Upload all the documents along with the Form1-A
  • Pay the renewal fee online
  • Book the slot at the respective RTO office to submit the document which can be downloaded from the above link. Take print out of all documents. Take 2 copies of slot booking form.
  • Submit all the documents with original driving license to the respective RTO office
  • Don't forget to take the sign on second copy of slot booking form. The license will be sent to your address within one month
  • Sunday, October 28, 2018

    Listing only directories in linux


    ls -d */

    Install android apk using adb with all permissions granted by default


    adb install -g myAndroidApplication.apk

    Clear android Application data using shell command


    adb shell pm clear com.app.packageName

    Reset a specific permission of android package


    adb shell pm revoke com.app.packageName android.permission.WRITE_EXTERNAL_STORAGE

    Reset all granted permissions to a android package


    adb shell pm reset-permissions -p com.app.packageName

    Get environment variables passed to android/linux process


    adb shell cat /proc/238/environ | sed -e "s/\x0/\n/g"

    Pass environment variables to pythons using sudo while invoking it


  • sudo -E PYTHONPATH=${PYTHONPATH} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} python
  • Set/Get global android device settings using command line


  • adb shell settings put global bluetooth_disabled_profiles 6
  • adb shell settings put global device_provisioned 1
  • adb shell settings list global
  • adb shell settings list system
  • adb shell settings list secure
  • adb shell settings get global bluetooth_on
  • Trim leading and trailing whitespace using sed


    sed -i 's/^[ \t]*//;s/[ \t]*$//' filename

    Create simple webserver in python


    To create simple web server in python run below command in shell
    python -m SimpleHTTPServer 5000
    this will start serving pages at the address http://localhost:5000 and will show files from the location from where command is ran.

    How to set/unset Windows 10 to boot in safe mode using command prompt


    After reboot press ESC then F11 to enter system recovery mode, then select Troubleshooting then "Advanced Options" then "Command Prompt".
  • After command prompt appears type following
    bcdedit /set {default} safeboot minimal and press Enter. or
    bcdedit /set {default} safeboot network and press Enter. or
    bcdedit /set {default} safebootalternateshell yes and press Enter.
  • Close command prompt
  • On "Choose an option" screen press Continue

    To Unset the safe mode booting, follow above steps till command prompt and then enter command
    bcdedit /deletevalue {default} safeboot and press Enter.
  • Saturday, August 25, 2018

    Sher


    लाजवाब है मेरी जिंदगी का फसाना,
    कोई सीखे मुझसे हर पल मुस्कुराना,
    पर कोई मेरी हंसी को नजर न लगाना,
    बहुत दर्द सहकर सीखा है मुस्कुराना....!!!!

    Friday, August 12, 2016

    Split single line into multiple lines separated with ;

    cat t.txt | xargs | sed 's/;/\n/g'

    Combine multiple lines into single line separated using ;

    cat t.txt |xargs | sed -e 's/\n/;/g'

    How to get print from android makefile

    Add below line to get print from android makefile
    $(info "I want this print")

    Delete single line from multiple files containing specific word

    To delete line which contains alsa-lib word from all .xml file, use
    for f in *.xml; do sed -i '/alsa-lib/d' $f ; done

    How to change linux console/terminal column width

    To change linux console/terminal column width use stty, e.g. to change width to 180 column use
    stty cols 180

    Tuesday, August 2, 2016

    Tensorflow on Windows

    Get tensorflow installed and working on Windows.
  • Download docker toolbox for windows from https://www.docker.com/products/docker-toolbox
    Use default selections, once installed it will create few shortcuts on your desktop.
  • Click on "Docker Quickstart Terminal" shortcut on desktop
  • Now press Windows key + R and type cmd, it will open new command terminal. Enter following in terminal
     docker-machine ssh default 
  • Start docker using below command
     docker run -it b.gcr.io/tensorflow/tensorflow:latest-devel 

    If Its first time it will display following error and download it, which takes some time. Unable to find image 'b.gcr.io/tensorflow/tensorflow:latest-devel' locally latest-devel: Pulling from tensorflow/tensorflow
  • check tensorflow, by typing following
    >>> import tensorflow as tf
    >>> msg = tf.constant("Hello, World")
    >>> sess = tf.Session()
    >>> print sess.run(msg)
    Hello, World
    >>> 
    
  • To use windows shared folder with docker

  • Click "Oracle VM VirtualBox" shortcut on desktop.
  • Goto Settings-> "Shared Folders"
  • Click Folder+ Icon
  • Provide Folder Path, Folder Name, check Automount. e.g. I have folder name as dl_share
  • Now start docker by mounting share folder dl_share to /home/
    docker-machine ssh default
    sudo mkdir /win-share
    sudo mount -t vboxsf dl_share /win-share
    docker run -it -v /win-share:/home b.gcr.io/tensorflow/tensorflow:latest-devel