About The Book: The Murmurs of the Dawn

The Murmurs of the Dawn Covers

Deeply rooted in Indian philosophical, perplexing, soaring in imagination, wonderfully improbable, intelligently abstruse.

In these stories, Dinker Charak weaves fifteen tales around characters whose insanity verges upon philosophical proclivity, whose simplicity only intensifies trifling incidents, whose circumstances rouses their dexterity, whose loneliness daunts and whose indiscriminate intelligence saves the day.

Available as Kindle eBook | Paperback

WD easystore + NTFS + Mac OSX: Making Them Work

WD EasyStore NTFS Mac OSX

So, I bought a WD’s EasyStorage 2TB drive. The case says it is Mac compatible but it is not. It comes with NTFS. DiskUtil (via UI) is unable to reformat / erase it and throws this error:

Unmounting disk
MediaKit reports not enough space on device for requested operation.
Operation failed…

So I followed commands in Terminal to fix this issue:

$ diskutil list

In my case the disk is “disk2”.

$ diskutil unmountDisk force disk2
$ sudo dd if=/dev/zero of=/dev/disk2 bs=1024 count=1024

After this I was able to use it. Help this helps.


Current Weather at Your Location Using Wunderground and Google Static Map APIs

Current Weather Location using Wunderground Google Static Map APIs

I was more concerned with ‘Feel Like’ temperature and wind speeds for my neighborhood. Also, I live much close to neighboring town which is next to river, the weather app on iPhone always showed by hometown conditions in locked screen widget. All this lead me to build a custom page for my needs using wunderground APIs.

Current Weather Location using Wunderground Google Static Map APIs

Some key items before we move to the code:

  • Needs valid API key from wunderground (see http://api.wunderground.com/weather/api/d/docs)
  • Needs valid API key from Google Static Maps (see https://developers.google.com/maps/documentation/static-maps/)
  • It used meta viewport for proper viewing on desktop and iPhone
  • I have added an icon used by iOS when page is added to Home Screen, that makes it feel like a real app 🙂
  • It open your default (and hard coded location)
  • There is a ‘ReLocate’ button that will refresh for your current geo-location. This however, works only on https. So if you do not see the red ‘ReLocate’ button, you are not on https
  • The page shows the map of you location so you get an idea which direction wind is flowing in from to prepare accordingly.

On Github

To extract code from git:

$ git clone https://github.com/ddiinnxx/weather_php

The PHP Code


// git clone https://github.com/ddiinnxx/weather_php 
 // more at www.ddiinnxx.com

// various defualts. get the right keys
 // check https://developers.google.com/maps/documentation/static-maps/
 $googleapi_key = "GOOGLE_MAPS_KEY";
 // check http://api.wunderground.com/weather/api/d/docs
 $wunderground_key = "YOUR_KEY";
 // enter location for which you check weather most often. avoids frequent geo-lookup. 
 $def_location = "IA/Cedar_Rapids";
 $p_lat = "41.9650539";
 $p_long = "-91.802762";
 // if new latitude and longitude were sent in params, use them instead of the defaults. 
 // the re-locate button send lat long of your current location and call this php file again
 if (isset($_GET["lat"]) && isset($_GET["long"])) {
 $p_lat = $_GET["lat"];
 $p_long = $_GET["long"];
 $location_url = "http://api.wunderground.com/api/" . $wunderground_key . "/geolookup/q/" . $p_lat . "," . $p_long . ".json";
 // get location for the lat long sent via params
 $location_string = file_get_contents($location_url);

$parsed_loc_json = json_decode($location_string);
 // name of state. eg: NY, MA, etc
 $loc_state = $parsed_loc_json->{'location'}->{'state'};
 // name of city. eg: New York, Boston
 $loc_city_raw = $parsed_loc_json->{'location'}->{'city'}; 
 // replace blanks with _. This is how the wunderground API understand multiworded cities.
 $loc_city = str_replace(" ", "_", $loc_city_raw); 
 $condition_url = "http://api.wunderground.com/api/" . $wunderground_key . "/conditions/q/" . $loc_state . "/" . $loc_city . ".json";
 // get weather conditions from wunderground
 $json_string = file_get_contents($condition_url);
 $condition_url = "http://api.wunderground.com/api/" . $wunderground_key . "/conditions/q/" . $def_location . ".json";
 // get weather conditions of default location from wunderground
 $json_string = file_get_contents($condition_url);

$parsed_json = json_decode($json_string);

$co_location = $parsed_json->{'current_observation'}->{'display_location'}->{'full'};
 $co_city = $parsed_json->{'current_observation'}->{'display_location'}->{'city'};
 $co_temp_str = $parsed_json->{'current_observation'}->{'temperature_string'};
 $co_feels_like = $parsed_json->{'current_observation'}->{'feelslike_string'};
 $co_wind_str = $parsed_json->{'current_observation'}->{'wind_string'};
 $co_rel_humidity = $parsed_json->{'current_observation'}->{'relative_humidity'};
 $co_precip_str = $parsed_json->{'current_observation'}->{'precip_today_string'};

echo "<html>"; echo "n"; echo "n";
 echo "<head>n"; echo "n";
 // using a google font
 echo '<link href="https://fonts.googleapis.com/css?family=Roboto+Condensed" rel="stylesheet">'; echo "n";
 // we have a css style sheet
 echo "<link rel='stylesheet' type='text/css' href='./weather.css'>"; echo "n";
 echo "<title>${co_feels_like}</title>"; echo "n";
 // using viewport ot make sure page is displayed fine in mobile too
 echo '<meta name="viewport" content="width=device-width, initial-scale=1.0">'; echo "n";
 // for iOS. icon to be used when someone adds the page to their home screen
 echo '<link href="apple-touch-icon.png" rel="apple-touch-icon" />'; echo "n";
 // get location script using getCurrentPosition function of browser. will pass the lat long as
 // param to this page via URL and reload it using new URL.
 // NOTE: Re-Locate will work only in HTTPS pages
 echo '<script>'; echo "n";
 echo 'function getLocation() {'; echo "n";
 echo ' if (navigator.geolocation) {'; echo "n";
 echo ' navigator.geolocation.getCurrentPosition(showPosition);'; echo "n";
 echo ' }'; echo "n";
 echo '}'; echo "n";
 echo 'function showPosition(position) {'; echo "n";
 echo ' window.location.href = "index.php?lat=" + position.coords.latitude + "&long=" + position.coords.longitude;'; echo "n";
 echo '}'; echo "n";
 echo '</script>'; echo "n";
 echo "</head>"; echo "n";
 echo "<body>"; echo "n";
 echo "<h1>${co_location}</h1>"; echo "n";
 // NOTE: Re-Locate will work only in HTTPS pages
 echo '<button id="relocate_btn" class="button" onclick="getLocation()">Re-Locate</button>'; echo "n";
 echo '<script>'; echo "n";
 // in case we are not on https, better hide the button as it will not work anyway
 echo " if (location.protocol != 'https:') {"; echo "n";
 echo ' document.getElementById("relocate_btn").style.display = "none";'; echo "n";
 echo '}'; echo "n";
 echo '</script>'; echo "n";
 echo "<p><b>Now: </b>${co_temp_str}</p>"; echo "n";
 echo "<p><b>Feels like: </b>${co_feels_like}</p>"; echo "n";
 // load a static map of the location to give a good idea of where the wind is coming in from
 echo '<img src="https://maps.googleapis.com/maps/api/staticmap?center=' . $p_lat . ',' . $p_long . '&zoom=15&size=300x300&maptype=roadmap&key=' . $googleapi_key . '" />'; echo "n";
 echo "<p><b>Winds: </b>${co_wind_str}</p>"; echo "n";
 echo "<p><b>Humidity: </b>${co_rel_humidity}</p>"; echo "n";
 echo "<p><b>Precipitation: </b>${co_precip_str}</p>"; echo "n";
 echo "<hr />"; echo "n";
 // thanking wunderground for their free and useful API
 echo "<p><img src='https://icons.wxug.com/logos/JPG/wundergroundLogo_4c.jpg' alt='Weather Underground' height='50'/></p>"; echo "n";
 echo "</body>"; echo "n";
 echo "</html>"; echo "n";


Solving “Could not determine Java version from ‘9.0.1’” with Gradle and IntelliJ on MacOSX

Solving Not Determine Java Version 9-0-1 Gradle Intellij Macosx

Solution To Gradle Error

As I was importing Gradle project to try out Java Spring, I encountered this error:

Gradle complete project refresh failed 

Error:Could not determine java version from 9.0.1.

I found this blog by Johan Haleby on same subject useful. But the solution #1 didn’t work. While I was on Project Structure settings (File -> Project Structure -> Project), I noticed the Project SDK was 9.0. This seemed odd as mine was 9.0.1.

So, I clicked on Edit, which took me to SDKs settings and updated the name to 9.0.1.

Solving Not Determine Java Version 9-0-1 Gradle Intellij Macosx

It worked.

Hope this helps if you are in situation like mine.

Installing Gradle

Just some basic noted on installing Gradle on Mac OS X.

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew update && brew install gradle
$ which gradle
$ ls /usr/local/Cellar/gradle/4.3.1/

Connecting Gradle & IntelliJ IDEA

While importing a Gradle project, I added following as Gradle path:


Then as suggested by various stackoverflow articles, I refreshed Gradle (View -> Tool Windows -> Gradle).


Setting Up Web Server in Mac OS X (macOS Sierra 10.12)

Setting Up Web Server in Mac OS X (macOS Sierra 10.12)

Was setting up a web server in my Mac OS X after a long time. Apple has removed ‘Web Server’ from Sharing in Settings. So, thought will share the steps to save you folks some time:

Step 1: Check if Web Server is up and running

$ sudo apachectl status


Go to http://localhost:80/server-status in the web browser of your choice.

Note that mod_status must be enabled for this to work.

Looks OK. But if you ever wanted to start / stop / restart, the ‘apachectl’ command works fine.

$ sudo apachectl stop

$ sudo apachectl start

Step 2: Your Web Directory

It is located at:

$  cd /Library/WebServer/Documents/

The default permissions are for user ‘root’ and group ‘wheel’. I changed them to my user logged user so as to make file editing easier (very useful during development).

$sudo chgrp -R staff Documents/

$  sudo chown -R dinker Documents/

Then I make a soft link to this fir from my home dir to make it easy to navigate to Documents/

$ cd

$ ln -s /Library/WebServer/Documents/ www

The default index file is index.html.en. You can edit it to test changes. To access the local webserver, you need to access http://localhost from your browser.

Step 3: Enabling PHP

If you rename index.html.en to index.php, you will get this error:

Mac OS X Forbidden You don't have permission to access / on this web server.


“Forbidden You don’t have permission to access / on this server.” This means web server is looking specifically for index.html.

Usually, when that happens, it will list the files in that directory. By default, apache setting do not allow listing. Hence this error.

You can see this in the error logs too:

$ cd /var/log/apache2/

$ tail error_log 

[Thu Nov 16 12:39:28.151000 2017] [autoindex:error] [pid 16262] [client ::1:62248] 
AH01276: Cannot serve directory /Library/WebServer/Documents/: No matching 
DirectoryIndex (index.html) found, and server-generated directory index forbidden by 
Options directive

To fix:

$ sudo vi /etc/apache2/httpd.conf

Search for php to find this line:

# LoadModule php5_module libexec/apache2/libphp5.so

and uncomment it by removing #. Then restart apache server.

$ sudo apachectl restart

Reload http://localhost and you should be good!


iTunes on Windows 10 doesn’t recognize your iPhone, iPad, or iPod

iTunes Windows 10 iPhone iPad Found

Someone in the family was facing an issue where the iTunes on Windows 10 wasn’t recognising an iPhone. Of course, I got called to be the ‘IT Expert’ 🙂

Google threw up some solution that worked for various folks. I am sharing what worked for me.

But, It Works On My iTunes & Computer!

I connected it to my Mac using their cable and the iTunes was able to recognise it. So, the issue was with their PC.

Did You Stop And Ask For Help?

Yes, I did. iTunes has an option for diagnostics. It showed that all was OK except there was no iPhone or iPad connected. So the tool was not of much help.

I even made sure I was clicking on Trust option, tried another USB port, upgraded iTunes, etc. No, I did not update Windows. Sorry, that’s a bit too much work.

Control Panel

After eliminating the obvious, this is where I tried to dig deeper.


First I wanted to check if service is running. I typed:


in Run box (WinKey+R) and hit enter. I was able to spot ‘Apple Mobile Device’. So the service was running.

Next stop, device setup

Device Management

I typed:


in Run box (WinKey+R) and hit enter. I then went looking for the iPhone in ‘Universal Serial Bus controllers’. It was not there! Finally, some news.

Note: For those who were never curious or never cared, Universal Serial Bus is USB

iTunes Windows 10 iPhone iPad Not Present

It was under Portable Devices. So that means, Apple iPhone device driver is missing, not working properly or needs to be updated.

Upgrading Device Driver

  1. Right-click on Apple iPhone
  2. Choose Update Driver Software.
  3. Select “Browse my computer for driver software.”
  4. Select “Let me pick from a list of device drivers on my computer.”
  5. Click the Have Disk button. If this isn’t available, choose a device category like Mobile Phone or Storage Device, if listed.
  6. Click Next. You should see the Have Disk button.
  7. Click Browse and navigate to C:Program FilesCommon FilesAppleMobile Device SupportDrivers.


And there it was in ‘Universal Serial Bus controllers’:

iTunes Windows 10 iPhone iPad Found

On the other hand, I will get called for the next family IT situation :-/

Never Alone