Skip to content

Instantly share code, notes, and snippets.

View chrisdavidmiles's full-sized avatar
💙

Chris David Miles chrisdavidmiles

💙
View GitHub Profile
@chrisdavidmiles
chrisdavidmiles / bulk_dig.sh
Last active September 9, 2024 16:48
Bulk DNS Lookup bash script
#!/bin/bash
# Bulk DNS Lookup
# Generates a CSV of DNS lookups from a list of domains.
#
# File name/path of domain list:
domain_list='domains.txt' # One FQDN per line in file.
#
# IP address of the nameserver used for lookups:
ns_ip='1.1.1.1' # Is using Cloudflare's 1.1.1.1.
#
@chrisdavidmiles
chrisdavidmiles / cdm-remove-admin-email-verification.php
Last active June 23, 2023 18:46
WordPress Plugin: Remove Admin Email Verification
<?php
/**
* Plugin Name: Remove Admin Email Verification
* Plugin URI: https://gist.github.com/chrisdavidmiles/94f58cc60fdb34d06a13f946f8ffd155
* Description: Removes the step in /wp-login.php that occasionally asks to confirm if the email on file for a site is still correct.
* Version: 1.0
* Requires at least: 5.3
*/
@chrisdavidmiles
chrisdavidmiles / wp-login.php.html
Created May 14, 2023 01:55
Rick roll wp-login.php page
<!--------------------------------------------------------+
|⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀|
|⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣶⣿⣿⣿⣿⣿⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀|
|⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣿⣿⣿⠿⠟⠛⠻⣿⠆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀|
|⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣆⣀⣀⠀⣿⠂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀|
|⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⠻⣿⣿⣿⠅⠛⠋⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀|
|⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⢼⣿⣿⣿⣃⠠⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀|
|⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣟⡿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀|
|⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣛⣛⣫⡄⠀⢸⣦⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀|
|⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣴⣾⡆⠸⣿⣿⣿⡷⠂⠨⣿⣿⣿⣿⣶⣦⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀|
@chrisdavidmiles
chrisdavidmiles / url-shorteners.txt
Last active April 22, 2023 06:03
URL shorteners and redirect sites
onelink.me/
app.link/
preview-domain.com/
//1click.im/
//1dl.us/
//1o2.ir/
//2tag.nl/
//7.ly/
//9en.us/
//ad7.biz/
@chrisdavidmiles
chrisdavidmiles / audiobook-commands.md
Last active December 25, 2022 23:38
Common Audiobook Plex Prep

Combine lots of mp3s into one file. They will be combined in alphabetical order so prepare the filenames ahead of time with leading zeros if needed (e.g. whatever-01.mp3 whatever-02.mp3 ... etc)

mp3wrap combined.mp3 origs/*


Strip out all the media track id3 tags from a file (useful after combining with mp3wrap)

id3convert -s file.mp3


@chrisdavidmiles
chrisdavidmiles / .htaccess
Created September 4, 2022 06:08
Block Crawlers and Other Bots .htaccess
# START Block Crawlers
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^APIs-Google [OR]
RewriteCond %{HTTP_USER_AGENT} ^AdsBot-Google [OR]
RewriteCond %{HTTP_USER_AGENT} ^AdsBot-Google-Mobile [OR]
RewriteCond %{HTTP_USER_AGENT} ^AdsBot-Google-Mobile-Apps [OR]
RewriteCond %{HTTP_USER_AGENT} ^BlackWidow [OR]
RewriteCond %{HTTP_USER_AGENT} ^Bot\ mailto:craftbot@yahoo.com [OR]
RewriteCond %{HTTP_USER_AGENT} ^ChinaClaw [OR]
RewriteCond %{HTTP_USER_AGENT} ^Custo [OR]
@chrisdavidmiles
chrisdavidmiles / cdm-remove-unwanted-image-sizes.php
Last active August 30, 2022 06:50 — forked from gmmedia/functions.php
WordPress Plugin: Remove Unwanted Image Sizes
<?php
/**
* Plugin Name: Remove Unwanted Default Image Sizes
* Plugin URI: https://gist.github.com/chrisdavidmiles/6fd21201d16f8a7e434b06b903d4706c
* Description: This removes three default image sizes that I don't want: medium_large, 1536x1536, and 2048x2048.
* Author: Jochen Gererstorfer
* Author URI: https://bloggerpilot.com/en/disable-wordpress-image-sizes/
* Version: 0.3
*/
@chrisdavidmiles
chrisdavidmiles / cdm-disable-emojis.php
Created August 25, 2022 14:14
WordPress Plugin: Disable Emojis
<?php
/**
* Plugin Name: Disable Emojis
* Plugin URI: https://gist.github.com/chrisdavidmiles/7727d3c4b8b8967f87e6ff0338b8297c
* Description: Disable the automatic emoji replacement in post content and prevent the use of the s.w.org emoji cdn on the site.
* Author: Chris David Miles
* Version: 0.1
*/
@chrisdavidmiles
chrisdavidmiles / auto-rename-uploads-to-match-post-slug.php
Last active August 25, 2022 01:41 — forked from filipecsweb/functions.php
WordPress Plugin: Auto Rename Uploads to Match Post Slug
<?php
/**
* Plugin Name: Auto Rename Uploads to Match Post Slug
* Plugin URI: https://gist.github.com/chrisdavidmiles/770ffbfe428b440fd007bcb6b08e94d7
* Description: Uploads will be automatically renamed to match the post slug
* Author: Chris David Miles
* Version: 0.1
*/
function auto_rename_uploads_to_post_slug( $filename ) {
@chrisdavidmiles
chrisdavidmiles / cdm-require-auth.php
Last active August 24, 2022 02:20
WordPress Plugin: Require Auth
<?php
/**
* Plugin Name: Require Auth
* Plugin URI: https://gist.github.com/chrisdavidmiles/01ad21767394d6b3770197667c32526a
* Description: Users must be logged in to WordPress to see site content. If a user is not authenticated, they will be redirected to the login screen.
* Author: Chris David Miles
* Version: 0.1
*/
if ( ! defined( 'ABSPATH' ) ) die;