Skip to content

Instantly share code, notes, and snippets.

@radiuscz
radiuscz / SQL
Created February 14, 2018 21:54
Intranet Koha: TOP 15 nejaktivnějších čtenářů
select count(*) as Pocet, ctenar as 'Čtenář', branches.branchname as 'Oddělení', itemtypes.description as 'Typ jednotky'
from (
select issuedate, itemnumber, borrowernumber, concat(firstname, " ", surname) as ctenar, old_issues.branchcode
from old_issues
left join borrowers USING(borrowernumber)
UNION
select issuedate, itemnumber, borrowernumber, concat(firstname, " ", surname) as ctenar, issues.branchcode
from issues
left join borrowers USING(borrowernumber)
) as T
@radiuscz
radiuscz / antibot.sh
Last active February 28, 2025 10:30
VuFind - přetížení roboty Semrush, Ahrefs, BLEX
#!/bin/bash
sed -i 's/# Uncomment the following lines/BrowserMatchNoCase SemrushBot|AhrefsBot|BLEXBot|AspiegelBot|SEOkicks|PetalBot|YandexBot|bingbot|DotBot|MJ12bot|Seekport|Adsbot|Amazonbot|DataForSeoBot|seoscanners|uni-leipzig|Turnitin|Bytespider|Barkrowler|serpstatbot|ImagesiftBot|ClaudeBot bad_bot|facebookexternalhit|FriendlyCrawler|GPTBot|meta-externalagent|AwarioBot|MSIE|Googlebot|Firefox\/[0-9][0-9]?\\\.|PPC Mac|Windows NT [4-6]\.|Windows CE|Windows 9.|Chrome\/[1-7][0-9]\\\.|Opera|AliyunSecBot|Owler|iPhone OS [0-9]_|Mac OS X 10_[0-9]_|iPad OS 1[0-3]_|netEstate NE Crawler|iPad OS [0-9]_|__RBIT__\n Order Deny,Allow\n Deny from env=bad_bot\n\n # Uncomment the following lines/' /usr/local/vufind2/local-*/httpd-vufind.conf