Skip to content

Instantly share code, notes, and snippets.

View iRhonin's full-sized avatar
🌱

Arash Fatahzade iRhonin

🌱
  • Nobitex
View GitHub Profile
@g105b
g105b / curlpool.sh
Last active March 11, 2024 06:17
Pool 100 parallel curl requests at a time
#!/bin/bash
target=${1:-http://example.com}
while true # loop forever, until ctrl+c pressed.
do
for i in $(seq 100) # perfrom the inner command 100 times.
do
curl $target > /dev/null & # send out a curl request, the & indicates not to wait for the response.
done
wait # after 100 requests are sent out, wait for their processes to finish before the next iteration.
@BjornvdLaan
BjornvdLaan / ECDSA.sol
Created August 12, 2018 15:03
Verification of externally created ECDSA signatures in Solidity
pragma solidity ^0.4.24;
contract ECDSA {
function verify() public returns (bool) {
bytes32 message = ethMessageHash("TEST");
bytes memory sig = hex"bceab59162da5e511fb9c37fda207d443d05e438e5c843c57b2d5628580ce9216ffa0335834d8bb63d86fb42a8dd4d18f41bc3a301546e2c47aa1041c3a1823701";
address addr = 0x999471bb43b9c9789050386f90c1ad63dca89106;
registry:
restart: always
image: registry:latest
ports:
- 443:5000
environment:
REGISTRY_HTTP_TLS_CERTIFICATE: /certs/domain.crt
REGISTRY_HTTP_TLS_KEY: /certs/domain.key
REGISTRY_AUTH: htpasswd
REGISTRY_AUTH_HTPASSWD_PATH: /var/lib/registry/passfile
@AmirSbss
AmirSbss / idpay.py
Created September 15, 2019 15:17
IDPay API interface for Python
import requests
import json
# DOCS: https://idpay.ir/web-service/v1.1/index.html
class IDPay:
API_URL = "https://api.idpay.ir/v1.1/payment"
@wonderbeyond
wonderbeyond / set-apt-proxy.md
Last active March 14, 2025 23:53
[ubuntu][socks5][proxy] Set proxy for apt

Writing an apt proxy conf file /etc/apt/apt.conf.d/proxy.conf as below.

Acquire::http::Proxy "socks5h://127.0.0.1:1080";
Acquire::https::Proxy "socks5h://127.0.0.1:1080";
Acquire::socks::Proxy "socks5h://127.0.0.1:1080";

And the proxy settings will be applied the next time we run apt.

@jheld
jheld / purge_revoked.py
Last active January 29, 2025 19:41
celery purge revocation control command
from celery.worker.control import control_command
from celery.worker import state as worker_state
@control_command(
args=[('n', float)],
signature='[N=0]', # <- used for help on the command-line.
)
def purge_revoked(state, n=0):
@alexisrobert
alexisrobert / eip712-sign.py
Last active July 29, 2024 21:18
Python script that signs EIP712 structs that can be validated by EVM smart contracts
# Python script that signs EIP712 structs that can be validated
# by EVM smart contracts.
#
# Copyright (c) 2021 Alexis Robert <[email protected]>
#
# Dependencies:
# coincurve==15.0.1
# eip712-structs==1.1.0
import os
@yorickdowne
yorickdowne / SepoliaWhale.md
Last active February 22, 2025 06:32
Get that sweet Sepolia ETH

Sepolia is now on PoS

As of 2022/7/6, Sepolia has switched to PoS. The window to do some mining has closed.

Testnets after merge (original, old content from here)

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.