I hereby claim:
- I am olegbuevich on github.
- I am obuevich (https://keybase.io/obuevich) on keybase.
- I have a public key ASDbQbeXTGHIVaIkcqw2-FKcIi6b7jAZ1T-GF_yT1smfbgo
To claim this, I am signing this object:
# based on: http://www.php2python.com/wiki/function.imap-utf7-encode/ | |
def modified_base64(s): | |
s_utf7 = s.encode('utf-7') # | |
aaa = s_utf7[1:-1].decode().replace('/', ',') # rfc2060 | |
return aaa | |
def modified_unbase64(s): | |
s_utf7 = '+' + s.replace(',', '/') + '-' |
# dump all databases once every 24 hours | |
45 4 * * * root nice -n 19 su - postgres -c "pg_dumpall --clean" | gzip -9 > /var/local/backup/postgres/postgres_all.sql.gz | |
# vacuum all databases every night (full vacuum on Sunday night, lazy vacuum every other night) | |
45 3 * * 0 root nice -n 19 su - postgres -c "vacuumdb --all --full --analyze" | |
45 3 * * 1-6 root nice -n 19 su - postgres -c "vacuumdb --all --analyze --quiet" | |
# re-index all databases once a week | |
0 3 * * 0 root nice -n 19 su - postgres -c 'psql -t -c "select datname from pg_database order by datname;" | xargs -n 1 -I"{}" -- psql -U postgres {} -c "reindex database \"{}\";"' |
SELECT query, calls, total_time, rows, 100.0 * shared_blks_hit / | |
nullif(shared_blks_hit + shared_blks_read, 0) AS hit_percent | |
FROM pg_stat_statements ORDER BY total_time DESC LIMIT 5; |
start on runlevel [2345] | |
stop on runlevel [016] | |
respawn | |
limit nofile 50000 50000 | |
chdir /opt/mattermost | |
exec su -c bin/platform mattermost |
# install needed packages | |
yum install librsync-devel python-devel | |
# remove old version | |
yum remove duplicity.x86_64 | |
wget http://savannah-nongnu-org.ip-connect.vn.ua/duplicity/duplicity-0.7.11.tar.gz | |
tar -zxvf duplicity-0.7.11.tar.gz | |
cd duplicity-0.7.11/ | |
python setup.py install |
#!/bin/sh | |
# | |
# /etc/init.d/tomcat8 -- startup script for the Tomcat 8 servlet engine | |
# | |
# Written by Miquel van Smoorenburg <[email protected]>. | |
# Modified for Debian GNU/Linux by Ian Murdock <[email protected]>. | |
# Modified for Tomcat by Stefan Gybas <[email protected]>. | |
# Modified for Tomcat6 by Thierry Carrez <[email protected]>. | |
# Modified for Tomcat7 by Ernesto Hernandez-Novich <[email protected]>. | |
# Additional improvements by Jason Brittain <[email protected]>. |
sudo cat /etc/letsencrypt/live/<hostname>/privkey.pem | ssh <router> "cat > /etc/key.pem" | |
sudo cat /etc/letsencrypt/live/<hostname>/fullchain.pem | ssh <router> "cat > /etc/cert.pem" | |
ssh <router> service restart_httpd |
# pip install python-telegram-bot | |
from telegram import bot | |
# example values | |
BOT_TOKEN='123456789:jhsagdhg_sakjdKHGKuyasgdkhsabdas' | |
CHAT_ID='7125376' | |
tbot = bot.Bot(BOT_TOKEN) | |
tbot.send_message(chat_id=CHAT_ID, text='Message from python') |
description "rocketchat application server" | |
# Wait for mongod before starting rocketchat app·· | |
start on (started mongod) | |
stop on runlevel [!2345] | |
# Automatically attempt to restart with finite limits | |
respawn | |
respawn limit 99 5 |
I hereby claim:
To claim this, I am signing this object: