Skip to content

Instantly share code, notes, and snippets.

View mitsh's full-sized avatar
💭
Life is too short - Write Fast Code!

Mustafa Özgür mitsh

💭
Life is too short - Write Fast Code!
View GitHub Profile
@mitsh
mitsh / iptables-rate-limit.sh
Created November 3, 2018 19:25
iptables for syn/dos attacks
#!/usr/bin/env bash
# @authors Rodrigo Gomes link: https://serverfault.com/questions/766901/how-temporarily-block-an-ip-address-making-too-many-hits-on-the-server-with-ipta
iptables -N BLOCK_IP
iptables -N SYN_CHECK
iptables -N DOS_CHECK
iptables -N SYN_ATTACK
iptables -N DOS_ATTACK
# first checks if the IP is already blocked
@mitsh
mitsh / docker.zsh
Created April 18, 2020 17:51
Docker completion for Zsh + prezto
curl -fLo ~/.zprezto/modules/completion/external/src/_docker https://raw.githubusercontent.com/docker/cli/master/contrib/completion/zsh/_docker
compinit
@mitsh
mitsh / icloud-duplicate-remover.php
Last active December 31, 2020 10:07
I wrote this script for iCloud sync problem. all my documents and desktop folders are duplicated because of the problem. This script uses '* 2.*' pattern to find and check the original file if they are same it will delete if you add 'delete' and of the command. copy this file under /usr/local/bin/.
#!/usr/bin/env php
<?php
clearstatcache();
$delete = !empty($argv[1]) && $argv[1] === 'delete';
/**
* @param string $folder
* @param string|null $pattern