Всегда делайте БЕКАПЫ! ВСЕГДА! ДЕЛАЙТЕ! БЕКАПЫ!

Сука, истина в последней инстанции! Только что полтора часа провозился с MySql после Power Failure –  слетела база юзеров, чинил, флашил – нихуя не помогало, ровным счетом нихуяшечки! Спасибо, блять, дебиану с его ебаной старой как мир Mysql 5.5… Так вот, я вдруг вспомнил, что делал когда-то бекапы по расписанию, и О БОЖЕ ЧТО ЭТО!!!!Адин-адин111 Полный бекап базочки даже с таблицей юзеров, гугель 30 сек, первая команда рестора – ЗАРАБОТАЛО! Сученька, спасибочки тебе, прошлый я, что поставил бекапы делаться еженедельно, каждый понедельник. Изменил расписание на ежедневно в полночь! Мало бекапов не бывает! Делайте бекапы! Read more…

For list of dicts: merge same key values, sum another diff. values, count each merge iteration +1 Python

If anybody can help me with some task? I have list of dicts(or tuples), where: if tuples: comment_id, user_id, comment_date, comment_time, comment_likes (‘51799’, ‘112801710’, ‘2015-12-07′, ’00:03:21’, ‘0’), (‘51761’, ‘112801710’, ‘2015-12-06′, ’19:31:46’, ‘3’), (‘51764’, ‘112801710’, ‘2015-12-06′, ’19:54:19’, ‘0’), (‘51741’, ‘112801710’, ‘2015-12-06′, ’14:17:34’, ‘2’), (‘51768’, ‘52879933’, ‘2015-12-06′, ’20:03:34’, ‘0’), (‘51766’, ‘52879933’, ‘2015-12-06′, ’21:33:34’, ‘0’), or can be converted to dict like: {‘comm_count’: 1, ‘user_id’: ‘217407103’, ‘likes’: 0}, comment_id – is always unique and cannot meet twice in this list, user_id – is not unique for this list, it can be there as much times as comments were left in the set of posts (naturally I wanted to use this as counter) comment_date and comment_time – can be ignored, needed to sel fromShort Read more…

PostgreSQL first run

This is the most common issue for PostgreSQL first run in Linux env: configure the server to allow TCP/IP connections postgresql server it can produce PostgeSQL cannot connect to database host Here I’ll show how to fix it before you struggle with firewall and ports: I’ve found ot here: 17.3. Starting the Database Server and How Do I Enable remote access to PostgreSQL database server? My situation: vi /var/lib/pgsql/data/pg_hba.conf add the string: host all all 10.10.29.0/24 trust with my range and next config: vi /var/lib/pgsql/data/postgresql.conf add the string: listen_addresses=’*’ After that restart the service: systemctl restart postgresql.service also you can use an old ‘service postgresql restart’ [root@centst010 ~]# service postgresql restart Redirecting to /bin/systemctl restart postgresql.service And here it is: [root@centst010Short Read more…

VMware KB: Reducing the size of the vCenter Server database when the rollup scripts take a long time to run

Looks risky but will try: VMware KB: Reducing the size of the vCenter Server database when the rollup scripts take a long time to run. Read more…