2017年2月6日 星期一

How to Increase max_connections of MySQL service on Ubuntu 16.04

From: http://stackoverflow.com/questions/30901041/can-not-increase-max-open-files-for-mysql-max-connections-in-ubuntu-15, by Fredik

As of MySQL 5.7.7, this is what the documentation recommends for Red Hat Enterprise Linux 7, Oracle Linux 7, CentOS 7, SUSE Linux Enterprise Server 12, Fedora 24 and 25:

https://dev.mysql.com/doc/refman/5.7/en/using-systemd.html

On Ubuntu 16.04 the service is called mysql, not mysqld, so this is what Fredik did:
sudo mkdir /etc/systemd/system/mysql.service.d
sudo vi /etc/systemd/system/mysql.service.d/override.conf
Added this in the new file override.conf:
[Service]
LimitNOFILE=5000
Then restarted the service:
sudo systemctl daemon-reload
sudo systemctl restart mysql

2016年12月27日 星期二

迷人的班瑞克 1999 (BenRiach 1999, Oloroso Sherry Finish, 59.2%, Cask #2101)

(未成年請勿飲酒)(飲酒過量有礙健康)


老友寄來了分享瓶,我印象中的班瑞克是和格蘭多納是同一等級的酒廠。相較於格蘭多納,班瑞克比較少人關注,但卻因此是尋寶的好品牌。很久以前,喝過班瑞克的紅鼎(BenRiach 12 Year Old Matured in Sherry Wood)、驚奇泥煤(Benriach 10 Year Old Curiositas)、以及被猜測由班瑞克釀造蒸餾的泥煤怪獸(Peat's Beast Cask Strength),但未喝過重雪莉等級的原酒。今天托好友的福,我也來逛逛大觀園 XD。

Nose:
柔軟的辛香料、柔美的雪莉桶,聞起來像是鼻腔細胞被高級的毛毯所包覆。氣味似青色泛黃熟透的棗子混合著肉桂,配上上等禢褟米發出的稻桿香。有如深色水果釀成的香水,緩緩地飄過輕熟女的身旁,讓我想起那著名的 "輕井澤"。真想聞上一整天。

Plate:
恰到好處的木質馨香,介於格蘭多納(Glendronach 15yo)的沈腐與亞伯樂原酒(Aberlour A'bunadh)的青澀之間,類似我所喜愛的噶瑪蘭 S06,但要更柔美些。一丁點兒的菸草味,讓它喝起來也像是山崎18再加強蜜餞乾果味後的原酒版本(註:原酒版本的山崎18尚未問世)。

After:
梅幹、蜜餞果核、回甘、餘韻十足、繞樑不絕,杯底有明顯的乳脂痕跡。典雅美好,喝完後會讓人想要抿一抿嘴呢!

Comments:
這瓶酒讓我覺得好似躺在自己最喜愛的床上,因為這張床柔軟舒適,而且帶有自己最熟悉、最喜愛、最信賴的氣味。有人說威士忌的顛峰年份是 18 年左右,因為這個年份的酒,完美成熟而不顯老態、熱情奔放而不顯輕佻。我想這瓶桶號 2101 的 1999 年班瑞克(雖不到18年),正是符合這種描述的好物,是我心目中完美威士忌的典範!

2016年11月14日 星期一

[Solved] phpmyadmin error during installation “Empty value for 'port' specified.”

This SOLUTION is coming from "http://stackoverflow.com/questions/37089568/phpmyadmin-error-during-installation-empty-value-for-port-specified" by "William Ardila".

[SOLUTION]
My machine configuration - Ubuntu 16.04 - MySql 5.7.13 - PHP 7.0.8 - Apache 2.4.18

Step 01:
Edit the file /etc/dbconfig-common/phpmyadmin.conf, changing dbc_dbport='' to dbc_dbport='0'

Step 02:
After edit the file and save it, if you are still on the dbconfig-common wizard select 'retry', if not run sudo dpkg-reconfigure phpmyadmin (choose 'Yes' when ask you if you want to Reinstall database for phpmyadmin), and continue normally without change any value, if you want change some value, do it in the file that you edit before.

Step 03:
When configuration window asks what you want to do with existing configuration file, choose 'Keep the local version currently installed'.

In this point you can check the differences and only must exist the ones that you made in the file.

[Solved] VNC authentication failure after upgrade UBUTNU to 16.04

This solution is from "http://superuser.com/questions/438024/vnc-authentication-failure" answered by "PleaseStand":

VNC uses a separate password system. It does not check passwords against /etc/passwd but rather against ~/.vnc/passwd, which contains a single primary password and optionally a secondary password that allows only viewing the screen.

To set your VNC password(s), use the "vncpasswd" command. VNC passwords must be between five and eight characters in length – characters beyond the eighth are silently ignored. So if you are using VNC over the Internet, pick a strong, random password, as attackers may use botnets that have numerous IP addresses to circumvent the lockout while cracking your password.

If you must use VNC over the Internet, run it on a randomly chosen port number (not 5900) to avoid detection in port scans that cover only the common ports. Preferably, tunnel your VNC connection over SSH to protect yourself against eavesdropping and man-in-the-middle attacks. If you do this, you should set vncserver to not accept connections from the Internet, disable password-only authentication on the SSH service and use public-key authentication to protect against common brute-force password cracking attempts.

Restarting vncserver should reset the lockout. The manual page does not mention any way to disable the (already inadequate?) lockout entirely.

2016年11月1日 星期二

Install Python OpenCV through Conda

環境:
  1. Windows 10, 64-bits
  2. Anaconda2-4.2.0-Windows-x86_64'

執行以下命令,以安裝 OpenCV 2.x.x:
anaconda show menpo/opencv

執行以下命令,以安裝 OpenCV 3.x.x:
anaconda show menpo/opencv3

執行以上指令後,即能獲得不同 OpenCV 版本的安裝提示,如:
conda install --channel https://conda.anaconda.org/menpo opencv3

conda install -c menpo opencv3

測試是否安裝成功(在 Python 環境中下達以下指令會顯示所安裝的 OpenCV 版本):
>>> import cv2
>>> cv2.__version__