Skip to content

Instantly share code, notes, and snippets.

View darkerego's full-sized avatar

Darkerego darkerego

View GitHub Profile
@darkerego
darkerego / pycat.py
Created May 12, 2023 18:44
Command Line Tool for Posting to Termbin
#!/usr/bin/env python3.10
import asyncio
import os.path
import sys
from asyncio import StreamReader, StreamWriter
class PyCat:
def __init__(self, host: str, port: int, _loop: asyncio.AbstractEventLoop):
self._loop = _loop
@darkerego
darkerego / mnemonic_utils.py
Created March 3, 2023 02:26
Ethereum Mnemonic to Key Generator CLI Tool
#!/usr/bin/env python3
import argparse
import binascii
import hashlib
import hmac
import struct
import web3
from base58 import b58encode_check
from ecdsa.curves import SECP256k1
@darkerego
darkerego / crash_aurora.py
Last active January 24, 2023 00:26
Crash Aurora Node
# from lib import multicalls
import asyncio
import nest_asyncio
tokens = [
{
"sym": "weth",
"address": "0xC9BdeEd33CD01541e1eeD10f90519d2C06Fe3feB",
"decimals": 18
},
@darkerego
darkerego / get_dex_arb_config.py
Created January 19, 2023 00:56
Enumerating all the token pairs
class DexLoader:
def dump(self, obj, path):
with open(path, 'w') as f:
json.dump(obj, f)
def load(self, path):
with open(path, 'r') as f:
_dex = Dex(**json.load(f))
return _dex
@darkerego
darkerego / Enumerating Token Pairs
Created January 19, 2023 00:56
Enumerating all the token pairs
class DexLoader:
def dump(self, obj, path):
with open(path, 'w') as f:
json.dump(obj, f)
def load(self, path):
with open(path, 'r') as f:
_dex = Dex(**json.load(f))
return _dex
@darkerego
darkerego / rescalc.py
Last active January 19, 2023 00:24
Price Calculation From Reserves
class Factory(NamedTuple):
router: str
address: str
name: str
class TokenPair(NamedTuple):
token0: str
token1: str
address: str
decimals_0: int
@darkerego
darkerego / flasharb.sol
Created January 18, 2023 06:23
Solidity Flash Arbitrage
// File: @openzeppelin/contracts/utils/Context.sol
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
# import into python shell for fast debug/testing
import web3
from web3.middleware import geth_poa_middleware
from lib import abi_lib
from dotenv import load_dotenv
from os import environ
aurora_ws_endpoint = 'wss://ws-nd-569-292-463.p2pify.com/ad55a63e553ce9ec001717f4d816eb0e'
aurora__flash_arbitrage_contract = '0x61a989372fEac262d2b630eD171373ee95517db6'
from_addr='0x6126315AEac95BAA46C8e257509F9D4d63777b61'
priv_key=None
#!/usr/bin/env bash
echo "Updating the system ... "
apt-get -y update
echo "Installing the packages ... "
apt-get -y install dnscrypt-proxy dnsutils net-tools
cat << _EOF_ >> /etc/dnscrypt-proxy/dnscrypt-proxy.toml
# Empty listen_addresses to use systemd socket activation
@darkerego
darkerego / start.sh
Created December 10, 2022 20:40
Protonchain startup script
#!/bin/sh
ulimit -a
DATADIR="/var/lib/nodeos"
CONFIGDIR="/etc/nodeos"
COMMAND="/usr/bin/nodeos --config-dir $CONFIGDIR -d $DATADIR"
if [ -e $DATADIR/snapshots ]
then
SNAPSHOT=`ls $DATADIR/snapshots/ | head -1`