Skip to main content

Posts

Showing posts from August, 2016

Search within associative array

Search within associative array this is value -- pc..5 Parent this is column -- $data['user_name'] Array ( [0] => Array ( [id] => 12 [user_name] => Tintin-PC..1 Parent [port] => 744 [ip] => 122.162.235.239 [source] => India [type] => 1 [version] => 1 ) [4] => Array ( [id] => 25 [user_name] => pc..5 Parent [port] => 264 [ip] => 115.249.8.245 [source] => India [type] => 1 [version] => 5 ) array_search('pc..5 Parent', array_map(function($data) {return $data['user_name'];}, $arrayofparents));

How To Set Up vsftpd on Ubuntu

How To Set Up vsftpd on Ubuntu Step One—Install vsftpd You can quickly install vsftpd on your virtual private server in the command line: sudo apt-get install vsftpd Once the file finishes downloading, the VSFTP will be on your droplet. Generally speaking, it is already configured with a reasonable amount of security. However, it does provide access on your VPS to anonymous users. Step Two—Configure vsftpd Once vsftpd is installed, you can adjust the configuration. Open up the configuration file: sudo nano /etc/vsftpd.conf The biggest change you need to make is to switch the Anonymous_enable from YES to NO: anonymous_enable=NO Prior to this change, vsftpd allowed anonymous, unidentified users to access the server's files. This is useful if you are seeking to distribute information widely, but may be considered a serious security issue in most other cases. After that, uncomment the local_enable option, changing it to yes and, additionally, allow the user to w

How to upload file in MEAN Stack

How to upload file in MEAN Stack Do these steps 1. npm install ng-file-upload 2. include ng-file-upload.min.js in your angular index .html 3. Use this example to copy form to your angular page from where u want to upload file. -- http://jsfiddle.net/0m29o9k7/ or http://jsfiddle.net/danialfarid/2vq88rfs/136/ Copy this code outside of any form which is already there: 4. Change this url from example code to where you want to upload files -- url: 'https://angular-file-upload-cors-srv.appspot.com/upload', 6. In your server.js or app.js which ever you are using as (node server.js) to start app add these lines     var crypto = require('crypto');         var mime = require('mime');         var multer  = require('multer');                     var storage = multer.diskStorage({           destination: function (req, file, cb) {             cb(null, 'app/app-content/images/')           },           filename: function (req, file, cb) {