Skip to content

Instantly share code, notes, and snippets.

@guoxingx
guoxingx / ipfsdocker.py
Last active July 20, 2018 08:50
wrapped ipfs docker cmd
#!/usr/bin/env python
"""
usage:
ipfsdocker start
ipfsdocker stop
ipfsdocker -h
ipfsdocker add <file>
"""
@guoxingx
guoxingx / list_nethogs.py
Created May 20, 2019 12:35
analyse script for "nethogs -t > filename"
#! /usr/bin/env python
# analyse script for "nethogs -t > filename"
import sys
def process_line(line, sent, received):
"""
@params: line: string: line to process
@params: sent: int: threshold for sent
@guoxingx
guoxingx / gerror.go
Created February 26, 2020 09:36
error with code and message
package gerror
import (
"fmt"
)
// Error with an code in int type
type Error struct {
code int
message string