Posts

Showing posts from September, 2017

Google chrome installation in ubuntu 14.4 by terminal command

1-> wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -  2-> sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'  3-> sudo apt-get update  4-> sudo apt-get install google-chrome-stable

Google Login Adding In Laravel

.env file: GOOGLE_LOGIN_CLIENT_ID= 4682799 66203- 3c47dfkknjj28irumub6c7vtp3dph2 oq.apps.googleusercontent.com GOOGLE_LOGIN_SECRET_KEY= vfXcMYMWPHkR3wjKhVikaCDY composer.json file :  "laravel/socialite": "^2.0" composer update config/app.php file: Provider: //  Laravel Auth Login service provider         Laravel\Socialite\ SocialiteServiceProvider:: class, Alias: // Socialite         'Socialite' => Laravel\Socialite\Facades\ Socialite::class, config/services.php file: 'google' => [         'client_id' => env('GOOGLE_LOGIN_CLIENT_ID'),         'client_secret' => env('GOOGLE_LOGIN_SECRET_KEY') ,         'redirect' => ' http://localhost:8000/auth/ google/callback ',     ],

MongoDB Auth User DB Access ACL

CASE 1 : Red Hat Server  Directory : /etc/mongod.conf Before : #security : Before :  security:     authorization: enable CASE 2 : Other Linux Directory :  /etc/mongod.conf Before :  #auth=true After : auth=true

Linux Terminal Commad (Move,Delete,Edit,Rename)

Move sudo su mv /home/your-local-file.txt /your-server-destination-path/your-local-file.txt Edit vim mongod.conf :qw or :q Delete rm x_mongod.conf Rename mv mongod.conf x_mongod.conf

Auth User From Terminal to access MongoDB Database

mongo -u userName -p userPassword localhost/databaseName

MongoDB Connection From PHP

By Authenticate User :  $user = 'testUser'; $pass = '123456'; $connection = new MongoClient("mongodb://${user}:${pass}@localhost", array("db" => "testDB")); Without Authenticate User: $host = 'localhost'; $nidCollection = 'nids'; $connection = new MongoClient("mongodb://{$host}"); $db = $connection->nidservice; $COLL_nid = $db->$nidCollection;