Вирішення:
sudo a2dismod mpm_event sudo a2enmod mpm_prefork sudo service apache2 restart
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)