git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
| # Basic Syntax | |
| x = 1 | |
| y = "Hello" | |
| BEGIN { | |
| puts "Start the thing" | |
| } | |
| END { | |
| puts "End the thing" |
| #!/bin/bash | |
| git clone https://github.com/wurstmeister/kafka-docker.git | |
| cd kafka-docker | |
| # Update KAFKA_ADVERTISED_HOST_NAME inside 'docker-compose.yml', | |
| # For example, set it to 172.17.0.1 | |
| vim docker-compose.yml | |
| docker-compose up -d |
| # local_k8s.sh https://github.com/kubernetes/kubernetes.git master v1.20.2 | |
| # Install Docker | |
| cd /tmp | |
| # Install Docker | |
| apt-get update | |
| apt-get -y install make docker.io | |
| systemctl enable docker |
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.
git revert {commit_id}'
Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:
| curl -s \ | |
| --form-string "token=$1" \ | |
| --form-string "user=$2" \ | |
| --form-string "title=$3" \ | |
| --form-string "sound=none" \ | |
| --form-string "message=$4" \ | |
| https://api.pushover.net/1/messages.json |
| package main | |
| import ( | |
| "context" | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "time" | |
| ) |
export NODE1=127.0.0.1
docker volume create --name etcd-data
export DATA_DIR="etcd-data"
export REGISTRY=quay.io/coreos/etcd
docker run -d \
-p 2379:2379 \
-p 2380:2380 \
--volume=${DATA_DIR}:/etcd-data \
$ export PUBLIC_IP=54.196.167.255
$ docker run -d -p 8001:8001 -p 5001:5001 quay.io/coreos/etcd:v0.4.6 -peer-addr ${PUBLIC_IP}:8001 -addr ${PUBLIC_IP}:5001 -name etcd-node1
$ docker run -d -p 8002:8002 -p 5002:5002 quay.io/coreos/etcd:v0.4.6 -peer-addr ${PUBLIC_IP}:8002 -addr ${PUBLIC_IP}:5002 -name etcd-node2 -peers ${PUBLIC_IP}:8001,${PUBLIC_IP}:8002,${PUBLIC_IP}:8003
$ docker run -d -p 8003:8003 -p 5003:5003 quay.io/coreos/etcd:v0.4.6 -peer-addr ${PUBLIC_IP}:8003 -addr ${PUBLIC_IP}:5003 -name etcd-node3 -peers ${PUBLIC_IP}:8001,${PUBLIC_IP}:8002,${PUBLIC_IP}:8003
$ curl -L $PUBLIC_IP/v2/stats/leader