Skip to content

Instantly share code, notes, and snippets.

View uweschaefer's full-sized avatar

Uwe Schaefer uweschaefer

View GitHub Profile
@gnarf
gnarf / ..git-pr.md
Last active April 12, 2024 22:00
git pr - Global .gitconfig aliases for Pull Request Managment

Install

Either copy the aliases from the .gitconfig or run the commands in add-pr-alias.sh

Usage

Easily checkout local copies of pull requests from remotes:

  • git pr 4 - creates local branch pr/4 from the github upstream(if it exists) or origin remote and checks it out
  • git pr 4 someremote - creates local branch pr/4 from someremote remote and checks it out
@kofemann
kofemann / GuavaCacheMXBean.java
Created September 25, 2013 16:12
Expose Google's guava Cache vie JMX
public interface GuavaCacheMXBean {
public long getRequestCount();
public long getHitCount();
public double getHitRate();
public long getMissCount();
@robbyt
robbyt / raring-heart.txt
Created April 11, 2014 21:18
Heartbleed fix - rebuild openssl for Ubuntu Raring 13.04
#!/bin/bash
mkdir sslfix
cd sslfix
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/openssl_1.0.1e-3ubuntu1.2.dsc
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/openssl_1.0.1e.orig.tar.gz
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/openssl_1.0.1e-3ubuntu1.2.debian.tar.gz
sudo apt-get build-dep openssl
dpkg-source -x openssl_1.0.1e-3ubuntu1.2.dsc
@staltz
staltz / introrx.md
Last active July 19, 2024 22:21
The introduction to Reactive Programming you've been missing
#!/usr/bin/ruby
require 'json'
DESC_HEAD = /^\.([^\.\[]+)/
DEREF_HEAD = /^\[(\d+)\]/
def usage
$stderr.puts <<USAGE
usage: json descriptor
anonymous
anonymous / gist:3207d6eefa07cd21e68e
Created June 30, 2015 09:52
List branches sorted by last activity date
alias gbr='git for-each-ref --sort="-authordate:iso8601" --format=" %(color:green)%(authordate:iso8601)%09%(color:white)%(refname:short)" refs/heads'
@vancluever
vancluever / gnome-tracker-disable.md
Last active July 17, 2024 18:17
GNOME Tracker Disable

Disabling GNOME Tracker and Other Info

GNOME's tracker is a CPU and privacy hog. There's a pretty good case as to why it's neither useful nor necessary here: http://lduros.net/posts/tracker-sucks-thanks-tracker/

After discovering it chowing 2 cores, I decided to go about disabling it.

Directories

@dlew
dlew / File.java
Created March 1, 2016 20:46
Automated onError() message generation
public static Action1<Throwable> crashOnError() {
final Throwable checkpoint = new Throwable();
return throwable -> {
StackTraceElement[] stackTrace = checkpoint.getStackTrace();
StackTraceElement element = stackTrace[1]; // First element after `crashOnError()`
String msg = String.format("onError() crash from subscribe() in %s.%s(%s:%s)",
element.getClassName(),
element.getMethodName(),
element.getFileName(),
element.getLineNumber());
@jthomerson
jthomerson / delete-all-cloudsearch-documents.sh
Created April 24, 2017 14:50
Delete all CloudSearch documents in a given domain
#!/bin/bash
# This script will delete *all* documents in a CloudSearch domain.
# USE WITH EXTREME CAUTION
# Note: depends on the AWS CLI SDK being installed, as well as jq
# For jq, see: https://stedolan.github.io/jq/ and https://jqplay.org/
if [[ ! $# -eq 2 || $1 != "--doc-domain" || ! $2 =~ ^https://.*$ ]]; then
echo "Must define --doc-domain argument (e.g. --doc-domain https://somedomain.aws.com)";
@bojand
bojand / index.md
Last active July 15, 2024 02:51
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.