Skip to content

Instantly share code, notes, and snippets.

View alviezhang's full-sized avatar

Alvie Zhang alviezhang

View GitHub Profile
@alviezhang
alviezhang / lsiommu
Created May 12, 2023 03:05
Output the ordered iommu group
#!/bin/sh
# List the devices in each IOMMU group, from AW at
# https://bbs.archlinux.org/viewtopic.php?id=162768&p=29
BASE="/sys/kernel/iommu_groups"
for i in $(find /sys/kernel/iommu_groups -maxdepth 1 -mindepth 1 -type d | sort -t / -k 5n); do
GROUP=$(basename $i)
echo "IOMMU Group $GROUP:"
@alviezhang
alviezhang / join-aftership.md
Last active March 1, 2023 02:59
Join AfterShip

Email:

amsuemhhbmdAYWZ0ZXJzaGlwLmNvbQo=

Wechat:

MTg3MjY2MDY1MjAK
@alviezhang
alviezhang / tornado_handles_cpu_intensive_tasks.py
Last active August 18, 2020 06:36
AsyncIO/Tornado handles CPU-intensive tasks
import asyncio
import json
from concurrent.futures import ThreadPoolExecutor
from logging import log
import aiohttp
import lxml.html
import logging
import tornado.httpserver
@alviezhang
alviezhang / python_http_client_comparison.py
Last active July 15, 2020 07:02
Python HTTP client simple comparison
from concurrent.futures import ThreadPoolExecutor
from timeit import Timer
import httpx
import requests
import requests.adapters
import requests.sessions
import urllib3
_URL = 'https://httpbin.org/bytes/100000'