EPOCARE

Recently was tasked with bringing up the website for a new startup named Epocare.

They are developing state of the art medical equipment that aid doctors to help treat their patients faster. They are working on a new product called Speccaflow

Checkout their website and product at epocare.in

How to scan a document directly into your HTML5, RAILS web app?

I was developing a small program for a client to help them manage their client membership data. They wanted a solution that can manage member data all in one place and send promotional communication, like SMSs and Emails.

One of the requirement to make their “onboarding workflow” easier, was to be able to scan documents using a scanner, directly from the web app.

Continue reading “How to scan a document directly into your HTML5, RAILS web app?”

Check out my new work – yesokservices.com

Yes OK Services, is a new service provider based out of Thiruvananthapuram, Kerala, India.

They offer :

  • Construction services
  • Mechanical Electrical and Plumbing services
  • Housemaid services
  • Chauffeur services
  • Security services
  • Home nurse services

They are quickly expanding their portfolio and offer opportunity for professionals who lost their jobs during the COVID-19 lockdown.

Visit them at http://yesokservices.com

Our unbearable loss

May 1st, 2020 will forever remain a dark day in my life and in the lives of my family as it was the day my dad passed. I have narrated this experience countless number of times, during his funeral, but this is for the record, how I felt.

During the COVID-19 lockdown, my dad was recovering from a Coronary Bypass Surgery that happened on December 25th, 2019. He was always an active person. He hated to sit still in one place. Working was how he rested.

True to his nature, he had returned to work long before the 90 days resting period had been complete. Though he was hasty in returning to work, he did so with care. For him, his clients and their cases were more important than taking rest. He would talk to them regularly and meet with them when his counsel was unavoidable.

Even though he had returned to work before the 90day mark, his recovery from the surgery was amazing. This fact was echoed by many of his doctors. But the COVID-19 lockdown made sure his body got the rest it deserved.

Glued to the television that was showing report after report about the COVID-19 pandemic, he found himself relaxing with his family. This was the first time after my parents’ marriage, that they were doing chores together in the house. For one whole month, my parents lived how retired people should live. Talking for hours on end, doing chores together, and relaxing. Dad understood how mom ran the house every day, when he was in his office fighting for his clients. He saw how wife kept the family together.

As the lockdown neared its end, he was getting ready to go back to office and get back to being a badass lawyer. Most of all, he was happy to get out of the house and be in his element, after being trapped inside for a long time. The Superman gets his powers from the sun, right? He cannot stay away from it forever.

One day, out of the blue, he got ill. He developed a difficulty in breathing. We ruled-out COVID-19 as he was not in contact with anybody outside the house. He had a blocked nose and symptoms of cold as well. We attributed that to the change in weather and his habit of sleeping with the Air-conditioning ON.

We talked to the doctors and as per their advice we took medications for two days to see if he was getting better. Indeed, he was getting better with the medication. But the pace was slow, and so on May 1st, we decided to go see the doctor, an E.N.T specialist.

In the hospital they took an ECG and diagnosed that he may be suffering from Left Ventricular Failure and the difficulty in breathing was caused due to this. They told me to shift him immediately to another hospital specializing in Cardiology. We took him to the Hospital where he had is Coronary Bypass Surgery.

When we reached the hospital, he was taken to the casualty from where he was referred to the airborne diseases ward, as per COVID-19 guidelines. Any patient showing symptoms of respiratory illness should be cleared negative by the COVID-19 tests before moving on to the respective departments. Even bystanders were not allowed to see the patient easily, once the patient was admitted into the airborne diseases ward. I was waiting outside the ward and due to hospital policy surrounding COVID-19.

We talked to the doctors. They discussed with doctors from the cardiology department and the people who performed his bypass surgery. Meanwhile, they had stabilized the patient. My family had also arrived by then, ready for dad’s hospitalization. He had to shifted to the ICU for further investigations and treatment.

After the decision was made, dad asked to see me and for a drink of water. I got a bottle of water and went inside to see him. He asked me, “They are saying I need to be admitted. Will that do any good?”.

I was not sure how to answer that, knowing that he hated to be hospitalized, and he hinted to mom before, that if his condition recurs or worsens, he does not wish to be hospitalized again.

“Of course, admitting to ICU will do good. It’s like apples and oranges. Admission has its advantages.”. I replied.

“Do not worry, I am right here, and mom and brother was waiting right outside”, I continued. The nurses took the bottle of water from me and asked me to wait outside.

After a little while, they called me again to let me know that they are moving him to the ICU, and we can see him in front of the ICU. Through the door, while talking, I could see that they were preparing dad for the shifting. They put a protective plastic cover around him to keep him safe from infections, or keep the outside safe from any infections he may have.

I ran to the ICU, but was waylaid by elevators being cleaned. I had run up the stairs, and by the time I reached the ICU door, dad was already inside and I waited outside the ICU door.

After a short while, I was called inside by the physician. He told me, dad’s condition deteriorated severely as he reached the ICU. They are not sure what went wrong, and he said, dad’s heart is not in a satisfactory state and that expectations are zero. He went back inside and I went cold.

Standing by the ICU door then, for the first time in my life, I did not know what to do. As some sort of reflex, I took my phone out, unlocked it, opened the phone app to call someone and my brain froze then. It could not figure out what to do next.

The doctor came out again in a short while (or a long while, I lost track of time by that point) and said “His heart is refusing to be stable, it crashes after we revive it.”. He might have understood from my empty stare, that I was zoned out. He asked me whether I was alone. My brain had switched to autopilot and replied, “My mom and brother are here. They are outside the building. Please arrange for them to come up here and see dad”.

The doctor made the necessary calls and let my family inside the building.

I called my brother on the phone and told him “Come up with mom. There is something wrong”. They came up and saw me standing there in drenched in horror and disbelief. The doctor had come out again and told us to go inside with him to see dad. Though the autopilot knew dad was gone, the hopeful part was still hoping for a miracle. Some magical occurrence by which dad was alive and well.

I saw my dad was laying on the ICU bed motionless. I knew his soul had left, his body was cold. The ECG machine read an almost perfectly flat line. My eyes were soaked as I walked towards him. My brother was the first to touch his feet and say his goodbyes. I waited with my palms together in prayer.

Once my brother was done with his goodbyes, I touched his feet and told him, “You should have waited just a little while longer. There is so much I want to ask you and tell you. You should have waited a little while longer. I love you and I miss you. Be safe and take care dad.”

After the body was brought home and the funeral was done, the days sped away and today is the 23rd of May 2020. Ever since my dad left us, when I am alone, I talk to him, hoping that my brain has enough memories of him to construct an imaginary dialogue in my head.

I realize that death is a part of life, an end that brings meaning to the days that a person were alive. At the time of death, those who are touched by the soul of the departed will come and share the grief. Everyone will share stories and lessons they learned from the deceased. I love hearing stories of my dad from friends of his and family members. How dedicated he was to his job and how loving and caring he was, in his own quirky ways.

After this many days of his passing, I realize, along with the big things I miss about him, I miss the little things just as much. How he called me, How he would respond to situations, the exclamations he would make, his laughter, the way he talked to his clients, etc.

Above all, I will miss his absolutely positive vibe, his awesome smile and the way he would make us feel comfortable and happy with his words and affection.

I love my dad and I miss him. The legend, the badass lawyer, Superhero to his clients and me. He left some pretty big shoes to fill, and we will try our best to make him proud.

To my dad, I want to say,

“Until we meet again, Ciao!”

Wi-Fi download speeds are slow in Manjaro Linux (Kernel 5.6) with Intel 8265 Wireless Chipset ( SOMETIMES )

[UPDATE: ] It turns out that fix did not improve or hamper the performance of the WiFi downloads. More testing showed that there some sites worked well even when download speeds are very less. Speedtest would just flat out refuse to run. It will not go past the “Ping” subtest. Right after Speedtest failed ( ie, I waited for download test to start, but it did not), I checked YouTube and it was working just fine.

I tried with other sites for checking speed. Google’s own speedtest stated I have 0.10Mbps but YouTube buffered flawlessly 1080p videos.

This is unusual.. I tested some more with my Office WiFi network and everything seems to be in order. So I am chalking this one up to a lousy internet connection and nothing to do with my WiFi Adapter.

But one thing still remains a mystery. When the connection overall download speed is less ( manual file downloads from Google Drive, random HTTP downloads, Manjaro Updates, website loading performances ) why does speedtest on my phone show high speeds and also, why does YouTube still work?

Read on below for the full story.

So,

I have been recently been plagued with bad Wi-Fi speeds on my Ryzen Laptop. It’s not always a problem but sometimes, it bugs the hell out of me.

Continue reading “Wi-Fi download speeds are slow in Manjaro Linux (Kernel 5.6) with Intel 8265 Wireless Chipset ( SOMETIMES )”

Uninitialized constant User::Leafe

Hi guys,

I was writing a ruby on rails app and while doing the test cases, I came across a situation where the test cases failed with an error

uninitialized constant User::Leafe

Now, there is no typo in my code. I have a User model and a User can have many Leaves. So I had added associations to the rails User model.

has_many :leaves, :dependent => :destroy

While searching around Stackoverflow, I found this solution here

It details that Inflections in rails assumes that singular form of “leaves” is “leaf”. It also detailed the solution as adding an irregular inflection to the inflection initialisers to solve this.

So, add the following to the file, config/initializers/inflections.rb

ActiveSupport::Inflector.inflections do |inflect|
   inflect.irregular 'opening_leave', 'opening_leaves'
end

This fixed the problem. It is weird that Ruby on Rails does this, but more digging lead me to a documentation page here

This states that due to the fact that legacy applications may still use errant inflections, new patches that fixes errors in conversions done by the “inflector” in rails are not being done. For every error we observe, we have to provide the correct inflection rule in our ruby on rails app.

 

Gnome does not lock screen

Recently I have been facing an issue where my Laptop does not auto lock when the lid was closed. It would let anyone who opens my laptop to use it where I left off.

The auto screen lock setting in gnome settings was turned on and it was working till a couple of days ago. I am guessing one of the updates screwed it up. When I open the auto screen lock settings in the gnome settings page, the auto lock is set to “on” but the whole page is greyed out. I cannot turn it off or change other properties.

I did some digging around and was able to find this thread. https://bbs.archlinux.org/viewtopic.php?id=227258

The steps mentioned there helped me solved it.

1) Open dconf-editor

2) Goto org > gnome > desktop > lockdown

3) Look for a property named “disable-lock-screen”

4) If it is set to “true” then the screen will not lock.

5) Change it to “false”

Screen lock should work now. I have to figure out what was causing this in the first place. Will update once I do.

Ciao

Geolocation error in Firefox

EDIT: In latest version of Firefox, the config entry name that needs to be updated is “geo.provider.network.url” and not “geo.wifi.uri”. I have updated the post below to reflect the same.

I have been facing an issue recently where HTML5 Geolocation is not working for any sites. I am using Firefox 73.0.1 and have the same issue in older versions of Firefox also.

I did some digging around, trying to figure out why this is happening and I stumbled upon a bug report, which states that the way Firefox figures out the geolocation of the user is by using a Google API and that recently there has been some changes in the way that API works. This is causing all requests to this API to return an error.

The following helped me resolve the issue. Though geolocation is now working, its not returning Exact location.

Still, its better than nothing.

  1. Open a new tab in Firefox.
  2. Visit the URL “about:config” (without the quotes of course)
  3. Search for config entries starting with “geo”
  4. Look for an entry with name “geo.provider.network.url”
  5. The setting has the value that looks like “https://www.googleapis.com/geolocation/v1/geolocate?key=%GOOGLE_LOCATION_SERVICE_API_KEY%”
  6. Copy this out and save it safely somewhere.
  7. Then change the entry into “https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY%”
  8. Press enter and save the setting.
  9. Reboot Firefox and try again.

How to remove an accidental commit of a large file

I frequently commit large files into my development branch like log files and binary files by accident.

I always end up needing to do a google search for how to resolve and subsequently end up forgetting what it is I have done.

Here is a simple way to remove a large from a git repo.

git filter-branch --force --index-filter \
  'git rm --cached --ignore-unmatch path/to/large_file.log' \
  --prune-empty --tag-name-filter cat -- --all

Parallel Testing in Rails 6

If anyone is having trouble running parallel tests in their shiny new rails 6 applications and if you are getting the following error:

Error:
Mysql2::Error::ConnectionError: Access denied for user 'user'@'localhost' to database 'Users_test-0'

Error:
Mysql2::Error::ConnectionError: Access denied for user 'user'@'localhost' to database 'Users_test-1'

Please make sure the database user you are using to run the tests, ie. the user details given in the config/database.yml file for testing, MUST have ‘create database’ permission for the tests to run successfully since, the parallel tests in Rails 6 dynamically creates new databases per parallel test worker.

Doing the following helped me:

GRANT ALL PRIVILEGES ON * . * TO 'user'@'localhost' identified by 'password';

You can give the specific permission to the user to be more secure, but for development purposes the above should be enough.