If this blog helped you in any way (professionally), please donate a dollar here

Monday, May 15, 2017

ADB Disable bluetooth on non-rooted devices

Here's a script to disable Bluetooth from non-rooted devices:

adb shell <<__eof
  input keyevent KEYCODE_WAKEUP;
  wm dismiss-keyguard;
  am start -a android.bluetooth.adapter.action.REQUEST_DISABLE;
  is_open=`dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp' | grep 'com.android.settings/com.android.settings.bluetooth.RequestPermissionHelperActivity'|wc -l`
  if [ $is_open = 0 ]; then exit; fi
  sleep 1;
  input keyevent KEYCODE_DPAD_RIGHT;
  input keyevent KEYCODE_DPAD_RIGHT;
  input keyevent KEYCODE_ENTER;

No warranties!

Thursday, May 11, 2017

Install mp4box on centos

Google behaved rather strangely today when I wanted to see how to install "Mp4Box". Yum search gave naught, so I decided to google this. On the hindsight maybe I needed better yum search fu for this.

As I was searching through the ways of installing MP4Box on Fedora / Centos I came up with installation instructions that asked me to build the application from source. Even the official website:  https://gpac.wp.imt.fr/mp4box/ provides no explanation on how to do it. They just have the official windows, debian and ios installers. It also offers an explanation to build from source on other linux-es.

While all this confusion is going round, the dude who had the requirement to simple and install gpac, since that is the name of the project! Well, guess what, it worked. So, here's how you install MP4Box on Fedora or CentOS :

Friday, April 28, 2017

RVM Ruby Execution with launchctl on osx

This addresses a problem that goes like this:

You want to create a launch file for launchd (launchctl) to run a ruby file periodically or as a daemon.

Various solutions to this problem include creating an RVM alias for the particular ruby version you want to use. Here I present a working version without aliases, just uses the default RVM Ruby. Please not that, for me, the default rvm ruby is 2.2.5.

When you create a sample plist file like this:

The rvm environment does get initialized. You get lots of gem issues.

The trick here lies in not running ruby but:


Simply use:

Ruby and RVM environments are now correctly updated.

Yeah and you don't need to create any aliases. It will work perfectly fine.

Wednesday, December 14, 2016

Clash of Clans on laptop

Okay this seems to be a click-bait but really not. Android Developers would know how painful it is to get the default android emulator up and running, not considering the pain that eventually follows when the actual application begins to run. It takes ages for the emulator to run even in a decent configuration PC or MacBook.

Now, I wasn't sure this could be done until my sister brought up the topic. She plays Clash of Clans on her laptop! Wow!

So, I decided to google. I knew about genymotion but it's a paid service, and then here's one emulator which actually worked for me on Mac OSX - BlueStacks.

Check this out:

Pretty cool huh!?