Авто удаление комментариев Вконтакте

Автоматически удалять комментарии оставленные НЕ подписчиков группы? Модуль, который проверяет каждый оставленный комментарий в первых 10 и 50-100 постах на предмет того, оставлен ли он участником группы. Логика действий простая: получить все комментарии с айди (словарь вида: айди_коммента, айди_автора, время_коммента) авторов каждого комментария, проверить есть ли айди автора комментария в списке участников группы, если нет – составить список значений из списка словарей выше, далее запустить луп, в котором удалять каждый комментарий ил списка словарей комментариев, которые оставлены не участниками группы. Данная логика не рассматривает использование vk_execute, но в моем модуле он используется. Возможно, я расскажу именно о vk_script когда-нибудь позднее, когда закончу разработку всех мыслимых модулей, которые запланировал внедрить. На основе: http://www.trianglesis.org.ua/vk-execute-args-python-requests Последнее время работаю над системой, которая выполняет рутинноеShort Read more…

Install Bacula on debian systems

Failed to load the database DBI driver SQLite at ./bacula-backup-lib.pl line 45 Based on: https://nklug.org.ua/node/23 http://www.microhowto.info/howto/connect_to_a_sqlite_database_using_perl_dbi.html https://ru.wikibooks.org/wiki/Bacula/Быстрый_старт http://help.ubuntu.ru/wiki/руководство_по_ubuntu_server/резервное_копирование/bacula https://www.digitalocean.com/community/tutorials/how-to-install-bacula-server-on-ubuntu-14-04 The main problem was: Failed to load the database DBI driver SQLite at ./bacula-backup-lib.pl line 45 this ultra fast fix can help: apt-get install libdbd-sqlite3-perl You can install any needed module based on SQL you use: MySQL, PostrgeSQL etc. Read more…

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

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

Better, then best vk execute and python part. 2

Крайняя степень эффективности. Теперь скрипт не парсит данные, их парсит сам ВК и возвращает мне лишь списки: айди, комменты, репосты и т.п. Для каждого набора свой список – длина списков всегда одинакова. Дело в том, что ВК не позволяет производить более 24-х итераций за раз в vk execute, поэтому, прежде чем отправить списки постов, я дроблю их на группы по 20. Мало того, благодаря вот этому вкраплению: https://toster.ru/q/234399 я теперь могу производить сбор постов по 100 штук по 20 раз за итерацию в Python, то есть на стороне ВК происходит 20 итераций по 100 постов за одну итерацию в python Далее списки zipаются в один большой список списков по 2000 элементов в каждом. Based on: http://www.trianglesis.org.ua/python-i-vk-execute-40-tysyach-postov-za-3-minuty Время выполнения сократилось почти в дваShort Read more…

Django + Python3.4 + Mysql(MariaDB)

Just hint for future me: [root@test smm_py]# vim settings.py [root@test smm_py]# python manage.py makemigrations import MySQLdb as Database ImportError: No module named ‘MySQLdb’ django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named ‘MySQLdb’ [root@test smm_py]# pip install mysql-python3 Collecting mysql-python Downloading MySQL-python-1.2.5.zip (108kB) 100% || 110kB 812kB/s ImportError: No module named ‘ConfigParser’ —————————————- Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-t64nwwtb/mysql-python [root@test smm_py]# easy_install mysql-python ImportError: No module named ‘ConfigParser’ ImportError: No module named ‘ConfigParser’ [root@test smm_py]# pip3 install ConfigParser Collecting ConfigParser _KEYCRE = re.compile(ur”%\(([^)]+)\)s”) SyntaxError: invalid syntax —————————————- [root@test smm_py]# pip3.4 install –allow-external mysql-connector-python mysql-connector-python Collecting mysql-connector-python Downloading http://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python-2.0.4.zip (277kB) 100% || 278kB 3.7MB/s Successfully built mysql-connector-python Successfully installed mysql-connector-python-2.0.4 [root@test smm_py]# vim /smm_py/settings.py 76 77 DATABASESShort Read more…

MySQL How to Reset the Root Password

Mysql

https://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html Added to bookmarks: Log on to your system as the Unix user that the MySQL server runs as (for example, mysql). Stop the MySQL server if it is running. Locate the .pid file that contains the server’s process ID. The exact location and name of this file depend on your distribution, host name, and configuration. Common locations are/var/lib/mysql/, /var/run/mysqld/, and /usr/local/mysql/data/. Generally, the file name has an extension of .pid and begins with either mysqld or your system’s host name.Stop the MySQL server by sending a normal kill (not kill -9) to the mysqld process. Use the actual path name of the .pid file in the following command: shell; kill `cat /mysql-data-directory/host_name.pid` Use backticks (not forward quotation marks) withShort Read more…

Can’t create plan: Table ‘bamboo_db.NOTIFICATIONS’ doesn’t exist RESOLVED

An issue with clean install Bamboo + MySQL Can’t create plan: Table ‘bamboo_db.NOTIFICATIONS’ doesn’t exist RESOLVED This is log cut: 2015-06-12 15:21:37,985 ERROR [AtlassianEvent::0-BAM::EVENTS:pool-3-thread-8] [JDBCExceptionReporter] Table ‘bamboo_db.NOTIFICATIONS’ doesn’t exist. 2015-06-12 15:21:38,030 ERROR [http-bio-8085-exec-2] [JDBCExceptionReporter] Table ‘bamboo_db.NOTIFICATIONS’ doesn’t exist 2015-06-12 15:21:38,046 ERROR [http-bio-8085-exec-2] [ExceptionMappingInterceptor] org.springframework.dao.InvalidDataAccessResourceUsageException: could not initialize a collection: [com.atlassian.bamboo.notification.NotificationSetImpl.notificationRules#425985]; SQL [select notificati0_.NOTIFICATION_SET as NOTIFICA4_36_1_, notificati0_.NOTIFICATION_RULE_ID as NOTIFICA1_1_, notificati0_.NOTIFICATION_RULE_ID as NOTIFICA1_37_0_, notificati0_.RECIPIENT_TYPE as RECIPIENT2_37_0_, notificati0_.RECIPIENT as RECIPIENT37_0_, notificati0_.NOTIFICATION_SET as NOTIFICA4_37_0_, notificati0_.CONDITION_KEY as CONDITION5_37_0_, notificati0_.CONDITION_DATA as CONDITION6_37_0_ from NOTIFICATIONS notificati0_ where notificati0_.NOTIFICATION_SET=?]; nested exception is org.hibernate.exception.SQLGrammarException: could not initialize a collection: [com.atlassian.bamboo.notification.NotificationSetImpl.notificationRules#425985] Caused by: org.springframework.dao.InvalidDataAccessResourceUsageException: could not initialize a collection: [com.atlassian.bamboo.notification.NotificationSetImpl.notificationRules#425985]; SQL [select notificati0_.NOTIFICATION_SET as NOTIFICA4_36_1_, notificati0_.NOTIFICATION_RULE_ID as NOTIFICA1_1_, notificati0_.NOTIFICATION_RULE_ID as NOTIFICA1_37_0_, notificati0_.RECIPIENT_TYPE as RECIPIENT2_37_0_, notificati0_.RECIPIENT as RECIPIENT37_0_, notificati0_.NOTIFICATION_SET as NOTIFICA4_37_0_,Short Read more…

Y.A. great plugin for Redmine!

Yet another great plugin for Redmine just teached me how to add tables and columns manually into MySQL db. This is “nice” plugin: Issue Templates Have a great issue: error 500 And YES it have been migrated! root@tet-redmine www/redmine# rake redmine:plugins:migrate RAILS_ENV=production Migrating hooks_manager (Hooks manager)… Migrating redmine_ckeditor (Redmine CKEditor plugin)… Migrating redmine_digest (Digest plugin)… Migrating redmine_issue_checklist (Redmine Issue Checklist plugin)… Migrating redmine_issue_templates (Redmine Issue Templates plugin)… Migrating redmine_lightbox (Redmine Light Box plugin)… Migrating redmine_omniauth_ulogin (Redmine Omniauth uLogin plugin)… Migrating redmine_open_links_in_new_window (Redmine Open Links In New Window plugin)… Migrating redmine_people (Redmine People plugin)… Migrating sidebar_hide (Sidebar Hide Plugin)… But did not works! And I spent about 3hrs of my sleeping to find a roocause. You can see picrelated – Ive added thoseShort Read more…

MySQL key efficiency 100

MySQL key efficiency 100% This is to remember the conf for this: for 1GB RAM dedicated server: query_cache_limit = 4MB query_cache_size = 128MB key_buffer_size = 128M max_connections = 300 wait_timeout = 7200 tmp_table_size = 64MB max_connect_errors = 1000 connect_timeout = 20 max_allowed_packet = 16M from here: thanks man! +1 Gb RAM = 2 Gb new config: log-slow-admin-statements query_cache_limit = 4MB query_cache_size = 64M key_buffer_size = 64M max_connections = 300 wait_timeout = 7200 tmp_table_size = 12MB max_connect_errors = 500 connect_timeout = 60 max_allowed_packet = 8M innodb_buffer_pool_size = 128M performance_schema plugin_dir = /usr/lib/plugin default-storage-engine = InnoDB innodb = ON   Read more…

MySQL tuning

Вот и пришло время, когда мне вдруг пришлось лезть в дебри MySQL tuning и пробовать заставить работать базу шустрее. Read more…