Programming notes, instructions, commands, snippets etc.
- MongoDB
- Git
-
Download MongoDB from https://www.mongodb.org/
-
Extract the contents of the zip file into C:\mongodb
-
Add MongoDB in windows path. Edit your environment variable. Append this: C:\mongodb\bin;
-
Create a configuration file C:\mongodb\mongod.conf and add these lines:
dbpath=C:\mongodb\data\db
logpath=C:\mongodb\log\mongo.log
verbose=vvvvv
Note: you have to manually create both c:\mongodb\data\db and c:\mongodb\log directory.
- Open commad prompt as administrator and run the following commands:
mongod -f c:\mongodb\mongod.conf
mongod -f c:\mongodb\mongod.conf --install
- Start MongoDB
net start mongodb
From now on mongodb service will run automatically every time the PC is restarted.
$ git config --global user.name "<your_name>"
$ git config --global user.email "<your_email>"
$ git config --global core.editor "<e.g vim>"
$ git config --global core.ignorecase false
$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
# Copy SSH key into the clipboard
# For Windows: $ clip < ~/.ssh/id_rsa.pub
# For Linux: $ xclip -sel clip < ~/.ssh/id_rsa.pub
# For OSX: $ pbcopy < ~/.ssh/id_rsa.pub
# Adding a remote
git remote add origin <remote_url>
#Updating a remote
git remote set-url origin <remote_url>
# Determine the url that a local git repo cloned from
git remote show origin
# Create new branch and checkout
git checkout -b <branch_name>
#Delete a branch from local
git branch -d <branch_name>
#Delete a branch from remote origin
git push origin --delete <branch_name>
#Throw away local commits in Git
git reset --hard origin/<branch_name>
# Adding & pushing a tag
git tag -a <tag_name> -m "<message>"
git push origin <tag_name>
# Deleting a tag
git tag -d <tag_name>
git push origin :refs/tags/<tag_name>
# History of a moved file
git log --follow <file_name>
# Show Log Graph
git log --oneline --graph
git reflog
The MIT License Copyright © 2016 Shibbir Ahmed