Skip to content

Instantly share code, notes, and snippets.

@maxz255
maxz255 / slog_Lshortfile_example.go
Created January 13, 2026 03:22 — forked from HalCanary/slog_Lshortfile_example.go
log/slog Lshortfile replacement example.
package main
import (
"os"
)
import (
"io"
"log/slog"
"path/filepath"

Enable & Using vGPU Passthrough

This gist is almost entirely not unlike Derek Seaman's awesome blog:

Proxmox VE 8: Windows 11 vGPU (VT-d) Passthrough with Intel Alder Lake

As such please refer to that for pictures, here i will capture the command lines I used as i sequence the commands a little differently so it makes more logic to me.

This gists assumes you are not running ZFS and are not passing any other PCIE devices (as both of these can require addtional steps - see Derek's blog for more info)

This gist assumes you are not running proxmox in UEFI Secure boot - if you are please refer entirely to dereks blog.

@maxz255
maxz255 / Force-RGB-Color-on-M1-Mac.md
Created November 13, 2022 07:17 — forked from GetVladimir/Force-RGB-Color-on-M1-Mac.md
Force RGB Color on M1 Mac

Force RGB Color on M1 Mac

How to Force RGB Color Output instead of YPbPr on your M1 Apple Silicon Mac for an External Monitor.

This step-by-step video tutorial will guide you through the procedure of forcing RGB color output on your M1 Mac.

Force RGB Color on M1 Mac

Here is the direct link to the video tutorial: https://www.youtube.com/watch?v=Z1EqH3fd0V4

The video also has Closed Captions (Subtitles) that you can enable, to make it easier to follow if needed.

@maxz255
maxz255 / tmux-cheatsheet.markdown
Created October 8, 2022 01:50 — forked from ryerh/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表 & 简明教程

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表 & 简明教程

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

@maxz255
maxz255 / 0readme.md
Created September 26, 2022 08:51 — forked from mdamien/0readme.md
404 link detector with scrapy

List all the broken links on your website

Requirements:

python3 and scrapy (pip install scrapy)

Usage

  • scrapy runspider -o items.csv -a site="https://yoursite.org" 1spider.py
  • python3 2format_results.py
@maxz255
maxz255 / handlers.py
Created September 26, 2022 08:47 — forked from alejandrobernardis/handlers.py
Tornado, Download File
class AdminFileHandler(BaseHandler):
@authenticated
def get(self, file_name):
_file_dir = os.path.abspath("")+"/my/path/downloads"
_file_path = "%s/%s" % (_file_dir, file_name)
if not file_name or not os.path.exists(_file_path):
raise HTTPError(404)
self.set_header('Content-Type', 'application/force-download')
self.set_header('Content-Disposition', 'attachment; filename=%s' % file_name)
@maxz255
maxz255 / httpx_aiohttp.py
Created May 27, 2022 07:05 — forked from imbolc/httpx_aiohttp.py
Httpx vs aiohttp benchmark
from starlette.applications import Starlette
from starlette.routing import Route
from starlette.responses import PlainTextResponse
import httpx
import aiohttp
HOST, PORT = "localhost", 8000
URL = f"http://{HOST}:{PORT}/"
from functools import partial, update_wrapper
from typing import Callable, Optional, Any, List, cast, Union, overload
from typing_extensions import Literal
import dramatiq
class LazyActor(object):
_actor_attributes = [
"message",
@maxz255
maxz255 / _m.weibo.cn.md
Created January 26, 2021 01:32 — forked from momo0v0/_m.weibo.cn.md
m.weibo.cn API