Skip to content

Instantly share code, notes, and snippets.


Juan Benet jbenet

View GitHub Profile
jbenet /
Last active Sep 21, 2022
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

jbenet /
Created Aug 4, 2022
Iceland Eruption
View main.go
// Package main demonstrates a problem with sockets.
// run it with:
// go build
// ./test
// Nevermind, found the problem (using select wrong)
package main
jbenet / tikz2svg
Last active Feb 19, 2022
tikz2svg - convert tikz input into svg
View tikz2svg
#!/usr/bin/env python
# author:
# license: MIT
# tikz2svg: convert tikz input into svg
# depends on:
# - pdflatex: comes with your tex dist
# - pdf2svg: brew install pdf2svg
jbenet / current_utc_time.c
Created Jul 17, 2011
work around lack of clock_gettime in os x
View current_utc_time.c
author: jbenet
os x, compile with: gcc -o testo test.c
linux, compile with: gcc -o testo test.c -lrt
#include <time.h>
#include <sys/time.h>
#include <stdio.h>
jbenet /
Last active Jun 29, 2021
Fast Research & Development

Fast Research & Development

People tend to believe that R&D takes a long time.

jbenet /
Last active Jun 18, 2021
Sending a tx in filecoin w/ extra data

Messages in Filecoin allow sending arbitrary values through the params field.

Encoding data into params

  • data to send through transactions should be base64 encoded when using the message sending APIs.
  • note: you'll be sending to method: 0, which should be the default in your tools. method: 0 will ignore the params.

lotus-shed example


Peter Thiel's CS183: Startup - Class 1 Notes Essay

Here is an essay version of my class notes from Class 1 of CS183: Startup. Errors and omissions are my own. Credit for good stuff is Peter’s entirely.

CS183: Startup—Notes Essay—The Challenge of the Future

Purpose and Preamble

View emacs-ox-hugo.el
#!/usr/bin/env emacs -Q --script
;; Sandbox
user-emacs-directory (concat (file-name-directory load-file-name) ".emacs/")
package-user-dir (concat user-emacs-directory "elpa/")
use-package-always-ensure t
inhibit-message t) ; if there are errors, remove this.
; debug-on-error t) ; if there are errors, add this.

sftp user

So you want to configure an sftp only user?

Setup a group for sftp only users

groupadd sftponly

Make chroot jail directory