Skip to content

Instantly share code, notes, and snippets.

@nayato
nayato / launch.json
Created April 5, 2018 13:55 — forked from puffybsd/launch.json
VSCode launcher for rust using lldb
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug-LLDB",
"type": "lldb",
"request": "launch",
"program": "${workspaceRoot}/target/debug/${workspaceRootFolderName}",
"args": [],
"cwd": "${workspaceRoot}",
@nayato
nayato / README.md
Created December 11, 2017 19:04 — forked from ihrwein/README.md
Building minimal Rust containers with Docker multi stage builds

The built image for a hello world project is less than 8 MB.

Builder image (it'd be best to upload this image to Docker Hub. This is 100% percent reusable).

FROM ubuntu:latest

ENV TARGET=x86_64-unknown-linux-musl
ENV BUILD_DIR=/src/target/x86_64-unknown-linux-musl/release/
@nayato
nayato / erasure.rs
Created October 12, 2017 20:09 — forked from anonymous/playground.rs
Rust code shared from the playground
fn main() {
let a = Test(None);
a.print();
let b = Test(Some(23));//Box::new(Test(Some(23)));
b.print();
print_it(&b);
}
struct Test (Option<i32>);
@nayato
nayato / tools.md
Created July 14, 2017 00:45 — forked from nrc/tools.md
Rust tooling

Rust developer tools - status and strategy

Availability and quality of developer tools are an important factor in the success of a programming language. C/C++ has remained dominant in the systems space in part because of the huge number of tools tailored to these lanaguages. Succesful modern languages have had excellent tool support (Java in particular, Scala, Javascript, etc.). Finally, LLVM has been successful in part because it is much easier to extend than GCC. So far, Rust has done pretty well with developer tools, we have a compiler which produces good quality code in reasonable time, good support for debug symbols which lets us leverage C++/lanaguge agnostic tools such as debuggers, profilers, etc., there are also syntax highlighting, cross-reference, code completion, and documentation tools.

In this document I want to layout what Rust tools exist and where to find them, highlight opportunities for tool developement in the short and long term, and start a discussion about where to focus our time an

@nayato
nayato / Howto convert a PFX to a seperate .key & .crt file
Created July 1, 2017 09:13 — forked from TemporaryJam/Howto convert a PFX to a seperate .key & .crt file
How to convert a .pfx SSL certificate to .crt/key (pem) formats. Useful for NGINX
source: http://www.markbrilman.nl/2011/08/howto-convert-a-pfx-to-a-seperate-key-crt-file/
`openssl pkcs12 -in [yourfile.pfx] -nocerts -out [keyfile-encrypted.key]`
What this command does is extract the private key from the .pfx file. Once entered you need to type in the importpassword of the .pfx file. This is the password that you used to protect your keypair when you created your .pfx file. If you cannot remember it anymore you can just throw your .pfx file away, cause you won’t be able to import it again, anywhere!. Once you entered the import password OpenSSL requests you to type in another password, twice!. This new password will protect your .key file.
Now let’s extract the certificate:
`openssl pkcs12 -in [yourfile.pfx] -clcerts -nokeys -out [certificate.crt]`