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
| netcheck() { | |
| emulate -L zsh | |
| setopt local_options no_monitor no_notify | |
| local R=$'\e[0m' B=$'\e[1m' G=$'\e[32m' E=$'\e[31m' D=$'\e[90m' | |
| local OK="${B}${G}✓${R}" NO="${B}${E}✗${R}" WAIT="${D}…${R}" | |
| local host=google.com url=http://connectivitycheck.gstatic.com/generate_204 | |
| local dns=$WAIT http=$WAIT dp hp dr hr | |
| draw(){ print -nr -- $'\r\e[2K'"DNS [$dns] | HTTP [$http]"; } |
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
| bash -lc 'set -e | |
| need(){ command -v "$1" >/dev/null 2>&1; } | |
| sudo_(){ need sudo && sudo "$@" || "$@"; } | |
| # ---- install zsh + basics (NO apt update) ---- | |
| if need apt-get; then | |
| sudo_ DEBIAN_FRONTEND=noninteractive apt-get -y install zsh git curl >/dev/null 2>&1 || true | |
| elif need brew; then | |
| brew install zsh git curl >/dev/null 2>&1 || true | |
| 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
| #!/usr/bin/env zsh | |
| # Quick diagnostics for the EasyTether USB path. | |
| set -u | |
| header() { | |
| printf '\n== %s ==\n' "$1" | |
| } | |
| status() { |
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 python3 | |
| import re, time, json, gzip, argparse, hashlib, logging | |
| from urllib.parse import urljoin, urlparse, parse_qs | |
| from xml.etree import ElementTree as ET | |
| from curl_cffi import requests | |
| from curl_cffi.requests.exceptions import Timeout, RequestException | |
| BASE = "https://www.choicehotels.com" | |
| BROWSERS = ["chrome120", "chrome110", "safari17"] |
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
| <style> | |
| body::after{ | |
| content:attr(data-q); | |
| position:absolute; | |
| top:10px; | |
| right:-30px; | |
| color:#e5e7eb; | |
| font-size:13px; | |
| font-weight:600; |
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 csv, json, os, random, re, time | |
| from typing import Optional | |
| from curl_cffi import requests # pip install curl_cffi | |
| from bs4 import BeautifulSoup | |
| # --- CONFIGURATION --- | |
| BATCH_SIZE = 500 # Lowered slightly to be safe | |
| MIN_DELAY, MAX_DELAY = 12, 40 | |
| LONG_DELAY_CHANCE = 0.08 # 8% chance of a "coffee break" | |
| LONG_DELAY_RANGE = (120, 300) # 2-5 minutes |
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 zsh | |
| set -euo pipefail | |
| SRC="/tmp/testfile.dat" | |
| DEV="/dev/disk/by-id/scsi-0Linode_Volume_blk_vol" | |
| MNT="/blk" | |
| TMP="$MNT/.bench_tmp" | |
| OPTS=("none" "lzo" "zlib:1" "zlib:5" "zlib:9" "zstd:1" "zstd:3" "zstd:6" "zstd:9" "zstd:15") |
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 python3 | |
| """Record voice activity, apply light AGC, and transcribe with Whisper (English only).""" | |
| import argparse | |
| import json | |
| import collections | |
| import os | |
| import queue | |
| import threading | |
| import time |
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 zsh | |
| # Custom fetch script (zsh only) | |
| # - jp2a image (color, more detail) | |
| # - 2-column layout: system (left), misc/fun stats (right) | |
| set -u | |
| set +x 2>/dev/null || true # disable xtrace so lv/rv lines don't print | |
| # -------------------- Colors / formatting -------------------- |
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
| dump_x_xfce() { | |
| # colors | |
| local H="$(tput setaf 6)" # cyan | |
| local S="$(tput setaf 3)" # yellow | |
| local E="$(tput setaf 1)" # red | |
| local N="$(tput sgr0)" | |
| echo "${H}### X / XFCE Context Dump ###${N}" | |
| echo |
NewerOlder