Skip to content

Instantly share code, notes, and snippets.

@mrosset
mrosset / ipfs.go
Created February 10, 2019 13:07
offline ipfs multihash verification
func CoreHashOnly(path Path) (string, error) {
node, err := core.NewNode(context.TODO(), &core.BuildCfg{Online: false}) // NilRepo: true})
if err != nil {
return "", err
}
fd, err := os.Open(path.String())
if err != nil {
return "", err
}
@mrosset
mrosset / main.go
Created February 7, 2019 06:38
rootless libcontainer
package main
import (
"github.com/opencontainers/runc/libcontainer"
"github.com/opencontainers/runc/libcontainer/configs"
_ "github.com/opencontainers/runc/libcontainer/nsenter"
"golang.org/x/sys/unix"
"log"
"os"
"path/filepath"
(defun my-timer ()
(setq dashboard-banner-logo-title (format "Emacs ready in %.2f seconds with %s garbage collections."
(float-time
(time-subtract after-init-time before-init-time)) gcs-done)))
(use-package dashboard
:init
(add-hook 'dashboard-mode-hook 'my-timer)
:config
(dashboard-setup-startup-hook))
Debugger entered--Lisp error: (error #("Not documented as a symbol: format" 28 34 (fontified t)))
signal(error (#("Not documented as a symbol: format" 28 34 (fontified t))))
error("Not documented as a %s: %s" symbol #("format" 0 6 (fontified t)))
info-lookup(symbol #("format" 0 6 (fontified t)) scheme-mode)
info-lookup-symbol(#("format" 0 6 (fontified t)) scheme-mode)
guile--manual-look-up(format :f)
apply(guile--manual-look-up (format :f))
geiser-impl--call-method(external-help guile format :f)
geiser-doc--external-help(guile format :f)
geiser-doc--xbutton-action(#<marker (moves after insertion) at 106 in *Geiser documentation*>)
@mrosset
mrosset / .bashrc
Last active January 5, 2018 04:08
export GUIX_LOCPATH="$HOME/.guix-profile/lib/locale"
export GUIX_PROFILE="$HOME/.guix-profile"
source "$GUIX_PROFILE/etc/profile"
(define-public python2-libtorrent
(package
(inherit libtorrent)
(name "python2-libtorrent")
(build-system python-build-system)
(arguments
`(#:phases
(modify-phases %standard-phases
(add-before 'build 'enable-python-libtorrent
(lambda* (#:key inputs #:allow-other-keys))))))
(use-modules (ice-9 format))
(use-modules (nomad repl))
(use-modules (nomad browser))
;; give some quality of life
(define q query)
(define b back)
(define f forward)
(define o browse)
(define h home)
func HashOnly(path Path) (string, error) {
node, err := core.NewNode(context.TODO(), &core.BuildCfg{NilRepo: true})
if err != nil {
return "", err
}
fd, err := os.Open(path.String())
if err != nil {
return "", err
}
defer fd.Close()
func AddR(path string) (string, error) {
r, err := fsrepo.Open(Path("$HOME/.ipfs").String())
if err != nil {
return "", err
}
node, err := core.NewNode(context.TODO(), &core.BuildCfg{
Repo: r,
})
if err != nil {
return "", err
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory