Skip to content

Instantly share code, notes, and snippets.

$ RUST_BACKTRACE=1 RUST_LOG=trace ./target/debug/examples/main
TRACE:mio::sys::unix::kqueue: registering; token=Token(18446744073709551615); interests=Ready {Readable}
TRACE:mio::poll: registering with poller
TRACE:mio::poll: registering with poller
DEBUG:tokio_core::reactor: adding a new I/O source
TRACE:mio::poll: registering with poller
TRACE:mio::sys::unix::kqueue: registering; token=Token(2); interests=Ready {Readable | Writable | Hup}
TRACE:sozu_command_futures: will send message: ConfigMessage { id: "message-id-42", version: 0, data: ListWorkers, proxy_id: None }
TRACE:sozu_command_futures: lock
TRACE:sozu_command_futures: calling start_send
@Geal
Geal / Sozu Individual Contributor Assignment Agreement
Last active April 3, 2017 15:03
Sozu Individual Contributor Assignment Agreement
Sozu Individual Contributor Assignment Agreement
Thank you for your interest in contributing to Sozu, legally represented by Clever Cloud SAS ("We" or "Us").
This contributor agreement ("Agreement") documents the rights granted by contributors to Us. To make this document effective, please sign it and send it to Us by electronic submission, following the instructions at . This is a legally binding document, so please read it carefully before agreeing to it. The Agreement may cover more than one software project managed by Us.
1. Definitions
"You" means the individual who Submits a Contribution to Us.
"Contribution" means any work of authorship that is Submitted by You to Us in which You own or assert ownership of the Copyright. If You do not own the Copyright in the entire work of authorship, please follow the instructions in .
"Copyright" means all rights protecting works of authorship owned or controlled by You, including copyright, moral and neighboring rights, as appropriate, for the full term of their
@Geal
Geal / Sozu Entity Contributor Assignment Agreement
Last active April 3, 2017 14:56
Sozu Entity Contributor Assignment Agreement
Sozu Entity Contributor Assignment Agreement
Thank you for your interest in contributing to Sozu, legally represented by Clever Cloud SAS ("We" or "Us").
This contributor agreement ("Agreement") documents the rights granted by contributors to Us. To make this document effective, please sign it and send it to Us by electronic submission, following the instructions at . This is a legally binding document, so please read it carefully before agreeing to it. The Agreement may cover more than one software project managed by Us.
1. Definitions
"You" means any Legal Entity on behalf of whom a Contribution has been received by Us. "Legal Entity" means an entity which is not a natural person. "Affiliates" means other Legal Entities that control, are controlled by, or under common control with that Legal Entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such Legal Entity, whether by contract or otherwise, (ii) ownership of fifty perc
macro_rules! default_incomplete (
($i: expr, $submac:ident!( $($args:tt)* ), $default: expr) => {
match $submac($i, $($args)*) {
IResult::Incomplete(_) => IResult::Done($i, $default),
other => other
}
}
);
Client.new(<some TCP or TLS stream>)
.connect() //will start the handshake of 7 or so messages, returns a future that resolves once the handshake is done
.and_then(|client| {
client.create_channel() // returns a future that resolves once the channel is created
.map(|channel| {
channel
.queue("queue_name") // returns a future that resolves once the queue is declared
.and_then(|queue| {
queue.publish(|queue| {
queue.send(message)
TRACE:mio::sys::unix::kqueue: registering; token=Token(18446744073709551615); interests=Ready {Readable}
TRACE:mio::poll: set_readiness event Ready {Readable} Token(0)
DEBUG:tokio_core::reactor: adding a new I/O source
TRACE:mio::poll: registering with poller
TRACE:mio::sys::unix::kqueue: registering; token=Token(2); interests=Ready {Readable | Writable | Hup}
DEBUG:tokio_core::reactor: consuming notification queue
DEBUG:tokio_core::reactor: scheduling direction for: 0
TRACE:mio::poll: custom readiness queue has pending events
TRACE:mio::poll: returning readiness event Ready {Readable} Token(0)
DEBUG:tokio_core::reactor: loop poll - Duration { secs: 0, nanos: 173303 }
@Geal
Geal / tp.md
Created February 6, 2017 12:18

B3 Piratage éthique 2017 - TP développement d’exploits

Le but de ce TP est de gagner en compétences sur la recherche de failles de sécurité, en étudiant des vulnérabilités existantes et en développant des exploits pour celles-ci.

Vous travaillerez en groupe de 3 ou 4 personnes.

Vous choisirez dans la première demi-heure un logiciel à attaquer. Voici les critères recommandés:

  • Open source, pour faciliter l’étude du code contenant la faille
  • Choisissez une vulnérabilité connue et publiée dans une version dépassée du logiciel
@Geal
Geal / fork-exec.rs
Last active December 24, 2019 02:26
extern crate nix;
extern crate libc;
use nix::sys::signal::*;
use nix::unistd::*;
use nix::fcntl::{fcntl,FcntlArg,FdFlag,FD_CLOEXEC};
use libc::c_char;
use std::mem;
use std::str;
//! AccReader is like a BufReader, but supports partial consumption
//! import new data with `fill_buf`, get the current buffer with
//! `current_slice`, and indicate with `consume` how many bytes
//! were used
use std::io;
use std::io::{Read,BufRead};
use std::iter::{repeat,Iterator};
use std::cmp;
@Geal
Geal / blogpost.md
Last active November 25, 2016 10:19
nom release blogpost

Nearly one year ago, on November 15th 2015, I released the 1.0 version of nom, the fast parser combinators library I wrote in Rust. A lot happened around that project, and I have been really happy to interact with nom users around the world.

TL;DR: it's new nom day! The 2.0 release is here! Read the changelog. Follow the upgrade documentation if it breaks stuff.

Interesting usage

I wouldn't be able to list all the projects using nom on this page, even the subset present on crates.io, but here are a few examples of what people built with nom: