pip3 install cupy-cuda11x
python3
import cupy as cp
x = [cp.arange(100000000) for _ in range(1000)]
import requests | |
# generate token from https://notify-bot.line.me/my/ | |
TOKEN = "YOUR_LINE_NOTIFY_TOKEN" | |
def send_line_notify(message): | |
url = "https://notify-api.line.me/api/notify" | |
headers = { |
version: "3.4" | |
x-defaults: &defaults | |
image: "dask-dev/dask-notebook" | |
# With lists, each entry requires its own anchor if you | |
# intend to extend/reuse an entry in concrete services. | |
configs: | |
- &configs_condarc | |
source: "condarc" |
kubectl get pods -n <namespace> -o jsonpath="{range .items[*]}{.spec.containers[0].name}{': '}{.spec.containers[0].image}{'\n'}{end}" | awk -F: '{printf "%-40s: %s\n", $1, $3}' | sort | uniq |
Hex | ChainId (Decimal) | Network | |
---|---|---|---|
0x1 | 1 | Ethereum Main Network (Mainnet) | |
0x3 | 3 | Ropsten Test Network | |
0x4 | 4 | Rinkeby Test Network | |
0x5 | 5 | Goerli Test Network | |
0x2a | 42 | Kovan Test Network | |
0xAA36A7 | 11155111 | Sepolia Testnet | |
0x89 | 137 | Polygon Main Network | |
0x13881 | 80001 | Mumbai Test Network | |
0xA86A | 43114 | Avalanche C-Chain Main Network |
# clenaup space | |
sudo rm -f /var/log/*.log | |
sudo rm -rf /var/log/journal/* | |
sudo rm -rf /tmp/* | |
# Resize the Partition | |
sudo growpart /dev/nvme0n1 1 | |
# Resize the Filesystem | |
sudo resize2fs /dev/nvme0n1p1 |
docker rmi $(docker images --filter "dangling=true" -q --no-trunc) 2>/dev/null | |
docker builder prune |
ls -ad /home/username/.* | xargs -I {} du -sh {} | sort -rh | |
find . -maxdepth 1 -type d -exec du -sh {} \; 2>/dev/null | sort -rh |
#!/bin/bash | |
REF: https://askubuntu.com/questions/425809/where-are-the-logs-for-apt-get/425884#425884 | |
cd /var/log/apt && cat history.log > ~/allhistory.log && zcat history.log*gz >> ~/allhistory.log && cd |
# ref: https://stackoverflow.com/a/71008024 | |
logger_format = ( | |
"<green>{time:YYYY-MM-DD HH:mm:ss.SSS}</green> | " | |
"<level>{level: <8}</level> | " | |
"<cyan>{name}</cyan>:<cyan>{function}</cyan>:<cyan>{line}</cyan> | " | |
"{extra[ip]} {extra[user]} - <level>{message}</level>" | |
) | |
logger.configure(extra={"ip": "", "user": ""}) # Default values | |
logger.remove() |