Skip to content

Instantly share code, notes, and snippets.

View vivekteega's full-sized avatar
💭
Booyakasha

Vivek Teega vivekteega

💭
Booyakasha
View GitHub Profile
@vivekteega
vivekteega / extract_propublica.py
Last active February 5, 2024 10:05
Pulling data from ProPublica into an Excel file
import requests
import pandas as pd
import pdb
def fetch_org_data(ein):
org_data = requests.get(f"https://projects.propublica.org/nonprofits/api/v2/organizations/{ein}.json")
if org_data.status_code == 200:
org_data = org_data.json()
print(f"Processing {org_data['organization']['name']}")
org_df = pd.DataFrame()
@vivekteega
vivekteega / ftt-error.log
Last active January 15, 2024 05:16
Token Tracker error log
2024-01-14 12:09:33,983:__main__:Before tx loop
Processing stateF
2024-01-14 12:09:33,984:__main__:Completed tx loop
2024-01-14 12:09:34,275:__main__:Received: {"id":"0","data":{"height":6523402,"hash":"9f0a41b77c58f9ce01a19ce10290976fbf16b6b1331ef624b3982676b55328c1"}}
/home/production/deployed/ftt-blockbook-migration-rescan/py3/lib/python3.8/site-packages/urllib3/connectionpool.py:1013: InsecureRequestWarning: Unverified HTTPS request is being made to host '0.0.0.0'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
warnings.warn(
2024-01-14 12:10:00,422:__main__:Before tx loop
2024-01-14 12:10:00,422:__main__:Completed tx loop
2024-01-14 12:10:00,688:__main__:Connection error: sent 1011 (internal error) keepalive ping timeout; no close frame received
@vivekteega
vivekteega / ftt-blockbook-migration-rescan.err.log
Created January 13, 2024 07:38
ftt-blockbook-migration-rescan error logs
Running on 0.0.0.0:5017 over http (CTRL + C to quit)
Running on 0.0.0.0:5017 over http (CTRL + C to quit)
Running on 0.0.0.0:5017 over http (CTRL + C to quit)
Running on 0.0.0.0:5017 over http (CTRL + C to quit)
Running on 0.0.0.0:5017 over http (CTRL + C to quit)
Running on 0.0.0.0:5017 over http (CTRL + C to quit)
Running on 0.0.0.0:5017 over http (CTRL + C to quit)
Running on 0.0.0.0:5017 over http (CTRL + C to quit)
Running on 0.0.0.0:5017 over http (CTRL + C to quit)
Running on 0.0.0.0:5017 over http (CTRL + C to quit)
@vivekteega
vivekteega / draw-pi-circle.py
Created November 1, 2023 11:48
Draw pi circle
import pygame
import math
'''----------------------- pygame setup -----------------------'''
pygame.init()
screen = pygame.display.set_mode((1000, 1000))
clock = pygame.time.Clock()
running = True
'''---------------------------------------------'''
@vivekteega
vivekteega / install-flo-core-wallet.yml
Created November 1, 2023 06:54
Ansible playbook for FLO core wallet
- name: Build-Setup FLO Core wallet
hosts: turing.ranchimall.net
remote_user: production
gather_facts: true
tasks:
- name: Installing build requirements
become: true
package:
name: "{{item}}"
@vivekteega
vivekteega / flosight-address-search1.log
Last active March 24, 2023 07:23
Flosight address search logs
This file has been truncated, but you can view the full file.
FLO address being searched : FHDqCJUGdHKHTHdLa8wuQ9NKXNNawfoDJ6
Line number 9 shows the first search
[2023-03-23T13:23:41.087Z] info: ::ffff:127.0.0.1 "GET /api/addr/FHZZnLFJ9nLseDgaSu6RpenvL1uyCAn5Ss/balance" 200 6 52.272 "-"
[2023-03-23T13:23:41.309Z] info: ::ffff:127.0.0.1 "GET /api/addr/FHZZnLFJ9nLseDgaSu6RpenvL1uyCAn5Ss/balance" 200 6 92.736 "-"
[2023-03-23T13:23:41.565Z] info: ::ffff:127.0.0.1 "GET /api/addr/FQ1qEtfR2GGb6EBU3rySUnxpfUVSjqyaVN/balance" 200 6 89.581 "-"
[2023-03-23T13:23:41.868Z] info: ::ffff:127.0.0.1 "GET /api/addr/FUGCbrrvjnjNqjwEYddHVrwjZyoS4qjGrz/balance" 200 6 173.423 "-"
[2023-03-23T13:23:42.090Z] info: ::ffff:127.0.0.1 "GET /api/addr/FHZZnLFJ9nLseDgaSu6RpenvL1uyCAn5Ss/balance" 200 6 74.180 "-"
[2023-03-23T13:23:42.165Z] info: ::ffff:127.0.0.1 "GET /api/addrs/FHDqCJUGdHKHTHdLa8wuQ9NKXNNawfoDJ6/txs?from=0&to=1" 200 27 8.046 "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/112.0"
[2023-03-23T13:23:42.298Z] info: ::ffff:127.0.0.1 "GET /api/addrs/FHDq
@vivekteega
vivekteega / problem.md
Last active March 20, 2023 16:26
RegEx parsing for Smart Contract

Regex parsing problem for Smart Contract

Problem

Write Regex to match amount and magnitude from the given string. The match should happen in two groups: Group 1 is amount, Group 2 magnitude.

For each match Group 1 - amount Group 2 - magnitude

Sample strings

@vivekteega
vivekteega / 6-jan-2023-10-40-pm.log
Last active January 8, 2023 13:19
Testing raw block
[2023-01-06T17:07:32.528Z] info: ::ffff:127.0.0.1 "GET /api/blocks?limit=1" 200 - 1.987 "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"
[2023-01-06T17:08:03.692Z] info: ::ffff:127.0.0.1 "GET /api/sync" 200 121 0.531 "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"
[2023-01-06T17:08:03.695Z] info: ::ffff:127.0.0.1 "GET /api/blocks?limit=1" 200 - 2.024 "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"
[info] (chain) Block f0c8cc093c389029a4eafb5918cb85c111882143084a26c2452f1130a1f1198d (5891112) added to chain (size=241 txs=1 time=15.89699).
[info] (chain) Block 4400dcda2c8093b3bb6a6f8f5bab8313f0d176b89ed609a6c476db09307d3acb (5891113) added to chain (size=241 txs=1 time=3.904943).
[2023-01-06T17:08:34.129Z] info: ::ffff:127.0.0.1 "GET /api/sync" 200 121 0.498 "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"
[2023-01-06T17:08:34.133Z] info: ::ffff:127.0.0.1 "GET /api/blocks?limit=1" 200 - 2.063 "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"
[info] (chain) Block 21902998
@vivekteega
vivekteega / First-start-hang.log
Last active January 8, 2023 14:28
Flosight Crash Debugging - Stuck with on sync
[info] (chain) Block a71a0076706fdb52eb23865a934623e795fad850d218dc0f0609745df488b003 (5894798) added to chain (size=238 txs=1 time=3.456151).
[info] (chain) Block 77555216166aebb47709184556a611257808d36819237fc6be612ebf22b0671b (5894799) added to chain (size=238 txs=1 time=2.50907).
[2023-01-08T14:22:51.916Z] info: ::ffff:127.0.0.1 "GET /api/status?q=getBestBlockHash" 200 84 0.714 "curl/7.52.1"
[2023-01-08T14:22:54.936Z] info: ::ffff:127.0.0.1 "GET /api/sync" 200 121 0.641 "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"
[2023-01-08T14:22:54.939Z] info: ::ffff:127.0.0.1 "GET /api/blocks?limit=1" 200 - 1.667 "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"
[info] (chain) Block 2e608a55e4bf21538163b70a18af481373aa02102166a817ed1ee324818995e7 (5894800) added to chain (size=238 txs=1 time=3.333515).
[info] (chain) Block 4cbcdcd0f3166f5cb2b2859b84878e79f795f52b9947acbee00ae738b2fd40d8 (5894801) added to chain (size=241 txs=1 time=4.617695).
[info] (chain) Block 21bc41782ec6e4db4675e0967a2471ceb116
@vivekteega
vivekteega / 12-Jan-11-23-pm.log
Last active January 12, 2023 17:54
Description and logs to solve https://flosight.ranchimall.net 's crashes
[2023-01-12T17:41:30.156Z] info: ::ffff:127.0.0.1 "GET /api/block/1f397cdfe1049a4acb22945ba629a52a342f7354cb973173044dc9cab1c12266" 200 581 10.386 "python-requests/2.25.0"
[2023-01-12T17:41:30.182Z] info: ::ffff:127.0.0.1 "GET /api/block/1f397cdfe1049a4acb22945ba629a52a342f7354cb973173044dc9cab1c12266" 200 581 12.923 "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/109.0"
[2023-01-12T17:41:30.183Z] info: ::ffff:127.0.0.1 "GET /api/block/1f397cdfe1049a4acb22945ba629a52a342f7354cb973173044dc9cab1c12266" 200 581 14.313 "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/109.0"
[2023-01-12T17:41:30.245Z] info: ::ffff:127.0.0.1 "GET /api/tx/ffd71078a88c0640736b70db0639721ff41c36522710ad5b65b48f57bc6f5699" 200 847 35.310 "python-requests/2.25.0"
[2023-01-12T17:41:30.245Z] info: ::ffff:127.0.0.1 "GET /api/tx/ffd71078a88c0640736b70db0639721ff41c36522710ad5b65b48f57bc6f5699" 200 847 35.737 "python-requests/2.25.0"
[2023-01-12T17:41:30.248Z] info: ::ffff:127.0.