All posts

Half yearly update 2018

I can't believe half of 2018, time flies. I made myself lot of promises start of the year. Overall I am quite satisfied with myself this year. I feel good when I continuously keep myself abreast of the latest things happening around or at least making an attempt to learn new things. I don't like stillness in life. We should always look forward to get familiar with new things not only related to our direct field of work but in other domains.

What I am happy about? or things I stuff I learned or tried
Go
Hugo
Known
Indieweb
Improve my blog
Learned about GPS
Youtube channel

What I want to do or could have done in the past 6 months
DevOps
It is such a wide field that you can not say that you are an expert in DevOps. This year I will continue learning and exploring this domain further. I already have a good understand of what is DevOps what I am gain more knowledge around certain topics.

VBA
I used to maintain one blog called autogrid.info where I used to share tips and tricks on Excel VBA. I wish to do that again. Not sure if I will be able to spend lot of time on this but I wrote a book which I will try to publish this year.

Write a book on Drupal
In 2011 January I wrote a book on Drupal 7 which I also published. The book was not great and rather unfinished. This year I wish in my free time on weekends I can update that book for Drupal 8. I will be very happy if I can finish this task before the end of this year.

Fluent in French
Again one of my dream is to one day speak fluent french. I really want to give more time for the remainder of this year. At least I can read a book and talk to my colleagues to lear more. I did learn lot of things this year but mostly random things, I did not give enough attention on this.

That is it for the time being. Long list is also not good but these are the things that are in my mind.

Displaying my live GPS location on the site and also my battery status

This Easter break was very fruitful for me. In fact I was quite satisfied with the work that I did in the last few days. In the past few weeks I am following IndieWeb principles and I implemented POSSE as well. I was quite satisfied with the new approach on my blog where I started posting small updates using notes. However I also wanted to implement checkins on the site and I shared the approach I took with my Drupal website and the modules I used to achieve it.

However I still wanted this ability to display my current location on my site. I was actually inspired by Aaron Parecki. I wanted to do the same thing and I first thought of using his code which he open sourced but I wanted to do it myself and also I don't have an iPhone plus my site runs on Drupal and I was more comfortable implementing it myself.


Introducing my live GPS location

If you go to the status page you will be able to check my last known location and the battery status coming directly from my phone.


How I did it?

I want to share the work that I did to achieve this. In case it is not clear or you need more information. Please contact me and I will be more than happy to share more details.

Step 1: Using GPSLogger app on Blackberry to track my location

Yes I love Blackberry and I use it in 2018 as well. It is great and don't ask me to change it. I use this android app running on my Blackberry Passport. This app captures the GPS location and creates a GPX and CSV file which I also send to my server using secure connection.

To save battery of my Blackberry, which is anyways great as compared to Android phones but I still wanted to make it last longer, I did some settings in the app as follows.

Distance filter: 50 meters (More is better for battery)
Accuracy Filter: 100 meters (More is better for battery)
Duration to match accuracy: 60 seconds (Less is better for battery)
Absolute time to GPS fix: 30 seconds (Less is better for battery)
Don't log if I'm not moving: On (Good for battery, uses accelerometer)

Anything which is better for the battery is not good for the GPS. I can log more frequently and make GPS very very accurate but it will drain the phone battery quickly.

Step 2: Shell script to read the CSV file and make a REST call to my Drupal site

This is my favourite part in the whole process. Lot of Linux skills and it was good to brush up my bash skills after a long time. I made a script that can read the last line of the CSV file and then sending the Timestamp, Latitude, Longitude and the Battery status, there are other things like elevation also in the CSV but I don't care about that (unless I am hiking, in that case I will use Garmin).

Then in the same shell script I am making a REST call to send these things to my site. I of course enabled the REST API modules that now come with the core and I also installed REST UI.

Step 3: Running the Shell script using Cron

I always get nervous when I use crontab. It is a pain to use it or may be I am not a good Linux Administrator. Well anyways after few hits and trials and way past my bedtime I was able to successfully run the shell script after every minute.

So every minute the shell script will update the last known location from the CSV file to my website. Of course it also depends whether my location has be updated or not. When I am not moving the location is not sent. Pretty cool stuff.


What's next - Querying my location database using REST API

I do have lot of GPX files store somewhere but I realised using flat CSV files works fine for me but I still want this ability to query my location database. Aaron Parecki mentioned on his site about Compass which he wrote using Lumen framework. I did try using it but was unable to set it up. I was able to get the Compass up and running but I was unable to login using my Known website. I also enable Indie Auth on this site but after few trials I gave up.

I am now planning to write my own code to query the flat CSV files. In Compass Aaron mentioned that he can query his location database using API calls which is exactly what I wanted to do. I will definitely write code for this, still not sure which language to use. May be good old PHP? Or Go? Don't know. May be I need couple of days to do this.

I hope this was useful and you can try something similar. To be honest I did this with the sole intention to learn something and I really had very, very good Easter break.

Have a nice day!

Excel VBA macro to convert the case of the first letter in a sentence

Let us say you have a some sentences in your excel sheet in one or two cells. Now if you are very particular about punctuation like me then you may want to change the case of all the words starting in a sentence. Let us say you have some sentences like below in various cells.

A1: ravi is very nice. he likes writing on his blog.
A2: he is a good boy. he like to walk in the par. he like good food.

The sentences are ending with a full stop and the next sentence is starting with a lower case first letter in the word. The following macro can fix that :) Just highlight the cell where you want to run the macro.

  1. Sub SentenceCase()
  2. Dim v As Variant
  3. Dim s As String
  4. Dim j As Long
  5. Dim cell As Range
  6. For Each cell In Selection.Cells
  7. If cell.HasFormula = False Then
  8. s = cell.Text
  9. v = Split(s, ".")
  10. For j = 0 To UBound(v)
  11. s = Application.Trim(v(j))
  12. s = StrConv(s, vbLowerCase)
  13. s = UCase(Left$(s, 1)) & Mid$(s, 2)
  14. v(j) = s
  15. Next
  16. cell = Application.Trim(Join(v, ". "))
  17. End If
  18. Next
  19. End Sub

After running the macro the sentences will be converted to the following.

A1: Ravi is very nice. He likes writing on his blog.
A2: He is a good boy. He like to walk in the par. He like good food.

Cool isn't it? It is not the best ever VBA code ever written but it gets the job done. It is much better than doing things manually. It will only work on the cells selected because we used For Each cell In Selection.Cells and it will ignore any other cell that you didn't select. The full stop in the above code acts like a delimiter. Of course more logic can be added in this macro like converting individual "i" to capital "I".

I hope this was useful. Let me know and have fun ;)

2014 Half Year Update

More than half of 2014 has passed away and today it is 1st August. Today is my mother's birthday and also starting August it is festival time. Rakhi is next week, then Independence Day, next month is my birthday, then Dusshera, Diwali an so on. Really looking forward to next few months.

I am happy. There is a reason. My company Sparxsys is doing really well, especially the way I planned. We are by far the best JIRA Training provider in India right now. I don't think any other institute or organization who is into JIRA training can match our quality and experience. That is one. Second we are also one of the leading Drupal training provider in NCR. On an average I receive atleast 10-15 Drupal training requirements every week and around 5 JIRA training leads. Lastly we have some really amazing Drupal development projects lined up.

At our company we are now selective with work, we don't accept boring work just for the sake of money. We prefer working with smart clients who are willing to pay for the quality. Though our rates are still affordable and we charge less than our counter parts.

I am sure Sparxsys is on its way to become the number 1 Drupal and JIRA Consultancy firm in India.

We are planning to focus more on trainings and building products now. Recently we did some changes in the company that was difficult for me but it was necessary. I recently read Lean startup book that talks about continuously monitoring your progress and pivoting as and when necessary. The decisions I took in last few months were little difficult but now I feel that it really helped me to get more focus on things that matter the most and bring maximum value.

BTW I am also receiving some job offers :) really tempting offers but you know it is not easy to give up your dream. I recently started writing a daily journal where I summarize daily stuff in few paragraphs. It is good to write regularly, it really clears up the confusion in the mind and I think everyone should write journals.

It is 8:30 PM and I can hardly focus and write well, so winding up now.

Good Bye.

2012 Year End Update

I am not really a good writer or blogger, this blog of mine has lot of posts related to different things around my life. Most of it is on Drupal which is my bread n butter and on Delhi which is my home. Rest of the blog has stupid stuff and the whole blog if unorganized. I think sometimes that I should work on making this blog focussed on few topics only but then I feel that I prefer it to be unorganized. This is my space where I can write whatever I feel and let everything out. Just like a daily journal. I feel bad that I can't write everyday but anyways I write whenever I can.

I havent really written what is happening in my life recently. Though facebook and twitter is one place where I usually post non sense stuff everyday but as some of my friends pointed that it is too easy to get carried away there and it is just waste of time. So I again made up my mind not to spend too much time on fb. May be once in 2 days are enough. I really need to get my mind focussed and motivated. There is so much noise out there. I completely stopped watching TV and reading newspaper and I must say it is one of the best thing I did this year. Whatever happening in the world doesnt really bother me much rather at this point of time I need to get my life in order and give all my energy to that.

I am juggling between tasks and so much work that I feel tired now. I was not admitting it but I am also human being and I too get tired. Any form of physical, mental or emotional activity sucks our energy and we need time to refuel. I am trying hard to get things in order so that I can plan things better and find time to rest but it is hard. Either I am in front of computer or traveling to meet clients for work or doing stuff. 7 days a week I am on my toes, which is good but I am not really getting things done. Most of my projects are getting delayed and the quality of my work is going down. I don't like that to happen for long.

I was recently blessed with a baby girl, she is beautiful little baby and I just love holding her in my arms and hugging her. Probably the best thing in life. I just love to thought of carrying her in my arm. Life does change when you become parent. I really need to work extra hard now.

One thing I hate these days is not being able to get up at 4. I feel shameful. I do get up to turn off the alarm clock but just couldnt gather the energy to get out of the bed. May be I am just working to hard that my body demands the sleep or may be it is the winters and cold weather. In any case I need to re-thing and change some stuff to get back to my usual schedule. Last month I got irregular with gym but now I am going to gym regularly. I am probably in the best shape of my life right now and I feel proud. I currently weight 67Kgs, a bit under weight but my body is in good shape and I lost lot of extra fat that accumulated on my body. I am not realy taking enough diet these days because I am always running around and missing lunch but thats how it is. I try my best in every way to do things right as much as possible.

About work, well I am still working full time but as my team is global and I really dont need to go to office so I am cool with that. I am working 100% from home these days, but I really want to get rid of my job as soon as possible. It is going to be a big decision, though I am running decent money from sparxsys, my company but the income is not steady all the time but I am sure things are good now. Right now I may possibly get enough work to survive 1 year which is good thing. I was looking for office space recently as I am thinking of increasing my team as it is tough to work from home as a team. We need to have a place where everyone get together and work. so not sure when but soon we may move to some office. It will add extra burden but thats the price we need to pay to grow. I don't really want sparxsys to become main stream company. By September I am planning to grow our team to 10 people. Lets see how things turn out. I am sure 2013 is going to be good for me. Lot of new and existing projects may come in next few weeks and I am really excited, though sometimes I worry how will I manage so much work. I am not good in delegating work to other team members, which I need to learn as I can't really do everything on my own.

One thing I realized in life is that I worry too much. Can't help it but I need to control my feelings and specially my anger. Lot of things frustrate me but thats how life goes on. Ups and downs are part of life and I need to learn to cope with it. I really need to end this year on a good note and for the next few days I really want to follow my plans and daily schedule so that when I start 2013 I am in a good pace.

Feeling tired writing now and it is getting late too. So stopping here. Bye.

Should I worry about the future - Achieve anything in life

A very happy Ravi Sagar

Yesterday for the first time ever in my life thoughts of old age scared me. What if I get sick in old age. Even in the young age when we get sick with cold or any small disease we get so helpless and need someone to take care of us. In the old age it is very tough. What if I am unable to handle the pain of old age. These scary thoughts came in my mind but I quickly diverted my attention to something different. I guess we should not worry at all about it and enjoy every bit of today. Yeah I know it is easy to say but very hard to follow. How can I stop my mind from thinking about future. Not possible. So what is the solutions. Old Age and Death is an inevitable truth. Delaying it won't stop it from happening. I really want to know now how people in very old ages manage their lives. How do they convince themselves that there is lot more in life than knee pain, diabetes and regular medication.

Exceptions are everywhere around us. I have seen many old people enjoying their lives to the fullest. I guess I and everyone else should start doing something for their lives no matter how old they are. As long as we are alive we have many years left to live. A 40 year old man may still have another 30 or 40 healthy year ahead. Which is lot of time to do new things, travel the world, start a new business or correct their mistakes. Thats the spirit. Everyone should have a mission in life, as long as we have a desire to achieve something we have every new day with some new challenge and a very good reason to live.

I know lot of people are stuck in complicated jobs or situations where they are not really happy with their lives, my message to them is to make a plan first and write down all the stuff that you want to do in life. It could be any thing and you can write down even the craziest things that you want to do in life for eg - climbing Mt. Everest!! Yes why not. If you have ever watch Discovery channel and seen climber reaching the peak of Everest, I am sure you must have imagined yourself in there place. I have. So what stops us from achieving our goals and desires in life?? I think everyone has some desires but they don't try to achieve them because they are not confident in themselves to even try to achieve it.

So I am just listing the things that we can do to achieve our goals and dreams
1. Make a list of all the things we want in life - this could be a high level list, not a micro-level list.
2. Keep this Main list handy, paste it on your desk!
3. Review the list everyday without fail. This will remind you about your goal in life.
4. Make a sublist for every unique goal. The sublist should have the action points of things that are needed to be done to achive that goal.

By now you have done a wonderful thing. You have just created your life plan. You dont have to follow these plans rigidly, you can do modifications in it from time to time as long as it contributes to your goal.

Now comes the difficult part to follow your plan. The main problem is that people back out when they encounter any obstacle in life or they are discouraged to follow that big dream. My suggestion is to keep yourself motivated remind yourself everyday about the goal. Everyday in the morning, close your eyes and imagine yourself achieving your goal. Lets say you want to buy a big house with lawn and swimming pool, then imagine it everyday without fail. Collect pictures of your dream home and paste it everywhere you can. So the next time any obstacle comes in your life just think about your goal and you will feel little better and you will get some energy to stay on track or find a deroute :) yes if you fail once, try again, you fail then try again, but don't get emotional, you can always make little adjustments in your plan and find a different route to your goal.

I am not writing thing post as a Gyan :) I am also trying to following the above things and I will surely write more on this topic in future. If you have some ideas or suggestions then please share them in the comments. I would love to hear your thoughts on this!!

Subscribe

* indicates required

Please confirm that you would like to from Sparxsys:

You can unsubscribe at any time by clicking the link in the footer of our emails. For information about our privacy practices, please visit our website.

We use Mailchimp as our marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp's privacy practices.

Want to contact me?