Skip to content

Instantly share code, notes, and snippets.

let unionedData = _.union(fcas.data.data, dev.data.data, maturity.data.data, utility.data.data);
// reduce data.data
let reducer = (map, obj) => {
let projObj = {};
if(map.hasOwnProperty(obj.project_id)) {
projObj = map[obj.project_id];
}
projObj.project_id = obj.project_id;
@ghoti143
ghoti143 / connect-remote-mongo-via-ssh-tunnel.md
Created August 24, 2018 01:28 — forked from umidjons/connect-remote-mongo-via-ssh-tunnel.md
Create ssh tunnel and connect to the remote mongo database on command line

Create ssh tunnel and connect to the remote mongo database on command line

Assume followings:

/mykeys/.ssh/prodserver.pem - is a certificate file

umid - is a user name

111.111.111.111 - is a remote host, that mongodb runs

<html>
<head>
<script src='https://unpkg.com/jquery@3.3.1/dist/jquery.min.js'></script>
<script src="https://unpkg.com/ramda@0.25.0/dist/ramda.min.js"></script>
<script src="https://unpkg.com/socket.io-client@2.1.1/dist/socket.io.slim.js"></script>
<script src='https://unpkg.com/leaflet@1.3.1/dist/leaflet.js'></script>
<link rel='stylesheet' href='https://unpkg.com/leaflet@1.3.1/dist/leaflet.css' />
<script src='https://unpkg.com/leaflet.markercluster@1.3.0/dist/leaflet.markercluster.js'></script>
@ghoti143
ghoti143 / docker_tips.md
Last active April 27, 2018 18:31
docker tips
curl -fsSL get.docker.com -o get-docker.sh
sudo sh get-docker.sh

sudo usermod -aG docker your-user
> let {PrivateKey, PublicKey, Signature, Aes, key_utils, config} = require('eosjs-ecc')
> let privateWif
> PrivateKey.randomKey().then(privateKey => privateWif = privateKey.toWif())
> pubkey = PrivateKey.fromWif(privateWif).toPublic().toString()

Keybase proof

I hereby claim:

  • I am ghoti143 on github.
  • I am ghoti143 (https://keybase.io/ghoti143) on keybase.
  • I have a public key ASAO_5nlAaIJcgKtfDR2PbfkDJIX-ip7HzuzkTBoGE8JjAo

To claim this, I am signing this object:

@ghoti143
ghoti143 / gen_eos_priv.md
Last active March 29, 2018 00:25
gen eos priv key using eosjs-ecc
npm i eosjs-ecc

node

let {PrivateKey, PublicKey, Signature, Aes, key_utils, config} = require('eosjs-ecc')

// Create a new random private key
let privateWif
PrivateKey.randomKey().then(privateKey =&gt; privateWif = privateKey.toWif())
@ghoti143
ghoti143 / gen_eos_keypair.md
Created March 19, 2018 13:24
generate EOS key pair
@ghoti143
ghoti143 / bld_eos_2x.md
Last active March 19, 2018 01:14
building EOS 2.x

downloading and building eos 2.x

  1. create new aws instance - m5.4xlarge

  2. launch instance

  3. screen -S eosbld

  4. git clone https://github.com/eosio/eos --recursive