Daily notes

Thursday, April 19, 2018 - 19:51
Tuesday, April 17, 2018 - 21:30

Lot of students and fresh college graduates ask me this question whether they should learn Jira or not? In this video I tried to answer that question.

Should you learn Jira
Sunday, April 15, 2018 - 20:14

Do you want to make sure that users cannot access your Jira instance when you are doing some maintenance? Well this can be done by changing the permissions but that can be cumbersome.

I found about this new add-on called Maintenance Mode for Jira

I hope you like this video. Enjoy!

Maintenance mode for Jira
Saturday, April 14, 2018 - 15:44
Tuesday, April 10, 2018 - 06:13

Today I want to show you how you can quickly setup a Drupal 8 website on Pantheon.io for learning purpose. It is a great way to get started on Drupal without setting up any environment on your local system.

Pantheon.io and Drupal 8
Sunday, April 8, 2018 - 13:56

They also give free chai when you tweet about them.

Thursday, April 5, 2018 - 12:07

Very nice town. Very sunny and clean here.

Basingstoke station , Basingstoke
Tuesday, April 3, 2018 - 22:40

This morning I was going to Reading when I thought of exposing the shell script that I wrote yesterday to read the CSV file where I am storing my GPS location and sending it to my website. I though of this idea where I can simply query my database of flat files. I thought of creating a bash script where I can pass the date and time argument and it will return my GPS coordinates of that day by looking in the CSV files. I also thought of exposing this script using API.

So when I was searching on the net for some libraries I am actually found one called goexpose that might do the job but I was interested in doing something very simple and quick. I also found one link where I found this code.

  1. // This tool exposes any binary (shell command/script) as an HTTP service.
  2. // A remote client can trigger the execution of the command by sending
  3. // a simple HTTP request. The output of the command execution is sent
  4. // back to the client in plain text format.
  5. package main
  7. import (
  8.  "flag"
  9.  "fmt"
  10.  "io/ioutil"
  11.  "log"
  12.  "net/http"
  13.  "os"
  14.  "os/exec"
  15.  "strings"
  16. )
  18. func main() {
  19.  binary := flag.String("b", "", "Path to the executable binary")
  20.  port := flag.Int("p", 8080, "HTTP port to listen on")
  21.  flag.Parse()
  23.  if *binary == "" {
  24.   fmt.Println("Path to binary not specified.")
  25.   return
  26.  }
  28.  l := log.New(os.Stdout, "", log.Ldate|log.Ltime)
  29.  http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
  30.   var argString string
  31.   if r.Body != nil {
  32.    data, err := ioutil.ReadAll(r.Body)
  33.    if err != nil {
  34.     l.Print(err)
  35.     http.Error(w, err.Error(), http.StatusInternalServerError)
  36.     return
  37.    }
  38.    argString = string(data)
  39.   }
  41.   fields := strings.Fields(*binary)
  42.   args := append(fields[1:], strings.Fields(argString)...)
  43.   l.Printf("Command: [%s %s]", fields[0], strings.Join(args, " "))
  45.   output, err := exec.Command(fields[0], args...).Output()
  46.   if err != nil {
  47.    http.Error(w, err.Error(), http.StatusInternalServerError)
  48.    return
  49.   }
  50.   w.Header().Set("Content-Type", "text/plain")
  51.   w.Write(output)
  52.  })
  54.  l.Printf("Listening on port %d...", *port)
  55.  l.Printf("Exposed binary: %s", *binary)
  56.  http.ListenAndServe(fmt.Sprintf("", *port), nil)
  57. }

The code above actually works perfectly. To expose the "date" command as a web API. You can simply run the tool as follows:

./bash2http -b date

Check the link for more details.

However I was not entirely convinced with the approach of this code. There is no security and that is why I will spend more time on goexpose code on github to understand how secure it is. It supports SSL which is assuring. Let us see if I can spend some more time this week. I really want to find a solution. Most likely I will try to make the above code slightly secure and reusable. I just don't understand Go that well yet. I wish if we can simply feed our brain with knowledge while we are sleeping.

I also came to know that the approach of exposing shell using API method so that it can be invoked over the internet is exactly what CGI used to do. It reminded me of the days when we used to work on C++ during our college days. Internet was still quite new in late 1990s and create a web page using C++ was so much fun. All the memories of floppy disk filled with hundreds of CPP files that we used to compile with Alt+F9 and then run with Ctrl+F9 by smashing the keys on TVS gold keyboard. So many amazing memories of college.

I made couple of projects with Chinar in college using graphics in C++ and mouse programming and working with interrupts. I wish if I get find the code again. It is a shame there was no Github back then. I am sure I must have the code somewhere in floppy disks but how will I read them?

Pic 1:Me in my college.

Pic 2: This is my class (Check the bag I still have the same bag here with my in London and I take it to work everyday).

Going to work after ages tomorrow. I am actually missing "Mind the gap" voice. Excited!

Ravi in college , Ravi in college
Monday, April 2, 2018 - 14:10
Sunday, April 1, 2018 - 13:51
Sunday, April 1, 2018 - 10:29

Recently I made a Hugo website for one of my domain. The idea was to learn Go Language but at the same time make a project as well. Good thing about Hugo is that it takes very less time to setup. I also deployed the website from my Github repository to Netlify.

Instructions to setup Hugo with Netlify: http://go.ravi.pro/c3meq

Here is the video.

Setup Hugo website and deploy it in less than 30 minutes
Saturday, March 31, 2018 - 19:13

I am obsessed with location tracking. I started using Foursquare more than 10 years ago on my Blackberry phone. I loved that app. It is still one of my favourite application. It was very popular for couple of years but then after the smart phone revolution (post Blackberry phase) I guess Foursquare lost its shine but they came back with their new service Swarm. I have not really restarted using Foursquare to the fullest yet however since the last few months I have been hooked to the IndieWeb principles.

I am trying very hard to post everything on my website and syndicating it elsewhere - POSSE. It is a good way to own your data and I don't see any reason why people should not follow IndieWeb principles.

Coming to the point of my obsession with GPS tracking. I do track lot of my actual physical location with either Garmin or an app on my Blackberry that continuously uploads a GPX file to my server but I still need to make it more usable. I used to use Google Latitude but we all know what happened to that and these days I am working on storing my GPS location on a regular interval in the background, without me pressing any button and I really want to also retrieve that location. For instance if I want to know "Where was I 3 years ago on this day at 4:00 PM?", On IndieWeb website I did find some great insights shared by Aaron Parecki and I am yet to fully implement and achieve what he is doing. He has open sourced his work and I can set it up as well but still I am not sure about the approach that I will take.

Anyways, so today what I did I implemented Geocoder and Geofield modules in Drupal. Install and enable both the modules and follow the instructions below.

Step 1

Create Geofield Field type called "Location" and add it in the Content Type of your choice. I added it in notes

Step 2

The "Geocode method" should be set to "No geocoding".

Step 3

Go to "Manage for display" of your Content Type and set the Widget of Location field to "Geofield Map".
Google Maps API Key: XXXXXXXXXXXXXXXX (Create your key and set it here)
Google Places Autocomplete Service: enabled
Map Library: Google Maps
Map Type: roadmap
Map Type Selector: enabled
Map Dimensions - Width: 100%; Height: 450px;
Zoom Levels - Start: 12; Focus: 16; Min: 1; Max: 22;
HTML5 Geolocation button: enabled
Click to find marker: enabled
Click to place marker: disabled
Geoaddress Field: - any -

I have enable Google Places Autocomplete Service because when I create a new node apart from choosing the location on the map I would also like to manually enter the venue name. It sometimes makes it simple sometimes. Also HTML5 Geolocation button is enabled so that it can pick the coordinates when I create a node from my Blackberry (Yeah!) browser.

Step 4

Go to "Manage display" of your Content Type and set the Format of Location field to "Geofield Google Map". You can modify various setting for the map as per your liking. I just changed the Start Zoom to 16.

And you are literally done but wait there is more. Yes few more sexy configurations to make this checkin thing little more fancy.

Step 5

Create one Address Field Type called "Address (field_address)" and set the "Geocode method" to "Reverse Geocode from a Geofield type existing field" and then under the "Reverse Geocode from an existing field" drop down select the "Location (field_location) [geofield]"

On the same page under the "Geocoder plugin(s)" select "GoogleMaps".

Using this Address field is optional but I also wanted to store the Venue's Company, Street address, Post town and Postal code because these fields are managed by just one "Address (field_address)" field. These fields are automatically populated based on the coordinates that you are setting in the "Location (field_location) [geofield]". Pretty neat. Though I had some issues sometimes when this Address field was not fully updated but the node was anyways saved with the location and that is what I needed.

Step 6

Create a view to display all the checkins with the map of course. I created a /checkins page view on this site. Since I am using my Notes Content Type so I just used the following "Filter Criteria".

Content: Location (not empty)

In the "Fields" section I added the "Content: Location" with "Formatter" set to "Geofield Google Map". Add more fields if you want.

This post is actually a note but I have written so much here, well that is the idea. I wanted to share this concept because if you want to also use similar technique of owning your checkins then this method can be very useful. To be honest I am not absolutely 100% sure how far I will take this but so far based on my 2 days of work I think I am satisfied. The next step would be to post checkins to my Foursquare whenever I add a node with location, vice versa can also be useful. This is what I did on my known site which I launched just few days back.

Amazing stuff, really happy with my holidays, doing what I love. I am so glad I starting spending more and more time with my first love again ;)

Drupal Blackberry Checkin
Saturday, March 31, 2018 - 18:45

Finally I figured out a way to manage checkins on my site. Phew. Was scratching my head since yesterday.

Friday, March 30, 2018 - 10:59

Amazing, it rains every weekend. Rain Rain wow

Rain in Burnham , DevOps
Thursday, March 29, 2018 - 13:28

I installed Known CMS last night quickly. It took me 10 mins flat to install it on my webfaction hosting. So far I like it.

Just couple of days back I setup Hugo which is a static site generator written in Go Language. I really like it.

Although this blog is my primary site which I will continue to use as it is a Drupal based site.

This is my post on my Known site: http://www.sagar.ravi.pro/2018/checked-into-dental-appointment

Let me check if webmentions work or not :)

Friday, March 23, 2018 - 18:54

There was a phase in my life when I used to do some side projects quite regularly. It really gave me satisfaction to build something. When I was kid I used to learn how to solder and make small electrical projects. When I bought my first computer those electrical projects turned into digital projects and I still miss playing with resistors, transistors and capacitors but you can't do everything at the same time in life. May be I will go back to electronics later in my life but till then I have to expand my knowledge in digital space.

This week I have 2 projects in mind. Little ambitious but possible certainly. I want to try Known CMS which follows IndieWeb principles and hopefully inline with my POSSE plan. Most likely I will setup a subdomain on ravisagar.in or ravi.pro but not sure where. Let us see.

The other thing which I want to try this weekend is the Circleci. Earlier this week I went to the DevOps summit and I attended one wonderful talk "Don't build your platform on sand" by "Aubrey Stearn, Interim Head of DevOps, Arcadia Group". It was really inspiring and Circleci was mentioned in the talk so I am really interested in evaluating it. I will try to understand how it is different from Bamboo and Jenkins.

Looking forward to the weekend.

Circleci , KnownCMS
Wednesday, March 21, 2018 - 21:36

I am doing a webinar where I will be showcasing how to use Atlassian tools for ALM lifecyle and implementing DevOps pipeline. There are still spots left to sign up but it is filling up soon. If you are always wondered how the full ALM works with Atlassian tools but always wondered how, this is the opportunity to learn.

Please click on the link below to sign up for this free webinar.

Register here

Earlier today I went to the #DevOps Summit and it had some amazing talks. I did a live tweeting from the event. If you missed it please check the details of the event here.

Ravi Sagar DevOps Webinar

Want to contact me?

Life begins outside your comfort zone and that is where your courage is developed". Write to me by filling this form. For living I am an Atlassian Consultant who love both Jira and Drupal. I am the author of "Mastering JIRA" and "Mastering JIRA 7" books. I Love both JIRA and Drupal (a bit more). You can Write To Me and I will get back to you as soon as I can. Have a nice day!

Social Links

Subscribe to my mailing list.

Enter your email address: