Skip to content

Instantly share code, notes, and snippets.

View mihaitodor's full-sized avatar
:shipit:
Shipit!

Mihai Todor mihaitodor

:shipit:
Shipit!
View GitHub Profile
@sj26
sj26 / LICENSE.md
Last active March 8, 2024 18:31
Bash retry function

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit

@jordelver
jordelver / gist:4430514
Created January 1, 2013 22:26
zsh-newuser-install

If you want to run the zsh new user setup, but have run it previously, do the following:

autoload zsh-newuser-install
zsh-newuser-install -f
@bojand
bojand / index.md
Last active March 1, 2024 19:32
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.

@joyrexus
joyrexus / README.md
Last active February 24, 2024 15:16
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@zeux
zeux / minid3d9.h
Created February 12, 2016 08:32
Minimal set of headers for D3D9
// This file is designed to be included in D3D9-dependent code instead of d3d9.h, while adding minimal amount of junk
#pragma once
#include <BaseTyps.h>
#include <BaseTsd.h>
// stdlib.h
#ifndef _INC_STDLIB
#define _INC_STDLIB
#endif
@stephenll
stephenll / .bash_profile
Created February 2, 2014 02:45 — forked from jernejcic/.bash_profile
.bash_profile file on Mac OS X
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases.
# Much of this was originally copied from:
# http://natelandau.com/my-mac-osx-bash_profile/
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
@rharkanson
rharkanson / RandomBigInteger.cs
Created March 1, 2017 01:35
RandomBigInteger - An extension to the C# Random class for generating random BigIntegers
using System;
using System.Numerics;
namespace System.Numerics
{
class RandomBigInteger : Random
{
public RandomBigInteger() : base()
{
}
@magicznyleszek
magicznyleszek / jekyll-and-liquid.md
Last active January 12, 2024 03:46
Jekyll & Liquid Cheatsheet

Jekyll & Liquid Cheatsheet

A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.

Running

Running a local server for testing purposes:

@mambroziak
mambroziak / awsEc2MetadataShortcuts.sh
Last active November 1, 2023 22:34
AWS EC2 Instance Metadata to BASH Script Variables
#!/bin/bash
# JQ is required to more easily parse json.
AWS_IAM_ROLE=`curl -sL http://169.254.169.254/latest/meta-data/iam/security-credentials/`
AWS_ACCESS_KEY_ID=`curl -sL http://169.254.169.254/latest/meta-data/iam/security-credentials/$AWS_IAM_ROLE/ | jq -r '.AccessKeyId'`
AWS_SECRET_ACCESS_KEY=`curl -sL http://169.254.169.254/latest/meta-data/iam/security-credentials/$AWS_IAM_ROLE/ | jq -r '.SecretAccessKey'`
AWS_TOKEN=`curl -sL http://169.254.169.254/latest/meta-data/iam/security-credentials/$AWS_IAM_ROLE/ | jq -r '.Token'`
AWS_AZ=`curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone`
AWS_DEFAULT_REGION="`echo \"$AWS_AZ\" | sed -e 's:\([0-9][0-9]*\)[a-z]*\$:\\1:'`"
LOCAL_IP=`curl -sL http://169.254.169.254/latest/meta-data/local-ipv4`
PUBLIC_IP=`curl -sL http://169.254.169.254/latest/meta-data/public-ipv4`
@mattfysh
mattfysh / benthos.yaml
Last active August 22, 2023 01:00
Benthos + Consul
input:
sequence:
inputs:
- generate:
count: 1
processors:
- http:
verb: GET
url: ${! env("CONSUL_ENDPOINT") }/v1/kv/${! env("CONSUL_KV_KEY") }
headers: