Skip to content

Instantly share code, notes, and snippets.

View bhowe's full-sized avatar

Blake Howe bhowe

View GitHub Profile
@bhowe
bhowe / fix-wordpress-permissions.sh
Last active July 22, 2018 21:15 — forked from Adirael/fix-wordpress-permissions.sh
Fix wordpress file permissions
#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 June 14, 2018 18:29 — forked from gowtham1337/temp_mail_server.md
A quick guide for creating your own temporary mail server

##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 June 7, 2018 03:48
Common .htaccess Redirects
#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 12:27
This is a simple way to test CURL just copy to your webserver and run.
<?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 22:35
Script to check your mail poet extensions
<?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 November 14, 2017 12:01
File permissions 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 October 3, 2017 15:34
Update from Authorize coming int 2018
<?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" );
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)
@bhowe
bhowe / ai-resources.txt
Created May 21, 2017 13:06
Various AI resource I run across
http://aiplaybook.a16z.com/docs/guides/dl-architectures
https://google.ai/
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_METHOD} ^(HEAD|TRACE|DELETE|TRACK) [NC]
RewriteRule ^(.*)$ — [F,L]
RewriteCond %{QUERY_STRING} \.\.\/ [NC,OR]
RewriteCond %{QUERY_STRING} boot\.ini [NC,OR]
RewriteCond %{QUERY_STRING} tag\= [NC,OR]
RewriteCond %{QUERY_STRING} ftp\: [NC,OR]
RewriteCond %{QUERY_STRING} http\: [NC,OR]