Monthly Archive: March 2014

Jquery Logo 0

Extending Jquery

This post explains how you can use your own javascript code along with Jquery by extending it So you have a function, lets say function blast(){ pullTrigger.init(); } Now your init function needs some jquery related function, so are you gonna write those from scratch… No lets take advantage of people who already wrote Jquery. OOPS ┬áis your friend. Now all you need to do is this: jQuery.fn.extend({ blast: function() { return this.each(function() { this.checked = true; }); } }); // Use the newly created .blast() method $(“#bomb”).blast(); Note:Leave your comments below, or shoot me at ankitsinha611@gmail.com Ankit Sinha

Install FTP on EC2 Intance 0

Install FTP on EC2 Intance

Step #1: Install VSFTPD sudo apt-get install vsftpd Step #2: Open up the FTP ports on your EC2 instance Log in to AWS management Console, go to EC2 Instance, select Security Group from Dashboard and add a port range 20-21. If FTP is not present just make it a custom rule. Add & Save. Step #3: Make updates to the vsftpd.conf file Edit your vsftpd conf file by typing: > sudo vi /etc/vsftpd/vsftpd.conf or >sudo nano /etc/vsftpd.conf (USE THIS) Disable anonymous FTP by changing this line: anonymous_enable=YES to anonymous_enable=NO Then add the following lines to the bottom of the vsftpd.conf file: pasv_enable=YES pasv_min_port=1024 pasv_max_port=1048 pasv_address=<Public IP of your instance> Your vsftpd.conf file should look something like the following – except make sure to replace the pasv_address with your public facing IP address: Step #4: Restart vsftpd Restart vsftpd by typing: > sudo /etc/init.d/vsftpd restart or >sudo service vsftpd restart You should see a message that looks like: Step #5: Create an FTP user If you take a peek at /etc/vsftpd/user_list, you’ll see the following: # vsftpd userlist # If userlist_deny=NO, only allow users in this file # If userlist_deny=YES (default), never allow users in this file, and # do not even prompt for a password. # Note that the default vsftpd pam config also checks /etc/vsftpd/ftpusers # for users that are denied. root bin daemon adm lp sync shutdown halt mail news uucp operator games nobody This is basically saying, “Don’t allow these users FTP access.” vsftpd will allow FTP access to any user not on this list. So, in order to create a new FTP account, you may need to create a new user on your server. (Or, if you already have a user account that’s not listed in /etc/vsftpd/user_list, you can skip to the next step.) Creating a new user on an EC2 instance is pretty simple. For example, to create the user ‘bret’, type: > sudo adduser bret > sudo passwd bret Here’s what it will look like: