$ SELECT User FROM mysql.user;
###Enable remote access to mysql For MySQL < 5.7
$ sudo nano /etc/mysql/my.cnf
For MySQL 5.7
apt-get -y update | |
apt-get -y upgrade | |
apt-get -y --force-yes install make unzip g++ libssl-dev git xvfb x11-xkb-utils xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic x11-apps clang libdbus-1-dev libgtk2.0-dev libnotify-dev libgnome-keyring-dev libgconf2-dev libasound2-dev libcap-dev libcups2-dev libxtst-dev libxss1 libnss3-dev gcc-multilib g++-multilib | |
npm -f init | |
npm i -S nightmare | |
xvfb-run nodejs index.js |
###Using Node.js as server with Express
Step 1: Install Express
$ npm install express
Step 2: Create a file named server.js with the following code:
var express = require('express');
var app = express();
app.use(express.static(__dirname)); //serve static files
###Using node.js as a simple web server that will serve static files
You can use Connect and ServeStatic with Node.js for this:
Step 1: Install connect & serve-static packages
npm install connect serve-static
Step 2: Create server.js file with content
var connect = require('connect');
var Xray = require('x-ray'); | |
var x = Xray(); | |
x('https://www.yelp.com/biz/bottega-louie-los-angeles', 'ul.ylist li .review--with-sidebar', [{ | |
reviewer: '.user-name .user-display-name', | |
reviewer_location: '.user-location b', | |
review_rating: '.rating-very-large meta[content]@content', | |
review_date: '.rating-qualifier [content]@content', | |
review_content:'.review-content p' | |
}]) |
var Xray = require('x-ray'); | |
var x = Xray(); | |
x('https://www.tripadvisor.com/Hotel_Review-g60763-d93545-Reviews-The_Manhattan_at_Times_Square_Hotel-New_York_City_New_York.html', '#REVIEWS .reviewSelector', [{ | |
reviewer: '.username.mo span', | |
//ajax_link:'div#most_recent_pager div .pam.uiBoxWhite.noborder.uiMorePagerPrimary@href' | |
reviewer_location: '.location', | |
//review_rating: '.rating-very-large meta[content]@content', | |
//review_date: '.rating-qualifier [content]@content', |
# Compiled source # | |
################### | |
*.com | |
*.class | |
*.dll | |
*.exe | |
*.o | |
*.so | |
# Packages # |
git init
git commit -m "Intial commit"
//Resource: http://www.pontikis.net/blog/how-to-use-php-improved-mysqli-extension-and-why-you-should | |
/*MySQLi supports two tpe of APIs | |
1. Procedural (NOT RECOMMENDED) | |
2. Object Oriented API | |
*/ | |
/********************connecting to database******************************/ | |
//Procedural | |
$conn = mysqli_connect($dbServer,$database, $username, $password); | |
if(mysqli_connect_errno()){ |
$_GET | |
$_POST | |
$_SERVER | |
$_COOKIE | |
$_SESSION | |
$_FILES |