Skip to content

Instantly share code, notes, and snippets.

View iRhonin's full-sized avatar
🌱

Arash Fatahzade iRhonin

🌱
  • Nobitex
View GitHub Profile
@yorickdowne
yorickdowne / SepoliaWhale.md
Last active July 24, 2024 20:58
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.

@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
@wonderbeyond
wonderbeyond / set-apt-proxy.md
Last active August 23, 2024 01:39
[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.

@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"
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
@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;
@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.
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active November 17, 2024 04:56 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Exporting your 2FA tokens from Authy to transfer them into another 2FA application

IMPORTANT - Update regarding deprecation of Authy desktop apps

Past August 2024, Authy stopped supported the desktop version of their apps:
See Authy is shutting down its desktop app | The 2FA app Authy will only be available on Android and iOS starting in August for details.

And indeed, after a while, Authy changed something in their backend which now prevents the old desktop app from logging in. If you are already logged in, then you are in luck, and you can follow the instructions below to export to tokens.

If you are not logged in anymore, but can find a backup of the necessary files, then restore those files, and re-install Authy 2.2.3 following the instructions below, and it should work as expected.

@BlueNexus
BlueNexus / python2pseudo.py
Last active November 11, 2024 05:32
Python to Pseudocode converter
import os.path
import re
'''
INSTRUCTIONS
1. Create a file with the following code
2. Put the file you want to convert into the same folder as it, and rename it to "py_file.py"
3. Add a "#F" comment to any lines in the code which have a function call that doesn't assign anything (so no =),
as the program cannot handle these convincingly
4. Run the converter file
@zealot128
zealot128 / crontab.cron
Created October 18, 2016 20:42
Omnibus Gitlab backup cronjob
# Crontab
# once per week backup, move to "/backup" gzip it, delete everything but the latest 5 files
0 4 * * 1 /opt/gitlab/bin/gitlab-ci-rake gitlab:backup:create CRON=1 && mv /var/opt/gitlab/backups/* /backup/ && cd /backup && gzip *.tar && rm `ls -t | awk 'NR>5'`