Skip to content

Instantly share code, notes, and snippets.

Lars-Magnus Skog ralphtheninja

Block or report user

Report or block ralphtheninja

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@substack
substack / kv.js
Created Nov 18, 2019
key/value pubsub with multiple feeds over sparse hypercore data
View kv.js
var minimist = require('minimist')
var argv = minimist(process.argv.slice(2), {
alias: { d: 'datadir' }
})
var path = require('path')
var pump = require('pump')
var feeds = {}
var Protocol = require('hypercore-protocol')
var swarm = require('discovery-swarm')
@cjdelisle
cjdelisle / cjdns_packet_priority.md
Last active Dec 8, 2019
Cjdns Packet Prioritization System
View cjdns_packet_priority.md

Cjdns Packet Prioritization System

The packet prioritization system is designed to allow access to a link to be exercised by it's owner, thus allowing for bandwidth to be sold and used.

  • A packet SHOULD NOT be dropped unless there is actually not enough bandwidth to send everything.
  • A bandwidth lease MUST be able to send at least its bandwidth limit.
  • Unused bandwidth SHOULD be divided between those leases which are currently sending traffic in a fair way based on the relative size of the leases.
View cabal architecture.md

ARCHITECTURE

cabal clients
  cabal-core

cabal-core
  discovery-swarm
    dat-swarm-defaults
  kappa-view-level
  kappa-core
View levelup.md
module levelup
version
downloads in the
last 30 days
total downloads
level-sublevel ~0.19.0 151,300 1,226,226
pouchdb 1.3.8 124,983 1,162,731
browserify-fs ^0.18.2 100,027 458,142
pouchdb-adapter-leveldb-core 1.3.8 97,566 419,461
level-packager ~1.3.0 74,165 758,119
merkle-patricia-tree ^1.2.1 13,231 127,025
dynalite ^1.3.3 10,553 258,090
mosca ^1.3.8 9,513 171,844
View neat-log-debug.js
var neat = require('neat-log')
var output = require('neat-log/output')
var progress = require('progress-string')
var crypto = require('crypto')
var hypercore = require('hypercore')
var hyperdiscovery = require('hyperdiscovery')
var feed = hypercore('data', process.argv[2], {valueEncoding: 'json'})
@maxogden
maxogden / readme.md
Created Mar 10, 2017
DIY DAT DYNDNS
View readme.md

for ubuntu, to set up a dynamic dns service that tells you what the external ip of some machine is

  • npm install dat lil-pids run-every add-to-systemd -g
  • mkdir ipdat; cd ipdat; dat create; cd ..;
  • edit file services with this:
cd ipdat && dat sync
cd ipdat && run-every 3600 curl ipinfo.io/ip > ip.txt
@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active Dec 14, 2019
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64
View clean-up-boot-partition-ubuntu.md

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@jaronkk
jaronkk / cleanup_docker.sh
Created Jun 2, 2016
Cleanup and reset docker on Jenkins workers / slaves
View cleanup_docker.sh
#!/bin/bash
# This script should be located on each Jenkins slave, and the jenkins user should have permission to run it with sudo
# Attempts to cleanly stop and remove all containers, volumes and images.
docker ps -q | xargs --no-run-if-empty docker stop
docker ps -q -a | xargs --no-run-if-empty docker rm --force --volumes
docker volume ls -q | xargs --no-run-if-empty docker volume rm
docker images -a -q | xargs --no-run-if-empty docker rmi -f
# Stops the docker service, unmounts all docker-related mounts, removes the entire docker directory, and starts docker again.
View package.json
{
"name": "utp-hole-punching",
"dependencies": {
"utp-native": "*",
"discovery-channel": "*"
}
}
View stream-rpc-example.js
var duplexify = require('duplexify')
var lpstream = require('length-prefixed-stream')
var ids = require('numeric-id-map')
var util = require('util')
function RPC () {
duplexify.call(this) // subclass yolo
this._encode = lpstream.encode()
this._decode = lpstream.decode()
this._pending = ids()
You can’t perform that action at this time.