This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
############################################################################## | |
# DDoS Mitigation Script: ban, unban and list IP to CF via API # | |
# # | |
############################################################################## | |
#TODO:: set ddosP in system path | |
load_conf() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##### Paths of the script and other files | |
PROGDIR="/usr/local/ddos" | |
PROG="/usr/local/ddos/ddos.sh" | |
BLOCK_IP_LIST="/usr/local/ddos/block.ip.list" | |
BLOCK_UA_LIST="/usr/local/ddos/block.ua.list" | |
IGNORE_IP_LIST="/usr/local/ddos/ignore.ip.list" | |
IGNORE_UA_LIST="/usr/local/ddos/ignore.ua.list" | |
IGNORE_IP_KEYWORDS="/usr/local/ddos/ignore.ip.keywords" | |
IGNORE_UA_KEYWORDS="/usr/local/ddos/ignore.ua.keywords" | |
IGNORE_NETWORK_LIST="/usr/local/ddos/ignore.network.list" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##### Paths of the script and other files | |
PROGDIR="/usr/local/ddos" | |
PROG="/usr/local/ddos/ddos.sh" | |
IGNORE_IP_LIST="/usr/local/ddos/ignore.ip.list" | |
IGNORE_NETWORK_LIST="/usr/local/ddos/ignore.network.list" | |
#CRON="/etc/cron.d/ddos.cron" | |
APF="/etc/apf/apf" | |
IPT="/sbin/iptables" | |
##### frequency in minutes for running the script |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
declare -a dbs | |
unset opt | |
for each in $(echo "show databases;" | mysql -u root) ;do | |
dbs+=($each) | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function convertCurrency($from = null, $to = null, $amt = null) { | |
$url = "https://www.xe.com/currencyconverter/convert/?Amount=$amt&From=$from&To=$to"; | |
$ch = curl_init(); // Initialize a CURL session. | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // Return Page contents. | |
curl_setopt($ch, CURLOPT_URL, $url); // Pass URL as parameter. | |
$data = curl_exec($ch); // grab URL and pass it to the variable. | |
curl_close($ch); // close curl resource, and free up system resources. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This CSS is used for responsive tables. | |
id of the table parent should be 'no-more-tables'. | |
table should have class 'table' | |
*/ | |
table { | |
width: 100%; | |
border-collapse: collapse; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author Anush Prem <goku.anush@gmail.com> | |
* @package Solver | |
* @subpackage Sudoku | |
* @version 0.1 | |
*/ | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Class Test extends SplQueue | |
{ | |
} | |
$queue = []; | |
//SplQueue new object | |
$dummyQueue = new test(); |