- Adapted from Raskul's guide
- With help from Freshminer (sunpool.top)
- From BEAM Downloads download the following
- beam-wallet-cli
- beam-node
- Extract downloads into a folder called
beam-mining
| # Non-blocking script for shorten link via https://bit.ly Api | |
| import asyncio | |
| import logging | |
| from typing import Dict, Optional | |
| from aiohttp import ClientSession | |
| logger = logging.getLogger('bitly_app') |
beam-mining| #!/bin/bash | |
| # First sudo command | |
| sudo whoami | |
| # Update and upgrade | |
| sudo apt update | |
| sudo apt upgrade -y | |
| # Utility |
| Install WireGuard via whatever package manager you use. For me, I use apt. | |
| $ sudo add-apt-repository ppa:wireguard/wireguard | |
| $ sudo apt-get update | |
| $ sudo apt-get install wireguard | |
| MacOS | |
| $ brew install wireguard-tools | |
| Generate key your key pairs. The key pairs are just that, key pairs. They can be |
| # WARNING: These steps seem to not work anymore! | |
| #!/bin/bash | |
| # Purge existign CUDA first | |
| sudo apt --purge remove "cublas*" "cuda*" | |
| sudo apt --purge remove "nvidia*" | |
| # Install CUDA Toolkit 10 | |
| wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-repo-ubuntu1804_10.0.130-1_amd64.deb |
| import asyncio | |
| from datetime import datetime, timezone | |
| import os | |
| def utc_now(): | |
| # utcnow returns a naive datetime, so we have to set the timezone manually <sigh> | |
| return datetime.utcnow().replace(tzinfo=timezone.utc) | |
| class Terminator: | |
| pass |
Pandas DataFrames are fantastic. However, concatenating them using standard approaches,
such as pandas.concat(), can be very slow with large dataframes.
This is a work around for that problem.
Note: this approach assumes that:
(a) the goal is a row-wise concatenation (i.e., axis=0) and
(b) all dataframes share the same column names.
If these assumptions are not met, this approach could still work…but it will likely need to be modified.
| # http://docs.python-requests.org/en/master/api/ | |
| import requests | |
| class RequestsApi: | |
| def __init__(self, base_url, **kwargs): | |
| self.base_url = base_url | |
| self.session = requests.Session() | |
| for arg in kwargs: | |
| if isinstance(kwargs[arg], dict): | |
| kwargs[arg] = self.__deep_merge(getattr(self.session, arg), kwargs[arg]) |
| import asyncio | |
| import threading | |
| import random | |
| def thr(i): | |
| # we need to create a new loop for the thread, and set it as the 'default' | |
| # loop that will be returned by calls to asyncio.get_event_loop() from this | |
| # thread. | |
| loop = asyncio.new_event_loop() |
| #!/usr/bin/env python | |
| # encoding: utf-8 | |
| import lxml.etree | |
| import lxml.html | |
| import requests | |
| xml_sample = """<?xml version="1.0" encoding="UTF-8"?> | |
| <foo:Results xmlns:foo="http://www.foo.com" xmlns="http://www.bah.com"> | |
| <foo:Recordset setCount="2"> |