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
<?php | |
add_action( 'init', function () { | |
// Exceptions (do not redirect these URIs) | |
$exceptions = array( | |
'/exception1', | |
'/exception2', | |
); | |
// Redirects to special URIs | |
$special_redirects = array( |
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/sh | |
file=$1 | |
if [ -z "$file" ]; then | |
echo "USAGE: extract_mkv_track.sh <filename>" | |
exit 1; | |
fi | |
extension="${file##*.}" |
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 | |
if ! command -v svgo &> /dev/null; then | |
echo "SVGO is not installed. Install it by running 'npm install -g svgo'" | |
exit 1 | |
fi | |
for file in "$@"; do | |
if [ -f "$file" ]; then | |
extension="${file##*.}" |
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/sh | |
cd images_processed | |
# Convert png to jpg | |
mogrify -format jpg -quality 90 *.png | |
rm -f *.png | |
# Resize images | |
for PHOTO in * |
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
<h1>This is the H1 Heading</h1> | |
<p>Above this paragraph should be the H1 heading for your web page. If it is not visible, the design settings for the H1 tag is set to <code>display:none</code> which many WordPress Themes use to hide the blog title text and replace it with a graphic. Do not use H1 within your blog post area.</p> | |
<p>If the design in the H1 heading looks like your blog title or blog post title, then that is the style set for that HTML tag and you should not use it within your blog post area.</p> | |
<p>Inside of this test data section are most of the basic HTML and XHTML and CSS styles that you might use within your WordPress Theme. You need to know what that will look like as part of structuring your styles.</p> | |
<h2>This is the H2 Heading</h2> | |
<p>Above this paragraph should be the H2 heading for your web page. WordPress Themes use the h2 heading for various purposes. Logically, it should be either the post title or the first heading in the post content.</p> | |
<p>However, it is used all over WordPres |
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
// Check banned IP | |
sudo zgrep '<IP>' /var/log/fail2ban.log* | |
// Unban IP | |
sudo fail2ban-client set <jail_name> unbanip <IP> |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
<script type="text/javascript"> | |
ga('send', 'event', 'error_404', '<?php echo $_SERVER['REQUEST_URI']; ?>', '<?php echo ($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : 'direct'; ?>'); | |
</script> |
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 | |
# Config | |
day=$(date +%Y-%m-%d) | |
filename=/var/cache/logwatch/$day-logwatch.txt | |
token=<YOUR BOT TOKEN> | |
chat_id=<YOUR CHAT_ID> | |
#Check if removed-but-not-purged | |
test -x /usr/share/logwatch/scripts/logwatch.pl || exit 0 |
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
RewriteEngine On | |
RewriteCond %{HTTPS} off | |
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.*)$ [NC] | |
RewriteRule (.*) https://%1%{REQUEST_URI} [L,R=301] |
NewerOlder