MySQL Data File Paths on Linux

Server version: 5.7.20-0ubuntu0.16.04.1 (Ubuntu) After logging into MySQL, you can use the following command to query where the related files are stored: show variables like '%dir%'; The output is shown below: Usually these are: The default location of the database files is: /usr/share/mysql/ Configuration file: /etc/mysql/my.cnf Database directory: /var/lib/mysql Configuration directory: /etc/share/mysql (mysql.server command and configuration files) MySQL related commands: /usr/bin Startup scripts: /etc/init.d/ One way to start mysql safely: /usr/bin/mysqld_safe-user=root&

December 1, 2017 · 1 min · Simplestory

Some Linux Commands

Using the command line under Linux is routine; usually we memorize forty or fifty commands, but some rarely used yet useful commands are overlooked by most people. This post collects a small subset of them. sudo !! Some commands report an error when run without superuser privileges, after which sudo !! can be used to invoke the previous command. !! grabs the last command. python command With a simple python command we can produce a simple web page that displays the folder structure over HTTP, accessible from a browser on port 8000 until an interrupt signal is sent. ...

November 7, 2017 · 7 min · Simplestory

Detecting Traffic Violations with Opencv

Opencv contains more than 2500 functions, and almost any mature algorithm you can think of can be implemented by calling Opencv’s functions, which is super convenient. This post combines Python and Opencv to detect cars in surveillance video and check whether they commit a violation (crossing the double yellow line). System environment: Ubuntu16.04LTS+OpenCV3.3.0+Python2.7.12 Background extraction For surveillance the position is relatively fixed, so the background will not change considerably over a long period of time. We can therefore consider using background subtraction to roughly extract the background. ...

November 5, 2017 · 6 min · Simplestory

Installing OpenCV on Linux

Recently, because a project needed computer vision recognition, I started tinkering with OpenCV. Although the installation process was long and winding, the experience of using it together with Python is actually quite good. Here I record the OpenCV installation and compilation process. System environment: Ubuntu16.04 Software installed: OpenCV3.3.0+Python2.7.12 Updating the system packages: $ sudo apt update $ sudo apt upgrade Installing some developer tools: $ sudo apt-get install build-essential cmake pkg-config The pkg-config package is very likely already installed by default, but just in case, add it in as well. The cmake program is used later to compile OpenCV. ...

October 20, 2017 · 4 min · Simplestory