Friday, October 23, 2015

Fix for accident nginx remove

Fix for accident nginx remove


Problem


I accidentally removed nginx from my Linux Server (Debian Jessie). I did it after my experiments with phusion passenger. I made:

$ sudo rm -rf /etc/nginx
$ sudo rm  /etc/init.d/nginx

And yes, I know that I made a stupid thing :)

After installing nginx by

$ sudo apt-get install nginx


I was able to run it. Test run

$ sudo nginx -t

output:

nginx: [emerg] open() "/etc/nginx/nginx.conf" failed (2: No such file or directory)
nginx: configuration file /etc/nginx/nginx.conf test failed


See details for solution...

Thursday, October 22, 2015

Resetting a forgotten MySQL root password

Resetting a forgotten MySQL root password


Problem


 You forgot you root MySQL password :)

Solution 


First, we need stop MySQL daemon:

$ sudo /etc/init.d/mysql stop

Also, we can use service command:

$ sudo service mysql stop

Wednesday, October 14, 2015

Pillow library install issue for RPi (running Raspbian)



Pillow library install issue for RPi 2 (running Raspbian)

Problem


I found little issue till Pillow installing (via pip for newly installed Python 3.5 to the almost clear RPi 2 (mod. B) running Raspbian):

ValueError: --enable-jpeg requested but jpeg not found, aborting. 

My Raspbian version (information retrieved by running $ uname --all):

Linux rpi-number08 4.1.10-v7+ #821 SMP PREEMPT Sat Oct 10 00:16:28 BST 2015 armv7l GNU/Linux

Building Python 3.5 on Raspberry Pi 2 (Raspbian)

Building Python 3.5 on Raspberry Pi 2 (Raspbian)


1. Problem



Problem: we want use the latest version of Python to run Flask and other fun stuff on our RPi 2 (mod. B). But only old version of Python (3.2) supported by apt-get.

We need to build and install our own build of latest Python release! So, our target will be Python 3.5.

Also, you may want to know What’s New In Python 3.5

UPD! You can follow procedures for Python 3.6 installation by following Building Python 3.6 on Raspberry Pi 3 from sources (clean Debian)