Skip to content

Instantly share code, notes, and snippets.

View sbilello's full-sized avatar

Sergio Bilello sbilello

View GitHub Profile
@sbilello
sbilello / install_pyenv_mac_zsh.rst
Created April 20, 2022 21:48 — forked from josemarimanio/install_pyenv_mac_zsh.rst
Installing pyenv on macOS for Zsh using Homebrew
import java.io.IOException;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.BitSet;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
import java.util.stream.Stream;
@sbilello
sbilello / clean_code.md
Created August 22, 2020 17:02 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@sbilello
sbilello / latency.txt
Created July 10, 2020 18:29 — 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
@sbilello
sbilello / ssh-agent-forwarding-screen.md
Created October 29, 2019 19:58 — forked from martijnvermaat/ssh-agent-forwarding-screen.md
SSH agent forwarding and screen

SSH agent forwarding and screen

When connecting to a remote server via SSH it is often convenient to use SSH agent forwarding so that you don't need a separate keypair on that server for connecting to further servers.

This is enabled by adding the

ForwardAgent yes

option to any of your Host entries in ~/.ssh/config (or alternatively with the -A option). Don't set this option in a wildcard Host * section since any user on the remote server that can bypass file permissions can now als use keys loaded in your SSH agent. So only use this with hosts you trust.

#!/usr/bin/env bash
##
# This configures an S3 bucket ObjectCreated notification for the given Lambda
# function so that when a file is uploaded the Lambda function is invoked. This
# is useful when the bucket is not defined in the same CloudFormation template
# as the function. CloudFormation cannot setup the notification in this case.
#
# Note that the AWS CLI is used and will require valid AWS credentials for the
# account containing the resources. The 'jq' JSON processor is also required
@sbilello
sbilello / advanced_test.yml
Last active September 3, 2019 20:39
advanced_test.yml
---
execution:
- write-xml-jtl: full
scenario: shire
executor: jmeter
concurrency: 100
ramp-up: 5m
hold-for: 15m
throughput: 60
@sbilello
sbilello / quick_test.yml
Last active September 3, 2019 20:38
quick_test.yml
execution:
- concurrency: 100
ramp-up: 1m
hold-for: 5m
scenario: quick-test
scenarios:
quick-test:
requests:
- http://blazedemo.com
@sbilello
sbilello / reaper.txt
Created March 8, 2019 23:59
Keyspaces for different Cassandra Reaper configurations
Let's suppose we have 2 datacenters
dc1
dc2
Available Reaper configuration options:
1) datacenterAvailability: ALL
create keyspace reaper_db with replication = {'class' : 'NetworkTopologyStrategy', 'dc1': 3, 'dc2': 3};
1 Reaper instance handling the entire cluster with 2 datacenters
@sbilello
sbilello / iterm2-solarized.md
Created February 19, 2019 23:12 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k