Skip to content

Instantly share code, notes, and snippets.

View olix0r's full-sized avatar
🍓

Oliver Gould olix0r

🍓
View GitHub Profile
# Examples:
#
# # Deploy everything
# :; target/cli/conduit-latest-macos inject config/strest.yml \
# | kubectl apply -f - --prune -l 'app=strest'
#
# # Add server instances
# :; kubectl -n strest scale -l 'strest-role=server' --replicas=3
#
# # Stop a specific test
@olix0r
olix0r / lb.yml
Created February 2, 2018 23:36
a K8s config to test load balancing behavior
:; cat ~/b/hello-world.yml
---
apiVersion: v1
kind: Service
metadata:
name: hello
spec:
selector:
app: hello
@olix0r
olix0r / thriftcrash.sh
Created July 27, 2017 18:35
Kill your thrift server with this handy dandy command
#!/bin/sh
set -e
echo -n -e \\x00\\x00\\x00\\x08\\x4e\\x49\\x5f\\x50\\x49\\x4e\\x47\\x00 | nc $@
@olix0r
olix0r / input.txt
Created June 20, 2017 02:26
BSD grep segfault
This file has been truncated, but you can view the full file.
Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
Running `target/debug/linkerd-tcp example.yml`
DEBUG:linkerd_tcp::balancer::dispatcher: start_send: dispatching waiter
TRACE:linkerd_tcp::balancer::dispatchq : start_send: dispatching sendq=1/1048575 recvq=0
TRACE:linkerd_tcp::balancer::dispatchq : dispatch: took waiter from sendq; polling recvq
TRACE:linkerd_tcp::balancer::dispatchq : dispatch: recvq not ready
TRACE:linkerd_tcp::balancer::dispatchq : start_send: dispatched sendq=1/1048575 recvq=0
DEBUG:linkerd_tcp::balancer::dispatcher: initiating 1 connections
DEBUG:linkerd_tcp::balancer::dispatcher: start_send: dispatched waiter ready=true
DEBUG:linkerd_tcp::balancer::dispatcher: start_send: dispatching waiter
@olix0r
olix0r / dispatchq.rs
Created June 19, 2017 19:47
single-producer multi-consumer dispatch channel
use futures::{Future, Stream, Poll, Async, AsyncSink, Sink, StartSend};
use futures::unsync::{oneshot, mpsc};
use std::cell::RefCell;
use std::collections::VecDeque;
use std::rc::Rc;
/// Creates a dispatching channel.
///
/// This channel supports a single producer task and many consumers.
/// It is intended to be used by a producer task that pushes T-typed
admin:
port: 9989
metricsIntervalSecs: 10
routers:
- label: default
interpreter:
kind: io.l5d.namerd.http
extern crate rand;
use rand::Rng;
use std::cell::RefCell;
use std::collections::HashMap;
use std::rc::Rc;
use std::thread;
use std::time::Duration;
fn main() {
@olix0r
olix0r / git-immolate.sh
Created January 17, 2017 21:49
Questionable Git Aliases
#!/bin/sh
set -e
# When the current branch has been merged to the origin, update master
# and delete the local branch.
branch=$(git rev-parse --abbrev-ref HEAD)
if [ -z "$branch" ]; then
@olix0r
olix0r / debughttpd.go
Created January 11, 2017 01:11
simple http debugging server
package main
import (
"flag"
"fmt"
"net/http"
"os"
)
func dieIf(err error) {
@olix0r
olix0r / docker-compose.yml
Created December 1, 2016 08:34
linkerd + grpc + docker-compose
version: '2'
services:
l5d:
image: buoyantio/linkerd:nightly
container_name: l5d
ports:
- 4142:4142
- 9990:9990