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
| Random shell scripts |
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 | |
| # tested with traefik v2.4.8 | |
| ACME_FILE="acme.json" | |
| # get jq from https://stedolan.github.io/jq/ | |
| SELECTED_DOMAINS=$(jq -r '.letsencrypt.Certificates[].domain.main' "$ACME_FILE" | fzf -m --height '40%' --reverse --border) | |
| if [[ -z "$SELECTED_DOMAINS" ]]; 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 | |
| # Author: @DrJume | |
| # This script lets you backup all mounted volumes of a Docker container | |
| # into a .tar.xz archive. | |
| # Throw on nonzero exit in pipelines | |
| set -e |
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
| // Avoid loading unused assets, both JS and CSS | |
| // Removes both CSS and JS | |
| // For Full Site Editing Theme! | |
| // In a better world block's author makes sure the block's assests are loaded only if block is actually in use (via enqueue_block_assets). For other cases we can do it ourselves | |
| // In this example I load Swiper's block assets only where the block is used | |
| // TODO: Works for content on Singular content only. if block is elsewhere or it's archive use this https://wordpress.stackexchange.com/questions/392493/find-if-widget-block-is-active | |
| add_filter( 'style_loader_tag', 'sz_stop_loading_unused_block_crap', 9999, 3 ); | |
| add_filter( 'script_loader_tag', 'sz_stop_loading_unused_block_crap', 10, 3 ); | |
| function sz_stop_loading_unused_block_crap( $tag, $handle, $src ) { |
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 | |
| # Copyright © 2015 Bjørn Johansen | |
| # This work is free. You can redistribute it and/or modify it under the | |
| # terms of the Do What The Fuck You Want To Public License, Version 2, | |
| # as published by Sam Hocevar. See http://www.wtfpl.net/ for more details. | |
| WP_PATH="/path/to/wp" | |
| # Check if WP-CLI is available | |
| if ! hash wp 2>/dev/null; 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 | |
| #Reads the date parameter. empty then date is today | |
| if [ -z "$1" ] | |
| then | |
| date=$(date +"%Y-%m-%d") | |
| else | |
| date=$1 | |
| 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
| #!/bin/bash | |
| ### | |
| # Backup Script | |
| ### | |
| # Toggle debug mode for CLI output - "YES" or "NO" | |
| DEBUG="YES" | |
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/sh | |
| # Download a list of exit-nodes | |
| wget -qO- https://check.torproject.org/torbulkexitlist | sort | awk '{print "" $1 " 1;"}' > /tmp/tor_exit_list.txt | |
| # Prepare a geoip config | |
| echo -e "geo \$isTor {\ndefault 0; \n$(cat /tmp/tor_exit_list.txt) \n}" > /etc/nginx/conf.d/deny-geoip-tor.conf | |
| ## Add to virtual host | |
| # location / { | |
| # if ($isTor) { | |
| # return 403; |