Skip to content

Instantly share code, notes, and snippets.

View DharmendraRathor's full-sized avatar
🎯
Focusing

Dharmendra Rathor DharmendraRathor

🎯
Focusing
View GitHub Profile
@DharmendraRathor
DharmendraRathor / spark_submit_configuration.sh
Created October 4, 2019 19:09
Spark submit partition and memory configuration
--conf spark.driver.memory=8G --num-executors=2 --executor-memory=14G --executor-cores=2
Explanation
@DharmendraRathor
DharmendraRathor / date_trimming_in_pyspark_datafarme.sh
Created October 4, 2019 19:06
How to trim minutes and seconds from date filed in Pyspark datarame
How to trim minutes and seconds from date filed in Pyspark datarame.
Different apporaches to do that
Input : 2019-01-31 23:16:28
output : 2019-01-31 23:00:00
Not effecient
df.withColumn('tpep_pickup_datetime', concat(df.tpep_pickup_datetime.substr(0, 13), lit(‘:00:00’)))
@DharmendraRathor
DharmendraRathor / CreateBranchFromGitCommit
Created July 25, 2018 00:24
Create new Git branch from Git commit
Create new branch from git commit withouth checkingout new branch
git branch newBranchName <commit-id>
Create new branch from git commit with checkingout new branch
git checkout -b newBranchName <commit-id>
@DharmendraRathor
DharmendraRathor / GitCherryPicking
Created July 25, 2018 00:14
Get Cherry picking commit
Git Cherry Picking
if you have to cherry pick commit from one branch to another in Git repository with Commit id.
git cherry-pick <commit-id>
eg git cherry-pick ...31ff5e.....
@DharmendraRathor
DharmendraRathor / gist:52b9e1abdc0af9e89964e383afda140d
Created June 7, 2018 20:50
Create branch from Tag in Github
git checkout -b <branchName> <tagName>
@DharmendraRathor
DharmendraRathor / txt
Created May 7, 2018 19:05
GIT_Important
How to view git remote url or remote branch details.
git remote show <branchName>
eg git remote show origin
@DharmendraRathor
DharmendraRathor / Java_Keytool_Commands.txt
Created May 1, 2018 03:02
Important Java Keytool commands
Check certificate details
keytool -list -v -keystore keystore.jks
@DharmendraRathor
DharmendraRathor / Git_ReplaceMasterWithNewBranch.txt
Last active May 3, 2018 04:19
Replace branch with master branch in git
You have branch having latest changes “latestBranch” and if you want to override master with latestBranch changes.
Use following commands
1. Checkout latestBranch.
git checkout latestBranch
2. Merge latestBranch with master with strategy as ours. Current branch changes will be used in case of conflicts.
git merge -s ours master
3. Checkout master branch.
@DharmendraRathor
DharmendraRathor / Git_MoveBranchbetweenRepository.txt
Last active May 3, 2018 04:19
Moving branches/tags from one git repository to another
A Moving branches/tags from one git repository to another
1. Clone existing git repo (source repository)
git clone --mirror <source git url>
eg
git clone --mirror [email protected]:source/source.git
2.
got to <folder with name of repo>