Saturday, January 30, 2016

How to show status of all init.d services in Ubuntu

To show status of all init.d services in Ubuntu, use the following command:

service --status-all

How to make an init.d service run at startup in Ubuntu

To make an init.d service run at startup in Ubuntu, use the following command:

sudo update-rc.d link-bin defaults

You can also disable it as follows:

sudo update-rc.d -f link-bin remove

Reference:
http://askubuntu.com/questions/9382/how-can-i-configure-a-service-to-run-at-startup

Unable to find Java

When you run a Spring Boot application as an init.d service,

you might encounter the following error:

$ sudo service link-bin start
Unable to find Java
$

An easy way to fix it is using a `.conf` file (`link-bin.conf`):

JAVA_HOME=/home/izeye/programs/jdk1.8.0_60

Reference:
http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#deployment-script-customization-conf-file

How to change owner of symbolic link

To change owner of symbolic link `test` to `izeye`, use the following command:

sudo chown -h izeye test

How to restart Ubuntu on terminal

To restart Ubuntu on terminal, use the following command:

sudo reboot

Reference:
http://askubuntu.com/questions/187071/how-do-i-restart-shutdown-from-a-terminal

Tuesday, January 26, 2016

Segmentation fault: 11

When you run TensorFlow, you might encounter the following error:

>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
Segmentation fault: 11

My Python version was 2.7.3:

Python 2.7.3 (v2.7.3:70274d53c1dd, Apr  9 2012, 20:52:43)

When I upgraded it to 2.7.11:

Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec  5 2015, 12:54:16)

it's fixed.

Monday, January 25, 2016

IOError: [Errno 2] No such file or directory: '/tmp/pip-1kNNWK-build/setup.py'

When you install TensorFlow, you might encounter the following error:

IOError: [Errno 2] No such file or directory: '/tmp/pip-1kNNWK-build/setup.py'

Upgrade your `pip` as follows:

pip install --upgrade pip

Reference:
https://www.tensorflow.org/versions/0.6.0/get_started/os_setup.html#common_install_problems

Wednesday, January 20, 2016

How to change `Accept-Language` in Chrome

I don't want to use Chinese as second language but `Accept-Language` was:

Accept-Language:ko,zh-CN;q=0.8,zh;q=0.6,en-US;q=0.4,en;q=0.2

You can fix as follows:

Settings -> Show advanced settings... -> Language and input settings...

And then fix your language preferences.