Skip to content

Instantly share code, notes, and snippets.

View jimmycuadra's full-sized avatar
☠️
GitHub profits from the separation of families and the deaths of children.

jimmycuadra

☠️
GitHub profits from the separation of families and the deaths of children.
View GitHub Profile
src/lib.rs:95:9: 95:17 error: the trait bound `T: std::marker::Reflect` is not satisfied [E0277]
src/lib.rs:95 impl<T> StdError for Error<T> where T: Debug {
^~~~~~~~
src/lib.rs:95:9: 95:17 help: run `rustc --explain E0277` to see a detailed explanation
src/lib.rs:95:9: 95:17 help: consider adding a `where T: std::marker::Reflect` bound
src/lib.rs:95:9: 95:17 note: required because it appears within the type `std::option::Option<T>`
src/lib.rs:95:9: 95:17 note: required because it appears within the type `Error<T>`
src/lib.rs:95:9: 95:17 note: required by `std::error::Error`
@jimmycuadra
jimmycuadra / kaws_agent_strace.txt
Last active April 14, 2016 19:18
kaws-agent stack overflow valgrind output
cat kaws-strace
execve("./kaws-agent", ["./kaws-agent", "run", "--role", "master"], [/* 6 vars */]) = 0
mmap(NULL, 624, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1ecac1d000
arch_prctl(ARCH_SET_FS, 0x7f1ecac1d120) = 0
set_tid_address(0x7f1ecac1d158) = 13
readlink("/etc/malloc.conf", 0x7ffe3db2d560, 4096) = -1 ENOENT (No such file or directory)
brk(0) = 0x1cf8000
mmap(NULL, 2097152, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1ecaa1d000
munmap(0x7f1ecaa1d000, 2097152) = 0
mmap(NULL, 4190208, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1eca81e000
@jimmycuadra
jimmycuadra / Dockerfile
Created April 14, 2016 17:13
Compiling rust-etcd targeting musl, but with openssl built against glibc
FROM debian:jessie
MAINTAINER Jimmy Cuadra <[email protected]>
ENV USER=root
ENV PATH=/root/.cargo/bin:$PATH
CMD ["/bin/bash"]
RUN apt-get -qq update
RUN apt-get install -qy --no-install-recommends ca-certificates curl git libssl-dev musl-tools
RUN curl -fSsO https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-setup
@jimmycuadra
jimmycuadra / gist:c52ee291b6be9c56fa5d96d050ac4f8b
Created April 2, 2016 10:16
musl libc bad gpg signature + sha 512 sums
$ gpg2 --verify musl-1.1.14.tar.gz.asc musl-1.1.14.tar.gz
gpg: Signature made Sun Feb 21 21:07:42 2016 PST using RSA key ID 3020450F
gpg: BAD signature from "musl libc <[email protected]>" [unknown]
$ shasum -a 512 musl-1.1.14.tar.gz
208f741bbccd36c9242b15206235e95673b9c24f8e449ce77676d19b66a7bf033894e66c3acfb519dcc92c4b1c100b8b204f9c5e3f9d013775a86788d00be562 musl-1.1.14.tar.gz
$ shasum -a 512 musl-1.1.14.tar.gz.asc
07c11ceea1eab502aba9331b6ee80c84a0cc833a00e60ea6eb5546bf5bf275216829cf08174b8d17cf60eff047da65bbe63e487959239a8e65ecd9c0f4a40ad2 musl-1.1.14.tar.gz.asc
@jimmycuadra
jimmycuadra / cross_compile.txt
Created March 31, 2016 23:29
`cargo build --release --target x86_64-unknown-linux-gnu` from OS X
$ cargo build --release --target x86_64-unknown-linux-gnu
Downloading yaml-rust v0.3.2
Downloading libc v0.2.9
Compiling yaml-rust v0.3.2
Compiling regex-syntax v0.3.1
Compiling vec_map v0.6.0
Compiling libc v0.2.9
Compiling mempool v0.2.0
Compiling unicode-width v0.1.3
Compiling clap v2.2.4
@jimmycuadra
jimmycuadra / travis.yml
Created February 27, 2016 09:28
Use nightly Rust for a specific target on Travis CI
matrix:
include:
- rust: nightly
script: cargo build --target foo-bar-baz
$ cargo build
Compiling ruma v0.1.0 (file:///Users/jimmy/Code/ruma)
src/user.rs:39:41: 39:51 error: no method named `get_result` found for type `diesel::query_builder::insert_statement::InsertStatement<schema::users::table, &user::NewUser>` in the current scope
src/user.rs:39 insert(new_user).into(users::table).get_result(connection).map_err(APIError::from)
^~~~~~~~~~
src/user.rs:39:41: 39:51 note: the method `get_result` exists but the following trait bounds were not satisfied: `diesel::query_builder::insert_statement::InsertQuery<(schema::users::columns::id, schema::users::columns::password_hash, schema::users::columns::created_at, schema::users::columns::updated_at), diesel::query_builder::insert_statement::InsertStatement<schema::users::table, &user::NewUser>> : diesel::query_builder::QueryFragment<_>`, `&diesel::query_builder::insert_statement::InsertStatement<schema::users::table, &user::NewUser> : diesel::query_builder::AsQuery`, `_ : diesel
@jimmycuadra
jimmycuadra / schema.sql
Created February 10, 2016 05:50
Synapse's full SQL schema as of c110eb9 (v0.12.1-rc1)
CREATE TABLE schema_version(
Lock CHAR(1) NOT NULL DEFAULT 'X' UNIQUE, -- Makes sure this table only has one row.
version INTEGER NOT NULL,
upgraded BOOL NOT NULL, -- Whether we reached this version from an upgrade or an initial schema.
CHECK (Lock='X')
);
CREATE TABLE applied_schema_deltas(
version INTEGER NOT NULL,
file TEXT NOT NULL,
UNIQUE(version, file)
@jimmycuadra
jimmycuadra / gist:58b5a01ef48876e87374
Created February 6, 2016 12:42
Ruma's first user registration
$ ruma start &
[1] 17673
curl -i -H "Content-Type: application/json" http://localhost:3000/_matrix/client/r0/register -d '{"password":"secret"}'
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Date: Sat, 06 Feb 2016 12:41:42 GMT
Content-Type: application/json; charset=utf-8
{"access_token":"fake access token","home_server":"fake home server","user_id":"tJfCJcClNRFn"}
@jimmycuadra
jimmycuadra / associated_type_constraint.rs
Created February 4, 2016 10:00
Syntax for constraining an associated type in a generic trait impl
trait Connection;
trait ManageConnection {
type Connection;
type Error;
}
struct ConnectionManager;
struct Error;