find . -maxdepth 1 -type f -exec wc -l {} + | awk '{sum+=$1} END {print sum}'
This file contains hidden or 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 | |
$q = trim($_POST["q"]); | |
$lines = explode(PHP_EOL, $q); | |
$result = ""; | |
foreach ($lines as $key => $value) { | |
$result .= $value . PHP_EOL; | |
} | |
echo $result; | |
exit; | |
?> |
This one line command will list each folders in current path by the number of files inside of it, recursively.
find . -type d -exec sh -c "fc=\$(find '{}' -type f | wc -l); echo \"\$fc\t{}\"" \; | sort -nr
find . -maxdepth 1 -type d -exec sh -c "fc=\$(find '{}' -type f | wc -l); echo \"\$fc\t{}\"" \; | sort -nr
This file contains hidden or 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
http { | |
## | |
# WebP conf | |
## | |
map $http_accept $webp_suffix { | |
default ""; | |
"~*webp" ".webp"; | |
} | |
This file contains hidden or 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
find . -type f -name '*.m4a' -exec bash -c 'avconv -i "$0" "${0/%m4a/mp3}"' '{}' \; |
apt install fail2ban
Fail2ban will ban IPs reported in log files. So, you need to configure it to know wich reported IP is to ban.
All configs are located in /etc/fail2ban/
A jail is configured inside the jail.local
file that will overwrite jail.conf
. It refferes to a filter file inside the filter.d
folder.
Here are some usefull example of jails.
This file contains hidden or 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
http{ | |
... | |
## | |
#AMP | |
## | |
map $http_user_agent $mobile_agent{ | |
default ""; | |
"~*android.+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino" "/amp/"; |
This file contains hidden or 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
from functools import reduce | |
from sympy import Symbol | |
X = Symbol('X') | |
def Lagrange(points): | |
P=[reduce((lambda x,y: x*y),[(X-points[j][0])/(points[i][0] - points[j][0]) for j in range(len(points)) if i != j])*points[i][1] for i in range(len(points))] | |
return sum(P) |