Skip to content

Instantly share code, notes, and snippets.

Avatar

Taner DOĞAN tanerdogan

View GitHub Profile
@tanerdogan
tanerdogan / web.config
Created Apr 20, 2016
Slim Framework IIS URL Rewrite Config
View web.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" />
View nginx-req-limit.conf
[Definition]
failregex = ^<HOST> -.*\"(GET|POST).*
ignoreregex = ^<HOST> -.*\"(GET|POST).*Googlebot
View nginx-req-limit
[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 Oct 23, 2014
fail2ban nginx settings
View jail.local
[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 Oct 23, 2014
fail2ban nginx access_log 403/404 too many req ban rule
View nginx-404.conf
[Definition]
failregex = ^<HOST>.*"(GET|POST).*" (403|404) .*$
ignoreregex =
View gist:748877e68b897be04fe7
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
ST2 - Default (OSX).sublime-keymap
View 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
ST2 - Preferences.sublime-settings
View 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 Apr 8, 2014
airports.sql - airport list (total 8800 airport)
View airports.sql
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,