To start Elasticsearch + Logstash + Kibana execute:
docker-compose up
The container images will be downloaded from docker hub at first run.
Next, import the log file data to logstash
| #!/bin/bash | |
| # | |
| # To make apache render files ending with .md with strapdown.js | |
| # markdown renderer (http://strapdownjs.com/), add following lines | |
| # to /etc/apache2/httpd.conf: | |
| # | |
| # Action markdown /cgi-bin/strapdown.cgi | |
| # AddHandler markdown .md | |
| # DirectoryIndex index.html index.md | |
| # |
| /* | |
| ## Compile | |
| g++ -Wall -std=c++11 -rdynamic -g stack-backtrace.cpp -lbacktrace -o stack-backtrace && ./stack-backtrace | |
| clang++ -Wall -std=c++11 -rdynamic -g stack-backtrace.cpp -lbacktrace -o stack-backtrace && ./stack-backtrace | |
| ## Output | |
| Backtrace: |
| // clang++ -Wall -std=c++11 -O0 -o test test.cpp && ./test | |
| // g++ -Wall -std=c++11 -O0 -o test test.cpp && ./test | |
| #include <iostream> | |
| #include <vector> | |
| #include <cstdio> | |
| namespace Ns | |
| { |
| // clang++ -Wall -std=c++11 -O0 -o scope-exit scope-exit.cpp && ./scope-exit | |
| // g++ -Wall -std=c++11 -O0 -o scope-exit scope-exit.cpp && ./scope-exit | |
| #include <iostream> | |
| template <typename F> | |
| struct ScopeExit | |
| { | |
| ScopeExit(F f) : f(f) {} | |
| ~ScopeExit() { f(); } |
| #include <boost/exception/diagnostic_information.hpp> | |
| struct MyException : virtual boost::exception, virtual std::exception | |
| { | |
| virtual const char* what() const throw() { return boost::diagnostic_information_what(*this); } | |
| }; |
This example demonstrates how to implement boost::asio handler
callback as a member functions in a safe way, even while the ASIO
timer or socket object is itself also contained in the same object.
When deleting the object containing both the handler method and ASIO
| *** RSA | |
| # Generate self-signed certificate with RSA 4096 key-pair | |
| openssl req -x509 -nodes -days 3650 -newkey rsa:4096 -keyout rsakey.pem -out rsacert.pem | |
| # print private and public key | |
| openssl rsa -in rsakey.pem -text -noout | |
| # print certificate | |
| openssl x509 -in rsacert.pem -text -noout |
https://github.com/cloudflare/cfssl
go get -v -u github.com/cloudflare/cfssl/cmd/cfssl
go get -v -u github.com/cloudflare/cfssl/cmd/...