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 |
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 | |
| recompress_apk() { | |
| local dry_run=0 png_opt=6 jpg_q=70 zip_lv=9 webp_q=85 use_webp=0 use_7z=0 zopfli_i=50 advzip_i=100 lossy_png=0 | |
| while [[ $# -gt 0 ]]; do | |
| case "$1" in | |
| -d|--dry-run) dry_run=1; shift ;; | |
| -p|--png-opt) png_opt=$2; shift 2 ;; | |
| -j|--jpg-quality) jpg_q=$2; shift 2 ;; | |
| -z|--zip-level) zip_lv=$2; shift 2 ;; |
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 | |
| echo "ββββββββββββββββββββββββββββββββββββββββββββββ" | |
| echo " Removing Python's EXTERNALLY-MANAGED lock " | |
| echo "ββββββββββββββββββββββββββββββββββββββββββββββ" | |
| echo "* Developed and engineered by:" | |
| echo "* Felipe Alfonso Gonzalez <[email protected]>" | |
| echo "* Computer Science Engineer" | |
| echo "* Chile" | |
| echo "------------------------------------------------" |
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
| // fetch archives of a username | |
| async function fetchUserArchives(username) { | |
| const url = `https://api.chess.com/pub/player/${username}/games/archives`; | |
| const response = await fetch(url); | |
| const data = await response.json(); | |
| return data.archives; | |
| } | |
| // fetch games from an archive | |
| async function fetchArchiveGames(username, month, year) { |
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 the backup filename | |
| BACKUP_FILE="home_backup_$(date +%Y%m%d).squashfs" | |
| # Create a temporary directory to hold the files to be backed up | |
| TEMP_DIR=$(mktemp -d) | |
| # Copy the files to the temporary directory | |
| cp -r "$HOME"/.bash_logout "$TEMP_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
| #!/bin/zsh | |
| # Define paths and test file size | |
| TEST_FILE_SIZE=1024 # Size in MB (1G = 1024MB) | |
| TEST_FILE_PATH_ROOT="/testfile" | |
| TEST_FILE_PATH_HDD="/hdd/testfile" | |
| # Clear bcache stats | |
| echo "Clearing bcache stats..." | |
| echo 1 | sudo tee /sys/block/bcache0/bcache/clear_stats > /dev/null |
NewerOlder