Skip to content

Instantly share code, notes, and snippets.

---
platforms:
windows:
batch_commands:
- powershell -Command "(Get-Content WORKSPACE) -Replace '# android_', 'android_' | Set-Content WORKSPACE"
build_flags:
- "--copt=-w"
- "--host_copt=-w"
# Remove when https://github.com/bazelbuild/bazel/issues/7026 is fixed.
steps:
- agents: {kind: pipeline}
command:
- |-
buildkite-agent annotate --style=info "Downstream testing is disabled for the following projects :sadpanda:
* **BUILD_file_generator**: https://github.com/bazelbuild/BUILD_file_generator/issues/39: reenable once fixed
* **rules_typescript**: https://github.com/bazelbuild/bazel/issues/6675
* **Bazel Remote Execution**: bazel#6288: enable once remote execution is green
* **rules_k8s**: Enable once https://github.com/bazelbuild/rules_k8s/pull/195 is merged
* **rules_webtesting**: Enable once is resolved: https://github.com/bazelbuild/continuous-integration/issues/191
# Remove all traffic shaping from eth0
sudo tc qdisc del dev eth0 root
# Add a priority traffic shaping class to the root of eth0
sudo tc qdisc add dev eth0 root handle 1: prio
# Add a qdisc (queuing discipline) with the appropriate traffic shaping to the new traffic shaping class
sudo tc qdisc add dev eth0 parent 1:1 handle 2: netem delay 25ms rate 1gbit
# Add a filter which only selects the qdisc for outgoing packets to 192.168.59.38 (i.e. Boundary Frontend)
sudo tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 match ip dst 192.168.59.38 flowid 2:1
@buchgr
buchgr / FooBenchmark.java
Created September 19, 2016 07:19
Simple EA test
package io.grpc;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.CompilerControl;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.State;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/*
* Copyright 2014 The Netty Project
*
* The Netty Project licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
Jakobs-MBP-4:bin buchgr$ ./h2spec -p 8080
3.5. HTTP/2 Connection Preface
✓ Sends invalid connection preface
4.2. Frame Size
× Sends large size frame that exceeds the SETTINGS_MAX_FRAME_SIZE
- The endpoint MUST send a FRAME_SIZE_ERROR error.
Expected: GOAWAY frame (ErrorCode: FRAME_SIZE_ERROR)
RST_STREAM frame (ErrorCode: FRAME_SIZE_ERROR)
Connection close
#include <unistd.h>
#include <sys/syscall.h>
#include <sys/mman.h>
#include <cstring>
#include <cstdio>
int main(int argc, char** argv) {
constexpr size_t SIZE = 512 << 20;
unsigned i = 10;
void *p = mmap(NULL, SIZE, PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE, -1, 0);
#ifndef PARALLEL_ZEROER_HPP
#define PARALLEL_ZEROER_HPP
#include <atomic>
#include <iostream>
#include <boost/asio.hpp>
#include <boost/thread.hpp>
class ParallelZeroer {
@buchgr
buchgr / Main.java
Created December 17, 2015 17:42
Test accuracy of ScheduledThreadPoolExecutor.
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.LockSupport;
// Run with enough heap and -verbose:gc to make sure that GC is not running.
public class Main {
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.LockSupport;
// Run with enough heap and -verbose:gc to make sure that GC is not running.
public class Main {