Skip to content

Instantly share code, notes, and snippets.

View rafaeljesus's full-sized avatar

Rafael Jesus rafaeljesus

  • Berlin, Germany
View GitHub Profile
@rafaeljesus
rafaeljesus / cloud_sql_flags.md
Created October 5, 2020 18:13 — forked from stfeng2/cloud_sql_flags.md
Cloud SQL Flags Tuning

Important Notice

  • ❗ All flags and settings described here are subject to change without any notice.
  • Last update: September 2017

Introduction

This document describes a set of MySQL flags that have been tuned in Google Cloud SQL (Second Generation) to make the out-of-box experience better on Google Cloud. This is for your reference only, with the hope that some of the settings might also be useful outside the Google Cloud environment.

innodb_buffer_pool_size

What Hiring Should Look Like

This is definitely not the first time I've written about this topic, but I haven't written formally about it in quite awhile. So I want to revisit why I think technical-position interviewing is so poorly designed, and lay out what I think would be a better process.

I'm just one guy, with a bunch of strong opinions and a bunch of flaws. So take these suggestions with a grain of salt. I'm sure there's a lot of talented, passionate folks with other thoughts, and some are probably a lot more interesting and useful than my own.

But at the same time, I hope you'll set aside the assumptions and status quo of how interviewing is always done. Just because you were hired a certain way, and even if you liked it, doesn't mean that it's a good interview process to repeat.

If you're happy with the way technical interviewing currently works at your company, fine. Just stop, don't read any further. I'm not going to spend any effort trying to convince you otherwise.

@rafaeljesus
rafaeljesus / server.js
Last active June 23, 2020 04:31
Process giant array non blocking event loop
// Instead of processing the whole giant result all at once,
// divide it into manageable chunks and process those one by one,
// yielding the CPU after each one.
var points = perform_elasticsearch_aggregtion();
Promise.each(_.range(points.length / 20000), function processChunk(n) {
return Promise.try(function() {
process(points.splice(0, 20000));
}).delay(1);
@rafaeljesus
rafaeljesus / listchars.vim
Created June 9, 2020 12:30 — forked from while0pass/listchars.vim
show/hide hidden characters in Vim
" hide hidden chars
:set nolist
" show hidden characters in Vim
:set list
" settings for hidden chars
" what particular chars they are displayed with
:set lcs=tab:▒░,trail:▓,nbsp:░
" or
@rafaeljesus
rafaeljesus / FB-PE-InterviewTips.md
Created February 28, 2020 22:27 — forked from ameenkhan07/FB-PE-InterviewTips.md
Facebook Production Engineering Interview

What to Expect and Tips

• 45-minute systems interview, focus on responding to real world problems with an unhealthy service, such as a web server or database. The interview will start off at a high level troubleshooting a likely scenario, dig deeper to find the cause and some possible solutions for it. The goal is to probe your knowledge of systems at scale and under load, so keep in mind the challenges of the Facebook environment.
• Focus on things such as tooling, memory management and unix process lifecycle.

Systems

More specifically, linux troubleshooting and debugging. Understanding things like memory, io, cpu, shell, memory etc. would be pretty helpful. Knowing how to actually write a unix shell would also be a good idea. What tools might you use to debug something? On another note, this interview will likely push your boundaries of what you know (and how to implement it).

Design/Architecture 

Interview is all about taking an ambiguous question of how you might build a system and letting

# Platform Teams
- A developer who is familiar with one system can easily navigate the next, with minimun frustration.
- Imagine walking in a new city without maps, distributed systems are by far haarder to reason about than cities (of course Venecy with excluded).
- Help to lighten the coginitive load for developers (it refers to the amount of working memory required by a developer to understand and build upon an existing system).
- Very often, cognitive load means both reducing the number of ways a system can be built and making sure the ways of deployment, observability and monitoring are unique.
- Common optimization tasks look like:
* creating new services
* testing services
* deploying changes to service safely
# variables.tf
variable "env" {
description = "env: stg or prod"
}
variable "image_name" {
type = "map"
description = "Image for container."
default = {
dev = "occollector:latest"

Introduction

So HAProxy is primalery a load balancer an proxy for TCP and HTTP. But it may act as a traffic regulator. It may also be used as a protection against DDoS and service abuse, by maintening a wide variety of statistics (IP, URL, cookie) and when abuse is happening, action as denying, redirecting to other backend may undertaken ([haproxy ddos config], [haproxy ddos])

@rafaeljesus
rafaeljesus / prom_comp_slo.yaml
Last active June 5, 2019 22:42
prometheus composed slo
- record: prometheus:composed_slo4w
expr: >
(
prometheus_product_team:up:max_avg_over_time4w +
prometheus_infrastructure_team:up:max_avg_over_time4w
) / 2
@rafaeljesus
rafaeljesus / kube_prom_comp.yaml
Last active June 5, 2019 22:41
prom composed slo
- record: prometheus_infrastructure_team:up:max_avg_over_time5m
expr: >
max (
avg_over_time (
up{job="prometheus-infra"}[5m]
)
)
- record: prometheus_infrastructure_team:up:avg_over_time4w
expr: >
avg_over_time (