Posts

Showing posts from November, 2018
Git basics [Alias]      lg = log --graph --pretty=format:'%Cred%h%Creset %ad %s %C(yellow)%d%Creset %C(bold blue)<%an>%Creset' --date=short      hist = log --graph --full-history --all --pretty=format:'%Cred%h%Creset %ad %s %C(yellow)%d%Creset %C(bold blue)<%an>%Creset' --date=short   git log --oneline --graph --all --decorate Do you want to hide your silly mistakes before pushing your changes? If so,  git pull --rebase  is perfect. It allows you to later squash your commits to a few (or one) commits. If you have merges in your (unpushed) history, it is not so easy to do a  git rebase  later one. I personally don't mind publishing all my silly mistakes, so I tend to merge instead of rebase. If you have a ton of small merge commits, it's easy to lose focus of the bigger picture that's happening in your history. This is actually the only time I do rebasing(*), and the rest of my workfl...
Docker basic commands everyone should know ### basic commmands ### docker pull ubuntu //just pull docker run image_name or id // pull and run docker images docker ps docker ps -a docker rm con_name docker rm e01 er2 // few letters are enough docker rmi image_name //  containers should be stopped docker stop container_id // or name docker start container_id // date persists docker run -d --name my_container_name ubuntu sleep 10 // -d background docker exec container_id cat /etc/*release* //exec command on running container (detached) docker run -it ubuntu bash // -it will login ; i will enable stdin cat /etc/*release* docker run jenkins ... some process So you have to stop this container in another tab so docker run -d jenkins // detached mode Now attach to the terminal using docker attach container_id docker run -i myapp // so that it listens to the input or wait for the input docker run -p 6000:80 mysql // check port 80 or what on docker file docker...