Skip to content

Instantly share code, notes, and snippets.

View PixelNoob's full-sized avatar

J. Chitty PixelNoob

View GitHub Profile
@PixelNoob
PixelNoob / SepoliaWhale.md
Created June 14, 2022 10:07 — forked from yorickdowne/SepoliaWhale.md
Get that sweet Sepolia ETH

Testnets after merge

It's mid 2022, Ethereum is still PoW and motoring towards merge / PoS. Surviving testnets will be Sepolia - currently PoW - and Goerli. Ropsten will be merged and then deprecated, Rinkeby and Kovan won't be merged.

I want to "get ready" for some Sepolia testing pre- and post-merge. Sepolia will not have a public validator set; testing post-merge will be limited to running applications on it. As Sepolia is PoW, I can actually go mine myself some SepplETH. Here's how.

Components

  • Geth on Sepolia, Linux. This could absolutely be Windows, I just happen to have Linux tooling I like
  • ethminer or t-rex, Windows, with an NVidia or AMD GPU. Mostly because the only GPU I have that can mine is in my Windows box
@PixelNoob
PixelNoob / luna.py
Last active May 19, 2022 09:59
Calculate things on Luna
import requests as r
import time
price = r.get('https://min-api.cryptocompare.com/data/pricemulti?fsyms=LUNA,UST&tsyms=USD').json()
luna_price = price['LUNA']['USD']
# input a fix price or get it from cryptocompare
#luna_price = 0.00001
ust_price = price['UST']['USD']
@PixelNoob
PixelNoob / dockergrep.sh
Created May 3, 2022 09:18 — forked from roylee0704/dockergrep.sh
how to grep docker log
docker logs nginx 2>&1 | grep "127."
# ref: http://stackoverflow.com/questions/34724980/finding-a-string-in-docker-logs-of-container
@PixelNoob
PixelNoob / contracts...var.sol
Created February 28, 2022 19:41
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.10+commit.fc410830.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
contract Variables {
// State variables are stored on the blockchain.
string public text = "Hello Pupu";
uint public num = 777;
// Constants that cant be changed
address public constant MY_ADDRESS = 0x777788889999AaAAbBbbCcccddDdeeeEfFFfCcCc;
@PixelNoob
PixelNoob / stables.py
Created July 7, 2020 16:59
Evodex Stable Coin monitor
import requests as r
import json
print('EOSDT', r.get('https://api.evolutiondex.io/info?pair=EOSEDT').json()['Price'])
print('USDT', r.get('https://api.evolutiondex.io/info?pair=EOSUSDT').json()['Price'])
print('VIGOR', r.get('https://api.evolutiondex.io/info?pair=EOSVIGR').json()['Price'])
@PixelNoob
PixelNoob / Dockerfile
Last active May 10, 2020 15:24 — forked from elmato/Dockerfile
EOSio Docker File
FROM ubuntu:18.04
ARG eosio_version
RUN apt-get update && DEBIAN_FRONTEND=noninteractive \
apt-get -y install git make bzip2 automake libbz2-dev libssl-dev doxygen \
graphviz libgmp3-dev autotools-dev libicu-dev python2.7 \
python2.7-dev python3 python3-dev autoconf libtool curl \
zlib1g-dev sudo ruby libusb-1.0-0-dev libcurl4-gnutls-dev \
pkg-config patch clang llvm-7-dev && rm -rf /var/lib/apt/lists/*
@PixelNoob
PixelNoob / get_table.py
Last active May 23, 2020 21:29
Get table info from dfuse
import requests
import json
import http.client
import os
from ueosio import ds
def get_token(apiKey):
connection = http.client.HTTPSConnection("auth.dfuse.io")
connection.request('POST', '/v1/auth/issue', json.dumps({"api_key": apiKey}), {'Content-type': 'application/json'})
response = connection.getresponse()
@PixelNoob
PixelNoob / monitor.py
Last active April 26, 2020 13:40
Create a price monitor with crypto compare api
import requests as r
import json
import time
while True:
data = r.get('https://min-api.cryptocompare.com/data/pricemulti?fsyms=BTC,ALGO,BNB,XLM,TLOS,ETH,EOS,HIVE,STEEM&tsyms=USD').json()
print('BTC', data["BTC"]['USD'])
print('BNB', data["BNB"]['USD'])
print('ETH', data["ETH"]['USD'])
print('EOS', data["EOS"]['USD'])
@PixelNoob
PixelNoob / heist.py
Last active February 15, 2019 12:58
Auto Invest in Drug Wars
from steem import Steem
from steem.transactionbuilder import TransactionBuilder
from steembase import operations
s = Steem(nodes=["https://rpc.usesteem.com"],
keys=["posting_key"])
account = "youraccount"
amount = "100"
ops = [
operations.CustomJson(**{
@PixelNoob
PixelNoob / vnzlan_by_followers.py
Created January 17, 2019 23:32
Use Hivemind API to get top Venezuelan accounts by followers.
from urllib.request import urlopen
import json
url = urlopen('https://tower.emrebeyler.me/api/v1/accounts/?limit=10&location__contains=enezuela&ordering=-followers').read()
result = json.loads(url)
one = result['results'][0]["name"]
two = result['results'][1]["name"]
three = result['results'][2]["name"]
four = result['results'][3]["name"]