博文

目前显示的是 十二月, 2017的博文

Why cannot mysqld be found?

In some LAMP server, you may be confused that mysqld service cannot be found. For example, when using the command: > sudo service msyqld restart It just failed and said something like mysqld.service didn't exist. When this happens, please try: >sudo service  mariadb restart Hope this will help.

Trap on the way to use a browserified react script - Invariant Violation: Target container is not a DOM element.

When using a script browserified from a react project, I encountered an error said: Invariant Violation: Target container is not a DOM element. It confused me for a while. After I moved the HTML script label from head to the end of the body , the problem was solved. It seems that when the script was executed, the related dom element had not been loaded yet. Then I tried ready function from jQuery, it also works. So when get this kind of error, try to check the position of the script.

Cheat sheet: Ubuntu 16.04 + NodeJS + React + Grunt + Babel + Browserify Configuration

1. Install NodeJS >sudo apt-get install nodejs nodejs-legacy 2. Create a project using npm >npm init 3. Install React >npm install --save react react-dom 4. Install Babel and plugins > npm install --save-dev grunt-babel > npm install babel-preset-env --save-dev > npm install --save-dev babel-plugin-syntax-jsx The last command line is for JSX which is highly recommended by React. 5.Config .babelrc { "plugins": ["syntax-jsx"], "presets": [ ["env", { "targets": { "chrome": 52, "browsers": ["last 2 versions", "safari 7"] } }] ] } 6.Install Grunt and plugins >npm install -g grunt-cli >npm install grunt --save-dev >npm install grunt-contrib-jshint --save-dev 7. Config Grunt file module.exports = function(grunt) { // Project configuration. grunt.initConfig({ pkg: grunt.file.readJSON('package.j

Use proxy chains to access socks proxy in command line in 3 steps - Linux

Step 1. Install sudo apt-get install proxychains Step 2. Config port sudo vim /etc/proxychains.conf Step 3. Usage proxychains <your command>