Skip to content

Instantly share code, notes, and snippets.

View sangeeths's full-sized avatar

Sangeeth Saravanaraj sangeeths

  • Bangalore - India
  • 12:16 (UTC +05:30)
View GitHub Profile
@sangeeths
sangeeths / git-submodule
Last active January 2, 2016 02:29
Git commands to create and update submodules
Creating a submodule:
git clone <parent-repo-url>
cd path/to/parent/repo
git submodule add <repo-url> path/to/submodule
Initializing a submodule:
git submodule init
git submodule update
Updating a submodule:
@sangeeths
sangeeths / openssl-commands
Created January 3, 2014 18:09
To get the server certificates that are used during the HTTPS connection initiation, run the following commands
OpenSSL commands
To get the server certificates that are used during the HTTPS connection initiation, run the following commands:
openssl s_client -showcerts -connect <hostname>:<port> < /dev/null > <outfile.txt>
openssl x509 -inform PEM -in <outfile.txt> -text -out <certificatefile.txt>
openssl s_client -showcerts -connect www.google.com:443 < /dev/null > outfile
openssl x509 -inform PEM -in outfile -text -out cdata
@sangeeths
sangeeths / tar-FUC
Created January 25, 2014 12:13
Frequently Used Commands - tar
Compose a tar file:
-------------------
tar -cvf file.tar dir1/
tar -zcvf file.tar.gz dir1/
tar -jcvf file.tar.bz2 dir1/
Extract a tar file:
-------------------
tar -xvf file.tar
@sangeeths
sangeeths / git-commands
Last active April 17, 2020 11:42
Some of the most frequently required Git commands
List of pending commits to be pushed from local to remote repo
--------------------------------------------------------------
git log origin/master..HEAD
git diff origin/master..HEAD
git diff origin/feature_branch..HEAD
Branch commands:
----------------
git branch list all the branches in the local machine
git branch -a list all the branches (local + remote)
@sangeeths
sangeeths / github-to-bitbucket
Created March 10, 2014 15:24
Forking a Github repo to Bitbucket
Go to Bitbucket and create a new repository (its better to have an empty repo)
git clone git@bitbucket.org:abc/myforkedrepo.git
cd myforkedrepo
Now add Github repo as a new remote in Bitbucket called "sync"
git remote add sync git@github.com:def/originalrepo.git
Verify what are the remotes currently being setup for "myforkedrepo". This following command should show "fetch" and "push" for two remotes i.e. "origin" and "sync"
git remote -v