Sunday, 30 April 2017

Screen does not sleep with time in Android - Solution

Ever noticed that your Android smartphone screen is never sleeping no matter what the setting is?
If yes, this post might be of your use.
What i found is that it happens because of  an app which is designed to keep the screen awake while the app is active. The app can be anyone among your installed apps.
The problem is that these apps keep the screen awake even when they are in background.

Quick Solution :
First ensure that in Settings - Display - Sleep, you have set the desired time for sleep.
After that just remove every single app from the background (recent screens).

This is easy, but if you want to know which app is the culprit in your case, you will have to check that by hit and trial method. Just remove the apps one by one and see if that solves your problem.

In my case, it was a game called LONEWOLF.

Solution tried and tested with : Moto G3, Android 6.0.1

Sunday, 28 August 2016

Bluestacks Vs. LeapDroid, which is better?

Recently the market has filled up with a lots of new and great Android Emulators. This has challenged the monopoly of Bluestacks. Also i believe that there are now some emulators which beat Bluestacks easily. Here i am explaining how LeapDroid (another free great emulator) is better than  Bluestacks.

1. LeapDroid is Faster
     LeapDroid boots up faster than Bluestacks.

2. LeapDroid gives you better storage space
    In LeapDroid you can use up all the free hard disk space in the emulator.

3. Bloatwares
    LeadDroid won't force you to install any app or game while Bluestacks will do that daily.

4. Reliability
     I used both emulators and sometimes Bluestacks even refuses to start for days, such a problem has never occurred to me with LeapDroid.

5. No crashes
     Bluestacks crashes on my machine every 10 minutes when i use an app continuously but no such problem occurs with LeapDroid.

LeapDroid has given me a completely better experience.
Also you might wanna know how to transfer files between LeapDroid and Windows host using shared folder between the host and the Android VM.

Friday, 11 December 2015

Remove write protection from your pen drive

Sometimes, your pen drive goes write-protected all of a sudden. 
In this situation, you can not delete or write anything on the flash drive. You cannot even format your own flash drive.

This might happen because of virus, hardware switch or some other reason.
Another fact out of my experience is that hoping to solve the problem with linux distro will not help. The problem persists on every OS.

makeuseof has given it a good shot.
First try those steps on the makeuseof blog, but if they do not work, don't be upset because i have a couple of more ideas to try.

1. Look for the recovery tools provided by the manufacturer of the flash drive
    eg. Transcend : (it worked for me)
2. If it is covered in warranty, return/replace it.
3. Try mUsbFixer from

Tried on : Transcend flash drive 8GB
May work with : other flash drives

Thursday, 3 September 2015

Display battery percentage level indicator on Android Lollipop (without root)

I am a cyanogenmod fan because i love how customizable it is at every aspect. Well, since i have got a new phone now (moto g3 2015), i have to stay away from cyanogenmod for at least a while for two reasons :
  1. Rooting my phone will void the warranty. 
  2. There is not yet any stable Cyanogenmod ROM available.
Due to this i am struggling with many customization tasks. One of them is the battery level indicator. I want it to display battery level in form of percentage but no option for that has been provided in the stock OS of my Moto G 2015. I reached out for a method to achieve battery percentage indicator (without rooting) and found many which i am gonna share with you :

The best one is Battery Percentage.

1. Full Battery & Theft Alarm
  Features :
  • SMART WATCH integration
  • Sound and vibration alarm when charger is unplugged. (Anti theft alarm)
  • Full battery alarm
   Pros :
  • Loads of features.
   Cons :
  • Always takes the space of a notification in the drop down space of android 
2. Battery Percentage
   Features :
  • Status bar icon 
   Pros :
  • Simple and small 
   Cons :
  • No additional features 
  • Always takes the space of a notification in the drop down space of android 

2. Batteryminder

    Features :
  •      Customizable status Bar Icon 
  •      Tells the temperature 
  •      Alerts for low battery and fully charged battery 
  •      Widget available 

    Pros :
  • Additional features like alerts for low or full battery 
  • Widget available 

    Cons :
  • Always takes the space of a notification in the drop down space of android. 

3. Battery Widget Reborn (Free)

Features :
  • Highly customizable status icon. 
  • Additional toggles for wifi bluetooth etc. 
  • Motorola 1% hack 
  • Customizable widget option 

Pros :
  • High customizability and many features 

Cons :
  • Always takes the space of a notification in the drop down space of android. 

4. Battery Percent Enabler :

Features :
  • Displays battery percentage within the stock battery icon 
  • Does not require root. 

Pros :
  • Most desirable feature 
  • Does not occupy the notification area 

Cons :
  • Zero customizability 
  • Very small text (hardly readable) 
  • Text does not show when battery is charging 

Battery Percent Enabler could be the best choice only if it could eliminate its cons listed above.

Tested with : Moto G3 2015, Android 5.1.1
May also work with : Any Android Phone

Monday, 13 April 2015

Remove Saleplus malware completely without any anti-malware

SalePlus adware
Recently my laptop got infected by the Saleplus adware/malware from a website. Symptoms are :
1. You see ads on every page you visit even when you have the Adblock Plus installed.
SalePlus ads
SalePlus ads

Saleplus adblock
SalePlus ads even with adblock plus enabled

2. Biased Google search results.
SalePlus google
Expected search results
Saleplus google
Search results altered by SalePlus

3. Slow internet speed.

In my case, only Google chrome was the affected browser. Hence following are the steps to remove it from Google chrome and Windows only. ...

How to get rid of it.....
  1. Uninstall SalePlus from Windows installed Program and features.
    To achieve this in windows 7, press windows button --> Control Panel --> Programs --> Uninstall a Program. After that find "SalePlus" and uninstall it. For other windows versions, steps are almost similar.
  2. Remove it from startup of WIndows.
    Press windows button and type "msconfig", hit enter.
    Goto the Startup and look for suspicious entries. Generally the adware takes the name of whatever file you were trying to download from the infected website. e.g. in my case it was "Eluveitie - The Call of the Mountains".
    Disable such suspicious startup programs. Do not close the window yet.
    Saleplus startup
    Remove SalePlus from startup

    1. Delete its files and folders
      Have a look at its location in the same table in msconfig (previous step) and go to that location i.e. go to "C:\Users\code\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\Eluveitie - The Call of the Mountains".
      Right click on the shortcut "Eluveitie - The Call of the Mountains" ---> properties.
      Note down the value in target field and go to that address. e.g. go to "C:\ProgramData\{82d33535-da55-b0aa-82d3-33535da5d4d7}" and delete "{82d33535-da55-b0aa-82d3-33535da5d4d7}" from C:\ProgramData. Also delete the shortcut you found earlier at "C:\Users\code\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\Eluveitie - The Call of the Mountains".
    2. Delete C:\ProgramData\4288546593436265821 (or similar folder with date modified same as other two folders in step 2 and step 3.)
    3. Remove the SalePlus extension from Google Chrome.
      Visit chrome://extensions/ (just paste this in chrome address bar)  and enable developer mode.
      Search for SSalePlus and check the "Loaded from: " attribute of the extension. This is the address which allows it to rise from ashes even when you delete the extension from chrome. In my case it is located at C:\ProgramData\ambmpnbogdlmjcmpeejljnhbnmojogeh.
      Delete this directory "ambmpnbogdlmjcmpeejljnhbnmojogeh".
      Also disable and and remove the extension from Google chrome.
      Saleplus chrome
      Saleplus chrome extension

    4. Now close msconfig window from step 2 and restart.
    Now the annoying ads must be gone. All the best.
    Tried on : Windows 7, Google chrome Version 41.0.2272.118 dev-m
    May also work for : Any version of windows, Other browsers

    Tuesday, 7 April 2015

    5 important steps to optimize the speed of your Wordpress website

    I am a Wordpress developer. I tried to optimize the speed of my Wordpress website. After hours of searching i found solutions but most of them didn't work for me. Then i thought, why not try combining some of the working solutions?.. I must tell, the website i was working on was created on Genesis Framework which is the fastest among all the themes we generally use for our websites.
    I will share how i optimized the speed of my Wordpress website.
    Let us jump to the steps without wasting much of your precious time.

    1. Reduce the size of all your images by compressing them, you'll get some online image compressors. Replace .png images with .jpg if possible because a png image increases the server response time which leads to slow pages. One of the online image compressors is :

    2. Try and use minimum javaScript in your website. If you have to use js anyway, put all your js in footer after </body> tag because web pages use top to bottom approach, else it loads the js first and then the content, due to which none of the above-the-fold content(html) on your page may be rendered.
    You can also call your js asynchronously by using async (suggested by google's pagespeed insights ).
    Most of us do not know what exactly calling the js "asynchronously" means. Well according to what i understood after applying async is that your js will load along with your page but it will not block the above-the-fold content.

    3.Try and use background colors instead of images.

    4. Add this code to your .htacess file
    # BEGIN Compress text files
    <ifModule mod_deflate.c>
      AddOutputFilterByType DEFLATE text/html text/xml text/css text/plain
      AddOutputFilterByType DEFLATE image/svg+xml application/xhtml+xml application/xml
      AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml
      AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript application/json
      AddOutputFilterByType DEFLATE application/x-font-ttf application/x-font-otf
      AddOutputFilterByType DEFLATE font/truetype font/opentype
    # END Compress text files
    # BEGIN Expire headers
    <ifModule mod_expires.c>
      ExpiresActive On
      ExpiresDefault "access plus 300 seconds"
      ExpiresByType image/x-icon "access plus 2592000 seconds"
      ExpiresByType image/jpeg "access plus 2592000 seconds"
      ExpiresByType image/png "access plus 2592000 seconds"
      ExpiresByType image/gif "access plus 2592000 seconds"
      ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
      ExpiresByType text/css "access plus 604800 seconds"
      ExpiresByType text/javascript "access plus 216000 seconds"
      ExpiresByType application/javascript "access plus 216000 seconds"
      ExpiresByType application/x-javascript "access plus 216000 seconds"
      ExpiresByType text/html "access plus 600 seconds"
      ExpiresByType application/xhtml+xml "access plus 600 seconds"
    # END Expire headers
    # BEGIN Cache-Control Headers
    <ifModule mod_headers.c>
      <filesMatch ".(ico|jpe?g|png|gif|swf)$">
        Header set Cache-Control "public"
      <filesMatch ".(css)$">
        Header set Cache-Control "public"
      <filesMatch ".(js)$">
        Header set Cache-Control "private"
      <filesMatch ".(x?html?|php)$">
        Header set Cache-Control "private, must-revalidate"
    # END Cache-Control Headers
    # BEGIN Turn ETags Off
    FileETag None
    # END Turn ETags Off# Leverage Browser Caching Ninja -- Starts here
    # Do not write anything between "Leverage Browser Caching Ninja -- Starts" and "Leverage Browser Caching Ninja -- Ends"
    # It will be deleted while uninstalling Leverage Browser Caching Ninja plugin
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault "access plus 1 month"
    ExpiresByType image/x-icon "access plus 1 year"
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
    ExpiresByType image/jpg "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    ExpiresByType text/css "access 1 month"
    ExpiresByType application/javascript "access plus 1 year"
    # Leverage Browser Caching Ninja -- Ends here
    The above code will do the following :
    i) Compress text files
    ii) Enable Cache control headers
    iii) Enable Expire Headers
    iv) Enable Leverage Browser caching Ninja

    5. If you still do not get the desired speed, you may want to minify your css and js as suggested by google page speed insights.
    These five steps got me an optimized website :). Good luck for yours....

    Tried on : Wordpress 4.1
    May work on : Any other Wordpress version


    Wednesday, 18 February 2015

    My tools for competitive programming in java

    Many programmers prefer to compete in online programming competitions by submitting solutions using Java. But one might wonder what tools are best for competitive java programming. Here i am revealing the tools i use for competitive java programming :

    1. Eclipse
    2. Vrapper
    3. Java SE Development kit (jdk)
    4. TCF Terminals
    Features/benefits of this configuration are :
    • All benefits of Eclipse such as :
      • Code Recommenders
      • Intelligent importing
      • Error highlighting
      • Warnings
        and much more.....
    • Enhanced efficiency with VI editor capabilities added to eclipse via Vrapper
      Vrapper can be installed inside eclipse as a plugin and it is one of the best plugins to add VI features to eclipse. Having Vrapper means you have all the power of VI editor.
    • By ensuring the that jdk is installed you can run the 'javac' command and 'java' command right from the command prompt or terminal.
    • By using the terminal for compilation and execution gives you the power of directing stdin input from a file and also stdout output to a file. These features are not yet available in eclipse luna. Ironically this feature is very helpful in studying large outputs and inputs and debugging.
    Steps for using the environment
    1. Create a new java project with any name.
    2. In package explorer, right click on its 'src' package and add new class to it. In the New Java Class dialog make sure to set package field empty i.e. default package.
    3. Now write your program in the class created in step 2.
    4. To run this program make sure jdk is installed properly and the 'javac' command runs properly in the terminal/ command prompt. Now open the terminal/command prompt, compile and run the program using the following command :
    javac && java Solution <in.txt> out.txt
    where is the file name in which code is written and the second command 'java Solution' (where Solution is the name of the class in .java file) runs the compiled program taking input from 'in.txt' in the same folder where exists and writes output to out.txt in the same folder

    Note that this environment can be setup on all popular OS platforms.