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,
package main
import (
"encoding/csv"
"fmt"
"io"
"log"
"os"
"strconv"
)
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() {
@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
@quantonganh
quantonganh / system.log
Created September 6, 2014 00:36
osx boot log
Sep 6 00:04:39 MacBook-Pro.local mds[98]: (Warning) Volume: vsd:0x7fba729a5000 Open failed. failureCount:10 {
DisabledRecycleCount = 10;
}
Sep 6 00:06:04 MacBook-Pro.local WindowServer[249]: _CGXSetWindowBackgroundBlurRadius: Invalid window 0xffffffff
Sep 6 00:06:04 MacBook-Pro.local loginwindow[101]: find_shared_window: WID -1
Sep 6 00:06:04 MacBook-Pro.local loginwindow[101]: CGSGetWindowTags: Invalid window 0xffffffff
Sep 6 00:06:04 MacBook-Pro.local loginwindow[101]: find_shared_window: WID -1
Sep 6 00:06:04 MacBook-Pro.local loginwindow[101]: CGSSetWindowTags: Invalid window 0xffffffff
Sep 6 00:06:04 MacBook-Pro kernel[0]: AppleCamIn::systemWakeCall - messageType = 0xE0000340
Sep 6 00:06:04 MacBook-Pro.local WindowServer[249]: device_generate_desktop_screenshot: authw 0x7fa6f95b5da0(2000), shield 0x7fa6f9608490(2001)