๐
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
label: Overseer | |
title: "Overseer [{{if .error}}ERR{{if .isDedup}}-DUP{{end}}{{else}}{{if .recovered}}RECOVERED{{else}}OK{{end}}{{end}}] ({{.tag}}): {{.input}}" | |
content: |- | |
{{if .error -}} | |
{{if eq .type "k8s-event"}}Event{{else}}Error{{end}} | |
{{- if .isDedup}} (duplicated){{end}}: {{.error}}{{end}} | |
Tag: {{.tag}} | |
Input: {{.input}} |
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 request = require('request'); | |
exports.notify17 = (event) => { | |
console.log('Received pub/sub event', event); | |
// Decoded event data is already JSON | |
const body = Buffer.from(event.data, 'base64'); | |
const options = { | |
uri: 'REPLACE_WITH_TEMPLATE_API_KEY', |
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
label: GCP Logs Pub/Sub | |
title: "GCP Logs: {{ coalesce .jsonPayload.event_subtype .logName }}" | |
content: "{{ Dump . }}" |
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
gcloud pubsub topics publish YOUR_TOPIC_NAME --message '{"name": "Mr.Anderson"}' |
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
# If prompted for a zone, you can e.g. use the flag --zone=us-central1-a | |
gcloud compute instances create test-logs-instance --machine-type=f1-micro |
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
{ | |
"name": "n17-pubsub", | |
"version": "0.0.1", | |
"dependencies": { | |
"@google-cloud/pubsub": "^0.18.0", | |
"request": "2.88.0" | |
} | |
} |
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
using System; | |
using System.Net; | |
namespace net_test_web | |
{ | |
internal class Program | |
{ | |
private static void Main(string[] args) | |
{ | |
Console.WriteLine("Hello World!"); |
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
And we'll get: | |
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
set -e | |
# Define the n17 function | |
n17() { sh -c "$(wget -qO - "https://n17.io/sh")" -- -k "N17_RAW_API_KEY" "$@"; } | |
# This function will be invoked on script error. | |
n17TrapErr() { | |
n17 \ | |
-t "Script execution error!" \ | |
-c "$(cat < |
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
n17() { sh -c "$(wget -qO - "https://n17.io/sh")" -- -k "N17_RAW_API_KEY" "$@"; } |