Skip to content

Instantly share code, notes, and snippets.

View hevertonfreitas's full-sized avatar

Heverton Coneglian de Freitas hevertonfreitas

View GitHub Profile
@hevertonfreitas
hevertonfreitas / psql_naturalsort
Created August 23, 2017 13:02 — forked from veob/psql_naturalsort
PostgreSQL natural sort
//sql
create or replace function naturalsort(text)
returns bytea language sql immutable strict as
$f$ select string_agg(convert_to(coalesce(r[2],length(length(r[1])::text) || length(r[1])::text || r[1]),'SQL_ASCII'),'\x00')
from regexp_matches($1, '0*([0-9]+)|([^0-9]+)', 'g') r; $f$;
//author: github.com/RhodiumToad
@hevertonfreitas
hevertonfreitas / slowloris.php
Last active February 14, 2017 12:49 — forked from Macuyiko/slowloris.php
PHP based slowloris attack with slow headers or post variants. Adapted from script here: <http://seclists.org/fulldisclosure/2009/Jun/207>
#! /usr/bin/env php
<?php
/* PHP Slowloris
* Adapted from the script found here: http://seclists.org/fulldisclosure/2009/Jun/207
* Contains get based attack (slow headers) and post based attack (long content length)
*
* Author: Seppe vanden Broucke
*/
function usage($argv)
@hevertonfreitas
hevertonfreitas / autopgsqlbackup
Created September 15, 2016 12:17 — forked from matthewlehner/autopgsqlbackup
Auto PostgreSQL backup script.
#!/bin/bash
#
# PostgreSQL Backup Script Ver 1.0
# http://autopgsqlbackup.frozenpc.net
# Copyright (c) 2005 Aaron Axelsen <[email protected]>
#
# This script is based of the AutoMySQLBackup Script Ver 2.2
# It can be found at http://sourceforge.net/projects/automysqlbackup/
#
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9