Skip to content

Instantly share code, notes, and snippets.

final boolean doReconnect() {
Exception failure = null;
synchronized (reconnectMutex) {
// First ensure we are up to date.
doUpdateURIsFromDisk();
if (disposed || connectionFailure != null) {
reconnectMutex.notifyAll();
}
@mabn
mabn / gist:de4d9260ffc84efa8697
Created March 15, 2015 15:50
eraseredis.sh - small script to erase redis without making it unresponsive and causing failover
#!/bin/bash
CNT=10
SLEEP=10
function show_help {
echo "Usage: $0 -a auth_token -h host [-c count_per_iteration] [-s sleep_after_iteration]"
}
while getopts "h:c:s:a:?" opt; do
case "$opt" in
\?)
  1. General Background and Overview
package test;
import java.util.Random;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;

asd

$$a_b+a^c$$

$ netstat -r
Routing tables
Internet:
Destination Gateway Flags Refs Use Netif Expire
127 localhost UCS 1 0 lo0
localhost localhost UH 661 308639805 lo0
192.168.59 link#10 UC 2 0 vboxnet
192.168.59.1 a:0:27:0:0:0 UHLWIi 2 319299 lo0
224.0.0 link#1 UmCS 2 0 lo0
@mabn
mabn / service-checklist.md
Created December 13, 2016 10:52 — forked from iaintshine/service-checklist.md
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
@mabn
mabn / PathNameProvider.java
Created January 16, 2017 23:52
path name provider
package com.getbase.tracing4j.spring;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.mvc.condition.PatternsRequestCondition;
import org.springframework.web.servlet.mvc.method.RequestMappingInfo;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
@mabn
mabn / Activation.java
Created February 12, 2017 14:04
opentracing activation hook
package io.opentracing.activation;
import java.util.List;
import java.util.Map;
import org.slf4j.MDC;
public class ActivationTest {
interface ActiveSpanManager {
@mabn
mabn / cassandra.yaml
Created June 7, 2017 11:03
OOMing cassandra config
# Cassandra storage config YAML
# NOTE:
# See http://wiki.apache.org/cassandra/StorageConfiguration for
# full explanations of configuration directives
# /NOTE
# The name of the cluster. This is mainly used to prevent machines in
# one logical cluster from joining another.
cluster_name: 'Test Cluster'