This file contains 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
echo $(($(cat /sys/class/pwm/pwmchip0/pwm0/duty_cycle) / 5000))% |
This file contains 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 | |
##################### | |
# Buggy, but good enough. | |
# Walks over users' Plesk-managed wp-cron entries, to change this: | |
# <whatever> * * * * /opt/plesk/php/8.2/bin/php -f 'httpdocs/wp-cron.php' | |
# ...into something like this: | |
# 7,23,39,55 /opt/plesk/php/8.2/bin/php -f 'httpdocs/wp-cron.php' | |
# so that wp-cron runs are spread out as much as possible, | |
# to reduce simultaneous memory usage. | |
##################### |
This file contains 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
# Usage: wprockettest https://example.com/some-path/ | |
wprockettest() { | |
URL="$1" | |
echo -n "$URL --> " | |
RES="$(curl -ksvG "$URL" 2>&1)" | |
CODE="$(echo "$RES" | grep -E '^< HTTP' | awk '{print $3}')" | |
CACHE_STATUS="Not cached" | |
This file contains 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 | |
##################### | |
# toggle-screen-dimmer.sh - X screen dimmer toggler | |
# Uses xrandr to toggle between dimming/brightening connected displays | |
# See --help for usage | |
# Recommended: create a launcher for this script on the task bar! | |
##################### | |
list_displays() { | |
xrandr --verbose --current | awk '/ connected/ {print $1}' |
This file contains 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 | |
####################### | |
# btheadset_toggle.sh | |
# | |
# Toggles bluetooth headset mode between | |
# A2DP (high quality, no microphone) | |
# and headset (low quality + microphone). | |
# | |
# Usage: ./btheadset_toggle.sh | |
# |
This file contains 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 | |
################################################# | |
# For each site in InfiniteWP, | |
# removes all but the latest history records. | |
# | |
# This speeds up InfiniteWP and | |
# reduces the size of its tables, | |
# particularly iwp_history_raw_details. | |
# | |
# Indended to be run as a daily cronjob. |
This file contains 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
/* | |
* Disclaimer: this was slung together as the result of some trial and error and can definitely be improved. | |
* | |
* Pass environment variable DEBUG=1 for lots of debug logging. | |
* | |
* Usage example: | |
* | |
* const rateLimits: RateLimitDef[] = [ | |
* { | |
* urlRegex: 'carriages/[^/]+/horses', |
This file contains 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 | |
############################################################ | |
# For every domain on a Plesk server: | |
# | |
# - Sets a desired PHP auto_prepend_file | |
# - Patches open_basedir (if necessary) | |
# - Strips any Wordfence WAF open_basedir override (make sure your custom prepend file re-includes it!) | |
# | |
# Only tested on RedHat-like servers with Plesk Obsidian 18.0.52 | |
# Use at your own risk |
This file contains 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 | |
# Quit on error | |
set -e | |
# Functions | |
msg() { | |
echo -e "\x1B[1m$1\x1B[0m" | |
} |
This file contains 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 | |
################################################################# | |
# mkem3u.sh - Extended m3u generator | |
# Usage: | |
# ./mkm3u.sh | |
# Setup: | |
# 1. Install dependencies: | |
# mp3info - http://ibiblio.org/mp3info/ | |
# id3tool - http://nekohako.xware.cx/id3tool/ | |
# 2. Supply INPATHS. Paths which are relative to |
NewerOlder