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
/******************************************************************************* | |
* Description: | |
* | |
* Gulp file to push changes to remote servers (eg: staging/production) | |
* | |
* Usage: | |
* | |
* gulp deploy --target | |
* | |
* Examples: |
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 | |
$mime_types = array( | |
'.3dm' => 'x-world/x-3dmf', | |
'.3dmf' => 'x-world/x-3dmf', | |
'.a' => 'application/octet-stream', | |
'.aab' => 'application/x-authorware-bin', | |
'.aam' => 'application/x-authorware-map', | |
'.aas' => 'application/x-authorware-seg', | |
'.abc' => 'text/vnd.abc', | |
'.acgi' => 'text/html', |
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
// Report ALL errors, and show them to the user | |
error_reporting(E_ALL); | |
ini_set('display_errors', 1); | |
// Log errors to log file, and do NOT show them to the user | |
ini_set('log_errors', 1); | |
ini_set('display_errors', 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
//-------------------------------------------------------------------------- | |
// See if a url contains http:// or https:// | |
//-------------------------------------------------------------------------- | |
if( !preg_match('/http(s?)\:\/\//i', $url) ) { | |
// URL does NOT contain http:// or https:// | |
} |
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
1. From the AWS EC2 Console go to "Key Pairs" and generate a new key pair (eg: NewKey.pem); Download the generated pem key, and chmod it to 0666 | |
2. Use the new pem key to generate a public key | |
$ ssh-keygen -y | |
When prompted, enter the path to NewKey.pem. This will generate NewKey.pub | |
Tip: Edit NewKey.pub and append the key's name so you can identify it easier in the next steps. | |
Just append a single space, then a tag/name for the key |
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
div#page-menu { | |
float: left; | |
width: 250px; | |
margin: 0; | |
} | |
div#page-menu ul { | |
border: 2px solid #ccc; | |
border-top: none; | |
padding: 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
1. Assign a secondary private ip to the instance | |
- Select the instance, then choose Actions > Mange Private IP Addresses | |
- In the Manage Private IP Addresses dialog box, Click "Assign new IP" | |
- Enter a specific IP address that's within the subnet range for the instance (or just leave the field blank to have it choose one for you) | |
- (Optional) Select Allow reassignment to allow the secondary private IP address to be reassigned if it is already assigned to another network interface. | |
- Click Yes, Update, and then click Close. | |
2. Add the new IP to the instance's network interface. | |
- SSH into the instance | |
- $ sudo ip addr add new.ip.address.here/20 dev eth0 |
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 | |
//--------------------------------------------------------------------------------- | |
// You can get the metadata for an AWS instance by loading the following URL | |
// Note: This URL must be loaded from an AWS instance | |
// | |
//--------------------------------------------------------------------------------- | |
// URL: | |
// http://169.254.169.254/latest/meta-data/instance-id | |
// | |
//--------------------------------------------------------------------------------- |
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/sh | |
################################################################################ | |
# Bash script to add a new domain (Apache2) | |
# (c) 2014 Mike Everhart | PlasticBrain Media LLC | |
# | |
# Prerequisites: | |
# Create a vhosts "template" in $APACHEDIR/sites-available. The template should | |
# include placeholders ($TOKEN) that will be replaced with the new domain name. | |
# See https://gist.github.com/plasticbrain/9620846 for an example template | |
# |
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
wget \ | |
-e robots=off \ | |
--referer="http://www.google.com" \ | |
--user-agent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6" \ | |
--recursive \ | |
--no-clobber \ | |
--page-requisites \ | |
--convert-links \ | |
--domains website.com \ | |
website.com/ |
NewerOlder