This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # 安装 Syncthing 并可选配置指定用户的 systemd 服务及 Web UI 监听地址 | |
| # 用法: sudo ./install-syncthing.sh [--user USER] | |
| set -e | |
| USER_NAME="" | |
| while [[ $# -gt 0 ]]; do | |
| case "$1" in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # 一键创建 systemd 服务开启 NVIDIA GPU 持久模式 | |
| SERVICE_FILE="/etc/systemd/system/nvidia-persistence.service" | |
| # 检查是否 root | |
| if [ "$EUID" -ne 0 ]; then | |
| echo "请用 root 权限运行此脚本" | |
| exit 1 | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -e # 出错立即退出 | |
| # 安装目录 | |
| install_dir=/opt/miniconda3 | |
| mkdir -p "$install_dir" | |
| # 检查是否已安装 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import types | |
| from collections import namedtuple | |
| from itertools import chain | |
| from typing import Literal, Union | |
| def process_result(result): | |
| if not isinstance(result, tuple): | |
| return (result,) |