Friday, October 26, 2018

How to configure ssh login with out password in Mac OS X and Linux


When ever we want to connect to remote server (or) host using SSH we will provide the host name after it prompt for password. If we follow the below step it won't ask for the password on each time.
ssh password less login


STEP 1 - Generating the key pair

Create your set of keys:
Start up the Terminal application and run:
ssh-keygen -t rsa -b 4096



STEP2 - Copy Generated public to our remote server


Copy the newly created public key to the SSH server(s) you need to auto login into by using your favourite transport method.

Please be careful not to overwrite ~/.ssh/authorized_keys if it already exist! This is how I personally copy the key, might not be your preferred method:

If authorized_keys exist:
cat ~/.ssh/id_rsa.pub | ssh username@example.com "cat - >> ~/.ssh/authorized_keys"
If authorized_keys does not exist:
scp ~/.ssh/id_rsa.pub username@example.com:~/.ssh/authorized_keys


Check your file permissions. A lot of different *nix system is picky when it comes to permissons. Setting your .ssh directory to 0700 and .ssh/authorized_keys to 0600.

  chmod 0700 ~/.ssh
  chmod 0600 ~/.ssh/authorized_keys

Tuesday, May 29, 2018

Read the data from server using Backbone js collection fetch data







Linux-Shell Script to Move to specific folder using "cd" command




Shell scripts are run inside a subshell, and each subshell has its own concept of what the current directory is. The cd succeeds, but as soon as the subshell exits, you're back in the interactive shell and nothing ever changed there.

To Resolve that we use bash command. 




#!/bin/sh
#!/bin/bash

cd "/opt/azw/webapp/src/";
bash



Thursday, January 4, 2018

To pull specific directory with git


To pull specific folder from git repository or git repo

mkdir directoryName
cd directoryName
git init
git remote add origin -f <>
git config core.sparsecheckout true
echo / >> .git/info/sparse-checkout
git pull origin master




Monday, October 16, 2017

Python Cheat Sheet

Python Cheat Sheet





Friday, October 6, 2017

Connect to Microsoft SQL Server Using PHP

Connect to Microsoft SQL Server Using PHP


Below Code will connect to the Microsoft Sql Server using php script.