Skip to content

Instantly share code, notes, and snippets.

View njam's full-sized avatar

Reto Kaiser njam

View GitHub Profile
@njam
njam / measure.sh
Created July 5, 2016 09:04
Measure bandwidth with tcpstat + gnuplot
# Measure traffic with tcpstat
tcpstat -i em1 -o "%r\t%b\n" -s 30 0.1 > traffic.txt
# Create plot using the below script
gnuplot traffic.script > traffic.png
# Display plot
qlmanage -p 2>/dev/null traffic.png
Q: How big is the blockchain today?
A: 415'000 blocks, 70 Gigabytes.
Q: Where is the blockchain stored?
A: On all the nodes participating in the Bitcoin p2p network.
Implicit consensus is achieved by all nodes following the same rules (and incentives).
Q: What kind of encryption is Bitcoin using?
A: none (rather hashing and signing).
@njam
njam / repo-list-license.js
Last active February 21, 2020 16:07
List license of all repos in a Github organisation
var GitHubApi = require('github');
var assert = require('assert');
var org = 'cargomedia';
var token = '<github-token>';
var api = new GitHubApi({
version: '3.0.0',
protocol: 'https',
headers: {'user-agent': 'repo-lister'}
(function($) {
function visible(element) {
return $.expr.filters.visible(element) && !$(element).parents().addBack().filter(function() {
return $.css(this, 'visibility') === 'hidden';
}).length;
}
function focusable(element, isTabIndexNotNaN) {
var map, mapName, img, nodeName = element.nodeName.toLowerCase();
if ('area' === nodeName) {