Nagios doesn’t start / internal service error / PID unfound

Nagios web-interface can fail to connect to process or to display any content at all. There can be different source of the problem, but the key to solving it:

  1. Checking permissions on the cgi-bin, fcgi-bin folders and scripts inside /nagios path.
  2. Checking Suexec log if you use it (`/var/log/apache2/suexec.log` for example).
  3. Checking access mode on statusjson.cgi and status.cgi

In case it doesn’t help, and nagios simply refuses to start, showing only:

Running configuration check...
or
Starting nagios:.

You have to manually run configuration check with the -v flag:

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

If the check is correct, but nags refuses to run, providing no info in {path}/var/nagios.log and not creating {path}/var/nagios.lock, then the problem might be in the device space.

Setting up Nagios monitoring on Debian-based servers

Nagios is a great tool for server monitoring, providing rich environment to setup different notifications and monitoring scenarios.

It supports hosts and notification service grouping, comes with a GUI out-of-the-box and has really great community and lots of documentation online.

Pretty much all the setup can be done, based on the google’s top search results. Nice place to start is Digital Ocean post about setting up Nagios on Ubuntu 14.04. There is  also another nice post, explaining how configuration is done.

If you fail to install package, or your server is different from Ubuntu, f.e, you run some Debian Stable server, you can address this post (RU) and build Nagios from source.

Configuring client can be done via this post, but check_nrpe command available only on server, not on the client.

Running cv2 in virtualenv on Mac

You may install cv2 using one of the available guides, f.e. this one.

And then just symlink so files into required virtualenv:

ln -s /usr/local/opt/opencv/lib/python2.7/site-packages/cv2.so /Users/user/.virtualenv/virtualenv/lib/python2.7/site-packages/

Why reading matters

Reading matters. Invention of writing let people preserve and pass knowledge and things that matter through generation. So reading was basically designed to save people from making mistakes someone had already made, to save people from going down the paths, which are already explored. But the obvious reason — to gain knowledge and experience which otherwise would be more expensive to gain — is not the only why lots of media advice so much how you can read one book a week.

Reading can help you to form habit of completion, which is extremely important, because conscientiousness, associated with completion by definition,  is the best predictor of many important human outcomes, including mortality, longevity, educational attainment, and a host of criteria related to career success, or at least so stated in «Organized mind».

Continue reading

Where to start with Data Science

There is now way to be taught to be data scientist, but you can learn how to become one yourself. There is no right way, but there is a way, which was adopted by a number of data scientists and it goes through online courses (MOOC). Following suggested order is not required, but might be helpful.

Best resources to study Data Science /Machine Learning

  1. Andrew Ng’s Machine Learning.
  2. Geoffrey Hinton’s Neural Networks for Machine Learning.
  3. Probabilistic Graphical Models specialisation on Coursera from Stanford.
  4. Learning from data by Caltech.
  5. CS229 from Stanford (Udemy link) by Andrew Ng.
  6. CS224d: Deep Learning for Natural Language Processing from Stanford.
  7. CS231n: Convolutional Neural Networks for Visual Recognition from Stanford.
  8. Deep Learning Book by Ian Goodfellow and Yoshua Bengio and Aaron Courville.
  9. Machine Learning Yearning by Andrew Ng.

О мотивации

Если в двух словах, то мотивации нет. Более известна длинная версия Артемия Лебедева: «Не хотите ничего делать — ради бога, оставайтесь в жопе». Если что-то не хочется делать, то время ещё не пришло, дедлайн не настал и тебе это не нужно. В мире нет людей, которые были слишком мало замотивированы, чтобы лечь спать, поесть когда голодны или встать и уйти на первой половине «Супермена» Зака Снайдера. Если тебе что-то действительно нужно — ты найдёшь мотивацию это сделать.

Тема очень неплохо раскрывается в коротком ролике Джорджа Карлина:

Continue reading