Skip to content

Instantly share code, notes, and snippets.

View webmaster128's full-sized avatar

Simon Warta webmaster128

View GitHub Profile
@webmaster128
webmaster128 / gist:7734385cdd7eee4cfc6c6171725ffb1c
Created July 31, 2017 20:36
Apple LLVM version 8.1.0 (clang-802.0.42)
$ c++ --verbose -c empty.cpp
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.12.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name empty.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu penryn -target-linker-version 278.4 -v -dwarf-column-info -debugger-tuning=lldb -coverage-file /Users/simon/Botan/botan-randombit/src/build-data/compiler_detection/empty.cpp -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.1.0 -stdlib=libc++ -fdeprecated-macro -fdebug-compilation-dir /Users/sim
$ strings /usr/bin/clang
clang
$ strings /usr/bin/clang++
clang++
diff --git a/boost/libs/filesystem/src/operations.cpp b/boost/libs/filesystem/src/operations.cpp
index 4114e02a..e663fabc 100644
--- a/boost/libs/filesystem/src/operations.cpp
+++ b/boost/libs/filesystem/src/operations.cpp
@@ -2169,8 +2169,6 @@ namespace
inline int readdir_r_simulator(DIR * dirp, struct dirent * entry,
struct dirent ** result)// *result set to 0 on end of directory
{
- errno = 0;
-
@webmaster128
webmaster128 / inspect
Last active December 4, 2017 18:03
An interactive command line tool for Linux and Mac that can show directories and files
__inspect_impl() {
if [ -d "$1" ]; then
#echo -n "Recusive size: "
#du -hs "$1" | awk '{print $1}'
ls -l -h -A "$1"
elif [ -f "$1" ]; then
less "$1"
else
echo "Path '$1' is of unknown type"
@webmaster128
webmaster128 / API.md
Last active January 8, 2018 11:55
Generated from libsodium.js (`rm ./dist/modules/libsodium-wrappers.js && make ./dist/modules/libsodium-wrappers.js`)

Libsodium.js wrapper - API usage

Once you've included libsodium.js and libsodium-wrapper.js, all the available wrapped functions and constants can be accessed in the sodium object.

To learn about the role of each method, please refer to the original documentation of libsodium

List of existing types:

  • Buf: An Uint8Array of a determined size. Used for keys, nonces, etc...
  • Unsized Buf: An Uint8Array of an arbitrary size. Used for messages to sign, encrypt, hash, etc...
  • Optional unsized buf
function installDummyCryptoPolyfill() {
var global = (function(global) {
return global;
})(new Function('return this;')());
try {
global.crypto.getRandomValues(new Uint8Array(1));
return;
}
catch (e) {
@webmaster128
webmaster128 / install-lisk-node-on-ubuntu.md
Last active March 27, 2018 08:25
Install lisk node from source ob Ubuntu 18.04 LTS

Lisk node setup

$ sudo apt-get update && sudo apt-get upgrade -y
$ sudo apt-get install -y curl git npm libtool autoconf libpq-dev postgresql jq
$ git clone https://github.com/LiskHQ/lisk.git
$ git clone https://github.com/LiskHQ/lisk-scripts.git
$ cd lisk
$ git checkout testnet-master
$ npm install

Rename network interface to eth0

If you can, you make your live easier by renaming the network interface (first cable network) to eth0. See https://askubuntu.com/a/801310

Install and configure heartbeat (all nodes)

$ sudo apt-get install -y heartbeat
$ sudo touch /etc/ha.d/authkeys
[dbg] 2018-04-22 17:08:31 | Transaction pool size: 0
[dbg] 2018-04-22 17:08:32 | No delegates enabled
[dbg] 2018-04-22 17:08:32 | Transaction pool size: 0
[inf] 2018-04-22 17:08:32 | Removed peer - 94.237.26.150:5001
[dbg] 2018-04-22 17:08:32 | Removed peer - {"peer":{"ip":"94.237.26.150","wsPort":5001,"state":1,"updated":1524416903957}}
[dbg] 2018-04-22 17:08:32 | Inserted new peer - 94.237.26.150:5001
[ERR] 2018-04-22 17:08:32 | Discovering new peers failed - RPC response timeout exceeded
[dbg] 2018-04-22 17:08:33 | [Outbound socket :: close] Peer connection to 94.237.41.99 failed with code 4103 and reason - Expected version: >=1.0.0-beta.6 but received: 1.0.0-beta.2
[dbg] 2018-04-22 17:08:33 | [Outbound socket :: error] Peer error from 94.237.41.99 - Socket connection closed with status code 4103 and reason: Expected version: >=1.0.0-beta.6 but received: 1.0.0-beta.2
[dbg] 2018-04-22 17:08:33 | [Outbound socket :: close] Peer connection to 83.136.249.102 failed with code 4103 and reason - Expected version:
{"success":true,"currentBlock":5116254,"currentBlockSlot":6127047,"currentSlot":6127047,"delegates":["90a0ef7eb62c70dacd751bb8bb18dffcb6c49effe330a76d64341ae100375db4","a202c8a4eea74e2b1587be73edf3e164cab81b6160ce21f1914a7094ceee664f","4d6e32111dc36f8074bda232f07119394180b11ac8e9f3698537c909ef24637e","18d1b236b98b02c464bbe057077c7dea32b4f519f573b4b2de57ea0634e64a7c","2e334da068a75c4ee5e7d82092ef30f70209b24fd29a008c2cf753bec091b04a","1a959e338f0c5d7df03c1f4b9a61447a1fa97335bab65d85ece7bbfef963bc71","71e1e34dd0529d920ee6c38497b028352c57b7130d55737c8a778ff3974ec29f","27738087a75139a2406eb84a6f298f260e63f836b836ea26bbe1111534473b58","d04d1f7a6de015ce1a2dc3838a35b28ca485212656c71225c48282ba3de21abe","5fb6b29846e95c88d464e003c835ca4f88260eaa57cd8deded8fc8038dfcbc60","633698916662935403780f04fd01119f32f9cd180a3b104b67c5ae5ebb6d5593","abaeb3786a1b1dffcd79c7d2167736d809580fe5a66eb69a79ea9b48276f590f","a1b15a1a1247feabfee80340cda393ebe6ec6bfa5b0b284adb597f6b8f18a438","2521c1136f095d4031af08d9c5aaf5bbf2589e620c7fc79dfdc