Skip to content

Instantly share code, notes, and snippets.

@leerspace
leerspace / add_pin_unpin.go
Created January 9, 2018 13:30
example of adding, pinning, and unpinning using IPFS as library
package main
import (
"context"
"log"
"net"
core "github.com/ipfs/go-ipfs/core"
corerepo "github.com/ipfs/go-ipfs/core/corerepo"
coreunix "github.com/ipfs/go-ipfs/core/coreunix"
@leerspace
leerspace / bash_ipfs_memory_logger.sh
Created September 21, 2017 01:43
bash script for logging ipfs daemon memory utilization, repo size, and peer count
#/bin/bash
while sleep 1; do
# get process id for ipfs daemon
output=`ps aux | grep "ipfs daemon" | grep -v grep`
set -- $output
pid=$2
# get timestamp
timestamp=$(date +%s)
# get process memory usage in kilobytes