Posts

Mac OSX version 10.12 - There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) - skipping

Image
This is a common issue I have seen in Mac OSX when I try to use pip. eg:sudo pip install -t lib -r requirements.txt   Could not fetch URL https://pypi.python.org/simple/google-api-python-client/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) - skipping However the reason for the problem is pip version update  with relevant to underlying OSX infrastructure. You have to identify which version of pip is there within mac OS.  Run brew install python    Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to `python3`, `python3-config`, `pip3` etc., respectively, have been installed into

Heroku Environmental Variables

Image
Heroku provide a nice solution for manage the variables within the cross environments. You can define the production variables within heroku and hide the details in .env files or keep the test data on .env files. eg: Using node js you can call these data as fallows. const stripe = require('stripe')(process.env.DATABASE_URI); With same code you can keep 2 values within  2 environments.

Schedule Task on Google Cloud (Firebase)

Image
Major difficulty I faced as a backend-developer using stripe is the automated tasks running in the back-end based on time.For an example a batch process run in night or a small intended delay within a user process. The use of javascript based delay functions cannot accept in enterprise level applications, due to high unreliability within them. For example, all the delay functions might removed within sever restart. During the search of solid solution, I found the google cloud cron jobs,  which overcome the issue without going out of google platform. Thanks for the reference: https://firebase.googleblog.com/2017/03/how-to-schedule-cron-jobs-with-cloud.html Start with prerequisites: Ensure these are available locally. git Python 2.7 Python pip Google Cloud SDK Clone the repository to a desired folder git clone https : //github.com/firebase/functions-cron Move to functions - cron folder from the command line enable gclould tool to use your project. ...

Git merge specific files to master

Image
 It is a common requirement for every developer to maintain a dev code and production seperately . Sometimes we have to merge specific files to master from dev specially when it come to bug fixing of a released module. This article describe how to achieve this impossible task in nutshell. Thanks jasonrudolph for the guide git checkout source_branch <paths>... I' m using bitbucket and if I need to merge only  kanchana branch new_product file to the master Frist you have to checkout to master Then checkout the file with the branch name (kanchana ) git checkout kanchana src/products/new_product   After that you can proceed with git commit and push as usual   

ZTE MF 667 Remove Card Lock

Image
DC Unlock is the Most populer application .But its not free. Sonic provide good chance .You can User following URL. http://ineedohelp.blogspot.com/2012/04/internet-dongle-unlock.html Fallow the interaction as it indicates .There is a major difference only on identify device .You need to select ZTE and enable DC Unlock to detect Dongle by clieck on Search. I used  this with Windows 10.

Firebase database.ServerValue.TIMESTAMP get current time

Firebase Server Time STAMP can only retive the value when it comminted to firebase database var currentTimeStamp=firebase.database.ServerValue.TIMESTAMP; value for this will be set when datbase operation like set ,push or update occures . In order to get the value you need to write code like below.   ref.child(test).child(time-stamp').set(firebaseAdmin.database.ServerValue.TIMESTAMP).then(function() {                           ref.child(test).once('value').then(function(Snapshot) {                                                          var currentTimeStamp= Snapshot.val()['time-stamp']; }); });

Firsby for Unit test Firebase REST API

Firebase required to iniciate in order to run test cases. Firsby is a api testing fromwork ,which can work with jasmine.  npm install jasmine-node -g Install frisby.js http://frisbyjs.com/ Create spec file witih spec folder Import depeldancy var request = require("request"); var server = require("./../src/test.js");   // server file var frisby = require('frisby'); Header value for every request frisby.globalSetup({ request: { headers: {'AccessToken':process.env.test_token}. // taken from the .env } }); Dependent Request frisby.create(' Login')   .post(process.env.npm_config_host+'/api/login',{.  //take the host when running test command         "profile-type": "test",         "mess-token":"" }) .after(function(err, res, body) {   frisby.create('Dome')     .post(process.env.npm_config_host+'/api/user',{           "profile-type": ...