Skip to content

Instantly share code, notes, and snippets.

View mmitech's full-sized avatar
💭
I may be slow to respond.

Mourad Ilyes Mlik mmitech

💭
I may be slow to respond.
View GitHub Profile
@mmitech
mmitech / gist:74a000df9a02895affc5
Last active August 29, 2015 14:27 — forked from genecyber/gist:46a835038221d8e30cfb
Bitpay insight altcoin p2p alt hashing hotfix
var blockHash = bitcoreUtil.formatHashFull(block.calcHash());
var check = blockHash.substring(0, 4);
if (check != '0000') {
console.log("Scrypt block detected. Falling back to RPC");
self.historicSync.start({forceRPC:1}, function(){
sockets.broadcastSyncInfo(self.historicSync.info());
self.log('[p2p_sync] Done resync.');
});
return;
}
@mmitech
mmitech / sendalert.cpp
Created June 16, 2016 12:37 — forked from laanwj/sendalert.cpp
Bitcoin send alert code
/*
So you need to broadcast an alert...
... here's what to do:
1. Copy sendalert.cpp into your bitcoind build directory
2. Decrypt the alert keys
copy the decrypted file as alertkeys.h into the src/ directory.
3. Modify the alert parameters in sendalert.cpp
@mmitech
mmitech / config.php
Last active November 3, 2016 13:00
Shielding and Clearing Zcash blocks
<?php
// Zcash daemon credentials
$rpcuser = "";
$rpcpass = "";
$rpchost = "";
$rpcport = "";
// Wallet addresses for shielding and clearing
$t_address = ""; //your t_coinbase address
@mmitech
mmitech / alert.cpp
Created April 23, 2017 08:10 — forked from lukem512/alert.cpp
Generate Alert Tests in Bitcoin Core (SignAndSave alternative)
// Sign CAlert with stored private key
bool SignAlert(CAlert &alert)
{
// key in WIF format
const char* pszPrivKey = "";
// serialize alert data
CDataStream sMsg(SER_NETWORK, PROTOCOL_VERSION);
sMsg << *(CUnsignedAlert*)&alert;
alert.vchMsg = std::vector<unsigned char>(sMsg.begin(), sMsg.end());

Keybase proof

I hereby claim:

  • I am mmitech on github.
  • I am mmitech (https://keybase.io/mmitech) on keybase.
  • I have a public key ASC_rgi1QLkJ1Ve5t5NTlmO-llXeBt6xKYgihac4Y9mVXgo

To claim this, I am signing this object:

0x080F411222C9F010D9c8fA053cf4c350E49609F0
@mmitech
mmitech / nginx-tuning.md
Created August 3, 2017 10:29 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@mmitech
mmitech / nginx.conf
Created August 3, 2017 11:33 — forked from calebwoods/nginx.conf
Sample Nginx config for deployment of Angular.js app
server { listen 80;
server_name example.com;
access_log /var/log/example.com/nginx.access.log;
error_log /var/log/example.com/nginx.error.log;
root /var/www/apps/example.com/public;
charset utf-8;
location / {
rewrite ^ https://$host$request_uri? permanent;
}
#!/bin/bash
#
# Adds Cloudflare IPV4 addresses to the Inbound rules of a AWS Security Group
#
## defining helper functions first
# show usage
show_usage() {
@mmitech
mmitech / 1_context.md
Last active April 1, 2019 09:12 — forked from dexX7/1_context.md
Token based 2-of-3 multisig arbitration with Omni Core

Context:

  • Let Alice be the seller of an item or service, and Bob the buyer

  • Trent is a service operator, who has the role of an arbitrator

  • Alice wants to deal in TetherUSD

  • Bob's address is mkXZ1FYBNuvrqMEE2PLzJkS39T6w7CouFH, which is funded with TetherUSD