Daily notes
In the past few weeks I have been posting a lot of content on my site. I decided that I should be writing small posts using notes concept which is nothing but a way to share updated on my own site. It is working fine so far and I am happy.
For writing proper blogs I was thinking I should be doing a bit more effort in writing them. Instead of just getting them out to the world I should spend more time doing research about the topic and then writing a detailed blog.
It is a very good way to understand the topic, learn new things and when you write with the intention to share and spread knowledge then you also remember it for a long time. I have been doing this for a long time actually.
Sometimes I just search on google with my name and the topic which I wrote many, many years ago.
This year I have ambitious plans - I want to learn french, gain deep insights on DevOps, improve my communication and presentation skills further and also to get back to Drupal development and few others. I want to give my 101% to achieve these goals and writing really gives me a boost.
This year so far has been astonishing for me. I also noticed that when I push myself more to do something I end up doing better in all areas of my life. For instance lately I was making some videos for my new youtube channel at the same time I have been writing a lot on my blog. It really help in building a will power and when I do better in one domain I always end up doing good in other areas.
I was thinking a lot whether I should write very long blogs and I decided now to write at least one good long detailed and useful blog every week. I will probably make a separate section on my blog for such blogs.
Hope this plan works.
I installed this simple chrome extension today that will show the number of Sundays remaining in your life. This chrome extension is developed by Paras Chopra, I follow his blog regularly and I came to know today about this simple extension.
Looking at this image is a constant reminder how short our lives are or I should say how less time we have left in this world.
If everything goes well then I am almost half way through my life.
However with age the energy level, determination and physical strength changes. In most cases it declines. If I look back at my life I don't think right now I work hard enough like I used to. I really miss the days when I was in class 11th and 12th. I think I worked hardest in those 2 years.
So far I spent more than half of my life studying and rest in working but I guess I put more effort in the first half of my life. Life was simple in first half though. Now it is complicated but still I guess I should be working harder.
Now I don't think I work hard enough. I have so much to do in life but so less time left.
This new chrome extension is a constant reminder and a visual aid to tell you that don't waste your time doing trivial useless things.
Have a nice day.


Ravi Sagar:
in reply to:
Thanks for posting the details
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.

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!

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.

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.
-
// This tool exposes any binary (shell command/script) as an HTTP service.
-
// A remote client can trigger the execution of the command by sending
-
// a simple HTTP request. The output of the command execution is sent
-
// back to the client in plain text format.
-
package main
-
-
import (
-
"flag"
-
"fmt"
-
"io/ioutil"
-
"log"
-
"net/http"
-
"os"
-
"os/exec"
-
"strings"
-
)
-
-
func main() {
-
binary := flag.String("b", "", "Path to the executable binary")
-
port := flag.Int("p", 8080, "HTTP port to listen on")
-
flag.Parse()
-
-
if *binary == "" {
-
fmt.Println("Path to binary not specified.")
-
return
-
}
-
-
l := log.New(os.Stdout, "", log.Ldate|log.Ltime)
-
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
-
var argString string
-
if r.Body != nil {
-
data, err := ioutil.ReadAll(r.Body)
-
if err != nil {
-
l.Print(err)
-
http.Error(w, err.Error(), http.StatusInternalServerError)
-
return
-
}
-
argString = string(data)
-
}
-
-
fields := strings.Fields(*binary)
-
args := append(fields[1:], strings.Fields(argString)...)
-
l.Printf("Command: [%s %s]", fields[0], strings.Join(args, " "))
-
-
output, err := exec.Command(fields[0], args...).Output()
-
if err != nil {
-
http.Error(w, err.Error(), http.StatusInternalServerError)
-
return
-
}
-
w.Header().Set("Content-Type", "text/plain")
-
w.Write(output)
-
})
-
-
l.Printf("Listening on port %d...", *port)
-
l.Printf("Exposed binary: %s", *binary)
-
http.ListenAndServe(fmt.Sprintf("127.0.0.1:%d", *port), nil)
-
}
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!


Want to contact me?
Ravi Sagar
ravi at sparxsys dot com
Author of "Mastering JIRA 7" book. Loves #Jira and #Drupal. #Blogger, #ProblemSolver, #Atlassian #Consultant and #Technologist @ravisagar on twitter
Want my help? raise a support request for me.
Social and other Links
- RSS Feed
- Github
- @ravisagar on Twitter
- Ravi Sagar YouTube: Atlassian tools and Jira tutorials
- Ravi Sagar LBRY: Synced with Ravi Sagar YouTube
- Blackberry Boy YouTube: Linux, Emacs, Org Mode and tech tutorials
- Ravi Sagar Podcast
- @ravisagar.in on Instagram
- Ravi.pro: site published with Org Mode, general IT and tech stuff
- LinuxIndya.com: site published with Org Mode on Linux
- AutoGrid.info: site published with Org Mode on Excel VBA and Google Apps Script