perl maillogconvert.pl vadmin < /var/log/mail.log | grep email@domain.com > result.txt
postfix, virtual mail
perl maillogconvert.pl vadmin < /var/log/mail.log | grep email@domain.com > result.txt
map $http_user_agent $limit_bots { default 0; ~*(google|bing) 1; ~*(AltaVista|Googlebot|Slurp|BlackWidow|Bot|ChinaClaw|Custo|DISCo|Download|Demon|eCatch|EirGrabber|EmailSiphon|EmailWolf|SuperHTTP|Surfbot|WebWhacker) 1; ~*(Express|WebPictures|ExtractorPro|EyeNetIE|FlashGet|GetRight|GetWeb!|Go!Zilla|Go-Ahead-Got-It|GrabNet|Grafula|HMView|Go!Zilla|Go-Ahead-Got-It) 1; ~*(rafula|HMView|HTTrack|Stripper|Sucker|Indy|InterGET|Ninja|JetCar|Spider|larbin|LeechFTP|Downloader|tool|Navroad|NearSite|NetAnts|tAkeOut|WWWOFFLE) 1; ~*(GrabNet|NetSpider|Vampire|NetZIP|Octopus|Offline|PageGrabber|Foto|pavuk|pcBrowser|RealDownload|ReGet|SiteSnagger|SmartDownload|SuperBot|WebSpider) 1; ~*(Teleport|VoidEYE|Collector|WebAuto|WebCopier|WebFetch|WebGo|WebLeacher|WebReaper|WebSauger|eXtractor|Quester|WebStripper|WebZIP|Wget|Widow|Zeus) 1; ~*(Twengabot|htmlparser|libwww|Python|perl|urllib|scan|Curl|email|PycURL|Pyth|PyQ|WebCollector|WebCopy|webcraw) 1; }
if ($limit_bots = 1) { return 403; }
# curl -H "Host: site_name" -A "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)" http://server_ip # curl -H "Host: site_name" -A "msnbot/2.0b (+http://search.msn.com/msnbot.htm)" http://server_ip # curl -H "Host: site_name" -A "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" http://server_ip
DOMAINS=$HOSTNAME systemctl stop nginx /opt/letsencrypt/letsencrypt-auto certonly --debug -d $DOMAINS --email hostmaster@$HOSTNAME --standalone --renew-by-default --agree-tos --standalone-supported-challenges tls-sni-01 && cp -Lr /etc/letsencrypt/live/$HOSTNAME/cert.pem /usr/local/mgr5/etc/manager.crt && cp -Lr /etc/letsencrypt/live/$HOSTNAME/privkey.pem /usr/local/mgr5/etc/manager.key && systemctl start nginx #killall5 -9 core
curl -s -w %{time_total}\\n -o /dev/null http://site.com.ua/
#!/bin/bash while : do ./rec.py DATE=`date +%Y%m%d%H%T` mv demo.wav demo-$DATE.wav #vlc demo-$DATE.wav & #killall -9 vlc echo "recorded $DATE" done
sudo a2dismod mpm_event sudo a2enmod mpm_prefork sudo service apache2 restart
#!/usr/bin/python import time import ftputil host = ftputil.FTPHost('ftphost', 'ftpuser', 'ftppass') mypath = ['/', '/dir1', '/dir2', '/dir3', '/dir3',] # директорії з яких видаляти бекапи now = time.time() for p in mypath: host.chdir(p) names = host.listdir(host.curdir) for name in names: if host.path.getmtime(name) < (now - (7 * 86400)): # 7 днів if host.path.isfile(name): host.remove(name) print 'Closing FTP connection' host.close()
This application failed to start because it could not find or load the Qt platform plugin "xcb"
sudo apt-get install libxcb-*
curl -s checkip.dyndns.org | sed -e 's/.*Current IP Address: //' -e 's/<.*$//'
або
wget http://ipinfo.io/ip -qO -
ngrep -q -d wlan0 -W byline port 554
session = vk.Session(access_token='blahblahblah') api = vk.API(session) upload_server = api.photos.getWallUploadServer() r = requests.post(upload_server['upload_url'], files={'photo': open("/home/gsv/photo.jpg","rb")}) params = {'server': r.json()['server'], 'photo': r.json()['photo'], 'hash': r.json()['hash']} wallphoto = api.photos.saveWallPhoto(**params) photoID = wallphoto[0]['id'] params = {'attachments': str(photoID), 'message': 'Тест'} api.wall.post(**params)