Skip to content

Instantly share code, notes, and snippets.

View jeromegn's full-sized avatar
🏠
Rusting it up

Jerome Gravel-Niquet jeromegn

🏠
Rusting it up
View GitHub Profile

aspe:keyoxide.org:RLPPCSIG7CQPI3T7UCEQIXTGHI

@jeromegn
jeromegn / Dockerfile
Created January 15, 2024 16:44
Quickwit cluster on Fly
FROM quickwit/quickwit:0.6.3
COPY entrypoint.sh /entrypoint.sh
RUN mkdir -p /quickwit/config
COPY config.yaml /quickwit/config/quickwit.yaml
ENTRYPOINT ["/entrypoint.sh"]
async fn transfer(inbound: MeteredIO, outbound: MeteredIO) -> Result<(), Error>
{
let (mut ri, mut wi) = tokio::io::split(inbound);
let (mut ro, mut wo) = tokio::io::split(outbound);
let mut client_to_server = ri.copy(&mut wo).fuse();
let mut server_to_client = ro.copy(&mut wi).fuse();
loop {
futures::select! {
error[E0308]: mismatched types
--> src/handlers/tcp.rs:159:5
|
159 | tokio::spawn(super::proxy_tcp(
| ^^^^^^^^^^^^ one type is more general than the other
|
= note: expected type `futures_util::future::map::Map<tokio_io::io::shutdown::Shutdown<'_, _>, _>`
found type `futures_util::future::map::Map<tokio_io::io::shutdown::Shutdown<'_, _>, _>`
@jeromegn
jeromegn / xdp_load_balancer.c
Created October 8, 2019 20:50 — forked from summerwind/xdp_load_balancer.c
XDP based load balancer with L3DSR support
#define KBUILD_MODNAME "load_balancer"
#include <uapi/linux/bpf.h>
#include <linux/in.h>
#include <linux/if_ether.h>
#include <linux/if_packet.h>
#include <linux/if_vlan.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
BPF_HASH(counter, uint32_t, long);
package main
import (
"fmt"
"io/ioutil"
"os"
"strconv"
"syscall"
"time"
"unsafe"
class Messages
include Enumerable
attr_reader :messages
delegate :each, to: :messages
def initialize(messages = {}) # hash of error messages
@messages = messages
end
def full_messages
@jeromegn
jeromegn / basic.ecr
Created February 7, 2016 18:26
Slang -> ECR -> HTML
<span id="some-id" class="classname">
<div id="hello" class="world world2">
<span data-some-var="<%= some_var %>">
<span>
<span class="deep_nested">
<%= Process.pid %>
</span>
</span>
</span>
<span class="alongside" pid="<%= Process.pid %>">
@jeromegn
jeromegn / index.html
Created March 20, 2012 03:02 — forked from benjchristensen/index.html
Animated Line Graphs / Sparklines using SVG Path and d3.js
<html>
<head>
<title>Animated Sparkline using SVG Path and d3.js</title>
<script src="http://mbostock.github.com/d3/d3.js"></script>
<style>
/* tell the SVG path to be a thin blue line without any area fill */
path {
stroke: steelblue;
stroke-width: 1;
fill: none;
@jeromegn
jeromegn / index.html
Created March 16, 2012 03:26
Activity on map
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="http://mbostock.github.com/d3/d3.js"></script>
<style type="text/css">
svg {
background: #222;
width: 960px;