python script as centos service

Task completed! I made a vkontakte Bot which delete all comments are not from group members! But I do not want to run it by cron, because it will SPAM all my system with cron emails. But I found resolution: make a worker.py allow worker to run delete scripts on time periods add worker as centos service have fun! Maybe later I’ll add more code, but now just for example I’ll show only worker and bash script:

And bash to run this as service:

Log: and process:   Based on: Run python as service: https://wolfpaulus.com/journal/software/pythonlauncher/ Schedule python: https://github.com/dbader/schedule Python 100% CPU: http://raspberrypi.stackexchange.com/questions/8077/how-can-i-lower-the-usage-of-cpu-for-this-python-program/8078   Read more…

JAVA_HOME and other Oracle tales

RUS: Открываю заявку на вступление в джентельменский клуб “Пуканы запеченые от продуктов Oracle” принимайте меня! ENG: How to Install JAVA 7 (JDK 7u79) on CentOS/RHEL 7/6/5 and Fedora Configuring Environment Variables Most of Java based application’s uses environment variables to work. Use following commands to set up these variable properly. It’s also good to add following commands to any start-up script like ~/.bashrc or ~/.bash_profile. Setup JAVA_HOME Variable

Setup JRE_HOME Variable

Setup PATH Variable

From: http://tecadmin.net/steps-to-install-java-on-centos-5-6-or-rhel-5-6/# Read more…

Centos 7 extend volume

One more guide which help me to save nerves. https://www.rootusers.com/how-to-increase-the-size-of-a-linux-lvm-by-expanding-the-virtual-machine-disk/ Part from it: Increasing the logical volume We use the pvcreate command which creates a physical volume for later use by the logical volume manager (LVM). In this case the physical volume will be our new /dev/sda3 partition.

In order to get around this you can either reboot, or use partprobe/partx as previously mentioned to avoid a reboot, as in this instance the disk does not appear to be there correctly despite showing in “fdisk -l”. After a reboot or partprobe/partx use the same command which will succeed.

Next we need to confirm the name of the current volume group using the vgdisplay command. The name will varyShort 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:

add the string:

with my range and next config:

add the string:

After that restart the service:

also you can use an old ‘service postgresql restart’

And here it is:

    Read more…

Installation Perforce Helix Proxy

From here Download here Installation on Windows Just using installer: Invalid Displayed Gallery Windows evidence:

And looks like there is nothing different with p4d.exe in logic. As service:

  Installation on Centos from guide: To install P4P on UNIX or Linux, do the following: Download the p4p executable to the machine on which you want to run the proxy. Select a directory on this machine (P4PCACHE) in which to cache file revisions. Select a port (P4PORT) on which p4p will listen for requests from Perforce applications. Select the target Perforce server (P4TARGET) for which this proxy will cache. And:

to start Proxy use this example:

Starting:

Started:

          Read more…

Plone installation

Will try to use Plone CMS for test cases, interesting to see what and how CMS on Python worked. Start here: https://plone.org/documentation/manual/installing-plone/installation-quick-guide For Python: Guide and I’ve use only one part from it here. I’ve done everything as guided above.

And Python lives here! Can have some troubles, like:

And this:

Be we can do a hardcore: (better do to it with this: ) Just adding all recommended settings which are: – path to installed and worked python 2.7 binaries, manually –with-python=/usr/local/bin/python2.7 – flag to allow Plone download needed dev modules and libraries –static-lxml=yes

I’m not guarantee that this method can save you from further pain with it – this is only my vision how to get busy. AfterShort Read more…

Заводим питончика дома или установка Python на Centos 6

Хороший гайд здесь: https://github.com/h2oai/h2o/wiki/Installing-python-2.7-on-centos-6.3.-Follow-this-sequence-exactly-for-centos-machine-only How to install Python 2.7.6 on CentOS 6.3 (6.2 and 6.4 okay too, probably others) stolen from Daniel Eriksson. Thanks Daniel! http://toomuchdata.com/2012/06/25/how-to-install-python-2-7-3-on-centos-6-2/ (modified a little) CentOS 6.2 ships with Python 2.6.6 and depends on that specific version. Be careful not to replace it or bad things will happen. If you need access to a newer version of Python you must compile it yourself and install it side-by-side with the system version. Here are the steps necessary to install Python 2.7.6. Execute all the commands below as root. Either log in as root temporarily or use sudo. Install development tools In order to compile Python you must first install the development tools:

You also need a fewShort Read more…

Perforce – Centos start investigation and install

The Perforce service and applications are available from the Downloads page on the Perforce web site: http://www.perforce.com/downloads/complete_list THIS is not a JOKE! Installation: Do not worked for me: Also do not work: Procedures above looks not complex, I cannot run P4 by them. Will try another: Another way don’t work: Doesn’t work:

FINALLY It’s worked: Probably there is no output after ./p4d runs, but server is up and listen   Useful commands: p4 info   — This should show if you can access the perforce server at all p4 counters — This should give you a list of all counters p4 counter change — This should give you the value of the change list counter, which is probably also requested byShort Read more…

All about Atlassian JIRA 2.1 – Atlassian JIRA “AJiraLockedError” and JIRA Startup Failed

Продолжаем мучать свой мозг новыми сюрпризами от JIRA или это я просто такой неудачник: Причина:

Способ из этого моего поста  может быть бессилен. Копаю дальше. Как оказалось, Jira крайне требовательна к ресурсам, жадная тварь! Еще можно попробовать поиграться с настройками: set JVM_MINIMUM_MEMORY=256m set JVM_MAXIMUM_MEMORY=1024m но лучше ставить Jira сразу на центос, меньше гемора потом.     Read more…

Update Redmine 2.6*

Как-то совсем упустил момент, когда вышли 2 новых версии редмайна с кучей исправлений и вот обновляху сделал. Кое-какие моменты могут обмать процесс, но общий порядок действий прежний, как описан здесь: http://trianglesis.org.ua/update-redmine-2-5-2 Возможные проблемы, некоторые исходят из прошлого гайда, чтобы не ругали меня, что я сломал вам редмайн. Смотрим:  

Решается просто закомментированием этих строк. Следующий конфликт начнется от того, что в прошлый раз я во время инсталляции просто руками указал версии, и сейчас файл жестко их использует. Нужно также изменить руками версии в файле gemfile.lock все версии на требуемые ниже:

Далее просто обновление джемов:

Все обновилось! Далее все делается по обычному мануалу, который я указал вверху. Непременно все пункты прочитать, потому как настройки могут слететь, но это легкоShort Read more…