Skip to content

Instantly share code, notes, and snippets.

View lanzafame's full-sized avatar

Adrian Lanzafame lanzafame

View GitHub Profile
#!/usr/bin/env bash
set -euo pipefail
ignore="(go-libp2p-quic-transport|go-libp2p-tls)" ## regex of modules for whom to bypass automatic gomod migration.
travis_file=$(cat << EOF
os:
- linux
language: go
go:
zenground0 [2:07 PM]
The first one is whether a libp2p host will advertise its (pid, multiaddr) mapping in a networks' DHT after constructing the node with a `libp2p.Routing(makeDHT)` option.
Right now this is all we do in the filecoin network and we don't seem to be advertising id,addr records in the dht.
Wondering if we're missing an obvious `provideRouteToMe` call or something like that
anacrolix [2:11 PM]
I’ll have to check, but a typical DHT will routinely reestablish its own presence to nearby peers, and announce itself during bootstraps.
In the context of libp2p, that should include the peer ID and routing information like multiaddrs
zenground0 [2:12 PM]
@jbenet
jbenet / large-docs-comments.css
Last active February 4, 2019 10:23
Large google docs comments
/*
large google docs comments
add this to a user stylesheet
like https://github.com/openstyles/stylus
*/
/* make comment boxes large */
@media only screen and (min-width: 1400px) {
.docos-layout-anchored
.docos-anchoreddocoview {
@sameer
sameer / plan9palette.go
Last active January 18, 2024 19:45
Creates a Plan 9 Palette as a 2D image using the gg library
import (
"github.com/fogleman/gg"
"image/color/palette"
"strconv"
"image/color"
)
func main() {
const numSquaresPerRow = 16.
const numSquaresPerColumn = numSquaresPerRow
@zupzup
zupzup / main.go
Created March 20, 2017 10:03
Go TCP Proxy / Port Forwarding Example (https://zupzup.org/go-port-forwarding/)
package main
import (
"flag"
"fmt"
"io"
"log"
"net"
"os"
"os/signal"
@abn
abn / rpm-build-workflow.md
Last active May 18, 2022 05:04
RPM build and hosting workflow using github, travis-ci and copr

RPM Build Flow

This document details a simple RPM build flow pattern used to build and host RPM artifacts for open source projects. The below is a visual summary of this flow.

In order to achieve this multiple tools and services are used. The services and their purpose in the flow is as listed below.

Service Purpose
GitHub As is the most common use for GitHub, it holds the build source code. In this case we hold only the spec files and related source files. All other sources, including project binaries/sources are retrieved at build time.

Go vs. Scala (Akka) Concurrency

A comparison from 2 weeks using Go.

Actors vs. Functions

Akka's central principle is that there you have an ActorSystem which runs Actors. An Actor is defined as a class and it has a method to receive messages.

@dearing
dearing / docker-nftables.conf
Created February 25, 2016 14:26
nftables with docker
# /etc/systemd/system/docker.service.d/docker-nftables.conf
# disable iptables in docker, allowing nftables to do work
[Service]
ExecStart=
ExecStart=/usr/bin/docker daemon -H fd:// --iptables=false
@vasanthk
vasanthk / System Design.md
Last active May 3, 2024 16:37
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@m-ou-se
m-ou-se / replace-debian-with-arch.txt
Last active October 22, 2023 12:16
Instructions to replace a live Debian installation with Arch
# Download latest archlinux bootstrap package, see https://www.archlinux.org/download/
wget 'ftp://ftp.nluug.nl/pub/os/Linux/distr/archlinux/iso/latest/archlinux-bootstrap-*-x86_64.tar.gz'
# Make sure you'll have enough entropy for pacman-key later.
apt-get install haveged
# Install the arch bootstrap image in a tmpfs.
mount -t tmpfs none /mnt
cd /mnt
tar xvf ~/archlinux-bootstrap-*-x86_64.tar.gz --strip-components=1