Skip to content

Instantly share code, notes, and snippets.

View akamajoris's full-sized avatar
💭
Life

Canis Majoris akamajoris

💭
Life
View GitHub Profile
@ezimuel
ezimuel / gist:9135151
Created February 21, 2014 14:24
Tesing SimpleXML and DOMDocument to prevent XXE attacks on XML
<?php
// The libxml entity loader is disabled by default
// even setting the libxml_disable_entity_loader to false doesn't works!
//
// @see http://uk3.php.net/manual/en/function.libxml-disable-entity-loader.php
// @see http://stackoverflow.com/a/10213239
$dir = __DIR__;
$content = 'This is a remote content!';
file_put_contents('content.txt', $content);
@fridolin-koch
fridolin-koch / app.php
Created October 22, 2013 13:35
PHP AWS SDK - S3 StreamWrapper with ACL and ContentType
<?php
//autoloader
require_once __DIR__ . '/vendor/autoload.php';
use Aws\S3\S3Client;
use Aws\S3\Enum\CannedAcl;
//init client
$s3Client = S3Client::factory(array(
'key' => '<key>',
'secret' => '<secret>',
# coding=utf-8
"""
LICENSE http://www.apache.org/licenses/LICENSE-2.0
"""
import datetime
import sys
import time
import threading
import traceback
import SocketServer
@saetia
saetia / parse.rb
Last active June 26, 2017 16:59
Parse MySQL dumps
ruby -e "$(curl -fsSkL https://gist.githubusercontent.com/saetia/2369908/raw/4bf9a6d36060582e69f02c314f66449971a7bb11/parse.rb)" /Users/Joel/site.db.121010.dump
ruby parse.rb site.120411.dump
@junaidpv
junaidpv / threadpool.py
Created August 7, 2011 14:20
A simple thread pool library for python programs.
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
A simple thread pool.
@author: Junaid P V
@license: GPLv3
"""