Skip to content

Instantly share code, notes, and snippets.

View Vishwas1's full-sized avatar
🎯
Focusing

Vishwas Anand Bhushan Vishwas1

🎯
Focusing
View GitHub Profile
/*
// cert.pem
-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDCFENGw33yGihy92pDjZQhl0C3
6rPJj+CvfSC8+q28hxA161QFNUd13wuCTUcq0Qd2qsBe/2hFyc2DCJJg0h1L78+6
Z4UMR7EOcpfdUE9Hf3m/hs+FUR45uBJeDK1HSFHD8bHKD6kv8FPGfJTotc+2xjJw
oYi+1hqp1fIekaxsyQIDAQAB
-----END PUBLIC KEY-----
// Ref: https://github.com/aeternity/aepp-sdk-js/blob/f2088c405ff6071f6b809c279231a3dff40e6ffb/es/utils/crypto.js
const nacl = require('tweetnacl')
const bs58check = require('bs58check')
const { blake2b } = require('blakejs')
const ed2curve = require('ed2curve')
const signer = require('nacl-signature')
nacl.util = require('tweetnacl-util')

Using android Keystore

Importing keystore

//TODO: import keystore in the project

Setting up postgres in stellar with UNIX socket

  • Setup UNIX socket in with stellar postgres db
  • sudo systemctl stop postgresql
  • Update the file sudo vi /etc/postgresql/9.5/main/pg_hba.conf with local core stellar md5
  • Update the db connection string in stellar-core.cfg with DATABASE="postgresql://dbname=core host=/var/run/postgresql user=stellar password=stellar"
  • sudo systemctl start postgresql
  • restart the stellar-core

Setting up stellar with sqllite

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>hanko-plugin-keycloak-parent</artifactId>
<groupId>io.hanko.plugins.keycloak</groupId>
<version>0.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<name>HANKO Plugin Keycloak EJB</name>
  • I wanted to learn Kalaripayattu - took 1 month leave from office.
  • Took flight to Kochi from Chennai.
  • It was a small village in rainforest in a place called Athirapally in Kerala.
  • This place was full of jungle, waterfalls and small tribal villages.
  • A tribal man took me into the jungle where there was Kalari - the school to learn Kalaripayattu
  • It was big room - lot of weapons - few people were practising
  • Met a woman, Paravathi - tall, strong, brown in color, bold and big eyes. I looked at her biceps. - she was no less than a warrior.
  • I was wondering is it really needed in this 21st century ? What about our army ? It looks like they are preparing for war. As usual I had many unanswered questions.
  • She took me to her house - a small hut with granny inside. She told me to get sleep and wake up at 3 AM in the morning for practise.
  • Granny told me stories about Kalaripayattu - how britishers banned that artform and came to the village in the search of that book. A book? What book? I asked
@Vishwas1
Vishwas1 / poll_timer.js
Last active July 8, 2019 04:29
Reactive programming polling
const { from, timer } = require('rxjs');
const fetch = require('node-fetch');
const getTimeFromAPI = () => {
return fetch('http://worldclockapi.com/api/json/est/now')
.then((resp) => resp.json())
}
// Observer timer and subscribe
@Vishwas1
Vishwas1 / introrx.md
Created July 3, 2019 06:14 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@Vishwas1
Vishwas1 / zagg-node-sync-problem.md
Last active June 10, 2019 07:09
Zagg multi node sync problem and possible solutions

Zagg multi node sync problem and possible solutions

Problem :

Zagg multi node sync (for bitcoin blocks) won’t work since we were not making level dbs sync to each other.

  • Setup 2 node zagg network using stellar’s configurations
  • Throw transaction with Account Marker operation (for bitcoin transaction HEX) over one of the node.
  • The operation has to go through validation from Bitcoin code base using doValidate() of the operation.
  • After getting all the operations validated, the transaction goes into mPendingTransaction (which is nothing but memepool for stellar.)

Find unspents

listunspents

[...]

Create Transaction