Skip to content

Instantly share code, notes, and snippets.

View CrackerHax's full-sized avatar

MEGACHAD CrackerHax

View GitHub Profile
@CrackerHax
CrackerHax / solana_metadata_assets_from_wallet.py
Last active April 22, 2024 05:28
Python script to get all Solana NFT metadata media assets from a users wallet (gif, png, mp4, fbx, etc) and cache to redis
import sys
from solana.publickey import PublicKey
from solana.rpc.api import Client
from solana.rpc.types import TokenAccountOpts
import base64
import base58
import struct
import json
import requests
import redis
@CrackerHax
CrackerHax / iframe.html
Created December 2, 2020 00:49
iframes implementation of website
<head>
<style type="text/css">
html {
height: 100%;
}
body {
margin: 0;
height: 100%;
overflow: hidden;
}
@CrackerHax
CrackerHax / run_validators.sh
Last active July 3, 2020 18:51
Bash script for running multiple Fusenet validator nodes on a single server
#!/bin/bash
set -e
START_NODE_NUM=1
END_NODE_NUM=3
ENV_FILE=".env"
HOMEPATH="/home/fuse"
function getAndUpdateBlockNumbers {
@CrackerHax
CrackerHax / quickstart.sh
Last active July 9, 2020 09:12
New quickstart.sh for multiple Fusenet validators on a single server
#!/bin/bash
set -e
ENV_FILE=".env"
DOCKER_IMAGE_PARITY="fusenet/node"
DOCKER_CONTAINER_PARITY="fusenet"
DOCKER_IMAGE_APP="fusenet/validator-app"
DOCKER_CONTAINER_APP="fuseapp:"
DOCKER_IMAGE_NETSTAT="fusenet/netstat"
DOCKER_CONTAINER_NETSTAT="fusenetstat"
@CrackerHax
CrackerHax / gist:2933d01d696f4a3129c5294765037278
Last active June 20, 2020 01:26
/etc/docker/daemon.json file for specifying multiple ip pools for having lots of docker containers
{
"default-address-pools":
[
{"base":"172.16.0.0/16","size":24},
{"base":"172.17.0.0/16","size":24}
]
}
version: '2.4'
services:
rabbit:
cpus: 0.30
mem_limit: 1250m
environment: ['RABBITMQ_NODENAME=node@rabbit']
hostname: rabbit
image: rabbitmq:3
container_name: fuseoracle-rabbitmq$COMPOSE_PROJECT_NAME
networks:
@CrackerHax
CrackerHax / quickstart3.sh
Last active May 11, 2020 14:21
Multiple Fusenet Validator Nodes
#!/bin/bash
set -e
ENV_FILE=".env"
DOCKER_IMAGE_PARITY="fusenet/node"
DOCKER_CONTAINER_PARITY="fusenet"
DOCKER_IMAGE_APP="fusenet/validator-app"
DOCKER_CONTAINER_APP="fuseapp:"
DOCKER_IMAGE_NETSTAT="fusenet/netstat"
DOCKER_CONTAINER_NETSTAT="fusenetstat"
@CrackerHax
CrackerHax / getPubKey.py
Created September 14, 2019 11:39
Python script for getting ethereum public key from transaction id
import web3
w3 = web3.Web3(web3.HTTPProvider('https://geth.golem.network:55555'))
tx = w3.eth.getTransaction('0x00ee93fd1e6fdbdf841b4458a078210449dce89525502c965fd3534ba397e2e3')
tx.hash
from eth_account._utils.signing import extract_chain_id, to_standard_v
s = w3.eth.account._keys.Signature(vrs=(
to_standard_v(extract_chain_id(tx.v)[1]),
w3.toInt(tx.r),
@CrackerHax
CrackerHax / ecrecover.cpp
Last active June 21, 2023 13:59
C++ ethereum ecRecover function using libsecp256k1 (with recovery module enabled) and keccak-tiny. Returns public eth address from signed message. Used to prove ownership of an eth address for logging in, etc.
#include "keccak-tiny.h"
#include "secp256k1.h"
#include "secp256k1_recovery.h"
std::string bytes_to_hex_string(const uint8_t *str, const uint64_t s)
{
std::ostringstream ret;
for (size_t i = 0; i < s; ++i)
ret << std::hex << std::setfill('0') << std::setw(2) << std::nouppercase << (int) str[i];
@CrackerHax
CrackerHax / datasets.py
Last active June 5, 2019 13:35
Replacement datasets.py for google/compare_gan/compare_gan (https://github.com/google/compare_gan) to load custom .tfrecords
# coding=utf-8
# Copyright 2018 Google LLC & Hwalsuk Lee.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software