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 / keybase.md
Created November 25, 2014 18:24
keybase.md

Keybase proof

I hereby claim:

  • I am jeromegn on github.
  • I am jerome (https://keybase.io/jerome) on keybase.
  • I have a public key whose fingerprint is 0638 8CB6 C529 1977 7911 A36A FAF6 2F81 F60B 40B8

To claim this, I am signing this object:

<div class="red-square" id="{{id}}-red-square">
</div>
<style>
.red-square {
background-color: red;
}
</style>
<script>