Skip to content

Instantly share code, notes, and snippets.

View tanerdogan's full-sized avatar

Taner DOĞAN tanerdogan

View GitHub Profile
@tanerdogan
tanerdogan / web.config
Created April 20, 2016 13:18
Slim Framework IIS URL Rewrite Config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="slim" patternSyntax="Wildcard">
<match url="*" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
[Definition]
failregex = ^<HOST> -.*\"(GET|POST).*
ignoreregex = ^<HOST> -.*\"(GET|POST).*Googlebot
[nginx-req-limit]
enabled = true
port = http,https
filter = nginx-req-limit
logpath = /var/log/nginx/access_log
findtime = 120
bantime = 120
maxretry = 200
@tanerdogan
tanerdogan / jail.local
Created October 23, 2014 01:39
fail2ban nginx settings
[nginx-404]
enabled = true
port = http,https
filter = nginx-404
logpath = /var/log/nginx/access_log
maxretry = 10
findtime = 30
bantime = 7200
@tanerdogan
tanerdogan / nginx-404.conf
Created October 23, 2014 01:37
fail2ban nginx access_log 403/404 too many req ban rule
[Definition]
failregex = ^<HOST>.*"(GET|POST).*" (403|404) .*$
ignoreregex =
@tanerdogan
tanerdogan / gist:748877e68b897be04fe7
Created October 15, 2014 09:05
MySQL Turkish Slugify
DROP FUNCTION IF EXISTS slugify;
DELIMITER ;;
CREATE DEFINER='root'@'localhost'
FUNCTION slugify (temp_string VARCHAR(200) CHARSET utf8)
RETURNS VARCHAR(200)
DETERMINISTIC
BEGIN
DECLARE x, y , z Int;
DECLARE new_string VARCHAR(200);
DECLARE is_allowed Bool;
@tanerdogan
tanerdogan / Default (OSX).sublime-keymap
Created May 8, 2014 09:31
ST2 - Default (OSX).sublime-keymap
[
{ "keys": ["ctrl+t"], "command": "side_bar_new_file2" },
{ "keys": ["f2"], "command": "side_bar_rename" },
{ "keys": ["ctrl+alt+f"], "command": "side_bar_find_files_path_containing" },
{"keys": ["ctrl+super+r"], "command": "reveal_in_side_bar"},
{ "keys": ["super+v"], "command": "paste_and_indent" },
{ "keys": ["super+."], "command": "reindent" , "args": {"single_line": false}},
{ "keys": ["super+shift+v"], "command": "paste" },
{ "keys": ["ctrl+u"], "command": "ftp_sync_current" }
]
@tanerdogan
tanerdogan / Preferences.sublime-settings
Created May 8, 2014 09:29
ST2 - Preferences.sublime-settings
{
"color_scheme": "Packages/Color Scheme - Default/Twilight.tmTheme",
"detect_slow_plugins": true,
"font_face": "Consolas",
"font_size": 11,
"ignored_packages":
[
"Vintage"
],
"soda_folder_icons": false,
@tanerdogan
tanerdogan / airports.sql
Created April 8, 2014 09:00
airports.sql - airport list (total 8800 airport)
This file has been truncated, but you can view the full file.
DROP TABLE IF EXISTS `airports`;
CREATE TABLE IF NOT EXISTS `airports` (
`code` varchar(50) COLLATE utf8_turkish_ci DEFAULT NULL,
`name` varchar(200) COLLATE utf8_turkish_ci DEFAULT NULL,
`cityCode` varchar(50) COLLATE utf8_turkish_ci DEFAULT NULL,
`cityName` varchar(200) COLLATE utf8_turkish_ci DEFAULT NULL,
`countryName` varchar(200) COLLATE utf8_turkish_ci DEFAULT NULL,
`countryCode` varchar(200) COLLATE utf8_turkish_ci DEFAULT NULL,
`timezone` varchar(8) COLLATE utf8_turkish_ci DEFAULT NULL,