Installing VSFTPD on Ubuntu 14.04 Amazon EC2 Instance

Install the server.

sudo apt-get install vsftpd

Note: I had a brand new server and needed to run sudo apt-get dist-upgrade before installing the server to get all packages up to date.

Let's check to make sure the server is up and running before making any changes.

sudo netstat -a | grep ftp

If you see this after running the netstat command then life is good. If not, you'll need to troubleshoot why the server is not starting.

Drupal Module - QR Code Generator

I created a simple Drupal module that will allow someone to enter in their contact information and generate a QR code that can then be scanned in to quickly and easily add someone's information to their address book.

There is a dependency to the Chart Module that uses Google's API to generate the QR code image.

There is a demo you can check out here to generate your own: QR Code Generator

Simple IPTables Commands

For the life of me I can't seem to remember these simple commands to edit IPTables so I just wanted to document the few that I seem to be using the most:

View current rules
View a list of current rules
iptables -L

Insert a new rule
This will insert a new rule in the INPUT chain in the number 5 slot:
iptables -I INPUT 5 -p tcp --dport [port] -j ACCEPT

Insert a new rule and allow only from specific IP address
This will insert a new rule in the INPUT chain in the number 5 slot and only allow a connection from the IP address specified:
iptables -I INPUT 5 -p tcp -s [ip address] --dport [port] -j ACCEPT

Delete specific rule
This will delete rule number 5 from the list. Change the 5 to whatever number you need to delete
iptables -D INPUT 5

Save rules to a file
Make sure to save the rules to a file so they are applied upon boot. Note that I needed to use the "sh -c" option for sudo or you will get a permission denied error

Backing up drupal sites with AutoMySQLBackup and Duplicity

Once everything is up and running smooth on the drupal site it is time for the warm fuzzy feeling of backups. Naturally, everyone has their own way of doing things and mine is to use a script called AutoMySQLBackup in conjunction with Duplicity and Amazon S3.

So what does this exactly do?

AutoMySQLBackup runs to take a dump of the database everyday and store the resulting files on the server. This gives me a complete snapshot of the database sitting on the server waiting to get backed up.

Duplicity takes care of compressing and securely transferring these database snapshots (as well as all other website files) offsite. In this case I decided to use Amazon S3 for offsite storage. Duplicity has a built-in protocol to transfer these files directly to Amazon S3 and makes it pretty simple.

AutoMySQLBackup

Move Drupal Site to Another Server Via Command Line

There are many times, for one reason or another, that I need to transfer a Drupal website from one server to another. I was used to using tools like Filezilla and phpMyAdmin to get most of the heavy lifting done, but after doing this many times I've found the command line to be my friend.

I use linode.com so I know how my server is configured, what's installed, and more importantly have shell access. If you use a shared host this guide/checklist probably won't help you out too much.

To prep the site I do a couple of quick changes:

  • Set to offline mode to prevent any more changes taking place in the database
  • Turn off caching/compressing mechanisms and flush all caches

Once those are done, here are the steps I use to transfer the site:

In my case the folder structure is usually set to something like the following:

/home/user/www/example.com
  /cgi-bin
  /htdocs
  /logs

Drupal Kiva Module

I've been using Drupal for quite a while (since verion 4.x) both as a hobby and building websites for clients.

Most of the stuff I've done has been configuration of available modules coupled with my own personal module and theme tweaks, but never anything public to the community. Now I've decided to get more involved and am the co-maintainer (along with CrookedNumber) of a new kiva module that aims to integrate Drupal with the Kiva API.

Currently, we have a block module that can be configured to display loans based on settings the user provides as well as an add-on parser module to Feedapi (which I'm really excited about). We're still in the initial development stage, so if anyone has ideas or feature requests please let us know.

Miscellaneous Dropbox Uses

When I first heard about dropbox I thought, "oh, here's another file sharing service...great." Boy was I wrong - what a simple and useful service. I won't go into the basic uses of the software - those have been documented enough. I'd like to explore the more "clever" uses that are possible.

From browsing around, this article sparked my interest in what else was possible. Here are a few different ideas:

  • SnagIt output. If I want to have my SnagIt screenshots automatically synced between computers why not create a profile that automatically puts it in the drop box? Better yet - create a profile to automatically drop your file in the public folder to easily share screenshots online.

Proftpd and Mysql

I recently had to setup FTP access on one of my servers which is running Ubuntu 8.04. I decided to go with proftpd tied in with MySQL for authentication. There were a couple of bumps and bruises along the way, but I was able to find some great resources to help me get it setup. That being said, I learned a couple of things along the way that weren't listed in the other tutorials I looked at so I though I would document the steps I used to create my FTP server.

Logmein ActiveX Registry

I ran into a problem with LogMeIn where I couldn't access my remote/target computer through ActiveX connections - only through the Java connection. When I tried to connect through ActiveX I would get access to the desktop and then after a couple of mouse clicks LogMeIn would "freeze up". I couldn't click on the screen to open programs, close windows, etc.

From talking to LogMeIn support they said a possibility was that I was doubled NAT'ed and Java was better at negotiating those type of connections. I knew that wasn't the case because I only had 1 router in between the connection.

It turns out there is a registry key that can be edited so you longer experience LogMeIn freezing up when connecting through ActiveX. I really prefer the ActiveX connection because it gives you more options and seems to work a lot quicker (especially upon first connect).

So, if you are experiencing the same problem where ActiveX is not working, but Java is, try editing the following registry key: