Skip to content

Instantly share code, notes, and snippets.

View sdmg15's full-sized avatar
πŸ‘¨β€πŸ’»
C++ ❀️

Sonkeng sdmg15

πŸ‘¨β€πŸ’»
C++ ❀️
View GitHub Profile

Codes for reproducing vunerabilities report by WizardZine (https://gist.github.com/darosior/4aeb9512d7f1ac7666abc317d6f9453b_

1 - Library crash on raw descriptor

const DB_PATH: &str = "bdk-example-electrum.sqlite";
const NETWORK: Network = Network::Testnet4;
const EXTERNAL_DESC: &str = "wpkh(tprv8ZgxMBicQKsPdy6LMhUtFHAgpocR8GC6QmwMSFpZs7h6Eziw3SpThFfczTDh5rW2krkqffa11UpX3XkeTTB2FvzZKWXqPY54Y6Rq4AQ5R8L/84'/1'/0'/0/*)";
const INTERNAL_DESC: &str = "wpkh(tprv8ZgxMBicQKsPdy6LMhUtFHAgpocR8GC6QmwMSFpZs7h6Eziw3SpThFfczTDh5rW2krkqffa11UpX3XkeTTB2FvzZKWXqPY54Y6Rq4AQ5R8L/84'/1'/0'/1/*)";
const ELECTRUM_URL: &str = "ssl://mempool.space:40002";

Codes for reproducing vunerabilities report

1 - Library crash on raw descriptor

const DB_PATH: &str = "bdk-example-electrum.sqlite";
const NETWORK: Network = Network::Testnet4;
const EXTERNAL_DESC: &str = "wpkh(tprv8ZgxMBicQKsPdy6LMhUtFHAgpocR8GC6QmwMSFpZs7h6Eziw3SpThFfczTDh5rW2krkqffa11UpX3XkeTTB2FvzZKWXqPY54Y6Rq4AQ5R8L/84'/1'/0'/0/*)";
const INTERNAL_DESC: &str = "wpkh(tprv8ZgxMBicQKsPdy6LMhUtFHAgpocR8GC6QmwMSFpZs7h6Eziw3SpThFfczTDh5rW2krkqffa11UpX3XkeTTB2FvzZKWXqPY54Y6Rq4AQ5R8L/84'/1'/0'/1/*)";
const ELECTRUM_URL: &str = "ssl://mempool.space:40002";

Reducing bandwidth and memory

  • -dbcache=n: This represents the UTXO database size. A lower value during IBD will make sync slower but once the sync is done it should be fine

  • -maxmempool=<n>: Limit the mempool size to n. A lower value obviously means transactions will be evicted faster

  • -maxconnections=<n>: number of connections to keep, the lower the better for memory

  • -par=<n>: number of script verification threads. (Should be 0 for us)

  • -prune=<n>: Reduce storage requirements by enabling pruning (deleting) of old blocks. For value β‰₯ 550 the node will automatically prune block files to stay under the specified targe size.

  • -maxmeepool=<n>: Keep the transaction memory pool below MB (default is 300)

  • -loadblock=file: This could be use to import blocks that are downloaded from clients startup.

At Njangi, we value your privacy and are committed to protecting your personal information. This Privacy Policy explains how we collect, use, and protect your information when you use our app. By using Njangi, you agree to the collection and use of information as described in this policy.
1. Information We Collect
We collect the following types of information when you use our app:
Personal Information: When you create an account or sign up for our services, we may collect personal details such as your name, email address, phone number, and other relevant information.
Financial Information: To offer our savings and credit group features, we may collect financial data, such as your account balances, savings goals, credit group contributions, and other related financial details.
@sdmg15
sdmg15 / tinyblockchain-cli.php
Created December 29, 2017 04:46 — forked from vgrovestine/tinyblockchain-cli.php
Dirt simple blockchain implemented in PHP
<?php
class Block {
private $ts;
private $nonce = 0;
private $data;
private $prev_hash;
protected $hash;
private $hash_algorithm;
private $hash_prefix;
// A helper function to determine the data model of the current platform
[[nodiscard]] constexpr const char* dataModelPlatform() {
if constexpr (sizeof(int) == 2 && sizeof(long int) == 8) {
if (sizeof(int*) == 2) {
return "ILP32";
}
return "LLP64";
}
#include <iostream>
#include <utility>
#include <tuple>
template<typename T>
void printWithSpace(T v) {
std::cout << v << " ";
}
syntax = "proto3";
package FIX;
import "executionreport.proto";
message NewOrderSingle {
string ClOrdID = 1;
string Instrument = 2;

Keybase proof

I hereby claim:

  • I am sdmg15 on github.
  • I am sdmg15 (https://keybase.io/sdmg15) on keybase.
  • I have a public key ASDReENYgSw8E69a3p0qpf5v0cVPm2RgcwULuZiCw58bMgo

To claim this, I am signing this object:

@sdmg15
sdmg15 / gist:fa6f6b3f69117e363bc7a15f8b88cc4a
Created July 19, 2019 17:21 — forked from bessarabov/gist:674ea13c77fc8128f24b5e3f53b7f094
One-liner to generate data shown in post 'At what time of day does famous programmers work?' β€” https://ivan.bessarabov.com/blog/famous-programmers-work-time
git log --author="Linus Torvalds" --date=iso | perl -nalE 'if (/^Date:\s+[\d-]{10}\s(\d{2})/) { say $1+0 }' | sort | uniq -c|perl -MList::Util=max -nalE '$h{$F[1]} = $F[0]; }{ $m = max values %h; foreach (0..23) { $h{$_} = 0 if not exists $h{$_} } foreach (sort {$a <=> $b } keys %h) { say sprintf "%02d - %4d %s", $_, $h{$_}, "*"x ($h{$_} / $m * 50); }'