Skip to content

Instantly share code, notes, and snippets.

Blake Howe bhowe

Block or report user

Report or block bhowe

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bhowe
bhowe / git_big_files.sh
Created Mar 2, 2019
Super handy script for finding large files.
View git_big_files.sh
#!/bin/bash
#set -x
# Shows you the largest objects in your repo's pack file.
# Written for osx.
# run sh git_big_files.sh
# @author Antony Stubbs
# set the internal field spereator to line break, so that we can iterate easily over the verify-pack output
IFS=$'\n';
View gist:e2e3367f0836b2ff1e8e278244752eaf
Regex Character Explanation
# Forces the server to ignore the text following the # on the same line. Typically used for comments
[F] Indicates Forbidden, with this the server should return a 403 forbidden error to the client
[L] The Last rule forces the server to stop processing rules in the .htaccess file
[N] Indicates Next and forces Apache to redo the rewrite process, except using the currently rewritten URL instead of the initial URL
[G] Gone tells the server to deliever the gone status message, which is used to mark pages that no longer exist on the site.
[R] This forces Apache to initialize a redirect, this can be a permanent redirect (page has moved, 301), or a temporary redirect (302).
[P] Indicates Proxy which tells the server to use mod_proxy to handle requests
[C] Tells the server to chain a rule with the next rule. If the rule matches for example, then the chained rules will run as well, if not, then they will not run.
[QSA] Tells the server to use the query string at the end of an expression
@bhowe
bhowe / fix-wordpress-permissions.sh
Last active Jul 22, 2018 — forked from Adirael/fix-wordpress-permissions.sh
Fix wordpress file permissions
View fix-wordpress-permissions.sh
#this is real cute but you can also just ssh to the public HTML paste this
#root@theweb [/home2/whatever/public_html]# find . -type d -exec chmod 755 {} \;
#root@wtheeb [/home2/whatever/public_html]# find . -type f -exec chmod 644 {} \;
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
@bhowe
bhowe / temp_mail_server.md
Created Jun 14, 2018 — forked from gowtham1337/temp_mail_server.md
A quick guide for creating your own temporary mail server
View temp_mail_server.md

##Overview You might have a need for a temporary mail service like mailinator.com on your own machine. This guide provides the minimum required steps to do that. The setup we will use is as follows

Procmail (Receive mail and forward to script)--->PHP Script(Parse Mail and put in Database)--->MySQL(Store the mails)--->JSON

Note: This is intended as a quick DIY for simple projects. Hence, we will not go into more details like spam detection and memory optimization.

##Instructions ####Setup Infrastructure

  1. Get a Top level domain name (Note: Getting this to work with a sub-domain will require more work and setup)
@bhowe
bhowe / .htaccess
Last active Jun 7, 2018 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
View .htaccess
#301 Redirects for .htaccess
#when troubleshooting remember htaccess is read from top to bottom with the top directives being run first.
#If there is a re-direct there, then it may be interfering with what you have added through the cPanel.
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
@bhowe
bhowe / curl-test.php
Last active May 26, 2018
This is a simple way to test CURL just copy to your webserver and run.
View curl-test.php
<?php
//Filename: curl_test.php
$ch = curl_init();
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
@bhowe
bhowe / mail-poet-requirements check.php
Created May 12, 2018
Script to check your mail poet extensions
View mail-poet-requirements check.php
<?php
#requirements for mail poet. The top three are the most common.
#https://beta.docs.mailpoet.com/article/152-minimum-requirements-for-mailpoet-3#php_extension
#https://stackoverflow.com/questions/3131411/php-code-to-test-pdo-is-available
echo 'mail poet extension check' . "<br><br>";
echo "GD: ", extension_loaded('gd') ? 'OK' : 'MISSING', '<br>';
echo "XML: ", extension_loaded('xml') ? 'OK' : 'MISSING', '<br>';
echo "zip: ", extension_loaded('zip') ? 'OK' : 'MISSING', '<br><br>';
@bhowe
bhowe / filepermissions fix for wp
Created Nov 14, 2017
File permissions fix for wp
View filepermissions fix for wp
From the root of your wp site
find . -type f | xargs chmod 444
find . -type d | xargs chmod 555
For normal permissions
From the root of your wp site
@bhowe
bhowe / Test tls 1.2 for authorize
Created Oct 3, 2017
Update from Authorize coming int 2018
View Test tls 1.2 for authorize
<?php
/*
The 'S' in "HTTPS" is the TLS protocol. When folks refer to the "TLS" they are referring to the most common of
modern protocols of encrypting data across the internet.
*/
// check the tls version
$ch = curl_init( "https://smartzweb.com" );
View php.ini locations
UNBUNTU
/etc/php/5.6/cli/php.ini is for the CLI PHP program, which you found by running php on the terminal.
/etc/php/5.6/cgi/php.ini is for the php-cgi system which isn't specifically used in this setup.
/etc/php/5.6/apache2/php.ini is for the PHP plugin used by Apache. This is the one you need to edit for changes to be applied for your Apache setup.
/etc/php/5.6/fpm/php.ini is for the php5-fpm processor, which is a fastcgi-compatible 'wrapper' for PHP processing (such as to hand off from NGINX to php5-fpm) and runs as a standalone process on the system (unlike the Apache PHP plugin)
You can’t perform that action at this time.