Docker Cheat sheet, a general cheat sheet for all use case

Docker general Help - docker COMMAND --help This is for each command’s detail For example, docker run --help TL;DR docker run <image> - to initialize a new container docker start <container_name> start running the “stopped” container docker stop <container_name> docker run - Initialize a container Run a command in a new container Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...] Basic form to initialize a container, or to run a command...

January 8, 2023 · 9 min · Derry

Curl cheat sheet, for web developement

HTTP Request Specify Method by -X Form: curl -X <METHOD> <URI> By default, it uses GET method curl https://www.google.com/ # same as curl -X GET https://www.google.com/ Use Post simply by: curl -X POST https://www.example.com/ GET Get entire document of the website in terminal curl https://www.google.com/ POST curl -X POST https://example.com/ More complex, pass data, -d and header -H to server. Below shows POST with json body curl -d '{"option": "value", "something": "anothervalue"}' \ -H "Content-Type: application/json" \ -X POST https://example....

December 18, 2022 · 1 min · Derry

Git - What Is Origin in Git Push Origin Main

What is origin in git push origin main? The origin is a convention. It’s an alias, short for what we see from the output of git remote -v. You can name it whatever you want. You can think of it as where this code is “originated” from. git remote -v # output origin git@github.com:derrykid/workongit.git (fetch) origin git@github.com:derrykid/workongit.git (push) Set the remote URL as origin and upstream Whenever we pull the code from remote repository, it flows downstream....

November 12, 2022 · 1 min · Derry

Linux Archive and Compress Command Tar Gzip

Archive vs compress As a former Windows user, I didn’t have much knowledge about file archiving and file compression. Like most PC users do, I simply collect the files we want to compress and right click the folder to compress then. The output compressed files are, without a doubt, mostly likely to be extension .zip or .rar files. However, when I switch to Linux, things changed. As on the road of knowing more commands, we inevitably go across files extensions ending like ....

November 4, 2022 · 4 min · Derry

Git Cheatsheet

I learn git from this interactive tutorial. I take note along the way while I was doing it. Learn git visual Commit to repo We was on C1 commit git commit Branch new branch git branch <name> change branch git checkout <name> create a new branch and check it out It can be shorthand: git checkout -b <name> merge Now we are working on main branch We are going to merge the branch bugFix into main...

June 27, 2022 · 5 min · Derry