Skip to content

Instantly share code, notes, and snippets.

View Kubuxu's full-sized avatar

Jakub Sztandera Kubuxu

  • Protocol Labs
  • Kraków, Poland
View GitHub Profile
#!/usr/bin/env bash
cat <<EOF | xargs -L1 ipfs ping -n 1
QmUd6zHcbkbcs7SMxwLs48qZVX3vpcM8errYS7xEczwRMA
QmbVWZQhCGrS7DhgLqWbgvdmKN7JueKCREVanfnVpgyq8x
QmUEMvxS2e7iDrereVYc5SWPauXPyNwxcy9BXZrC1QTcHE
QmdnXwLrC8p1ueiq2Qya8joNvk3TVVDAut7PrikmZwubtR
QmNSYxZAiJHeLdkBg38roksAR9So7Y5eojks1yjEcUtZ7i
EOF
#!/bin/bash
FILE="$1"
TYPE="$(file $1)"
if ! echo "$TYPE" | grep "compressed data" >/dev/null 2>&1; then
echo "Plik $FILE nie jest zkompressowany";
exit 1
fi
case "$FILE" in
*.zip)
@Kubuxu
Kubuxu / providers okrs.md.md
Created October 17, 2018 10:16
providers okrs.md
  • cid-crums while walking graphs
  • ancher blocks
  • breakoff content routing from bitswap
  • design the strategies

KRs:

  • Able to add npm, tr-wikipedia without turning off providing.
  • Providers records scale sublinear with content.
  • Write 4 user stories about user expirience with providing/resolving.
data = dlmread('wprice');
data = data';
dt = 5*60;
N = length(data);
Fs = 1/(dt);
t = 0:1/Fs:(N-1)*dt;
x = data - mean(data);
subplot(2,1,1);
WARNING: DATA RACE
Read at 0x00c420444410 by goroutine 47:
gx/ipfs/QmTnsezaB1wWNRHeHnYrm8K4d5i9wtyj3GsqjC3Rt5b5v5/go-multistream.(*lazyConn).Write()
/home/kubuxu/go/src/gx/ipfs/QmTnsezaB1wWNRHeHnYrm8K4d5i9wtyj3GsqjC3Rt5b5v5/go-multistream/lazy.go:114 +0x48
gx/ipfs/QmapADMpK4e5kFGBxC2aHreaDqKP9vmMng5f91MA14Ces9/go-libp2p/p2p/host/basic.(*streamWrapper).Write()
/home/kubuxu/go/src/gx/ipfs/QmapADMpK4e5kFGBxC2aHreaDqKP9vmMng5f91MA14Ces9/go-libp2p/p2p/host/basic/basic_host.go:462 +0x75
gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/io.(*varintWriter).WriteMsg()
/home/kubuxu/go/src/gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/io/varint.go:74 +0x259
gx/ipfs/QmapADMpK4e5kFGBxC2aHreaDqKP9vmMng5f91MA14Ces9/go-libp2p/p2p/protocol/identify.(*IDService).RequestHandler()
/home/kubuxu/go/src/gx/ipfs/QmapADMpK4e5kFGBxC2aHreaDqKP9vmMng5f91MA14Ces9/go-libp2p/p2p/protocol/identify/id.go:133 +0x360
thread '<unnamed>' panicked at 'failed to write file "out/A/2001_Vegalta_Sendai_season.html"', /checkout/src/libcore/option.rs:785
thread '<unnamed>' panicked at 'failed to write file "out/A/2005_Denmark_Open.html"', /checkout/src/libcore/option.rs:785
thread '<unnamed>' panicked at 'failed to write file "out/A/(85633)_1998_KR65.html"', /checkout/src/libcore/option.rs:785
thread '<unnamed>' panicked at 'failed to write file "out/I/m/1979-1983_William_F._Engel.jpg"', /checkout/src/libcore/option.rs:785
thread '<unnamed>' panicked at 'failed to write file "out/A/2003_NECBL_season.html"', /checkout/src/libcore/option.rs:785
thread '<unnamed>' panicked at 'failed to write file "out/A/1897.html"', /checkout/src/libcore/option.rs:785
thread '<unnamed>' panicked at 'failed to write file "out/A/10_Years_of_Cheap_Fame.html"', /checkout/src/libcore/option.rs:785
thread '<unnamed>' panicked at 'failed to write file "out/A/16_(Regina)_Field_Ambulance.html"', /checkout/src/libcore/option.rs:785
thread '<unnamed>' panicked
/ # cpp -dM empty.h
#define __SSP_STRONG__ 3
#define __DBL_MIN_EXP__ (-1021)
#define __UINT_LEAST16_MAX__ 0xffff
#define __ATOMIC_ACQUIRE 2
#define __FLT_MIN__ 1.17549435082228750797e-38F
#define __GCC_IEC_559_COMPLEX 2
#define __UINT_LEAST8_TYPE__ unsigned char
#define __SIZEOF_FLOAT80__ 16
#define __INTMAX_C(c) c ## L
server1 &
PID1=$!
server2 &
PID2=$!
TMPD=$(mktemp -d)
curl path1 > "$TMPD/resp1" &
CURL1=$!
curl path2 > "$TMPD/resp2" &
CURL2=$!
{
"depthsDist": {
3: 0.2,
4: 0.3,
5: 0.5
},
"sizeDist": {
99: 0,
100: 0.02,
300: 0.10
#!/bin/sh
(for p ; do
printf "%s\n" "$p"
done) | tac |
( read -r PREV ;
while read -r CURR ; do
printf '%s: | %s\n' "$PREV" "$CURR"
PREV="$CURR"
done) | tac