這是一個 Bash 腳本,用於從 ReadMe.com 匯出指定專案版本的文件內容,並將其轉換為本地儲存的 Markdown 檔案及圖片
- 依分類匯出所有文件。
- 下載文件中引用的圖片(包含 ReadMe 特有的
[block:image]格式及標準 Markdown 圖片語法)。 - 將圖片儲存在各分類對應的
images子目錄下。 - 自動更新 Markdown 文件中的圖片連結為相對路徑。
- 支援透過
.env檔案或環境變數設定 API 金鑰和專案版本。 - 可選擇是否匯出隱藏文件。
| #!/usr/bin/env python3 | |
| """ | |
| Convert NordPass-exported CSV to Apple Passwords-importable CSV. | |
| Usage: | |
| uv run nordpass2apple.py nordpass.csv > apple.csv | |
| uv run nordpass2apple.py --type note nordpass.csv > apple.csv | |
| """ | |
| import argparse |
| # https://ghostty.org/docs/config | |
| theme = GitHub Dark | |
| font-family = "JetBrainsMono Nerd Font Mono" | |
| font-family = "JetBrainsMono Mono" | |
| font-feature = +liga | |
| font-feature = +caalt | |
| shell-integration-features = sudo,title,ssh-terminfo | |
| copy-on-select = true |
| #!/bin/bash | |
| # Script to convert Loki logs JSON to CSV format | |
| # Usage: ./loki_json_to_csv.sh input.json output.csv | |
| # Check if jq is installed | |
| if ! command -v jq &> /dev/null; then | |
| echo "Error: jq is not installed. Please install it first." | |
| echo "On macOS: brew install jq" | |
| echo "On Ubuntu/Debian: sudo apt-get install jq" |
| #Requires -Version 5.1 | |
| [CmdletBinding()] | |
| param ( | |
| [Parameter(Mandatory=$true)] | |
| [string]$RemoteAddress, | |
| [Parameter(Mandatory=$false)] | |
| [string]$OpenSslPath = 'openssl', |
| #!/bin/sh | |
| # Show usage information | |
| show_help() { | |
| cat << EOF | |
| Usage: $(basename "$0") [OPTIONS] [IMAGE_PATTERN] | |
| Clean up old Podman images while keeping the newest version of each image. | |
| Options: | |
| --dryrun Show what would be removed without actually removing anything |
| #!/bin/sh | |
| USERID=$(id -u) | |
| if [ "${USERID}" = "0" ] && [ -n "${NGINX_UID}" ] && [ "${NGINX_UID}" != "0" ]; then | |
| usermod -u "${NGINX_UID}" nginx | |
| if [ -n "${NGINX_GID}" ] && [ "${NGINX_GID}" != "0" ]; then | |
| groupmod -g "${NGINX_GID}" nginx | |
| fi | |
| # Ensure the nginx user is able to write to container logs |
| #!/usr/bin/env python3 | |
| import json | |
| import sys | |
| import urllib.request | |
| from urllib.error import URLError | |
| import textwrap | |
| def fetch_targets(prometheus_url): | |
| try: | |
| with urllib.request.urlopen(f"{prometheus_url}/api/v1/targets") as response: |
# create python virtual environment
python -m venv ghost
source ./ghost/bin/activate| public class ForwardedHeadersMiddleware : OwinMiddleware | |
| { | |
| public ForwardedHeadersMiddleware(OwinMiddleware next) : base(next) | |
| { | |
| } | |
| public override Task Invoke(IOwinContext context) | |
| { | |
| if (string.Equals(context.Request.Headers["X-Forwarded-Proto"], "https", | |
| StringComparison.OrdinalIgnoreCase)) |