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 | |
# Just comment this out to run the script within the target directory. | |
cd /mnt/example || exit 1 | |
for f in *; do | |
lower="$(echo "$f" | tr '[:upper:]' '[:lower:]')" | |
if [[ "$f" != "$lower" ]]; then | |
if [[ -e "$lower" ]]; then |
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 | |
# update `/search/path/dir`, `/old/link/path`, and `/new/link/path` | |
find /search/path/dir -type l | while read link; do | |
target=$(readlink "$link") | |
if [[ "$target" == "/old/link/path"* ]]; then | |
suffix="${target#/old/link/path}" | |
newtarget="/new/link/path$suffix" | |
echo "Updating: $link -> $newtarget" | |
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 -euo pipefail | |
IFS=$'\n\t' | |
# Path to the data disk | |
DATA_DISK="/mnt/data" | |
WHEELHOUSE_PATH="$DATA_DISK/wheelhouse" | |
PIP_CONF_PATH="$DATA_DISK/pip/pip.conf" | |
mountpoint -q "$DATA_DISK" || { echo "Error: $DATA_DISK not mounted"; exit 1; } |
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
////////////////////////////////////////////////////////////////////////////// | |
// Stellarium Script: Mercury Twilight Search | |
// Date Range: Feb 10, 2025 – Apr 30, 2025 | |
// Time Step: 5 minutes | |
// Location: Miami (lat: 25.7617, lon: -80.1918), ignoring DST complexities. | |
////////////////////////////////////////////////////////////////////////////// | |
// ------------------------ USER CONFIGURATION ------------------------ | |
// Observing location |
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
/* SOURCE: https://gregbenzphotography.com/photoshop/photoshop-now-natively-supports-avif-for-50-smaller-files-than-jpg/ | |
REVISED with corrections and error handling. | |
*/ | |
function replaceAvifImagesWithPicture() { | |
const logToConsole = true; | |
if (logToConsole) console.log("replaceAvifImagesWithPicture()"); | |
// Select all <img> elements with a .avif source that haven't been processed yet. | |
// We check that its parent is NOT a <picture> element. |
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
data = ["1.2.3.4", "1.1.1.1"] | |
data.sort(key=lambda ip: [int(part) for part in ip.split('.')]) |
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 | |
# The directory containing your git repositories, passed as the first argument. | |
PARENT_DIR="$1" | |
# Check if a directory was provided. | |
if [ -z "$PARENT_DIR" ]; then | |
echo "❌ Error: No directory supplied." | |
echo "Usage: $0 <path/to/your/repos>" | |
exit 1 |
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 | |
# The directory containing your git repositories, passed as the first argument. | |
PARENT_DIR="$1" | |
# Check if a directory was provided. | |
if [ -z "$PARENT_DIR" ]; then | |
echo "❌ Error: No directory supplied." | |
echo "Usage: $0 <path/to/your/repos>" | |
exit 1 |
OlderNewer