Skip to content

Instantly share code, notes, and snippets.

View josephfusco's full-sized avatar
:octocat:
Building the web

Joe Fusco josephfusco

:octocat:
Building the web
View GitHub Profile
@pistell
pistell / XMLRPC_Hack_Attempts
Created April 7, 2016 12:39
Finds IPs accessing xmlrpc.php from Apache logs and sorts them by connection attempts
grep -i "xmlrpc\.php" other_vhosts_access.log.1 | awk '{print $2 " " $8}' | sort | uniq -c | sort -n | tail > hack_attempts.txt
1. cd into your apache logs directory (ex- /var/log/apache2)
2. Run the grep command
This will search the file "other_vhosts_access_log.1" for the string "xmlrpc.php
Awk will then print out column 2 (the incoming connection) and column 8 (the file accessed)
Sorts by unique IPs then numbers them by attempts
Data is output to hack_attempts.txt for analysis
Example output::
@oneblackcrayon
oneblackcrayon / mc-jumpstart.html
Created April 11, 2012 03:33
Mailchimp Variable Content Jumpstart Code
<!-- use this code to jumpstart your variable content block supported email template for Mailchimp -->
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" mc:repeatable="first-repeater" mc:variant="one">
<tr>
<td>
<!-- HTML code goes here -->
@KittyGiraudel
KittyGiraudel / SassMeister-input.scss
Last active November 22, 2016 11:19
Generated by SassMeister.com.
// ----
// Sass (v3.4.9)
// Compass (v1.0.1)
// ----
@function is-number($value) {
@return type-of($value) == 'number';
}
@function is-time($value) {
@sbine
sbine / Main.sublime-menu
Created November 14, 2012 17:54
Custom 3-pane Sublime Text window layouts
[{
"id": "view",
"children": [{
"id": "layout",
"children": [
{
"command": "set_layout",
"caption" : "Custom: 3 Pane (2T 1B)",
"mnemonic": "C",
"args": {
@jcallery
jcallery / acf-field-names.php
Created March 1, 2016 17:34
Display ACF field names
/**
* Display ACF field names for development
*/
function action_function_name( $field ) {
echo $field['_name'];
}
add_action( 'acf/render_field', 'action_function_name', 10, 1 );
@ibreakthecloud
ibreakthecloud / github-OAuth.php
Last active December 16, 2019 14:51
Complete PHP 7 code for Implementing OAuth via Github
<?php
session_start();
$code = $_GET['code'];
$url = 'https://github.com/login/oauth/access_token';
$client_id = 'xxxxxxxxxxxxxxxxxxxxxxx';
$client_secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
// echo $code;
$postdata = http_build_query(
@wycks
wycks / image_optimize-wordpress.php
Last active December 16, 2020 01:48
Remove WordPress full size images from being inserted into a post + option to and add max size to to prevent users from inserting massive images.
<?php
/**
*
* This removes the ability to add the FULL image size into a post, it does not alter or delete the image
* Add whataever extra image sizes to the insert dropdown in WordPress you create via add_image_size
*
* For now we have to do it this way to make the labels translatable, see trac ref below.
*
* If your theme has $content_width GLOBAL make sure and remove it
@benatkin
benatkin / Global.sublime-settings
Created July 20, 2011 04:26
excluding node_modules from Sublime Text 2
// Place user-specific overrides in this file, to ensure they're preserved
// when upgrading
{
"folder_exclude_patterns": [".svn", ".git", ".hg", "CVS", "node_modules"]
}
<?php
/**
* Plugin Name: YOUR PLUGIN NAME
*/
include( dirname( __FILE__ ) . '/lib/requirements-check.php' );
$your_plugin_requirements_check = new YOUR_PREFIX_Requirements_Check( array(
'title' => 'YOUR PLUGIN NAME',
'php' => '5.4',
@wpscholar
wpscholar / functions.php
Last active March 1, 2021 13:26
Enqueueing IE conditional stylesheets in WordPress the right way
<?php
add_action( 'wp_enqueue_scripts', 'enqueue_my_styles' );
/**
* Example callback function that demonstrates how to properly enqueue conditional stylesheets in WordPress for IE.
* IE10 and up does not support conditional comments in standards mode.
*
* @uses wp_style_add_data() WordPress function to add the conditional data.
* @link https://developer.wordpress.org/reference/functions/wp_style_add_data/