Skip to content

Instantly share code, notes, and snippets.

View redotics's full-sized avatar

Red Boumghar redotics

View GitHub Profile
@redotics
redotics / cardano-node-without-systemd.patch
Created February 6, 2021 22:29
Cardano node and client compilation without systemd dependency
diff --git a/cabal.project b/cabal.project
index 05666eff..03bffb03 100644
--- a/cabal.project
+++ b/cabal.project
@@ -153,7 +153,7 @@ source-repository-package
plugins/backend-ekg
plugins/backend-monitoring
plugins/backend-trace-forwarder
- plugins/scribe-systemd
+ -- plugins/scribe-systemd
@redotics
redotics / destructor.cpp
Created September 19, 2013 23:50
This show that destructor is called on object at end of the block where they were called. With valgrind you could also see that the 42 allocated ints (42*4=168 bytes) are still here --> LEAK SUMMARY: definitely lost: 168 bytes in 1 blocks
#include <iostream>
#include <stdlib.h>
class Monstre {
public:
Monstre() { A = (int*)malloc(sizeof(int)*42); }
~Monstre() { std::cout << "iDestroy the new way of iPhoning." << std::endl; }
private:
int* A;
@redotics
redotics / boostposixtime.cpp
Created September 19, 2013 23:38
Manipulate Boost posix time output # g++ boostposixtime.cpp -o boostposixtime; ./boostposixtime
// to have the cout ("equivalent" to printf)
#include <iostream>
// to have string stream
#include <sstream>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/date_time/posix_time/posix_time_io.hpp>
using namespace boost::posix_time;