Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Booyakasha

Vivek Teega vivekteega

💭
Booyakasha
View GitHub Profile
@vivekteega
vivekteega / task.txt
Created Jan 6, 2022
Task for Divyansh
View task.txt
Sort out the input list ending with special character according to the following weights if the symbols
Weight of the symbols
@ - 3
* - 2
# - 1
$ - 0
Input
['abc#','def*','ghi@','jkl$','mno:','pqr#']
@vivekteega
vivekteega / flosight-api
Created Dec 24, 2021
Flosight API test
View flosight-api
API CALL
--------
https://flosight.duckdns.org/api/tx/send?txid=4a0a2102c85d32062cec4e77b6ec2637c8f4500a26e753d2e9ef33dbbc9b0039
RESPONSE
--------
<!DOCTYPE html>
<html lang="en">
@vivekteega
vivekteega / flosight-crash-15-Dec-2021.log
Last active Dec 14, 2021
Flosight crash logs - 15 December 2021
View flosight-crash-15-Dec-2021.log
[2021-12-14T20:14:22.146Z] info: ::ffff:127.0.0.1 "GET /api/tx/b4ac4ddb51188b28b39bcb3aa31357d5bfe562c21e8aaf8dde0ec560fc893174" 404 9 0.682 "python-requests/2.23.0"
[2021-12-14T20:14:23.153Z] info: ::ffff:127.0.0.1 "GET /api/tx/b4ac4ddb51188b28b39bcb3aa31357d5bfe562c21e8aaf8dde0ec560fc893174" 404 9 0.580 "python-requests/2.23.0"
[2021-12-14T20:14:24.162Z] info: ::ffff:127.0.0.1 "GET /api/tx/b4ac4ddb51188b28b39bcb3aa31357d5bfe562c21e8aaf8dde0ec560fc893174" 404 9 0.600 "python-requests/2.23.0"
[2021-12-14T20:14:25.169Z] info: ::ffff:127.0.0.1 "GET /api/tx/b4ac4ddb51188b28b39bcb3aa31357d5bfe562c21e8aaf8dde0ec560fc893174" 404 9 0.697 "python-requests/2.23.0"
[2021-12-14T20:14:26.177Z] info: ::ffff:127.0.0.1 "GET /api/tx/b4ac4ddb51188b28b39bcb3aa31357d5bfe562c21e8aaf8dde0ec560fc893174" 404 9 0.606 "python-requests/2.23.0"
[2021-12-14T20:14:27.184Z] info: ::ffff:127.0.0.1 "GET /api/tx/b4ac4ddb51188b28b39bcb3aa31357d5bfe562c21e8aaf8dde0ec560fc893174" 404 9 0.604 "python-requests/2.23.0"
[2021-12-14T20:14:27.6
@vivekteega
vivekteega / flosight_backup.py
Created Dec 9, 2021
Automated backup scripts
View flosight_backup.py
import subprocess
import sys
import datetime
import os, pdb
current_time = datetime.datetime.now()
backup_directory = f"{os.getcwd()}/backups/flosight/"
def make_archive(source, destination):
base = os.path.basename(destination)
View component.js
const smButton = document.createElement('template')
smButton.innerHTML = `
<style>
*{
padding: 0;
margin: 0;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
:host{
@vivekteega
vivekteega / flosight.logs
Created May 14, 2021
Flosight - 2 lines comment - last 1000 lines
View flosight.logs
[2021-05-14T09:00:54.256Z] info: ::ffff:127.0.0.1 "GET /api/block/52cccfed1de4f88aef8d842739af92fa60d14443800e1e7fe6c943b19fc45d14" 200 666 2.480 "python-requests/2.23.0"
[2021-05-14T09:00:54.276Z] info: ::ffff:127.0.0.1 "GET /api/tx/773fb34ad0af413e4979ebcb84b43d9b096170317f96f78a71030f7058633d8b" 200 927 2.987 "python-requests/2.23.0"
[2021-05-14T09:00:54.302Z] info: ::ffff:127.0.0.1 "GET /api/block-index/3974100" 200 80 0.414 "python-requests/2.23.0"
[2021-05-14T09:00:54.322Z] info: ::ffff:127.0.0.1 "GET /api/block/c308caa48cd172c910d9197dc2868a8d1acec6c9d70d18a752b4847939477c94" 200 667 3.611 "python-requests/2.23.0"
[2021-05-14T09:00:54.343Z] info: ::ffff:127.0.0.1 "GET /api/tx/f74527cd997bc94d74f17cff218f1377b9bed694bb64ae9499b94a08e9baf3e5" 200 912 3.254 "python-requests/2.23.0"
[2021-05-14T09:00:54.368Z] info: ::ffff:127.0.0.1 "GET /api/block-index/3974101" 200 80 0.457 "python-requests/2.23.0"
[2021-05-14T09:00:54.387Z] info: ::ffff:127.0.0.1 "GET /api/block/2c11f22b3e31195d1db6fdc3305ce5743d75
@vivekteega
vivekteega / docker.log
Created May 11, 2021
Flosight docker container sz changes logs
View docker.log
[2021-05-11T10:37:38.949Z] info: ::ffff:127.0.0.1 "GET /api/blocks?limit=5" 200 - 0.869 "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36"
[2021-05-11T10:37:38.953Z] info: ::ffff:127.0.0.1 "GET /api/blocks?limit=5" 200 - 0.729 "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36"
[2021-05-11T10:37:38.954Z] info: ::ffff:127.0.0.1 "GET /api/blocks?limit=5" 200 - 0.840 "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0"
[2021-05-11T10:37:38.955Z] info: ::ffff:127.0.0.1 "GET /api/block/2ec05413b14d1811be71a15b124db43f7a3d6660227ebdaaa692d3c8bb245485" 200 656 2.738 "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0"
[2021-05-11T10:37:38.959Z] info: ::ffff:127.0.0.1 "GET /api/block/0571d8c24da0c47af8c92c5ac6bf6e3720561bf5f2f144e9ca7f2ea85cb317c3" 200 656 1.724 "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0"
[2021-05-1
@vivekteega
vivekteega / Dockerfile
Created Apr 30, 2021
Changed Flosight docker file
View Dockerfile
FROM node:10-stretch-slim
# Install Dependencies
RUN apt-get update && \
apt-get install --no-install-recommends -y build-essential git libzmq3-dev python nginx curl && \
rm -rf /var/lib/apt/lists/*
RUN apt-get update
RUN apt-get install ca-certificates -y
RUN update-ca-certificates
@vivekteega
vivekteega / gist:ea68e976ee7163bd39cf620dbde5d077
Created Apr 8, 2021
Flosight reorg logs in which the code doesn't go ahead to find common ancestors and download new blocks. Because after downloading the new headers, it says "saved tip is good to go"
View gist:ea68e976ee7163bd39cf620dbde5d077
[2021-04-08T07:36:18.791Z] warn: Header Service: Reorganization detected, current tip hash: f62e02f4cae72d26f2868a7e57e94ee2b250f1957fa795d440ee24fb9884dd69, new block causing the reorg: ac91262919b5bec88909bd0037371768990599e326e6f408d90d475b6fb22451
[2021-04-08T07:36:18.792Z] info: Header Service: Getting last header synced at height: 4700266
[2021-04-08T07:36:18.823Z] info: Block Service: download progress: 4703767/4703767 (100.0000%)
[2021-04-08T07:36:18.823Z] info: Block Service: starting p2p block subscription.
[2021-04-08T07:36:18.823Z] info: localhost-block subscribe: p2p/block total: 2
[2021-04-08T07:36:18.823Z] info: Mempool Service: Mempool enabled.
[2021-04-08T07:36:19.115Z] info: localhost-header unsubscribe: p2p/headers total: 0
[2021-04-08T07:36:19.115Z] info: localhost-header unsubscribe: p2p/block total: 1
[2021-04-08T07:36:19.115Z] info: Header Service: Gathering: 20000 header(s) from the peer-to-peer network.
[2021-04-08T07:36:19.115Z] info: Header Service: subscribed to p2p headers.
@vivekteega
vivekteega / flosight.log
Created Apr 7, 2021
Sample of a good reorg operation in Flosight
View flosight.log
[warning] (chain) WARNING: Reorganizing chain.
[info] (node) Spawning worker process: 2.
[info] (node) Spawning worker process: 3.
[warning] (chain) Chain reorganization: old=cd4802927759720336278fe1cfac8708123b350202ceae558017b76c2791b3f9(4699808) new=4ca28d40e34cbc61053a49cf9edac4bf7ee466016f6c64e47fc0bc44bd0b1ed9(4699809)
[info] (chain) Block 4ca28d40e34cbc61053a49cf9edac4bf7ee466016f6c64e47fc0bc44bd0b1ed9 (4699809) added to chain (size=330 txs=1 time=280.809984).
[info] (chain) Block 1279c0c05d7fe2bf7f487c307218e3edab161a4707306c55f71277ab5990b547 (4699810) added to chain (size=330 txs=1 time=4.230457).
[2021-03-26T00:18:45.417Z] warn: Header Service: Reorganization detected, current tip hash: cd4802927759720336278fe1cfac8708123b350202ceae558017b76c2791b3f9, new block causing the reorg: 4ca28d40e34cbc61053a49cf9edac4bf7ee466016f6c64e47fc0bc44bd0b1ed9
[2021-03-26T00:18:45.417Z] info: Header Service: Getting last header synced at height: 4697808
[2021-03-26T00:18:45.507Z] info: localhost-header unsubscribe: