Skip to content

Instantly share code, notes, and snippets.

View BlackYoup's full-sized avatar

Arnaud Lefebvre BlackYoup

View GitHub Profile
@BlackYoup
BlackYoup / mongodb.rs
Last active December 21, 2016 23:31
Rust mongo db
extern crate mongodb;
#[macro_use] extern crate bson;
use bson::{Bson, Document};
use bson::oid::ObjectId;
use mongodb::{Client, ClientOptions, ThreadedClient};
use mongodb::db::{Database, ThreadedDatabase};
use mongodb::connstring::{ConnectionString, ConnectionOptions, Host};
use mongodb::topology::{TopologyDescription, TopologyType};
* Rebuilt URL to: lolcat.st/
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to lolcat.st (127.0.0.1) port 80 (#0)
> GET / HTTP/1.1
> Host: lolcat.st
> User-Agent: curl/7.52.1
> Accept: */*
>
* HTTP 1.0, assume close after body
@BlackYoup
BlackYoup / tcpdump -i lo port 9090
Last active February 2, 2017 22:42
tcpdump -i lo port 9090
0x0020: 8010 0156 fe28 0000 0101 080a 085b fc58 ...V.(.......[.X
0x0030: 085b fc58 .[.X
23:38:34.872884 IP localhost.58592 > localhost.9090: Flags [P.], seq 1:72, ack 1, win 342, options [nop,nop,TS val 140246105 ecr 140246104], length 71
0x0000: 4500 007b 4e9d 4000 4006 eddd 7f00 0001 E..{N.@.@.......
0x0010: 7f00 0001 e4e0 2382 ba18 b2c4 bbf8 38ad ......#.......8.
0x0020: 8018 0156 fe6f 0000 0101 080a 085b fc59 ...V.o.......[.Y
0x0030: 085b fc58 4745 5420 2f20 4854 5450 2f31 .[.XGET./.HTTP/1
0x0040: 2e31 0d0a 486f 7374 3a20 6c6f 6c63 6174 .1..Host:.lolcat
0x0050: 2e73 740d 0a55 7365 722d 4167 656e 743a .st..User-Agent:
0x0060: 2063 7572 6c2f 372e 3532 2e31 0d0a 4163 .curl/7.52.1..Ac
2017-02-24T12:16:09Z 12719061850404 19756 INFO MASTER starting up [305/27862]
2017-02-24T12:16:09Z 12719062618572 19756 TRACE MASTER sozu::worker parent(19756)
2017-02-24T12:16:09Z 12719148810423 19756 INFO MASTER launching worker
2017-02-24T12:16:09Z 12719148968817 19756 INFO MASTER worker launched: 19758
2017-02-24T12:16:09Z 12719149192252 19756 TRACE MASTER sozu::worker parent(19756)
2017-02-24T12:16:09Z 12719151763735 19756 TRACE MASTER sozu::worker child(19758):will spawn a child
2017-02-24T12:16:09Z 12719234992022 19756 INFO MASTER launching worker
2017-02-24T12:16:09Z 12719235162907 19756 INFO MASTER worker launched: 19759
2017-02-24T12:16:09Z 12719235262822 19756 TRACE MASTER sozu::worker child(19759):will spawn a child
2017-02-24T12:16:09Z 12719235406859 19756 TRACE MASTER sozu::worker p
https://crash-stats.mozilla.com/report/index/bp-95af1310-6934-42d2-b8e4-a11820170418 4/18/17 1:53 PM
https://crash-stats.mozilla.com/report/index/bp-dfc5a763-c836-4d34-bd4d-92bce0170418 4/18/17 1:53 PM
https://crash-stats.mozilla.com/report/index/bp-a1345aa9-03e0-4755-a31a-c5ec20170418 4/18/17 1:53 PM
https://crash-stats.mozilla.com/report/index/bp-f578d1c4-ce2c-4a7f-8da6-2a4c40170418 4/18/17 1:53 PM
https://crash-stats.mozilla.com/report/index/bp-9202b6f6-6d11-4626-993b-6850a0170418 4/18/17 1:53 PM
https://crash-stats.mozilla.com/report/index/bp-2f2a7553-5505-4d0f-ba03-67dcc0170418 4/18/17 1:53 PM
https://crash-stats.mozilla.com/report/index/bp-3269f2ba-4de7-4992-a3b3-75cba0170418 4/18/17 1:53 PM
https://crash-stats.mozilla.com/report/index/bp-c9238e55-1d50-4afe-8cf9-880f10170418 4/18/17 10:11 AM
https://crash-stats.mozilla.com/report/index/bp-221be130-2f93-4089-9b2a-e523b0170418 4/18/17 10:11 AM
https://crash-stats.mozilla.com/report/index/bp-e33080d9-2971-4ea9-bfd6-1b0f90170418 4/18/17 10:11 AM
[13:33:09][arnaud:~/Dev/sozu/bin] git:(master|✚1) ~ $ RUST_LOG=trace ../target/debug/sozu start -c config.toml
2017-04-20T11:33:15Z 13896251598651 24011 INFO MASTER starting up
2017-04-20T11:33:15Z 13896252068087 24011 TRACE MASTER sozu::worker parent(24011)
2017-04-20T11:33:15Z 13896254740754 24011 INFO MASTER launching worker
2017-04-20T11:33:15Z 13896254895598 24011 INFO MASTER worker launched: 24013
2017-04-20T11:33:15Z 13896254964027 24011 TRACE MASTER sozu::worker child(24013): will spawn a child
2017-04-20T11:33:15Z 13896255417005 24011 TRACE MASTER sozu::worker parent(24011)
2017-04-20T11:33:15Z 13896258328904 24011 INFO MASTER launching worker
2017-04-20T11:33:15Z 13896258459256 24011 INFO MASTER worker launched: 24014
2017-04-20T11:33:15Z 13896258537145 24011 TRACE MASTER sozu::worker child(24014): will spawn a child
[1:02:07][arnaud:~/Dev/sozu/bin] git:(configurable-timeouts↑1|✚1…) ~ $ cargo build && RUST_BACKTRACE=1 RUST_LOG=trace ../target/debug/sozu start -c config.toml
Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
2017-04-23T23:02:16Z 20414126576492 27856 INFO MASTER starting up
2017-04-23T23:02:16Z 20414126942093 27856 TRACE MASTER sozu::worker parent(27856)
2017-04-23T23:02:16Z 20414129658377 27856 INFO MASTER launching worker
2017-04-23T23:02:16Z 20414129795405 27856 INFO MASTER worker launched: 27858
2017-04-23T23:02:16Z 20414129887136 27856 TRACE MASTER sozu::worker child(27858): will spawn a child
2017-04-23T23:02:16Z 20414130107017 27856 TRACE MASTER sozu::worker parent(27856)
2017-04-23T23:02:16Z 20414132857274 27856 INFO MASTER launching worker
2017-04-23T23:02:16Z 20414132992942 27856 INFO MASTER worker launched: 27859
# sozu proxy test config file
command_socket = "./command_folder/sock"
saved_state = "./state.json"
log_level = "info"
log_target = "stdout"
#log_target = "udp://127.0.0.1:9876"
#log_target = "tcp://127.0.0.1:9876"
command_buffer_size = 16384
worker_count = 2
2017-04-25T20:34:14Z 41450422554964 5962 INFO TAG-1 ref: Ssl { state: "unknown state" }
2017-04-25T20:34:14Z 41450422679454 5962 INFO TAG-1 checking servername: eldorado.blackyoup.me
2017-04-25T20:34:14Z 41450422746203 5962 INFO TAG-1 looking for fingerprint for "eldorado.blackyoup.me"
2017-04-25T20:34:14Z 41450422876798 5962 INFO TAG-1 looking for context for "eldorado.blackyoup.me" with fingerprint [31, 94, 41, 6, 22, 222, 195, 242, 176, 48, 172, 139, 199, 66, 209, 116, 52, 57, 67, 134, 91, 242, 255, 182, 104, 18, 118, 96, 243, 20, 48, 191]
2017-04-25T20:34:14Z 41450423035165 5962 INFO TAG-1 found context for "eldorado.blackyoup.me"
2017-04-25T20:34:14Z 41450423206649 5962 INFO TAG-1 servername is now Some("eldorado.blackyoup.me")
2017-04-25T20:34:14Z 41450444190421 5962 TRACE TAG-1 sozu_lib::network::session front readable interpreting client order Continue
2017-04-25T20:34:14Z 41450493117610 5962 DEBUG TAG-1
{
"234": {
"11": {
"type": "Application - Genre",
"mode": "single",
"terms": {
"1034": "Crack",
"162": "Firmware",
"130": "Animaux",
"173": "Navigateur Web",