Month: October 2016

Cheat Sheets — @BruteSpike


What Are Cheat Sheets? Cheat Sheet in literal translation, means cheat sheet. It is very difficult for a programmer to decorate all functions, classes and attributes existing in the various languages that use on a daily basis, so we use cheat sheets to have a reference of what we need time to program.

via Cheat Sheets — @BruteSpike

Advertisements

Show log of MySQL when running query in rails — hungnhot’s blog


When you run query to select, update, insert… in ruby, you can show log realtime when query is running. First, go to MySQL and run: show variables like ‘%log%’; And find record with variable_name = general_log_file and get its value. In case, value is /var/lib/mysql/OFF016.log Then, set set global general_log = 1; Then, open terminal and […]

via Show log of MySQL when running query in rails — hungnhot’s blog

NodeJS ,Restful API build authentication for multiple devices — Sharing Knowledge and programming


1.please install express MVC by using the following url https://www.npmjs.com/package/express-mvc-generator 2. build a server listner that should work for API ,api_app.js /** * * importing all necessary libraries */ var nodemailer = require(‘nodemailer’); var passport = require(‘passport’); var multer = require(‘multer’); var bcrypt = require(‘bcrypt-nodejs’); var async = require(‘async’); var crypto = require(‘crypto’); var express […]

via NodeJS ,Restful API build authentication for multiple devices — Sharing Knowledge and programming

Connect PHP with MySQL and display data rows into HTML table — Amjad Khan


MySQL Database having table name “emp” has records as below, Below is the source code to connect PHP with MySQL:

via Connect PHP with MySQL and display data rows into HTML table — Amjad Khan

Setup PHP Dev Environment on Mac OS X Sierra – Apache, MySQL & PHPMyAdmin — Maltronic.io


Getting the development environment right at the start is vitally important to productive application development. Here we will setup a flexible “LAMP” development environment on the latest Mac Os X, El Capitan. We will focus on keeping the development platform flexible and stable, centrally managing all system & application dependencies. Within a few minutes, we […]

via Setup PHP Dev Environment on Mac OS X Sierra – Apache, MySQL & PHPMyAdmin — Maltronic.io

Script to automatically backup MySQL database — Victor Tommasi


Its obvious to say that so much important to keep your data safe when systems are in production, but there are so many ways to this. Here is a simple and good way to do it. First of all, make a backup folder mkdir /home/backup inside the folder, create bash script file sudo touch backup.sh […]

via Script to automatically backup MySQL database — Victor Tommasi

Using MySQL Load Data Local Infile — SQL code examples


Security Issues with MySQL have resulted in changes to command procedures. An error 1148 is kicked up when load data local infile ‘…’ is used. To avoid this you must start mysql from the command line: $mysql –local-infile=1 -uyourname -ppassword mysql>source projects/utility/mysql2016/create_load_ohlc.sql Once the parameter: –local-infile=1 is set, then the load data local command […]

via Using MySQL Load Data Local Infile — SQL code examples