Skip to content

Instantly share code, notes, and snippets.

View stenvix's full-sized avatar
💻
Coding

Valentyn Stepanov stenvix

💻
Coding
View GitHub Profile
@stenvix
stenvix / gist:fec2831f77d34c51bfd7302210fb710c
Created July 13, 2016 10:08 — forked from stuart11n/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@stenvix
stenvix / gist:f6900b0b35cc5e01c4f95c52ca761d14
Created July 8, 2016 13:51 — forked from tamoyal/gist:10441108
Create super user and database user in Mongo 2.6
# Create your superuser
$ mongo
> use admin
> db.createUser({user:"someadmin",pwd:"secret", roles:[{role:"root",db:"admin"}]})
> exit
# Alias for convenience (optional and at your own risk)
$ echo 'alias mongo="mongo --port 27017 -u someadmin -p secret --authenticationDatabase admin"' >> ~/.bash_profile
$ source ~/.bash_profile