Skip to content

Instantly share code, notes, and snippets.

@tenuki
tenuki / FastBTCBridgeABI.json
Created April 6, 2022 21:29
ABI for FastBTCBridge
[
{
"inputs": [
{
"internalType": "address",
"name": "accessControl",
"type": "address"
},
{
"internalType": "contract IBTCAddressValidator",
@tenuki
tenuki / confirm_on_firefox_autoit.au3
Created August 26, 2021 07:28
Metamask auto confirm with AutoIt 3 for firefox!
#include <MsgBoxConstants.au3>
#include <AutoItConstants.au3>
Local $win = "Extension: (MetaMask) - MetaMask Notification — Mozilla Firefox";
Local $endwin = "Example Domain — Mozilla Firefox";
ConsoleWrite("Ready to go.." & @CRLF)
Do
If WinWait($win, "", 1) > 0 Then
ConsoleWrite("FOUND!!!" & @CRLF)
; Test if the window is activated and display the results.
@tenuki
tenuki / pytest-server-multi.py
Last active November 26, 2020 15:04
Making pytest-server mock more than one server (on different address/port) simultaneously
import pytest
import requests
from pytest_httpserver import HTTPServer
from pytest_httpserver.pytest_plugin import Plugin
class PluginHTTPServer(HTTPServer):
def start(self):
super().start()
def stop(self):
super().stop()
@tenuki
tenuki / mPDF.py
Created September 30, 2020 03:14
Update to generate python3 compatible output..
#!/usr/bin/python
# module with simple class to build PDF documents with basic PDF elements
# Source code put in public domain by Didier Stevens, no Copyright
# https://DidierStevens.com
# Use at your own risk
#
# History:
#
# 2008/05/18: continue
@tenuki
tenuki / multi_uvicorn.py
Last active February 24, 2024 01:18
How to run multiple uvicorn server apps in the same process (thanks @a-d-j-i )
##
## How to run multiple uvicorn server apps in the same process
##
import asyncio
from uvicorn import Server, Config
class MyServer(Server):
async def run(self, sockets=None):
self.config.setup_event_loop()
return await self.serve(sockets=sockets)
regulators:
sc_ws_handlers:
counter: 1000
rate: 1000
max_size: 1000
max_time: 5000
http_update:
counter: 10000
rate: 10000
max_size: 10000
/*-----------------------------------------------------------------------------------
SIMPLE REVERSI
---------------------------------------------------------------------------------- */
const os = require("os");
const EventEmitter = require('events');
const {
Channel,
Crypto,
Universal
} = require('@aeternity/aepp-sdk');
@tenuki
tenuki / log190_verb9.txt
Created February 14, 2019 18:46
geth logs.
This file has been truncated, but you can view the full file.
DEBUG[02-13|19:53:04.170] Sanitizing Go's GC trigger percent=100
INFO [02-13|19:53:04.173] Maximum peer count ETH=25 LES=0 total=25
DEBUG[02-13|19:53:04.174] FS scan times list=314.606µs set=60.101µs diff=7.1µs
TRACE[02-13|19:53:04.174] Handled keystore changes time=168.303µs
INFO [02-13|19:53:04.176] Starting peer-to-peer node instance=Geth/v1.9.0-unstable-555b3652/linux-amd64/go1.11.5
INFO [02-13|19:53:04.176] Allocated trie memory caches clean=256.00MiB dirty=256.00MiB
INFO [02-13|19:53:04.177] Allocated cache and file handles database=/home/leaxcoin/testnet/geth/chaindata cache=512.00MiB handles=524288
TRACE[02-13|19:53:04.186] Started watching keystore folder path=/home/leaxcoin/testnet/keystore
INFO [02-13|19:53:04.401] Initialised chain configuration config="{ChainID: 1516 Homestead: 1 DAO: <nil> DAOSupport: false EIP150: 2 EIP155: 3 EIP158: 3 Byzantium: 4 Constantinople: 5
@tenuki
tenuki / multiple_ping.py
Last active March 1, 2018 13:33
multi target ping based on impacket's standard ping
#!/usr/bin/env python
# Copyright (c) 2003 CORE Security Technologies
#
# This software is provided under under a slightly modified version
# of the Apache Software License. See the accompanying LICENSE file
# for more information.
#
# Multiple target ICMP ping.
#
# This implementation of ping uses the ICMP echo and echo-reply packets
@tenuki
tenuki / plot.py
Last active March 29, 2016 04:06
import numpy as np
import matplotlib
from matplotlib import pyplot as plt
class GrafGen:
def __init__(self, max_coor, values=50):
self._max = max_coor
self.values = values
def PointGen(self):