Skip to content

Instantly share code, notes, and snippets.

@yoyonel
yoyonel / index.md
Created November 20, 2020 07:55 — forked from bojand/index.md
gRPC and Load Balancing

Just documenting docs, articles, and discussion related to gRPC and load balancing.

https://github.com/grpc/grpc/blob/master/doc/load-balancing.md

Seems gRPC prefers thin client-side load balancing where a client gets a list of connected clients and a load balancing policy from a "load balancer" and then performs client-side load balancing based on the information. However, this could be useful for traditional load banaling approaches in clound deployments.

https://groups.google.com/forum/#!topic/grpc-io/8s7UHY_Q1po

gRPC "works" in AWS. That is, you can run gRPC services on EC2 nodes and have them connect to other nodes, and everything is fine. If you are using AWS for easy access to hardware then all is fine. What doesn't work is ELB (aka CLB), and ALBs. Neither of these support HTTP/2 (h2c) in a way that gRPC needs.

@yoyonel
yoyonel / image_write.py
Created July 27, 2019 21:22 — forked from dutc/image_write.py
/proc/self/mem allows arbitrary access to image virtual memory
from os.path import realpath
from sys import executable
from re import compile
from logging import getLogger, basicConfig, INFO
logger = getLogger(__name__)
basicConfig(level=INFO)
#4f2616000-4f2618000 r-xp 00000000 fe:02 3467051 /usr/bin/python3.6
PATTERN = compile('^([0-9a-f]+)-([0-9a-f]+).+$')
@yoyonel
yoyonel / encode.sh
Created April 17, 2019 18:46 — forked from mikoim/README.md
YouTube recommended encoding settings on ffmpeg (+ libx264)
#/bin/sh
ffmpeg -i input -c:v libx264 -preset slow -profile:v high -crf 18 -coder 1 -pix_fmt yuv420p -movflags +faststart -g 30 -bf 2 -c:a aac -b:a 384k -profile:a aac_low output
@yoyonel
yoyonel / asyncio-producer-consumer-task_done.py
Created February 26, 2018 09:32 — forked from tomschr/asyncio-producer-consumer-task_done.py
Producer/Consumer pattern for asyncio (Python >=3.4)
# Original source from http://asyncio.readthedocs.io/en/latest/producer_consumer.html
# Rewritten for Python >=3.4
import asyncio
import random
@asyncio.coroutine
def produce(queue, n):
for x in range(n):
@yoyonel
yoyonel / waveform.py
Created August 6, 2017 08:26 — forked from mixxorz/waveform.py
Generate waveform images from audio files
# Requires pydub (with ffmpeg) and Pillow
#
# Usage: python waveform.py <audio_file>
import sys
from pydub import AudioSegment
from PIL import Image, ImageDraw
@yoyonel
yoyonel / git-dmz-flow.md
Created October 19, 2016 12:53 — forked from djspiewak/git-dmz-flow.md
Git DMZ Flow

Git DMZ Flow

I've been asked a few times over the last few months to put together a full write-up of the Git workflow we use at RichRelevance (and at Precog before), since I have referenced it in passing quite a few times in tweets and in person. The workflow is appreciably different from GitFlow and its derivatives, and thus it brings with it a different set of tradeoffs and optimizations. To that end, it would probably be helpful to go over exactly what workflow benefits I find to be beneficial or even necessary.

  • Two developers working on independent features must never be blocked by each other
    • No code freeze! Ever! For any reason!
  • A developer must be able to base derivative work on another developer's work, without waiting for any third party
  • Two developers working on inter-dependent features (or even the same feature) must be able to do so without interference from (or interfering with) any other parties
  • Developers must be able to work on multiple features simultaneously, or at lea
@yoyonel
yoyonel / Dockerfile
Created September 9, 2016 21:36 — forked from ruffsl/Dockerfile
Small ROS Network Example
FROM ros:indigo-ros-base
# install ros tutorials packages
RUN apt-get update && apt-get install -y \
ros-indigo-ros-tutorials \
ros-indigo-common-tutorials \
&& rm -rf /var/lib/apt/lists/
@yoyonel
yoyonel / frug.cpp
Created April 29, 2016 21:21 — forked from jfalcou/frug.cpp
C++ FRUG 07/04/2016
#include <initializer_list>
#include <functional>
#include <iostream>
#include <utility>
#include <tuple>
//--------------------------------------------------------
// Appliquer une fonction sur une ligne d'arguments
template<class F, class...Ts> F for_each_args(F f, Ts&&...a)
{