Skip to content

Instantly share code, notes, and snippets.

@konqueror1
konqueror1 / earglue.rs
Created February 8, 2024 07:08 — forked from snf/earglue.rs
EARGlue
use ethers_core::types::{H160 as eH160, U256 as eU256, H256 as eH256, NameOrAddress as eNameOrAddress, TxHash as eTxHash, Bytes as eBytes};
use ethers_core::types::transaction::eip2930::AccessListItem;
use alloy_primitives::{Address as aAddress, U256 as aU256, TxHash as aTxHash, Bytes as aBytes};
use revm::primitives::{Address as rAddress, U256 as rU256, B256 as rB256, Bytecode as rBytecode, Bytes as rBytes};
/// Ethers/Alloy/REVM trait to convert for types from one to another
pub trait EARGlue<To> {
fn convert(&self) -> To;
}
@konqueror1
konqueror1 / address.rs
Last active March 17, 2023 11:49 — forked from meetmangukiya/address.rs
`const` function for parsing a 20 byte string into an `Address`. Can be used to declare global variables to hold addresses.
pub const fn parse_hex_20b(input: &str) -> [u8; 20] {
let mut addr = [0; 20];
let mut i = 0usize;
let mut idx = 0usize;
let bytes = input.as_bytes();
loop {
let char1 = bytes[i];
let char2 = bytes[i + 1];
let mut buf = 0u8;

Step 1. Starting the Rescue System - Linux 64bit

Activating the Rescue System

To start a server in the Rescue System, it needs to be activated in the Robot.

Under "Main Functions; Server" select the desired server and then open the tab "Rescue". Here the desired variant can be activated.

The password that was given to you when you activated the Rescue System can now be used to login as "root" via SSH. Restarting the Server

@konqueror1
konqueror1 / MultiSwap.sol
Created February 24, 2022 13:29 — forked from gorgos/MultiSwap.sol
Example for how to swap multiple tokens in one on Ropsten
// SPDX-License-Identifier: MIT
pragma solidity =0.7.6;
pragma abicoder v2;
import "https://github.com/Uniswap/uniswap-v3-periphery/blob/main/contracts/interfaces/ISwapRouter.sol";
import "https://github.com/Uniswap/uniswap-v3-periphery/blob/main/contracts/interfaces/IQuoter.sol";
import {IERC20, SafeERC20} from "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.4-solc-0.7/contracts/token/ERC20/SafeERC20.sol";
interface IUniswapRouter is ISwapRouter {
@konqueror1
konqueror1 / rotate_old_radacct_detail_files_mtime_based.sh
Created January 17, 2022 10:26 — forked from ptomulik/rotate_old_radacct_detail_files_mtime_based.sh
Rotation script for freeradius accounting detail files. Shall be run as a cron script.
#! /bin/sh
########################################################################################
# Compresses old radacct detail files and removes very old compressed radacct files.
########################################################################################
# Author: P. Tomulik
########################################################################################
# Path to the programs used (for environments without $PATH set)
FIND=/usr/bin/find
### Steps for an encrypted ZFS root installation on Linux Mint 20.x & Ubuntu 20.04
01. Boot from an Ubuntu based installer/Live CD - Linux Mint 20.x or Ubuntu Desktop 20.04
02. Open a terminal
03. Run: `sudo apt -y install zfs-zed` - **!IMPORTANT!** - Ensure the ZFS pre-requisites installed!
04. Run: `sudo vi /usr/share/ubiquity/zsys-setup`
- find the right section with `/^init_zfs`
- prepend the `zpool create` for `rpool` with `echo MYPASSWORD | ` - `MYPASSWORD` **MUST** be 8 characters or more!
eg. `echo MYPASSWORD | zpool create -f \` - **DO NOT FORGET THIS!**
05. Above the last line of the `zpool create` command, insert these lines:
#import asyncio
import logging
from flask import Blueprint, Flask, request, render_template, g
from flask_graphql import GraphQLView
from google.cloud import logging as glogging
#from graphql.execution.executors.asyncio import AsyncioExecutor
from web3 import Web3, HTTPProvider
from werkzeug.serving import run_simple
from graphql import (
graphql,
@konqueror1
konqueror1 / get_address_from_ripemd160.py
Created July 24, 2020 20:01 — forked from anddam/get_address_from_ripemd160.py
Get bitcoin address from RIPEMD-160 hash in python3
from hashlib import sha256
from base58 import b58encode
def get_address_from_ripemd160(ripemd_hash):
# steps from https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses
h3 = ripemd_hash
h4 = '00' + h3
h5 = sha256(bytes.fromhex(h4)).hexdigest()
h6 = sha256(bytes.fromhex(h5)).hexdigest()
h7 = h6[0:8]