How to setup Git Server using Bitvise SSH

Author posted by Jitendra on Posted on under category Categories Tech Tips and tagged as Tags , , with Leave a comment on How to setup Git Server using Bitvise SSH

Step by step guide to setup Git Server using Bitvise SSH Server

Recently for one of client, I was in need to setup Git on their intranet. Being healthcare industry and compliance issue, source code could not leave company network and therefore needed in-house solution for Source Code Management (SCM) and automate builds.

In this blog post, I will explain how did we setup Git server that is accessible from anywhere in company network.

We need below two software installed on system which will act as a Git Server.

  1. Git (Free)
  2. Bitvise SSH Server (Paid )

First we need to install Git on server and add path of “git.exe” in environment variable, so that we can use git command from console.

Next, we need to install Bitvise SSH Server and set it up. Once, Bitvise SSH Server is installed, we need to follow below steps.

Step 1: Open Bitvise SSH Server control panel as shown in below image

Bitvise SSH Control Panel
Bitvise SSH Control Panel

Continue reading “How to setup Git Server using Bitvise SSH”

How to use Symbolic Link to move Google Chrome AppData folder to other location

Using Symbolic Link to move high storage folders to new location like moving Google Chrome AppData folder to other location

Few months back I bought a new high end laptop with i7 processor and 16GB of RAM. Decided to give a shot to “SSD hard disc” over conventional hard disc. Performance of my system is incredibly fast, I have SQL Server, Jenkins, Command line Dataloader jobs, Apex static code analyzer all running almost at same time. Windows OS boots up in almost 2-3 seconds only, as compared to 15-25 sec previously. However because of decision of “SSD Drive” I had to compromise storage capacity. My “C” drive is only around 150 GB however D drive has lot of space. After analyzing many folders, I found that google chrome browser creates its temporary folder in “C” drive even though I have installed it explicitly in “D” drive. I wanted to move “Appdata” folder of google chrome to “D” drive to make sure I have enough space in “c” drive.

I came across “Symbolic link” concept in operating System. In “Symbolic link” folder points to other location and its very useful technique to solve problem of storage. We can create symbolic link of many folder from “c” drive to any other location where we have good enough space.  Continue reading “How to use Symbolic Link to move Google Chrome AppData folder to other location”

Fix Git errors : Permission denied , Cannot spawn , No supported authentication methods available

Recently, I came across few errors of Git and found very time consuming to fix those. Let’s discuss what are those errors and how we can fix it.

Error : Permission denied (publickey). fatal : could not read from remote repository

Git permission denied error
Git permission denied error

This error came while trying to push changes to remote repository using ssh keys. This error means we need to provide information about SSH key. it can be done by setting environment variable GIT_SSH. Continue reading “Fix Git errors : Permission denied , Cannot spawn , No supported authentication methods available”

Using Selenium to test workflow field update action – Salesforce automated testing – Video tutorial – Part 2

We have already discussed basics of selenium and how we can use this tool for automated testing. Here we will see how we can take advantage of Selenium to test workflow field update. in this article we will create a simple workflow rule on Lead object and update “Description” field by adding fields “Number of Employees” and “Number of Locations”. We can use selenium to test if workflow is working or not ?

Salesforce Workflow rule - field update on Lead
Salesforce Workflow rule – field update on Lead

Continue reading “Using Selenium to test workflow field update action – Salesforce automated testing – Video tutorial – Part 2”

Getting started with Git and Bitbucket in 5 minutes with TortoiseGit | Video Tutorial

This is very short video tutorial which explains how easily we can use Git to manage source code on bitbucket using Tortoisegit in almost 5 minutes.

Using CCTray to monitor continuous integration setup using Jenkins for Salesforce | Video Tutorial

In previous article, I have explained that how to use Jenkins to setup Continuous integration for Salesforce.

Now, once Jenkins is up and its doing its job to build Salesforce changes. Next task is to monitor build result. We already setup post deployment task by creating chatter message to notify everyone about build result, however there is one more excellent way to be aware about result and its small desktop client named “CCTray”.

You can download CCTray from here. Once installed, follow below steps to setup.

Open CCTray and navigate to settings :

CCTray Settings
CCTray Settings

Continue reading “Using CCTray to monitor continuous integration setup using Jenkins for Salesforce | Video Tutorial”

Resolve Error : Eclipse SSH key is not matching the SSH key(s) that is associated with your Heroku account

We have seen that how to create First Heroku application using Eclipse. However it is possible that after following all steps properly in above article you may receive error saying

the Eclipse SSH key is not matching the SSH key(s) that is associated with your Heroku account. To fix this error, you can: – Associate your SSH key to your Heroku account by going to “Preferences” OR – If the SSH Key is correct, restart Eclipse

Eclipse and Heroku SSH key is not matching
Eclipse and Heroku SSH key is not matching

However, if you will login to heroku, you will find that application is already created. Error is only at Eclipse end. Continue reading “Resolve Error : Eclipse SSH key is not matching the SSH key(s) that is associated with your Heroku account”

IndexedDB – Client Side Database

Author posted by Jitendra on Posted on under category Categories HTML, Tech Tips and tagged as Tags , , with Leave a comment on IndexedDB – Client Side Database

One of many features of HTML5 is capability to store data on client machine with the help of “Indexed Database API“. Using this technique web developers can add offline capabilities to their application. Currently almost every modern browser supports “IndexedDB”.

Unlike traditional RDBMS, IndexedDB doesn’t have table or columns which supports SQL. In RDBMS, it is very hard to change structure of table once schema is decided. IndexedDB actually stores object which can be of any type. Store Object in IndexedDB and process inside Javascript, it is that simple. Every object needs to have unique Index which makes it accessing faster and efficient. Before IndexedDB, we had “Web SQL Database“. However W3C announced that it is depreciated, still few browsers continues support for Web SQL.

Lets start with Example on Indexed DB :

Very first step in IndexedDB is opening database. Below Code Sample will explain the process.

Continue reading “IndexedDB – Client Side Database”

Streaming API Using JQuery – Salesforce

Author posted by Jitendra on Posted on under category Categories Tech Tips and tagged as Tags , with 8 Comments on Streaming API Using JQuery – Salesforce

Tutorial of Streaming API in Salesforce with Source code and Demo Video – Implementation of Bayeux protocol and CometD using JQuery and JSON

Push technology is a model of Internet-based communication in which information transfer is initiated from a server to the client. Also called the publish/subscribe model, this type of communication is the opposite of pull technology in which a request for information is made from a client to the server. The information that’s sent by the server is typically specified in advance. When using Streaming API, you specify the information the client receives by creating a PushTopic. The client then subscribes to the PushTopic channel to be notified of events that match the PushTopic criteria.

In push technology, the server pushes out information to the client after the client has subscribed to a channel of information. In order for the client to receive the information, the client must maintain a connection to the server. Streaming API uses the Bayeux protocol and CometD, so the client to server connection is maintained through long polling.

The Bayeux protocol and CometD both use long polling.

  1. Bayeux is a protocol for transporting asynchronous messages, primarily over HTTP.
  2. CometD is a scalable HTTP-based event routing bus that uses an AJAX push technology pattern known as Comet. It implements the Bayeux protocol.

There is nice jQuery plugin available on web which implements Bayeux protocol and CometD.

Navigate here for Salesforce documentation for Streaming API.

Common Terms used in Streaming API:

  • Event : Either the creation of a record or the update of a record. Each event may trigger a notification.
  • Notification : A message in response to an event. The notification is sent to a channel to which one or more clients are subscribed.
  • PushTopic : A record that you create. The essential element of a PushTopic is the SOQL query. The PushTopic defines a Streaming API channel.

Example used in this article :

I want notifications about all opportunity whose status is won.
First step to implement any streaming API is to create the Push Topic, which is going to subscribed by all the clients.

Create PushTopic:

To create PushTopic, we will need the developer console of the Salesforce and assume that the name of the topic is “WonOpportunity”.

PushTopic pushTopic = new PushTopic();
pushTopic.ApiVersion = 23.0;
pushTopic.Name = 'WonOpportunity';
pushTopic.Description = 'Notify if the Opportunity won';
pushTopic.NotifyForOperations = 'All';
pushTopic.NotifyForFields = 'Referenced';
pushtopic.Query = 'Select o.OwnerId, o.Name, o.IsWon, o.Id, o.Amount From Opportunity o WHERE o.IsWon = true';
insert pushTopic;
System.debug('Created new PushTopic: '+ pushTopic.Id);
Salesforce Streaming API - Create Push topic
Salesforce Streaming API - Create Push topic

Continue reading “Streaming API Using JQuery – Salesforce”

Handling Colon in Element ID in JQuery – Visualforce problem

Resolving the JQuery error when the Element ID contains colon with Live Demo

Today i came across very known problem of jQuery and thought of sharing same with everyone. In Salesforce the element id is in the format of “j_id0:j_id3:j_id4:c_txt“. In previous post we have already discussed about getting the elementId in Visualforce.
When i tried to find the element in JQuery like $(‘#j_id0:j_id3:j_id4:c_txt’), i was getting the error on JavaScript console of the browser. After few searches, i got to know that this is known problem and faced by many of the developers.

Live Demo

Continue reading “Handling Colon in Element ID in JQuery – Visualforce problem”