Skip to content

Instantly share code, notes, and snippets.

View fforbeck's full-sized avatar

Felipe Forbeck fforbeck

View GitHub Profile
@fforbeck
fforbeck / cli.sh
Created February 11, 2025 17:42 — forked from alanshaw/cli.sh
env vars for w3cli
export STORACHA_SERVICE_DID=did:web:alan.up.storacha.network
export STORACHA_SERVICE_URL=https://n7js8smi24.execute-api.us-west-2.amazonaws.com
export STORACHA_STORE_NAME=storacha-cli-alan
export STORACHA_RECEIPTS_URL=https://n7js8smi24.execute-api.us-west-2.amazonaws.com/receipt/
export W3_SERVICE_DID=did:web:alan.up.storacha.network
export W3_STORE_NAME=storacha-cli-alan
export W3UP_SERVICE_URL=https://n7js8smi24.execute-api.us-west-2.amazonaws.com
export W3UP_RECEIPTS_ENDPOINT=https://n7js8smi24.execute-api.us-west-2.amazonaws.com/receipt/
@fforbeck
fforbeck / delegation-vis.js
Created February 7, 2025 00:46 — forked from alanshaw/delegation-vis.js
Visualise a delegation
import fs from 'node:fs'
import { Readable } from 'node:stream'
import { CARReaderStream } from 'carstream'
import * as dagCBOR from '@ipld/dag-cbor'
import * as dagJSON from '@ipld/dag-json'
import * as DID from '@ipld/dag-ucan/did'
Readable.toWeb(fs.createReadStream('proof.car'))
.pipeThrough(new CARReaderStream())
.pipeTo(new WritableStream({
@fforbeck
fforbeck / JProfiler-with-Docker.md
Created August 14, 2020 16:08 — forked from kevin-lee/JProfiler-with-Docker.md
JVM Profiler with Docker

JProfiler with Docker

Docker

DockerFile

DockerFile should have JProfiler installation.

RUN wget <JProfiler file location> -P /tmp/ && \
  tar -xzf /tmp/<JProfiler file> -C /usr/local && \
  rm /tmp/<JProfiler file>
@fforbeck
fforbeck / latency.txt
Created June 17, 2020 14:30 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@fforbeck
fforbeck / links.md
Created December 12, 2019 13:48 — forked from akitaonrails/links.md
Links de referência pro Episódio 66 do Canal Akitando
@fforbeck
fforbeck / k8s-svc-annotations.md
Created December 5, 2019 19:16 — forked from mgoodness/k8s-svc-annotations.md
AWS ELB-related annotations for Kubernetes Services (as of v1.12.0)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-emit-interval (in minutes)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-enabled (true|false)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-name
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-prefix
  • service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags (comma-separated list of key=value)
  • service.beta.kubernetes.io/aws-load-balancer-backend-protocol (http|https|ssl|tcp)
  • service.beta.kubernetes.io/aws-load-balancer-connection-draining-enabled (true|false)
@fforbeck
fforbeck / clean-up-boot-partition-ubuntu.md
Created September 6, 2018 01:06 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64

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

Reference

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

1. Check the current kernel version

$ uname -r 
@fforbeck
fforbeck / gist:cad4cc5049c19d2958b6464b7a88e15c
Created February 2, 2018 16:15 — forked from mmdemirbas/gist:3656288
Aggresive MySql Stored Procedure Debugging
DECLARE E INT DEFAULT 0;
DECLARE M TEXT DEFAULT NULL;
DECLARE CONTINUE HANDLER FOR 1000 SET E='1000', M="hashchk";
DECLARE CONTINUE HANDLER FOR 1001 SET E='1001', M="isamchk";
DECLARE CONTINUE HANDLER FOR 1002 SET E='1002', M="NO";
DECLARE CONTINUE HANDLER FOR 1003 SET E='1003', M="YES";
DECLARE CONTINUE HANDLER FOR 1004 SET E='1004', M="Can't create file '%s' (errno: %d)";
DECLARE CONTINUE HANDLER FOR 1005 SET E='1005', M="Can't create table '%s' (errno: %d)";
DECLARE CONTINUE HANDLER FOR 1006 SET E='1006', M="Can't create database '%s' (errno: %d)";
@fforbeck
fforbeck / gist:43f3e946357a045a6cf3
Created January 20, 2016 16:49 — forked from duydo/elasticsearch_best_practices.txt
ElasticSearch - Index best practices from Shay Banon
If you want, I can try and help with pointers as to how to improve the indexing speed you get. Its quite easy to really increase it by using some simple guidelines, for example:
- Use create in the index API (assuming you can).
- Relax the real time aspect from 1 second to something a bit higher (index.engine.robin.refresh_interval).
- Increase the indexing buffer size (indices.memory.index_buffer_size), it defaults to the value 10% which is 10% of the heap.
- Increase the number of dirty operations that trigger automatic flush (so the translog won't get really big, even though its FS based) by setting index.translog.flush_threshold (defaults to 5000).
- Increase the memory allocated to elasticsearch node. By default its 1g.
- Start with a lower replica count (even 0), and then once the bulk loading is done, increate it to the value you want it to be using the update_settings API. This will improve things as possibly less shards will be allocated to each machine.
- Increase the number of machines you have so
// installed Clojure packages:
//
// * BracketHighlighter
// * lispindent
// * SublimeREPL
// * sublime-paredit
{
"word_separators": "/\\()\"',;!@$%^&|+=[]{}`~?",
"paredit_enabled": true,