Skip to content

Instantly share code, notes, and snippets.

@boxofrox
boxofrox / error.txt
Created November 14, 2017 20:45
build error in carnix 0.4.6 with rustc 1.21.0
$ nix-env -iA nixos.carnix
... build crates ...
Building src/main.rs (carnix)
Running rustc --crate-name carnix src/main.rs --crate-type bin -C opt-level=3 --out-dir target/bin --emit=dep-info,link -L dependency=target/deps -L native=/nix/store/gplwjf38jzylm1kfxgyd9z5a1lkvhlzv-rust_backtrace-sys-0.1.16/backtrace-sys.out/.libs -L native=/nix/store/z650nric4bzz9h0i1dj54dgx2gbzyyp4-sqlite-3.21.0/lib -l sqlite3 -l static=backtrace --extern clap=/nix/store/da54ljzhdj1w9lnjany9nhpmfaf13i9j-rust_clap-2.27.1/libclap-0d0f70b4fe.rlib --extern env_logger=/nix/store/4fjlf2fs9fjpj88b8yzcmv1yxanzrwgr-rust_env_logger-0.4.3/libenv_logger-44fd8c2574.rlib --extern error_chain=/nix/store/b2s6m89igvcp7igp95pv5pqzlwnrkrnk-rust_error-chain-0.11.0/liberror_chain-e3c9b7a037.rlib --extern log=/nix/store/zi0py5c94qzzdqsvd9nsffx3clr7pxq2-rust_log-0.3.8/liblog-4ed683d9af.rlib --extern nom=/nix/store/c2bymx136ba85j1k0k9pzimdfi5y8ymp-rust_nom-3.2.1/libnom-ab93402e0b.rlib --extern regex=/nix/store/wxnlnhqimhwa3dz2npp5v0bb8g0gwi41-r
@boxofrox
boxofrox / decode.out
Created November 6, 2017 02:32
Decoding /outputs/nvimpam_mid.stdout for KillTheMule
[ 94 - fixarray length 4
0 00 - fixint 0
0 00 - fixint 0
nvim_command ac - fixstr with 12 bytes
[ 91 - fixarray length 1
echom "rust client connected to neovim" d9 27 - str with 39 letters
]
]
[ 94 - fixarray length 4

Keybase proof

I hereby claim:

  • I am boxofrox on github.
  • I am boxofrox (https://keybase.io/boxofrox) on keybase.
  • I have a public key ASCJO3UC2OMQ78uBO_FrS5rGfPHhEBzAfaoRoJYaVtRIJAo

To claim this, I am signing this object:

@boxofrox
boxofrox / openssl-self-signed-san-certificate.md
Created June 30, 2017 00:23 — forked from jdeathe/openssl-self-signed-san-certificate.md
How to generate a self-signed SAN SSL/TLS certificate using openssl

How to generate a self-signed SAN SSL/TLS certificate using openssl

Generating a self-signed certificate is a common taks and the command to generate one with openssl is well known and well documented. Generating a certificate that includes subjectAltName is not so straght forward however. The following example demonstrates how to generate a SAN certificate without making a permanent change to the openssl configuration.

Generate a list of all required DNS names, (Note: CN will be discarded).

$ export SAN="DNS:www.domain.localdomain,DNS:domain.localdomain"
@boxofrox
boxofrox / valgrind.txt
Created June 8, 2017 18:24
report - valgrind --tool=memcheck target/release/bug-test-01
▶ DSN=mysql://testbot:testbot@192.168.70.162/fake_data RUST_BACKTRACE=1 RUST_LOG=bug_test_01=debug valgrind -v --tool=memcheck target/release/bug-test-01
==32500== Memcheck, a memory error detector
==32500== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==32500== Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyright info
==32500== Command: target/release/bug-test-01
==32500==
--32500-- Valgrind options:
--32500-- -v
--32500-- --tool=memcheck
--32500-- Contents of /proc/version:
@boxofrox
boxofrox / valgrind.txt
Created June 8, 2017 18:16
report - valgrind --tool=memcheck target/debug/bug-test-01
▶ DSN=mysql://testbot:testbot@192.168.70.162/fake_data RUST_BACKTRACE=1 RUST_LOG=bug_test_01=debug valgrind -v --tool=memcheck target/debug/bug-test-01
==31827== Memcheck, a memory error detector
==31827== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==31827== Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyright info
==31827== Command: target/debug/bug-test-01
==31827==
--31827-- Valgrind options:
--31827-- -v
--31827-- --tool=memcheck
--31827-- Contents of /proc/version:
@boxofrox
boxofrox / playground.rs
Created May 30, 2017 03:20 — forked from anonymous/playground.rs
Rust code shared from the playground
extern crate serde;
#[macro_use]
extern crate serde_derive;
extern crate serde_json;
use std::collections::HashMap;
use serde::{Serialize, Serializer};
fn main() {
let mut map: HashMap<String, String> = HashMap::new();
@boxofrox
boxofrox / main.rs
Last active May 23, 2017 23:52 — forked from ob/gist:11961f2f82fc7001c71444d261352f94
tokio-rs : two url example -> many url example
extern crate curl;
extern crate futures;
extern crate time;
extern crate tokio_core;
extern crate tokio_curl;
extern crate tokio_timer;
use curl::easy::Easy;
use futures::{Future, Stream};
use futures::stream::futures_unordered;
@boxofrox
boxofrox / main.rs
Created May 22, 2017 00:16
snippet of tokio-rs wrapping io:Error in a custom error-chain::Error
// load ssl certificate into tls handler
let tls_acceptor = TlsAcceptor::builder(load_pkcs12(pkcs12_file)?)
.chain_err(|| "invalid cert")?
.build()
.chain_err(|| "cannot build tls acceptor")?;
// create event loop for socket listener
let mut core = Core::new().chain_err(|| "cannot create event loop")?;
let handle = core.handle();
@boxofrox
boxofrox / backtrace.txt
Created May 19, 2017 22:35
backtrace: mysql_async: add with overflow
thread 'main' panicked at 'attempt to add with overflow', /home/boxofrox/.cargo/registry/src/github.com-1ecc6299db9ec823/mysql_async-0.9.2/src/conn/futures/read_packet.rs:76
stack backtrace:
0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
1: std::sys_common::backtrace::_print
at /checkout/src/libstd/sys_common/backtrace.rs:71
2: std::panicking::default_hook::{{closure}}
at /checkout/src/libstd/sys_common/backtrace.rs:60
at /checkout/src/libstd/panicking.rs:355
3: std::panicking::default_hook