Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Let's print help first:

     Running `/Users/quantong/Code/github.com/libp2p/rust-libp2p/target/debug/perf -h`
Usage: perf [OPTIONS]

Options:
      --server-address <SERVER_ADDRESS>
      --transport <TRANSPORT>
 --upload-bytes 
@quantonganh
quantonganh / main.go
Last active April 8, 2023 15:03
rivo/tview: how to show an InputField at the current list item's position?
package main
import (
"strconv"
"github.com/gdamore/tcell/v2"
"github.com/rivo/tview"
)
const pageEditTitle = "editTitle"
digraph gocallvis {
graph [bb="0,0,555.35,1305.1",
bgcolor=lightgray,
fontname=Arial,
fontsize=14,
label="github.com/syncthing/syncthing/cmd/stindex",
labeljust=l,
lheight=0.22,
lp="144.57,12.049",
lwidth=3.79,
const gulp = require('gulp'),
util = require('gulp-util'),
notifier = require('node-notifier'),
child = require('child_process'),
os = require('os'),
path = require('path');
var server = 'null'
function build() {
package main
import (
"encoding/csv"
"fmt"
"io"
"log"
"os"
"strconv"
)
@quantonganh
quantonganh / auth0-golang-jwt.md
Last active September 17, 2019 08:44
square/go-jose: error in cryptographic primitive

https://github.com/auth0-blog/auth0-golang-jwt/blob/master/main.go#L45

secret := []byte("{YOUR-AUTH0-API-SECRET}")
secretProvider := auth0.NewKeyProvider(secret)
audience := []string{"{YOUR-AUTH0-API-AUDIENCE}"}

configuration := auth0.NewConfiguration(secretProvider, audience, "https://{YOUR-AUTH0-DOMAIN}.auth0.com/", jose.HS256)
validator := auth0.NewValidator(configuration)
Mar 28 03:58:19 hostname dockerd[2470]: time="2018-03-28T03:58:19Z" level=info msg="=== BEGIN goroutine stack dump ===
Mar 28 03:58:19 hostname dockerd[2470]: goroutine 28 [running]:
Mar 28 03:58:19 hostname dockerd[2470]: main.dumpStacks()
Mar 28 03:58:19 hostname dockerd[2470]: #011/go/src/github.com/containerd/containerd/cmd/containerd/main_unix.go:63 +0x8c
Mar 28 03:58:19 hostname dockerd[2470]: main.handleSignals.func1(0xc4201b2420, 0xc4201b23c0, 0x557560bfe540, 0xc4201c8f90, 0xc4201ba1e0)
Mar 28 03:58:19 hostname dockerd[2470]: #011/go/src/github.com/containerd/containerd/cmd/containerd/main_unix.go:38 +0x28b
Mar 28 03:58:19 hostname dockerd[2470]: created by main.handleSignals
Mar 28 03:58:19 hostname dockerd[2470]: #011/go/src/github.com/containerd/containerd/cmd/containerd/main_unix.go:28 +0x8b
Mar 28 03:58:19 hostname dockerd[2470]: goroutine 1 [chan receive, 6045 minutes]:
Mar 28 03:58:19 hostname dockerd[2470]: main.main.func1(0xc4201e0000, 0xc4201e0000, 0xc42004fb4f)
This file has been truncated, but you can view the full file.
#
# Defines environment variables.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
# Ensure that a non-login, non-interactive shell has a defined environment.
if [[ "$SHLVL" -eq 1 && ! -o LOGIN && -s "${ZDOTDIR:-$HOME}/.zprofile" ]]; then
source "${ZDOTDIR:-$HOME}/.zprofile"
VirtualBox VM 4.3.10_Ubuntu r93012 linux.amd64 (Apr 7 2014 03:37:47) release log
00:00:00.149293 Log opened 2016-02-24T06:45:40.396008000Z
00:00:00.149294 Build Type: release
00:00:00.149296 OS Product: Linux
00:00:00.149297 OS Release: 3.13.0-68-generic
00:00:00.149297 OS Version: #111-Ubuntu SMP Fri Nov 6 18:17:06 UTC 2015
00:00:00.149311 DMI Product Name: S1200RP
00:00:00.149314 DMI Product Version: ....................
00:00:00.149502 Host RAM: 32113MB total, 5992MB available
00:00:00.149504 Executable: /usr/lib/virtualbox/VBoxHeadless
```
/etc/cron.d/passive-checks:
file:
- append
- text: |
*/5 * * * * nagios output=$(/usr/lib/nagios/plugins/check_procs -c 1:1 -C rsyslogd -u syslog); return_code=$?; printf "%s\t%s\t%s\t%s\n" "q-mail" "rsyslogd_procs" "$return_code" "$output" | /usr/local/nagios/bin/py_send_nsca -H 10.134.151.217 -c /etc/send_nsca.conf
*/5 * * * * nagios output=$(/usr/lib/nagios/plugins/check_procs -c 1:1 -C rsyslogd -u syslog); return_code=$?; printf "%s\t%s\t%s\t%s\n" "q-mail" "rsyslogd_procs" "$return_code" "$output" | /usr/local/nagios/bin/py_send_nsca -H 10.134.185.197 -c /etc/send_nsca.conf
```