From 5f2a9496f72b363f2a314c7f763195e1671d70bd Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Tue, 11 Oct 2022 19:45:21 +0400 Subject: [PATCH] Add content for vmstat --- .../101-live-in-terminal/109-vmstat.md | 8 +++++++- package.json | 1 - scripts/pr-review.sh | 16 +++++----------- scripts/squash-merge.sh | 9 +++++++++ 4 files changed, 21 insertions(+), 13 deletions(-) create mode 100755 scripts/squash-merge.sh diff --git a/content/roadmaps/102-devops/content/102-managing-servers/101-live-in-terminal/109-vmstat.md b/content/roadmaps/102-devops/content/102-managing-servers/101-live-in-terminal/109-vmstat.md index e539733dd..90f90bd66 100644 --- a/content/roadmaps/102-devops/content/102-managing-servers/101-live-in-terminal/109-vmstat.md +++ b/content/roadmaps/102-devops/content/102-managing-servers/101-live-in-terminal/109-vmstat.md @@ -1 +1,7 @@ -# Vmstat \ No newline at end of file +# Vmstat + +`vmstat` (**V**irtual **M**emory **Stat**istics) is a performance monitoring command. It is used to obtain information about memory, system processes, paging, interrupts, block I/O, disk, and CPU scheduling. Users can observe system activity virtually in real time by specifying a sampling period. + +Useful Links +vmstat man page +vmstat tutorial diff --git a/package.json b/package.json index 71d0e76bd..3aba7cc9e 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,6 @@ "private": true, "license": "BSD-4-Clause", "scripts": { - "review": "./scripts/pr-review.sh", "dev": "next", "serve:out": "serve out", "build": "./scripts/build.sh", diff --git a/scripts/pr-review.sh b/scripts/pr-review.sh index 2ef18e1ce..15384fad4 100755 --- a/scripts/pr-review.sh +++ b/scripts/pr-review.sh @@ -15,16 +15,10 @@ require jq require gh require fzf -# get the list of open pull requests -prs=$(gh pr list --json number,title --limit 100 | jq -r '.[] | "\(.number) \(.title)"') +prd="$(gh pr list --json 'number,title' | jq -r '.[]| [.number, .title] | @sh' | column -t -s"'" | fzf)" +[ -z "$prd" ] && echo "No PR selected" && exit 0 -# select a pr -pr=$(echo "$prs" | fzf --prompt="Select a PR: " --height=50% --reverse --preview="gh pr view {1} --json 'files' | jq -r '.files|map(.path)|.[]'") +pr_id="$(echo "$prd" | awk '{print $1}')" -# get the pr number -pr_number=$(echo "$pr" | awk '{print $1}') - -[ -z "$pr_number" ] && echo "🛑 No PR selected" && exit 1 - -echo "Checkout PR: $pr_number" -gh pr checkout "$pr_number" +gh pr view "$pr_id" --json "files" | jq -r '.files|map(.path)|.[]' +gh pr checkout "$pr_id" diff --git a/scripts/squash-merge.sh b/scripts/squash-merge.sh new file mode 100755 index 000000000..71b1868e8 --- /dev/null +++ b/scripts/squash-merge.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +set -e + +git reset --soft HEAD~$(git rev-list --count HEAD ^master) +git checkout master +git add -A +git commit -m "$1" +