Monthly Archives: มิถุนายน 2015

thai slug url friendly

public static function slugify($text) { // replace non letter or digits by – $text = preg_replace(’~[^\\pL\d้ำัไใาะี๊ๆฯ็้๋่ิ์ุูึๅ]+~u’, ‘-’, $text); // trim $text = trim($text, ‘-’); // transliterate $text = iconv(’utf-8′, ‘utf-8′, $text); // lowercase $text = strtolower($text); // remove unwanted characters … Continue reading

Posted in php | Leave a comment

fail2ban block request

fail2ban https://www.digitalocean.com/…/how-to-protect-ssh-with-fail… Add a block-all-dem-noobs.conf file to your filter.d directory, something like this failregex = <HOST> – – .* “GET * ignoreregex = Translation: a RegExp to find GET requests in access_log Then create a new entry in your jail.conf, … Continue reading

Posted in knowledge | Leave a comment