Skip to content

Instantly share code, notes, and snippets.

@mshRoR
mshRoR / ubuntu-command.txt
Last active Apr 27, 2020
Important ubuntu comamnds
View ubuntu-command.txt
# Refresh ubuntu keys server
$ sudo apt-key adv --refresh-keys --keyserver keyserver.ubuntu.com
# Group permission change
$ sudo chgrp -R root esdata
# Add current login User ID to .bashrc or .zshrc file
$ echo "export UID=$UID" >> ~/.bashrc
or
$ echo "export UID=$UID" >> ~/.zshrc
@mshRoR
mshRoR / docker-permission.txt
Created Apr 8, 2020
How to fix docker: Got permission denied issue
View docker-permission.txt
If you want to run docker as non-root user then you need to add it to the docker group.
1. Create the docker group if it does not exist
$ sudo groupadd docker
2. Add your user to the docker group.
$ sudo usermod -aG docker $USER
3. Run the following command or Logout and login again and run (that doesn't work you may need to reboot your machine first)
$ newgrp docker
4. Check if docker can be run without root
$ docker run hello-world
@mshRoR
mshRoR / important-git-repo-link.txt
Last active Jan 18, 2020
important-git-repo-link
View important-git-repo-link.txt
View k8s-setup.txt
MiniKube Setup:
1. https://kubernetes.io/docs/tasks/tools/install-minikube/
2. https://kubernetes.io/docs/tasks/tools/install-kubectl/
KOPS Setup for production:
http://github.com/kubernetes/kops
@mshRoR
mshRoR / code-quality.md
Last active May 8, 2019
writing code quality behavior key notes.
View code-quality.md

Then the code you write should have the following qualities. Code should be

  • Transparent The consequences of change should be obvious in the code that is changing and in distant code that relies upon it
  • Reasonable The cost of any change should be proportional to the benefits the change achieves
  • Usable Existing code should be usable in new and unexpected contexts
  • Exemplary The code itself should encourage those who change it to perpetuate these qualities

Code that is Transparent, Reasonable, Usable, and Exemplary (TRUE) not only meets today’s needs but can also be changed to meet the needs of the future. The first step in creating code that is TRUE is to ensure that each class has a single, well-defined responsibility.

@mshRoR
mshRoR / django2.1-python3.7-pipenv-installing-command.txt
Last active May 13, 2020
python 3.7 | pip3 | pipenv | django 2.1 installing commands in ubuntu 16.04
View django2.1-python3.7-pipenv-installing-command.txt
## python 3.7 install
-> sudo apt update
-> sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget
-> sudo apt install software-properties-common
-> sudo add-apt-repository ppa:deadsnakes/ppa
-> sudo apt update
-> sudo apt install python3.7
-> python3.7 --version
## pip3 install
@mshRoR
mshRoR / rename_git_branch.txt
Last active May 11, 2018
Rename a local and remote branch in git
View rename_git_branch.txt
1. Rename your local branch.
If you are on the branch you want to rename: git branch -m new-name
or If you are on a different branch: git branch -m old-name new-name
2. Delete the old-name remote branch and push the new-name local branch.
git push origin :old-name new-name
3. Reset the upstream branch for the new-name local branch.
Switch to the branch and then: git push origin -u new-name
@mshRoR
mshRoR / miserables.json
Created Apr 16, 2018
d3 graph demo data
View miserables.json
{
"nodes": [
{"id": "Myriel", "group": 1},
{"id": "Napoleon", "group": 1},
{"id": "Mlle.Baptistine", "group": 1},
{"id": "Mme.Magloire", "group": 1},
{"id": "CountessdeLo", "group": 1},
{"id": "Geborand", "group": 1},
{"id": "Champtercier", "group": 1},
{"id": "Cravatte", "group": 1},
@mshRoR
mshRoR / rails http status codes
Created Dec 26, 2017 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
View rails http status codes
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
@mshRoR
mshRoR / install.sh
Created Jul 16, 2017 — forked from wdullaer/install.sh
Install Latest Docker and Docker-compose on Ubuntu
View install.sh
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"