Skip to content

Instantly share code, notes, and snippets.

View win0err's full-sized avatar
⌨️
Sergei is typing...

Sergei Kolesnikov win0err

⌨️
Sergei is typing...
View GitHub Profile
@win0err
win0err / habratest.php
Last active September 3, 2017 11:23
Тест различных циклов в PHP на время выполнения и потребление памяти
<?php
echo 'PHP ' . phpversion() . PHP_EOL . PHP_EOL;
$test = [];
for($i = 0; $i < 100000; $i++)
$test[$i] = $i;
process_test(function() use ($test) {
foreach($test as $t)
@win0err
win0err / block_jorgee.sh
Last active February 9, 2021 07:10
Blocks IPs from Jorgee Security Scanner searching for vulnerabilities on a server
#!/usr/bin/env bash
printf "Searching in Apache2 and nginx access logs for Jorgee's scans";
zcat -f /var/log/{apache2,nginx}/access.*\
| grep Jorgee \
| grep -oE '^([0-9]{1,}\.){3}[0-9]{1,}' \
| sort -n \
| uniq \
| awk '{ system("iptables -A INPUT -s " $0 " -j DROP"); printf "."; }'