This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const lineConfig = { | |
| channelAccessToken: 'XXXXXXXXXXX', | |
| channelSecret: 'XXXXXXXXXXX' | |
| }; | |
| const crypto = require('crypto'); | |
| const channelSecret = lineConfig.channelSecret; | |
| app.post('/webhook', line.middleware(lineConfig), (req, res) => { | |
| // 給 LINE 的 body 要是 string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| View: Pods(<namespace>)[number of pods listed] | |
| NAME pod name | |
| READY number of pods in ready state / number of pods to be in ready state | |
| RESTARTS number of times the pod has been restarted so far | |
| STATUS state of the pod life cycle, such as Running | ... | Completed | |
| CPU current CPU usage, unit is milli-vCPU | |
| MEM current main memory usage, unit is MiB | |
| %CPU/R current CPU usage as a percentage of what has been requested by the pod | |
| %MEM/R current main memory usage as a percentage of what has been requested by the pod |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # file /home/user/gpg-no-tty.sh | |
| #!/bin/bash | |
| /usr/bin/gpg --batch --no-tty "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env node | |
| /** | |
| * Grafana Dashboard Screenshot | |
| * | |
| * Derived from https://github.com/sindresorhus/capture-website/blob/v0.8.0/index.js | |
| * by @sindresorhus (MIT). | |
| */ | |
| const fs = require('fs'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -x | |
| default_k3d_cluster=$(k3d cluster list --no-headers | awk '{print $1}') | |
| export KUBECONFIG=$(k3d kubeconfig write ${default_k3d_cluster}) | |
| kubectl cluster-info |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Databricks notebook source | |
| import org.apache.spark.sql.{SparkSession} | |
| import org.apache.spark.sql.functions._ | |
| // Create Spark Session | |
| val spark = SparkSession.builder().master("local") | |
| .appName("Rate Source") | |
| .getOrCreate() | |
| val df = spark.readStream.format("rate") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Recording Rule Example 1 | |
| ================================ | |
| # Aggregating up requests per second that has a path label: | |
| - record: instance_path:requests:rate5m | |
| expr: rate(requests_total{job="myjob"}[5m]) | |
| - record: path:requests:rate5m | |
| expr: sum without (instance)(instance_path:requests:rate5m{job="myjob"}) | |
| Recording Rule Example 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -Eeuo pipefail | |
| trap cleanup SIGINT SIGTERM ERR EXIT | |
| script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) | |
| usage() { | |
| cat <<EOF | |
| Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| wget -qO - https://package.perforce.com/perforce.pubkey | sudo apt-key add - | |
| sudo bash -c 'echo "deb http://package.perforce.com/apt/ubuntu $(lsb_release -cs) release" > /etc/apt/sources.list.d/perforce.list' | |
| cat /etc/apt/sources.list.d/perforce.list | |
| sudo apt update -y && sudo apt install -y helix-p4d |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| cd /tmp && wget https://download.teamviewer.com/download/linux/signature/TeamViewer2017.asc | |
| sudo apt-key add TeamViewer2017.asc | |
| sudo sh -c 'echo "deb http://linux.teamviewer.com/deb stable main" >> /etc/apt/sources.list.d/teamviewer.list' | |
| sudo sh -c 'echo "deb http://linux.teamviewer.com/deb preview main" >> /etc/apt/sources.list.d/teamviewer.list' | |
| sudo apt update -y | |
| sudo apt install -y teamviewer |
NewerOlder