博文

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

MongoDB study note (2): security configurations - Setup username and password, Bind interface and Iptables (on Ubuntu 16.04/mongoDB 3.4)

Setting up username and password First, check your /etc/mongod.conf to confirm it is not in the auth mode. Add comment symbol '#' of the following code and restart mongod service: #security:   #authorization: enabled sudo service mongod restart Then, Connect to local mongodb: mongo --port 27017 Switch to admin database: use admin Create admin user: db.createUser({ user: "admin", pwd: "<your password>", roles: [{ role: "userAdminAnyDatabase", db: "admin" }] }) Grant Roles: db.grantRolesToUser('admin',[{ role: "root", db: "admin" }]) Check if successfully added (should return 1): db.auth("admin", "<your password>") Exit mongo client: exit Enable the auth mode in your /etc/mongod.conf by activating the following lines and then restart the service: security:   authorization: enabled sudo service mongod restart Go back to

MongoDB study note (1): Installation and Run (on Ubuntu 16.04/MongoDB 3.4)

Installation Command list: (Ubuntu 16.04 for example. Other systems please refer to https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/) sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6 echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list sudo apt-get update sudo apt-get install -y mongodb-org Run Command list: sudo service mongod start

Special effects for html using JS and CSS

This page may not work because the restriction of the Blog theme. Please use your browser to inspect the code. Thank you! Magic Letterfall Mad Rotating Letters Mad Scaling Letters

How to deal with the ERROR: D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open “/var/lib/dbus/machine-id”

After I deployed the scrapy-splash, I ran my spider and encountered an ERROR: D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open “/var/lib/dbus/machine-id” It seemed that no affection to the results but really annoying. After I tried a few solutions from Google, finally I solved it with this command: dbus-uuidgen > /var/lib/dbus/machine-id Good Luck!

Symbols in the version field of package.json

You may have seen something like the following code before in package.json and may be puzzled about the symbols like '<>~^'. Code: { "dependencies" : { "foo" : "1.0.0 - 2.9999.9999" , "bar" : ">=1.0.2 <2.1.2" , "baz" : ">1.0.2 <=2.3.4" , "boo" : "2.0.1" , "qux" : "<1.0.0 || >=2.3.1 <2.4.5 || >=2.5.2 <3.0.0" , "asd" : "http://asdf.com/asdf.tar.gz" , "til" : "~1.2" , "elf" : "~1.2.3" , "two" : "2.x" , "thr" : "3.3.x" , "lat" : "latest" , "dyl" : "file:../dyl" } } Here are the definitions I found in https://docs.npmjs.com/files/package.json . version  Must match  version  exactly >version  Must be greater than  version >=version  etc <version <=versi