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
@Kubuxu
Kubuxu / NeverSink.filter
Created March 20, 2016 08:31
NeverSink's lootfilter
#---------------------------------------------------------------------------------------------------------------
# NeverSink's Indepth Loot Filter
# VERSION 3.12 - Full Version
#---------------------------------------------------------------------------------------------------------------
#
# You can always find the latest version here:
# http://pastebin.com/Af00CbhA
# Forum discussion thread. You can post question and feedback here:
# http://www.pathofexile.com/forum/view-thread/1246208/page/1
# Please use this thread for feedback, questions and suggestions
@Kubuxu
Kubuxu / curl
Last active April 3, 2016 20:24
IPFS gateways HEAD not working
dig ipfs.io +short | xargs -L1 -i -- curl -Iv --max-time 30 {}/ipfs/QmVLRLxc9jDTkF7KLnfUr9hSrB4QjuhRjBS9bGTmPfK5Lx/
* Trying 162.243.248.213...
* Connected to 162.243.248.213 (162.243.248.213) port 80 (#0)
> HEAD /ipfs/QmVLRLxc9jDTkF7KLnfUr9hSrB4QjuhRjBS9bGTmPfK5Lx/ HTTP/1.1
> Host: 162.243.248.213
> User-Agent: curl/7.47.1
> Accept: */*
>
* Operation timed out after 30001 milliseconds with 0 bytes received
* Closing connection 0
@Kubuxu
Kubuxu / generated with
Created June 9, 2016 15:43
Goroutine leak report
cat ../ipfs.stacks| sed -e 's/(0x.*$//' -e 's/ +0x.*$//' | grep -v -e '^goroutine' | csplit -s - '/^$/' '{*}' -f trace -n 5
find . -type f -exec sha1sum '{}' \+ | sort | uniq -c --check-chars=40 | sort -nr | awk '{if($1 > 100) {print "\n";print $1 " times"; system("cat " $3)}}'
@Kubuxu
Kubuxu / ipfs-daemon-remote.sh
Last active March 2, 2021 06:34
Tunnel IPFS API via SSH
#!/usr/bin/env bash
REMOTE_HOST=${1-"YOUR REMOTE HOST HERE"}
DEFAULT_API_FILE="$HOME/.ipfs/api"
API_FILE="${IPFS_PATH-$DEFAULT_API_FILE}"
if [ -e "$API_FILE" ]; then
echo "IPFS API is already running"
exit 1
fi
@Kubuxu
Kubuxu / clone-all.go
Created September 22, 2016 16:42
Clone all Github repos in an org
package main
import (
"fmt"
"os"
"os/exec"
"strings"
"github.com/google/go-github/github"
)
@Kubuxu
Kubuxu / libp2p pnet - writeup.md
Last active March 27, 2022 13:14
libp2p Private Networks - pnet

Pre-shared Key Based Private Networks in IPFS

This document describes the first version of private networks (PN) featured in IPFS.

Only pre-shared key (PSK) functionality is available for the first implementation, as the Public Key Infrastructure approach is much more complex and requires more technical preparation.

It was implemented as an additional encryption layer before any IPFS traffic and is designed to leak the absolute minimum of information on its own. All traffic leaving the node inside a PN is encrypted, and there is no characteristic handshake.

Interface

@Kubuxu
Kubuxu / profile.txt
Created November 9, 2016 22:58
silent army profile
Flat profile:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls ms/call ms/call name
100.06 0.04 0.04 59621 0.00 0.00 verify_sol
0.00 0.04 0.00 100156 0.00 0.00 sort_pair
0.00 0.04 0.00 9600 0.00 0.00 mix
0.00 0.04 0.00 3100 0.00 0.00 check_clSetKernelArg
0.00 0.04 0.00 1200 0.00 0.00 check_clEnqueueNDRangeKernel
#!/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
{
"depthsDist": {
3: 0.2,
4: 0.3,
5: 0.5
},
"sizeDist": {
99: 0,
100: 0.02,
300: 0.10
server1 &
PID1=$!
server2 &
PID2=$!
TMPD=$(mktemp -d)
curl path1 > "$TMPD/resp1" &
CURL1=$!
curl path2 > "$TMPD/resp2" &
CURL2=$!