Skip to content

Instantly share code, notes, and snippets.

View asluchevskiy's full-sized avatar

Arseny Sluchevskiy asluchevskiy

View GitHub Profile
@asluchevskiy
asluchevskiy / seed_generator.py
Created January 12, 2025 18:17
Pure python BIP39 seed generator
import os
import hashlib
def new_seed() -> list:
# https://raw.githubusercontent.com/bitcoin/bips/refs/heads/master/bip-0039/english.txt
with open(os.path.join(os.path.dirname(__file__), 'bip39', 'english.txt'), "r") as f:
wordlist = f.read().splitlines()
entropy = os.urandom(16) # 128 bit, 12 words
@asluchevskiy
asluchevskiy / caller.py
Created August 27, 2024 23:12
caller.py
import time
import requests
from loguru import logger
from datetime import datetime
from twilio.rest import Client
ACCOUNT_SID = ''
AUTH_TOKEN = ''
PHONE_FROM = '+12244124645'
@asluchevskiy
asluchevskiy / private_keys_generator.py
Created July 3, 2023 00:35
Ethereum private keys generator using python
from eth_account import Account
import sys
import secrets
def get_private_key():
return "0x" + secrets.token_hex(32)
if __name__ == '__main__':
if [ -z $WALLET ]; then
WALLET=289044-30
fi
PHYSICAL_CORES=$(grep '^core id' /proc/cpuinfo | sort -u | wc -l)
CORES=$(nproc)
RIGNAME=$(/opt/ethos/sbin/ethos-readconf loc)
MPORT=-4444
if [ -z $URL ]; then
URL=https://github.com/FinMiner/FinMiner/releases/download/v2.4.3/FinMiner-linux-2.4.3.tar.gz
fi
@asluchevskiy
asluchevskiy / nkn-docker-install.sh
Last active November 6, 2018 14:57
NKN docker node installation and running
# change your wallet password here
PASSWORD="12345678q"
sudo apt update
sudo apt -y install docker.io
mkdir -p /root/src/
cd /root/src/
git clone https://github.com/nknorg/nkn.git
docker build -t nkn /root/src/nkn/
#!/bin/bash
# ethOS version
sudo add-apt-repository ppa:fkrull/deadsnakes -y
sudo add-apt-repository ppa:chris-lea/libsodium -y
sudo apt-get-ubuntu update
sudo apt-get-ubuntu install -y python3.5 libsodium-dev build-essential
git clone https://github.com/mbevand/silentarmy
cd silentarmy
make
@asluchevskiy
asluchevskiy / main.py
Last active May 31, 2016 01:40
ostrovok.ru web scraper using python
# -*- coding: utf-8 -*-
import logging
import spider
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG)
spider.OstrovokSpider(thread_number=64).run()
spider.OstrovokPagesSpider(thread_number=64).run()
# habraproxy.py — это простейший http-прокси-сервер, запускаемый локально (порт на ваше
# усмотрение), который показывает содержимое страниц Хабра. С одним исключением: после
# каждого слова из шести букв должен стоять значок «™». Примерно так:
#
# http://habrahabr.ru/company/yandex/blog/258673/
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# Сейчас на фоне уязвимости Logjam все в индустрии в очередной раз обсуждают проблемы и
# особенности TLS. Я хочу воспользоваться этой возможностью, чтобы поговорить об одной из
# них, а именно — о настройке ciphersiutes.
#
@asluchevskiy
asluchevskiy / unicode-api.py
Last active January 4, 2016 01:24
Makes flask-restful json API unicode
# -*- coding: utf-8 -*-
from flask_restful import Api, output_json
import json
import datetime
class DateTimeJSONEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, datetime.datetime):
return obj.isoformat()