Why do exercise in office hours?

When most of us sit continuously for long hours at work. Long hours of sitting is bad for health ,therefore it is advisable to do some walk and excercise to remove the stress and improve the health outcomes.

Excercise could be very simple and all have a purpose – look away from screen, reduce stress level and perform some muscle relaxing activities.

  1. Close eyes for 1 minute and do nothing.
  2. Walk every 2nd hours for 5 minute
  3. Turn necks left and right slowly to relieve neck pain.
  4. Stretch leg and relax muscle. 
  5. Stretch arms 
  6. Twist body to relieve back pain

Beside it, consume water at regular interval.

Why you should use sqlite as portable database

Most of time when we need some tasks to run for long hours in a loop, sqlite is ideal solution to use as a database.

  1. sqlite is available in most of system. No need to install big binary files.
  2. You can easily use it with multiple programming language using simple apis.
  3. You can transport it as file to other system. No need to export and import files to recreate the same
    I use sqlite too much in smaller long running batch tasks to store data and use across different cli apps. I can run this on smallest and tiniest machine easily

Why deploy nginx as most preferred proxy server?

Nginx define itself as open-source, high-performance HTTP server and reverse proxy engine. It is simple to configure proxy server, effective load balancer. 
Nginx is super easy to configure. Multiple types of proxy configuration is possible – round robin, least connected , ip bound , fail over connection, path based.

It is easy to host a rails app on mail domain and wordpress on /blog path. Run an analytic engine using R (shiny apps) and do some smart system tasks using python backend.

nginx is free and open source . It is much robust than apache and first choice for proxy. I love it when need to operate a bunch of service varied by different type of services .

What is mobile first indexing and why adhere to it?

Mobile first Indexing (MFI) is now becoming to core of search snippets because mobile search in increasing ( voice + text ) . It is highly recommended to shift focus on mobile first and mobile friendly content. 

Use adaptive layout(responsive layout) with similar static content . More interactive content could be loaded over ajax. Proper usages of schema will content of your pages to be index smoother. 

Schema are data-points embedded in your page. Separate business logic, business data and business presentation separate , so any crawler could easily evaluate the source code and map useful data instantly. Schema is for carry data , independent of visual representation.

Outcome of this message is – 

  1. Make mobile first strategy ( UI + UX)
  2. Use Schema to embed data in your page
  3. Static version (initial load) content should be closely identical.

How to access currently logged in user data in Laravel ?

To achieve this info, you need to follow the laravel Documentation .  Visit https://laravel.com/docs/5.6/authentication#retrieving-the-authenticated-user

Use laravel facade to achieve this 

use Illuminate\Support\Facades\Auth;

// Get the currently authenticated user...
$user = Auth::user();

// Get the currently authenticated user's ID...
$id = Auth::id();

How do I know if I am having a heart attack?

There are some early signs those could lead to heart attack in upcoming future . These signs are chest pain with following type of features

  1. Tightness
  2. Discomfort
  3. Crushing Pain
  4. Heaviness
  5. Burning  

The pain develop from chest and spread to nearby parts like shoulder,neck,jaw or to arms. Shortness of breath is also a clear sign of future heart attack. 

It is always advisable to keep an eye on health indicators ,so you can avoid multiple problems by diagnosing them during early stage

How to improve python requests module with retries and timeouts

I found this useful article at https://www.peterbe.com/plog/best-practice-with-retries-with-requests

Most of time, It will be useful to retry the requests so request loop could be process successfully.

While accessing any webpage, there may be different types of timeout. 

Connection timeout => Time taken to identify the resolved ip and connect to them

Read timeout => Time taken to get response from connected server. If this take longer time, then will be read timeout

connect_timeout, read_timeout = 5.0, 30.0
response = requests.get(URL, timeout=(connect_timeout, read_timeout))