Skip to content

Instantly share code, notes, and snippets.

View maxidev's full-sized avatar

Maxi maxidev

View GitHub Profile

Keybase proof

I hereby claim:

  • I am maxidev on github.
  • I am maxidev (https://keybase.io/maxidev) on keybase.
  • I have a public key ASAHulndivX_55vMdYP1Fa0iwHNzUyw5sX9olmk5Bhsa-wo

To claim this, I am signing this object:

var ethUtil = require('ethereumjs-util');
var ethTx = require('ethereumjs-tx');
var privkey = "";
var privBuff = new Buffer(privkey, "hex");
var msg = ethUtil.sha3("The Times 03/Jan/2009 Chancellor on brink of second bailout for banks");
var sign = ethUtil.ecsign(msg, privBuff);
console.log(sign);
var signedHash = ethUtil.toRpcSig(sign.v, sign.r, sign.s);
var sigDecoded = ethUtil.fromRpcSig(signedHash);

Keybase proof

I hereby claim:

  • I am maxidev on github.
  • I am maxidev (https://keybase.io/maxidev) on keybase.
  • I have a public key whose fingerprint is 9849 3304 C8EC C9C1 0DFB 293C 8A97 C544 5008 4A4D

To claim this, I am signing this object:

@maxidev
maxidev / escrow-contract.js
Created January 31, 2018 01:27
Escrow type contract creation
//Require Bitsign's library
const bitsignjs = require('bitsignjs');
//Instantiate the library with your access token
let api = bitsignjs.init('d2..83');
api.contracts.deploy({
password: '<your_password>',
type: 'Escrow',
"args": {
"_buyer": "<buyer_address>",
@maxidev
maxidev / notary-tx.js
Created January 31, 2018 01:20
Create notary transaction using Bitsignjs
//Require Bitsign's library
const bitsignjs = require('bitsignjs');
//Instantiate the library with your access token
let api = bitsignjs.init('d22..83');
api.transactions.notarizeTx({
address: '0x16E843402d1bEe260D5464C927A6A0DC11b0384f',
data: '<some_hexa_data>',
password: '<your_password>'
}).then(data => console.log(data))
@maxidev
maxidev / status.js
Created January 31, 2018 01:17
Blockchain Status call
//Require Bitsign's library
const bitsignjs = require('bitsignjs');
//Instantiate the library with your access token
let api = bitsignjs.init('d2..83');
api.eth.status().then(data => console.log(data));
@maxidev
maxidev / project-bitsign.js
Created January 31, 2018 01:11
How to integrate Bitsign library into your project
//Require Bitsign's library
const bitsignjs = require('bitsignjs');
//Instantiate the library with your access token
let api = bitsignjs.init('<your_token>');
@maxidev
maxidev / mongo_backup.sh
Last active May 23, 2017 20:31 — forked from sheharyarn/mongo_backup.sh
Mongodump Shell Script for Cronjob
#!/bin/bash
MONGO_DATABASE="your_db_name"
APP_NAME="your_app_name"
MONGO_HOST="127.0.0.1"
MONGO_PORT="27017"
TIMESTAMP=`date +%F-%H%M`
MONGODUMP_PATH="/usr/bin/mongodump"
BACKUPS_DIR="/home/username/backups/$APP_NAME"

Keybase proof

I hereby claim:

  • I am maxidev on github.
  • I am maxidev (https://keybase.io/maxidev) on keybase.
  • I have a public key whose fingerprint is 9849 3304 C8EC C9C1 0DFB 293C 8A97 C544 5008 4A4D

To claim this, I am signing this object:

server {
listen 80;
server_name website.com;
location / {
proxy_pass http://localhost:1337;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;