Monday, October 22, 2012

How To: LAMP (Linux, Apache, MySQL, PHP) server on Amazon EC2

There are several articles out there outlining the process of getting a LAMP server up and running on Amazon's Elastic Cloud (EC2) service, but most of them seem to be missing some small caveats as well as a couple additional features I wanted my instance to have like FTP access, and VNC access to a GUI as well. Lets get started!

Table of Contents
1. What is this?
2. Prerequisites
3. Create a new server instance
4. Install & Configure Apache, PHP, & MySQL
5. Install & Configure VSFTP
6. Configure Putty to authenticate to your server (optional)
7. Install & Configure VNC
8. Install & Configure Dropbox
9. Resources

1. What is this?
Amazon's EC2 service allows you to host a virtual machine to configure any way you like. You are charged based on your resource consumption at very low rates making this a great way to set up a free hosting account for a small personal site, or even host sites for small business clients if you develop websites professionally. You can choose what operating system you would like to put on your server instance.

2. Amazon EC2 Prerequisites
- If you don't have an Amazon Web Services account you will of course need one. Head over to Amazon Web Services and sign up.
- You'll need java installed to use the web based ssh client to communicate with your instance after it is installed.
- You will probably want a good ftp client to make transferring files to your new web server nice and easy.

3. Create a New Server Instance
There are many ready made LAMP instances available that may reduce your setup time, but this guide is about setting this up exactly how we want it, so we will go with a plain old Ubuntu server and do each step ourselves. Once you've created your instance you will need to find your public DNS address. This will be used several times throughout this process so keep it handy. 

The public DNS address may change under certain circumstances, so it is best to associate an elastic IP address to your instance.

Before going any further you need to know about Amazon's security groups or you will not be able to connect to your server via the web. The EC2 service has an external firewall that will block incoming and outgoing traffic by default unless those ports are opened up. This is done using security groups. Create a new security group and open up the following ports:

20, 21, 22, 80, 9000, 50000 - 51000

This is what my security group looks like:

You will also need to create a Key Pair. This will be used for authentication and is required. From the EC2 management console, click key pairs on the left, and click 'create key pair'. You will need to save the generated .pem file on your computer in a place you will not lose it. This same file will be used for every instance you create (If you lose it you can always generate a new key pair).

Now that we have the security groups and the key pair taken care of, go back to 'instances', right click on your instance and choose 'connect'. Make sure your username is set to 'ubuntu' and click 'Launch SSH Client. Once we have a shell prompt, the first thing we want to do is update the packages installed that may be outdated. To do this, simply type:

sudo aptitude update && sudo aptitude dist-upgrade
Now we need to reboot the server before moving forward with installing our web server components:

sudo reboot
4. Install & Configure Apache, PHP, & MySQL

To Install, execute the following command from the shell:

sudo aptitude install apache2 php5-mysql libapache2-mod-php5 mysql-server
Note: During the install, you will be asked for a mysql password. KEEP TRACK of this password, you will need it later when we install PHPMyAdmin for easy mysql administration.

Once these packages are installed, open a browser and go to your instance address (you can use either the public DNS address, or an IP address if you have assigned one)
Ex: -OR-

If all is right in the world you will see "It Works!" in your browser indicating our web server is now up and running. 

If you'd like to test PHP, using your favorite text editor, create a new file called test.php. I'm using nano.

sudo nano /var/www/test.php
Type this into the file:

<?php phpinfo(); ?>
Press control+x, press Y when prompted to save and click press enter.

Note: If you receive an error saying you cannot save the file you will need to set the permissions on the var/www/ directory which is explained a bit later in this tutorial (FTP section).

Once you have your test.php file saved, just navigate to the php test page in your browser. Ex: . You should see a php info page detailing the PHP configuration.

Now we're ready to install PHPMyAdmin which we will use to easily administer MySQL databases.

sudo apt-get install phpmyadmin
At this point it's a good idea to turn on the firewall to harden security a bit. Ubuntu comes with an 'uncomplicated firewall' that can be toggled on and off very easily. Lets turn it on:

sudo ufw enable
Now that firewall is on open up ports 22 and 80. If you want to install FTP you'll also need exceptions for 20, 21, 51000, and 5000. If you're going to enable VNC then you should also allow port 9000. The last two ports can actually be in anything you want so long as it isn't interfering with any other services. These ports are used for passive FTP configuration which we will be using in this tutorial). execute these commands to make your firewall exceptions:

sudo ufw allow 22
sudo ufw allow 80
sudo ufw allow 20
sudo ufw allow 21
sudo ufw allow 9000
sudo ufw allow proto tcp to any port 50000:51000
If you'd like more details on the uncomplicated firewall see the Ubuntu guide on the matter:

5. Install & Configure VSFTP
You can do this with other ftp servers but the commands below will differ of course. I chose to use vsftpd (or the Very Secure FTP Daemon).

First, we install the package:

sudo apt-get install vsftpd
Now there are several changes we need to make to the configuration file to get this working correctly with amazon's EC2.

First, we need to edit /etc/vsftpd.conf and set some variables.

sudo nano etc/vsftpd.conf
 You'll be looking at a list of configuration settings for vsftpd. We need to turn on a couple that exist and add some others that do now. Find the local_enable and write_enable settings and turn them on by uncommenting them (remove the # at the beginning of the line).

Add these settings to the bottom of the file. (Again if you don't know your server's IP address you can find it by right clicking your instance in EC2 and choosing connect):

Now restart vsftpd:

sudo /etc/init.d/vsftpd restart 
You can also use (or just "sudo service vsftpd restart" if you have it configured to run as a service already)

Now we need to create a user to use for logging in via ftp:

sudo adduser YOUR_USER_NAME
Follow the prompts and that's it for creating a new user. But now we need to give the new user permissions to write to the www directory:

sudo chown -R USERNAME /var/www
sudo chmod -R 777 /var/www
From here I went ahead and rebooted for good measure although it may not be necessary. Now launch up your FTP client (I'm using FileZilla) and make sure you can connect, upload files, and overwrite files.

6. Configure Putty to Authenticate on EC2
This process entails using puttygen to import your .pem file from your keypair we set up earlies, and converting to a putty key file. There are also a couple settings you want to change such as the username to use (ubuntu). This is pretty well covered elsewhere so I'll just provide the link here. Just keep in mind I was unable to use Amazon's DNS name for my server, but it worked for me using the elastic IP instead:
Putty connect instructions (must use elastic ip not host name!).

One other helpful tip I found was to make sure and set a root password. After setting up putty I was able to log in as my new user automatically with no problem, however I couldn't run any privileged commands because it would prompt me for a password. The simple fix is to go back to the web based client where you already have proper privileges and run this command to set your root user password:

sudo passwd root
7. Install & Configure VNC
As with most cloud hosts, Amazon's Elastic Compute Cloud (Amazon EC2) offers only Secure Shell (SSH) access by default to Linux cloud servers. But if you aren't a command-line fan or your application requires a GUI, you can set up remote desktop access to most Linux cloud servers.

First Install the gnome desktop manager:

sudo apt-get install gnome-core
Next install the VNC server itself:

sudo apt-get install vnc4server
Now we set a password by simply typing:

The password cannot be longer than 8 characters. Once the password is set, we want to stop the server:

 vncserver -kill:1
Next, configure the VNC xstartup file so you'll see the desktop when connecting via VNC. Enter nano .vnc/xstartup.

Edit the file until it looks like this:

# Uncomment the following two lines for normal desktop:
#exec /etc/X11/xinit/xinitrc
gnome-session --session=gnome-classic &

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
#x-terminal-emulator -geometry 1280x1024+10+10 -ls -title "$VNCDESKTOP Desktop" & 
#x-window-manager &
 Save the file and exit. Start the VNC server back up:

 vncserver -geometry 1024x600
Now go ahead and try to connect using you favorite VNC client such as Tight VNC. In the remote host field you will need to add a :1 like this:

Now we need to configure vncserver to start every time the EC2 instance boots up. We need to add an entry in the init.d folder. If you're unfamiliar, the etc/init.d directory is where Linux stores various start / stop scripts for services. We will be adding one to start the vncserver and use the .conf file we just created.

sudo touch /etc/init.d/vncserver
sudo chmod +x /etc/init.d/vncserver
sudo nano /etc/init.d/vncserver
Paste the following code into our new the init.d script. Notice on line 8 our default username 'ubuntu' is there. If you're using a different username this will need to be changed.

# Provides: vncserver Required-Start: networking Default-Start: S 
# Default-Stop: 0 6
# The Username:Group that will run VNC
export USER="ubuntu"
# The display that VNC will use
# Color depth (between 8 and 32)
# The Desktop geometry to use. GEOMETRY="x" 
# The name that the VNC Desktop will have.

OPTIONS="-name ${NAME} -depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}" 

. /lib/lsb/init-functions 

case "$1" in 
log_action_begin_msg "Starting vncserver for user '${USER}' on localhost:${DISPLAY}" 
su ${USER} -c "/usr/bin/vncserver ${OPTIONS}" 

log_action_begin_msg "Stoping vncserver for user '${USER}' on localhost:${DISPLAY}" 
su ${USER} -c "/usr/bin/vncserver -kill :${DISPLAY}"

$0 stop 
$0 start 
exit 0
Run the vncserver command once more.


And finally, we need to run this command to add our init.d script to system startup:

sudo update-rc.d vncserver defaults 99
Now restart the service:

sudo service vncserver restart
8. Install & Configure Dropbox
The goal here is to allow me to edit files right in my dropbox from my home PC or mobile phone and have those changes automatically sync to my server's var/www directory making the changes live without the need for manually transferring files via FTP. This has also been pretty well documented so I'll simply share a link if you're interested in taking this additional step.
Set up DropBox Selective Sync on Ubuntu EC2

9. Resources
Putty connect instructions (must use elastic ip not host name!):

Thursday, May 3, 2012

Mayan Calendar Predicts Renewal of 100 Year Federal Reserve Charter?

There is a rumor traversing the echo chamber claiming the Federal Reserve's charter with the US government is set to expire on Dec 23, 2012... just as the final pages are ripped from the Mayan calendar. I can appreciate the wishful thinking... but unfortunately, this belongs in the non-fact category.  The original Federal Reserve Act of 1913 was bound by a 20 year expiration date on the authority of member reserve banks 1. So where did the 100 year rumor come from? It was the Act of July 1, 1922 which changed the expiration to 99 years from the date of organization 2.  This myth would have held true had it not been for the Act of Feb. 25, 1927 which made the Federal Reserve's power over our monetary policy perpetual 3. Today, only an act of congress can dissolve the Fed.

If it hadn't been for that last amendment, we might have been full swing into a global discussion about renewing the most ambitious wealth siphoning system in history. Unfortunately, the amendment exists and the power of the fed has no such expiration date.

Is this really so bad?

To answer that question, lets take a look at the last 100 years of fractional reserve banking and you can judge for yourself. For those of you who would rather watch a cartoon instead of reading boring posts about our country's economic foundation... I've got you covered:

For the rest of you... lets dig a bit deeper...

How it started...
The push for a centralized banking system began well before our nation was founded. Prior to the establishment of the United States, the big bankers were much more up front about their deceptive banking practices. Take for example the quote often attributed to Mayer Amschel Rothschild... "Let us control the money of a country and we care not who makes its laws." 4

Many of our greatest national leaders opposed the banking institutions and feverishly condemned their involvement with monetary policy and specifically the issuance of currency for fear of the abuse that would accompany it. Among these men were Thomas Jefferson, Abraham Lincoln, Andrew Jackson, and many others.

Our story, for the purposes of brevity, begins with the first time our currency was devalued under the banner of financial stability. The Federal Reserve Act was signed into law in 1913 by Woodrow Wilson, and it was about as "Federal" as Federal Express. A cartel of 12 privately owned banks were to take control of the nation's monetary policy. Most notably, this act allowed for the expansion of money supply beyond our nation's holdings in physical reserves. Although it was a pivotal moment in our country's history, it was not nearly as powerful as the Fed we tolerate today. The Fed of 1913 was severely limited, not only by the 20 year expiration date mentioned earlier, but by physical gold reserves. Even at a time when we first began to dabble in the abandonment of hard currency, we still had the good sense restrict the dangerous power of artificially inflating the money supply. To prevent over-inflation, the Fed was only allowed to expand money supply to a percentage above the nation's holdings of physical gold. This act, like the Aldrich-Vreeland Act before it, and the many revisions to the National Currency Act before that, was a mere stepping stone toward the modern monetary monster we know today. If the banks were to have the power they sought, they would have to bastardize hard currency and pry it from the dollar at every opportunity. This is exactly what they did.

As people were slowly introduced to the new financial system, they began to hold gold in events of financial uncertainty. This was exactly what people had done for centuries in order to shield themselves from the devaluation that occurs as the money supply is expanded. The banks knew they needed to eliminate the culture of gold holdings. It wasn't long before the attack on gold and silver based currency continued.

Executive Order 6102
On April 5th, 1933, President F. D. Roosevelt signed Executive Order 6102 "forbidding the hoarding of gold coin, gold bullion, or gold certificates within the continental United States". This order literally criminalized the possession of monetary gold by any individual, forcing everyone into the new system regardless of their position on monetary policy.

Although by this point the bankers had made great strides toward controlling the US monetary system, there was still a faction of opposition within our government.

Executive Order 11110
Fast forward to June 4th, 1963. JFK authorized the US Treasure to begin printing a new form of silver certificate. $4 billion worth (roughly $30 billion in today's dollars), free of debt, free of interest, redeemable for hard silver reserves. These certificates would not involve the fed at all and would compete with the traditional federal reserve note. 5 Months later, on November 22, 1963 Kennedy was assassinated. Less than 3 months after Kennady was buried the executive order was derailed in March of 1964 when Secretary of the Treasury C. Douglas Dillon halted redemption of silver certificates for silver dollars. The new reserve notes were removed from circulation and destroyed with the exception of the few remaining samples held by collectors.

JFK was an opponent of institutional secrecy, an ingredient fundamental to the survival of the Fed by their own admission (more on this later). He was in clear and direct opposition to secret organizations, and made that abundantly clear in a well known speech made two years before his assassination.

We're All Keynesians Now
Unfortunately, Richard Nixon was not among the list of the few courageous men who publicly denounced the abusive monetary system. In a famous speech by Nixon in 1971, it was declared to the world that we had completed our transition from a responsible currency to a system comprised of mythology, theft, and secrecy. Ironically, Nixon's stated intent was to "defend the dollar".

..."the overwhelming majority of Americans who buy American made products in America, your dollar will be worth just as much tomorrow as it is today."

So was Nixon right? According to the published consumer price index figures over time, one dollar in 1971 has the purchasing power of only $0.18 in today's world 5. This was the result of only 40 years of completely decoupling gold from our dollar.

I Must be a Conspiracy-loving Paulbot Moron
Many will argue that wages have increased at the same rate, and so the devaluation is non existent in real terms... but is that really true? In short, maybe the Mayans were onto something after all...

Chart Source: TPM

As you can see, something occurred in the early 70s that changed the direct relationship between productivity and compensation. We began to develop a gap that seems to under-compensate workers, and the gap is growing very rapidly. Could it have been Nixon's abandonment of gold backed currency combined with the Fed's persistant expansion of our money supply? 

Many will tell you the flexibility provided by the Federal reserve's ability to introduce new money into the system has saved us from imminent financial disaster. Others, including myself, will look at the world around them and call bullshit.

To defend the fractional reserve banking system, you must make several leaps of faith that I am not prepared to assume. The most important of which comes down to the secrecy of the fed (although the politically accepted term has become "the independence of the Fed").

In order to defend this system, you must accept that the individuals granted such massive financial power do not need to be completely transparent or accountable in order to operate in the best interests of the people. You must simply trust that they are behaving responsibly. This is because no government official has the authority to peak behind the curtain and completely Audit the Federal Reserve. In fact, the fed is owned by a group of shareholders whose identities are not publicly known. The Fed of course claims all of this keeps you safe from the meddling of your pesky elected representatives, but how can we ever come to any proper conclusion without all of the information? I'm starting to understand what Kennedy was talking about.

And now, for the grand finally. I have uncovered a massive plan to replace the dollar. In fact, the notes have been drafted and kept secret from the public... until now. It looks as though they have decided to stay with the lovely color scheme we have all come to know so well, but have reduced the size of the bills by about 40% to save paper and ink. Introducing the world's new reserve currency:

So, which of the two fathers of economic theory do you believe?

1Federal Reserve Act of 1913 (P.L. 63-43, 38 STAT. 251, 12 USC 221)
2Standard Catalog of United States Paper Money 30th Edition, ,George S. Cuhaj, William Brandimore, p. 279
3Standard Catalog of United States Paper Money 30th Edition, ,George S. Cuhaj, William Brandimore, p. 279
4 - Rural Credits - Joint Hearings Before the Subcommittees on Banking and Currency of the Senate and of the House of Representatives Sixty-third Congress, Second Session, Washington Government Printing Office, 1914
5 - Inflation Calculator - Dollar Times -

Tuesday, February 14, 2012

Large Scale Election Fraud in Maine Caucuses

The other day, I woke up and checked the final results from the Maine Caucus that went on the night (and entire week) before. I'm afraid what I found was what looks like the most blatant case of election fraud I have ever witnessed. I'm going to summarize what happened as best as I understand it at this point, who is responsible, who was cheated out of their vote and what they can do about it.

Big story: 140 Towns Unaccounted For? Maine GOP Chair Charlie Webster Calls the Win Anyway. When he receives push-back from the media and local officials, he sticks to his guns saying they will discuss it in March (after Super Tuesday of course) to decide if they will include the neglected votes.

Side story: Totals reported found to be incorrect on multiple occasions as reported by Caucus leaders, either due to addition errors, or just plain wrong information. See breakdown below.

Side side story: Some officials in Maine are speaking up. Washington County commissioner Chris Gardner is pushing the GOP to count the votes there. State Senate President Raye is demanding the votes be counted. Charlie Webster is insisting they will not count toward the official total.

Update: 2/18/2012
The GOP in Maine has released a new set of results. I've compiled a spreadsheet to more easily compare the results:

County by County Problems List
  • Androscoggin
    • No problems I'm aware of
  • Aroostook
    • Results not broken down by town so we have no way of knowing if some towns were not counted like in the other counties. Aroostook was the only county Ron Paul won in 2008. He won again this year but we cannot verify that there were not towns missing without the results broken down as they should be.
  • Cumberland
  • Franklin
    • Avon (2 votes in '08), Carthage (2 votes in '08), Coplin, Dallas, Eustis, Madrid, Phillips (2 votes in '08), Rangeley, Sandy River, Wilton (10 votes in '08) - zero votes reported by GOP
  • Hancock
    • Amherst, Aurora (6 votes in '08), Castine, Cranberry Isles, Eastbrook (2 votes in '08), Franklin, Frenchboro, Gouldsboro, Great Pond, Hancock (19 votes in '08), Lamoine, Mariaville, Osborn, Sorrento (5 votes in '08), Stonington (3 votes in '08), Sullivan, "T3 ND Part of"?, Waltham, Winter Harbor - zero votes reported by GOP
    • Apparently 10 towns in Hancock were also postponed just like they were in Washington County. Hancock county as a whole received 263 votes in 2008. There are already 315 votes in Hancock being reported indicating a much higher turnout in the county this year.
  • Kennebec
    • Clinton, Rome (3 votes in '08), Vienna (1 vote in '08), Waterville (53 votes in '08), Wayne - zero votes reported by GOP
    • Waterville - +16 votes for Paul? - From a facebook comment on a Bangor Daily News article: " We were robbed of votes in waterville also! Doctor won the place by 16 votes but maine resiults shows 0! Now you guys be the judge and decide whether there was proven voter fraud in GOP Maine!"
    • China - Official vote total was Romney - 6, Paul - 11, 1 - Santorum, 0 - Gingrich, 0 - Other. totals had a different result:  Romney - 3, Paul - 13, Santorum - 1, Gingrich - 1, TOTAL: 18 (Source)
  • Knox
    • Isle Au Haut, Matinicus Isle, North Haven - zero votes reported by GOP
    • Was this the town with a delayed caucus or was that hancock?
  • Loncoln
    • Boothbay (18 votes in '08) - two line items on GOP sheet, one is all zeros. Were there two caucuses in boothbay or was this just a typo?
    • South Bristol (14 votes in '08), Whitefield (6 votes in '08) - zero  votes reported by GOP
  • Oxford
    • Albany (7 votes in '08), Byron, Gilead (2 votes in '08), Lincoln, Magalloway, Milton (2 votes in '08), Newry (3 votes in '08), Otisfield (15 votes in '08), Stoneham, Stow, Sumner, Sweden, Upton - zero votes reported by GOP
  • Penobscot
    • Alton (2 votes in '08) - Total is wrong. Two votes for paul, one vote for 'other' but a big fat zero in the total column.
    • Bangor - Again Paul bests romney by 10 votes, but the totals column is zero.
    • Burlington, Carroll, Corinth, Drew Plantation, Edinburg, Enfield, Kenduskeag, Kingman, Lakeville, Mattawamkeag, Maxfield, Mount Chase, Passadumkeag, Patten, Penobscot, Plymouth (10 votes in '08), Prentiss, Seboeis, Springfield, Stacyville, Stetson (2 votes in '08), Veazie (10 votes in '08), Webster, Winn, Woodville - zero votes reported by GOP
  • Piscataquis
    • Abbot (4 votes in '08), Greenville (3 votes in '08), Kingsbury, Lake View, Shirley, Wellington (1 in '08), Willimantic (2 in '08) - zero votes reported by GOP
  • Sagadahoc
    • No problems I've heard of
  • Somerset
    • Anson (4 votes in '08), Brighton, Caratunk, Cornville (2 votes in '08), Dennistown (3 in '08), Detroit (1 in '08), Highland (1 in '08), Jackman (1 in '08), Mercer (2 in '08 both for RP), Moscow (1 in '08), New Portland (2 in '08 both for RP), Moose River (1 in '08), Pleasant Ridge (1 in '08), Rockwood Strip, Starks (4 in '08, 3 for RP), The Forks, West Forks
  • Waldo
    • Belfast - +7, +9 or +21 votes for Paul (I've seen this in 3 places with different numbers) - votes from Belfast (largest caucus including 22 towns) . Ron Paul won with 71 votes according to Matt McDonald, the Chairman of the Belfast Caucus. He called the State office and their numbers had Romney winning. By the way, the votes in the Belfast caucus were read publicly.
    • Belfast (37 in '08), Belmont (3 in '08), Brooks (5 in '08), Burnham, Freedom, Islesboro, Jackson (2 in '08), Knox (11 in '08), Liberty (11 in '08), Lincolnville (7 in '08), Monroe (6 in '08), Morrill (4 in '08), Prospect (2 in 08), Searsmont, Searsport (8 in '08, 5 for RP), Swanville (4 in '08), Thorndike, Troy (5 in '08 3 for RP), Waldo (3 in '08), Winterport (14 in '08) - zero votes reported by GOP
  • Washington
    • Washington was postponed due to imminent snow. Turns out the snow storm was miniscule, dropping only a dusting on Washington county, but nevertheless the Caucus totals should still be counted toward the winner right? Wrong. Charlie Webster refuses to allow the final tally in Washington county to count toward the official "winner" of the nonbinding straw vote that has been already been called for Mitt Romney.
  • York
    • Acton (14 in '08) - zero votes reported by GOP

I will be updating this article as more info comes in. Feel free to point me in the direction of any additional info you may have on discrepancies in the figures.

Official Vote Breakdown from Maine GOP -
Vote Breakdown from 2008 -

Wednesday, January 26, 2011

New Android 3.0 Developer Tools Available

To update, run the Android SDK manager, install the new updates from the available updates option.

Don't forget to update your Eclipse plugin! Launch Eclipse, go to Help > Check for Updates and then restart eclipse after installation.

Thursday, January 20, 2011

Painless code syncing from any device with DropBox and GoodSync.



For years I've been manually coding my web applications using Textpad and have recently discovered a way to configure a few tools to work wonders together. The typical process we are trying to streamline goes something like this:
  • While at work, launch my FTP client
  • Download all the latest files from the FTP server
  • Open the files in Textpad on the work pc and edit them.
  • Each time an edit is made, upload the file using your favorite FTP client.
  • Open the browser and refresh the page to check out the results of my new code.
  • When I'm finished, I have to make sure to close any open files.
  • Then on my home PC, I again launch my FTP client
  • Download all the website files to make sure my local copy is up to date.
  • Open TextPad and begin editing files. If I happened to already have some files open, I'll be prompted to reload the file since we just updated them with the new ones from the server.
  • Make sure all files are closed when finished.
  • Repeat again and again for the rest of my life..... or maybe not!
At the end of this process, the files on my work computer are now out of date, and if I forget to download the newest version from the server, I run the risk of overwriting newer files accidentally and will likely proceed to frighten others by loudly exercising my obscenity vocabulary. In addition, every minor change made to the code requires that I flip through several windows to check and see what effect the changes had on the page I'm working on. We are going to resolve both of these issues as well as add another cool feature: the ability to make minor changes automatically from my mobile device using any basic mobile text editor.

Here is the gist of what we're going to do:
  • Configure two computers (or more) to keep website files and folders synchronized.
  • Automatically update the website when changes are saved via FTP.
  • Automatically reload changes made in one location on the other PC(s) if the file was left open.
  • Allow changes to be made from a mobile device, and automatically sync changes with both computers and the web server via FTP.
Warning: It is important you follow these directions in order. Failure to do so could result in the exact problem we are trying to avoid: overwriting new files with old ones. It is recommended that you back up your files until you are able to test and make sure everything is working properly (although I have not have any problems implementing this solution on many devices).

  1. Download Dropbox via this link and sign up for an account! (Please use my referral link to get an extra 250mb of free storage space!). This will designate a folder on your PC to be a DropBox which will automatically synchronize between all PCS and keep a copy in the cloud for you so you never have to worry about losing those files.

  2. Install Drop box on both your computers. In addition, you can install it on your mobile device as well (optional) .

  3. Create a folder inside your DropBox folder called "websites". Create a folder inside of it for each website you would like to sync. Then just copy your various website root directory files into each new folder. Make absolutely sure you are using the most up to date versions of the files.

  4. Download GoodSync and install it on a computer that is always on. It does not need to be installed on both computers. (In fact, installing it on more than one computer could cause some issues since DropBox is synchronizing between computers they could end up with different "Created" and "Modified" timestamps and producing an endless sync loop. I did not test this.)  We will be using GoodSync to update your website via it's FTP sync feature. (Note: You may be able to configure this using a free sync application however I am partial to GoodSync and think it is very well done compared to some of the others I have tried. This site has a few reviews of a couple more popular sync utilities, however the instructions below are specific to GoodSync. If you do use a different sync client, it must support sync via FTP and have the ability to monitor your folders for any changes.)

  5. Configure GoodSync to automatically start when windows does. I also checked 'create left/right sync folders if they are not found' and 'auto hide mini window'. In Tools > Program Options, use the following configuration:

  6. Now we need to configure a sync job in GoodSync. To do this, we will first browse to the folder we want to keep synchronized on the left (Click browse in the upper left hand corner of the window). Navigate to the folder that reflects the root directory of the website you would like to sync (the site folder you created in your DropBox). Next, we need to set up the ftp connection to the web server for this particular site on the right side. Blick browse on the upper right side and enter your host, username and password. Click the "go" button once your info is entered and you will be given a directory listing of the remote server. Click on the root folder that matches the folder you will sync with the folder for that website located in your DropBox. Click ok to get out of that screen and you will see the new sync job listed in GoodSync.

    (Please note that if you have a "websites" folder in your DropBox with multiple websites in it like I do, you cannot sync all of the sites at once since each website will have a different FTP host, path, and credentials. )
  7. Click "Analyze" and make sure it is finding the matching files properly and there are no errors. If everything looks good, click the "Auto" button and tick the box to sync on file change like so:

  8. If you have additional websites you would like to sync, return to step 6 and follow the same process and create new sync jobs for each site.

  9. Now in TextPad go to Configure > Preferences. Click on File on the left, and configure the options like this:

    I change these settings so that if I leave a file open and change it from another location, when I return to the original PC, the updates are reflected without having TextPad prompt me to reload the file. It's all automatic. This of course you will want to do on each PC you will be using to write code. Also I'm sure  there are many other great text editors that support this functionality. Feel free to let me know in the comments.
That's it! So long as GoodSync is running, any changes to a DropBox folder you have configured to sync with GoodSync will automatically be uploaded to your website no matter where the change was made be it at home, at work, or even from your mobile device. I can now edit my website from my mobile phone, ipod, ipad, or any device that supports DropBox without the need to transfer any files at all. Just edit, and save!

I realize there are IDEs out there with plugins that handle much of this as well as text editors with FTP functionality built in, but for me this is the ideal solution. The tools are lightweight and fast (in contrast with many IDEs out there) and once it is configured it is exactly what I wanted.

Hopefully someone finds this as helpful as it was to me =)

Wednesday, September 29, 2010

FBI Wants to Read Your Facebook Messages

Being a programmer and not the biggest fan of government intervention in general due to the unintended consequences it usually delivers, I think this is an awful idea. Imagine that every app that is designed, every website that is built, and every tool that is used to allow people to communicate required additional features to allow the government to decrypt the messages it sends and receives. This would take valuable time to build for each developer, would be incredibly expensive overall and would create a barrier to entry for the little guy who wants to learn to program and release some software. Additionally, it could create new technical limitations for developers and could seriously stifle flexibility in some cases. This is the type of innovation inhibitor the country does not need, especially in our current economic climate.

Also, what's the point? What would stop a terrorist organization from writing their own program that didn't incorporate the government mandated decryption capabilities? How would they even know? The only software and websites that would comply with such a mandate would likely have no need for such a "protection".

Additionally, government already generally has access to this type of data via subpoena. They can already subpoena Verizon for example to get your text messages, or Google to get your chat messages or emails even if the government doesn't have the power to secretly decrypt the messages themselves. This bill would only force the terrorist communication away from mainstream communication methods and into the underground where subpoena power cannot find it.

All of that aside, opening a hole intended for use only by the government would almost inevitably lead to new security risks all over the place exposing personal and privater data to malicious eyes (A.K.A. domestic and international terrorists).

Where is this coming from?
Knowing this, why would the government want to implement such a bill? The only reason I can imagine would be to poke a foot in the door to something the government has wanted for quite some time, and has seen some success at achieving.

With the unique challenges that fighting "terror" (which is really a vague term for anyone who opposes the U.S. in its current form and could potentially do the country or its citizens harm), we have had to sacrifice some of our principles to be effective. Not only have we adopted a policy of "pre-emptive war" with other countries and groups (possibly Iran now too if we aren't careful), but the government has also expressed interest in identifying potential patterns in communication in order to identify 'terror' before it happens. The only problem is they are applying this pattern detection to political groups critical of the government, which happen to be the ones who fight for real change, protest, or push back at big brother at all. The term terrorism was redefined with the passing of the Patriot Act, and today it is quite easy to label a group of fed up citizens who protest government policy as domestic terrorists (see article from the ACLU). Knowing that any citizen who becomes politically involved can be easily labeled a domestic terrorist, passing of legislation like this means those individuals can be spied on legally not only over the phone, text message, email, etc but in private online communities as well. Don't believe the government would label a peaceful political activist as a terrorist? There are already over 1 million names on the terror watch list. What about mistakes?

And even if they pass legislation making it legal only when a warrant is issues, it's not like they haven't taken it too far before:

There are hundreds of videos, documentaries and articles like the ones I've posted here outlining details about how the government has taken their intelligence authority too far. Unfortunately it has often been to the detriment of the American people it is intended to protect.

Update: New related info out today. The EFF's FOIA request shows that internal government memos encourage agents to befriend people on facebook in an effort to receive information about them (without a warrant or even probable cause required of course). Source:

Tuesday, September 28, 2010

The Great Tea Party Hijack of 2010 Chronicled in Video

I'm afraid the new Tea Party movement is a hybrid comprised of
- the powerful force of frustrated Americans who are tired of politics as usual in Washington
- political opportunists, neo-conservatives & career politicians who see these frustrated Americans as a free ticket to political power.

First let me say, I am one of those fed up Americans. I have followed the real roots of the Tea party since it began to gain traction a couple of years ago to its current state. I have seen the principles on which it is founded begin to resonate with the people as many as ten years ago. I want the Tea Party to be a legitimate representation of this, and to exemplify the incredible grass roots movement I have seen break out across the country since some time in 2007. Unfortunately, the only real tea party candidates who truly represent these ideals are not getting the exposure they need to win their races, or are having a tough time sealing the victory, unlike these new "tea party" candidates like Christine O'Donnell in Delaware and Joe Miller in Alaska. I am afraid these candidates are a compromise given to the people by the powers that be in order to calm the rough seas the GOP find themselves in. I'm afraid they may be designed to help the people feel as though they finally have a say in their government only to give them some of what they want while continuing the endless printing of money and distraction of tireless war. These are the principles neo-conservatives hold closest to their hearts.

Who Started the REAL Tea Party?
The Tea Party we see today is a hijacked version of the true Tea Party. To distinguish the two, I will refer to the movement of the real grassroots (the movement I myself identify with) as the Liberty Movement, and the current more mainstream movement as the Tea Party.

For a long time now, the Liberty movement has been festering like a south Atlantic low pressure system in hurricane season. George W. Bush was elected on a platform for non interventionism and no nation building in 2000. Cutting taxes, getting the government out of our hair, these were all things Bush campaigned on. Unfortunately, as we know, he did not follow through on these things (nation building wars in Iraq and Afghanistan, massive stimulus spending, erosion of civil liberties through the patriot act). We got more of the same. Politicians telling us what they knew we wanted to hear:

The Liberty Movement began to take real form during the race for President in 2008 with the grassroots following that swelled up underneath Texas congressman Ron Paul. The grass roots tidal wave was so strong that his supporters (not his official campaign) organized mass donations in large collectives called money bombs. On Dec 16th 2007 Ron Paul's campaign received an astounding $6 million and change ENTIRELY FROM THE GRASS ROOTS. To this day it is the largest single day haul from any campaign. They also rented a blimp that flew up and down the East coast, something that also had never been done in a presidential campaign, and something that was not organized by the campaign itself but by the grass roots supporters alone. This of course is impressive, but the incredible part is that this was done without the large donations from special interest groups and big corporations that the mainstream media's favorite candidates were receiving at the time. Possibly even more incredible is the fact that this was orchestrated at a time when Dr. Paul's campaign was entirely drowned out by a complete media blackout. In fact, even though Paul:
- defeated some front-runners in early primaries

- crushed every presidential internet poll

- earned record breaking support from individuals across the country (even though it was reported as just over 4 million in 24 hours instead of 6 million total)

- won numerous text polls hosted by the national media (which they publicly marginalized)

- and was by far the favorite of major information hubs like Youtube, Digg, and other community based websites
he was minimized by the media at every pass and received a fraction of a percentage of the media coverage given to their favorite candidates, and was not invited to some of the most important Republican primary debates like the one hosted by Fox News in New Hampshire in 2008

Naturally, his supporters became furious and vowed to continue fighting for the sake of the liberty message. When the time came for Paul to back out of the race he realized a movement had begun, and that he should stay involved and continue to stoke the fire that his campaign had started in America. He created the Campaign for Liberty, a political action committee designed to help his grass roots supporters to continue their mission of pushing for Limited government, less taxes, less spending, sound money, less regulation and government intervention in the affairs of Americans, strong national defense without engaging in entangling alliances and unending undeclared wars, and strict protection of our civil liberties granted by the constitution. These are the principles Paul has stood for since he was first elected to congress in 1978. These are the principles at the foundation of the Liberty movement, and they are also the principles adopted in part by the Tea Party in an effort to lure an existing grass roots movement into the fold of a few players seeking to advance their own political power.

The first Tea Parties began to organize. The grass roots recognized the similarities in their principles and began to accept the Tea Party as a route to further the liberty message. Some of the grass roots favorites began to attend Tea Parties. They would speak at these events and naturally the amount of skepticism held by the original grass roots members of the Liberty movement faded. At times, their differences would flare up, but mostly the Tea Party organizers stayed quiet on the topics that would discourage their new found grass roots members and chose instead to focus on their similarities.

Suddenly, the folks who bankrolled many of the tea party events began to fund new Tea Party candidates who were unknowns to the grass roots. When the mainstream media started to announce big upsets in the senate races and the uprising of the Tea Party, the grassroots communities that remained from Ron Paul's presidential campaign and worked tirelessly supporting their own liberty candidates were a bit confused. How is it that they have never heard of Christine O'Donnell?
How were they unfamiliar with Joe Miller?
It is simply because these are results of the 'Establishment' version of the Liberty movement, dubbed the Tea Party. The strategic hijacking had brought the Liberty movement grass roots into the fold and had tricked them into gaining attention for candidates that didn't necessarily agree with many of the core principles Ron Paul had ran on in 2008.

The difference between the two groups are not subtle so far, but with any luck the principles of the Liberty movement will overshadow those of the current Tea Party candidates who seem to be making it into the house and senate. The Tea Party seems more accepting of pre-emptive war under the banner of "National Defense". They generally support the wars in Iraq and Afghanistan and are open to war with Iran (or if they do not support these wars they certainly don't say so publicly).

These new Tea Party candidates tend to be very scant on details. Their websites and interviews proudly boast the easy things like "shrink government" and "cut taxes" but the devil is in the details... details that don't seem to be available to the tea party voters. The modern Tea Party candidates say they would like to cut taxes and shrink government, but they can never seem to articulate what departments would be cut, or where the shrinkage would occur. This has never been a problem for the Liberty movement. They have always been very specific in discussing the details of government waste and what departments we need to rid ourselves of. You certainly never hear them say "End the Fed", which has become a thunderous mantra of the Liberty movement grass roots. You will not hear them question any specific establishment. Instead the message is generalized and vague. To me, these are bright red flags.

The true liberty candidates are having a much tougher time, probably because that establishment money isn't flowing in like it is for the Tea Party candidates who are virtually unknown to the original grass roots community. There have been many grass roots candidates endorsed by Ron Paul. John Dennis is running against Nancy Pelosi in California. This race has had lots of attention from the grass roots because Dennis is a true Liberty candidate completely in line with the Ron Paul principles established during his campaign. Dennis, running in a large state like California, however has not receive anywhere near the campaign contributions that O'Donnell did, and that has everything to do with where the money is coming from. For John Dennis it is coming almost entirely from the grass roots Liberty movement. For O'Donnell it is coming from the wealthy hijackers looking to absorb the liberty movement into the Establishment GOP. Peter Schiff was running in the Connecticut Senate race and was beaten down by a WWE (Wrestling) Executive with boat loads of cash. Again a true Liberty candidate with tons of grass roots support, but just not enough money to make it all the way. Rand Paul having the most name recognition of any Liberty candidate so far managed to win his primary and he may just make it into the Senate, but even Paul has had to face a real uphill battle against Establishment candidates. Other true Liberty candidates include Jake Towne, Clint Didier, and B.J. Lawson, none of which have raised money like O'Donnell has. It goes to show you what kind of power is wielded by the tag team effort of the establishment GOP and the mainstream media.

I'm not saying that this movement as a whole is a horrible thing. I'm saying that we need to be very careful about unwittingly compromising our principles under the "safety" of the tea party flag. Ron Paul himself sums it up quite well:

Who is trying to ride the Liberty Coat Tails?
The candidates being elected under the Tea Party banner are only a small piece of the hijacked pie. The true orchestrators behind the hijack of one of the most revolutionary movements in American history to my knowledge are Dick Armey & Freedomworks, Newt Gingritch, Sarah Palin, and possibly even Mike Huckabee. Weather or not these people are planning a grand absorption of a strong political movement, they are certainly wide eyed with enthusiasm about the possibility of using the fired up masses to their advantage.

Which political philosophy will win in the end?
We have a Libertarian leaning movement that was born from the Ron Paul revolution and those neo-conservatives of the Washington Republican "brand" meeting in the middle to topple the existing Democratic leadership. The question remains, which philosophy will last in the long run and what will the confused mixture that is the Tea Party emerge as in its final form? Will we have a Republican party that returns to its roots of limited government and fiscal responsibility as well as being responsible international citizens? or will be continue the war mongering and quantitative easing loved so dearly by the neo-conservative republican establishment?

Thanks to the internet's role in politics I think the people are awake now, and I do not think we will be fooled. We are no longer forced to listen to what big media wants us to hear. We are no longer limited in what information we receive.

If you want to know what is happening with the true liberty movement, read The Daily Paul. Remember who Fox News is. Remember who MSNBC is. Remember who CNN is. Also Russia Today, BBC, and every other big media outlet. Take them with a grain of salt. Keep an open mind. Research on YouTube. Research on Wikipedia. Research on Wikileaks. Research on Google. Search for your questions and find your own answers.

Friday, September 17, 2010

Net Neutrality - A Tougher Issue Thank You Think

Net Neutrality has been a hot topic for a while. The fear that corporations would bundle each and every website into 'packages' like cable TV is enough to scare most people into supporting net neutrality at face value, but is that the only side to the argument that the American people need be concerned with? Is this the only thing we have to be afraid of?


There are more than two sides to this story this time around. We have in one corner, the service providers who would love to squeeze every extra ounce of cash from the internet as possible (the blessing and curse of capitalism). In the next corner, you have the government. They tend to gradually grow, consuming private businesses and private interests "for our own good" in each industry they become involved. Then they waste a ton of money on them, use them as political weapons and ultimately siphon money from the American people into the hands of those who are in charge of programs via taxes and inflation. Then in yet another corner we have the American people.

What are we really asking for in net neutrality?

We are asking to be left alone. We are afraid of having a free and open internet dismantled, censored, ruined. We're afraid that the likes of companies like Comcast in all its wisdom will make deals with other companies and giving traffic priority and an unfair competitive advantage over the smaller mom and pop shop, or even personal blogs. We're afraid that these companies could give us access to only pieces of the internet, charging us more for each additional chunk we would like access to.

In normal free markets this is no real concern because competition will eliminate most bad practices, however in the internet service game, we have a country divided up into groups where companies like Time Warner Cable and Comcast enjoy regional monopolies. They have no REAL competition, and therefore not nearly as much of an incentive to give us what we really want instead of what would earn them the most money.

So our solution is to ask the government to step in to protect us.... but hold on just one second.

We are starting to realize that if the government steps in to rescue the people from the big bad companies, we will be following a trend that we have seen become all too real in recent months. I'm not going to argue the point, but I think most Americans agree that we should have reservations about government involvement in anything that we wish to remain free (as in freedom, not cost), open (as in everyone has equal access), and unrestricted (as in our first amendment right to freedom of speech). The government has imposed warrentless wiretapping on American citizens, demanded our personal information from Google and countless other companies (citing reasons other than court ordered subpoenas), and has even used any information it could get from the internet to go after citizens for additional taxes.

Barack has come out in support of Net Neutrality.

The things Obama mentions in this video are fantastic, and a sentiment that I think most people would generally agree with wholeheartedly. The problem is, what sort of slippery slope are we opening ourselves up to by allowing the government to regulate the internet in new ways? What sort of new regulations will they add on year after year? How can we be sure future regulations will always be in the true interest of the people and not of the spend happy politicians who need new sources of tax revenue? What happens when there is an incentive for government to ask for more, and then more again?

The question becomes "who do you trust more?" A company who has a regional monopoly and not grounded by the same capitalist forces that keep other companies in check (competition), OR the government, who has shown us that they do not care about your privacy, or about how they spend our money?

So what is the solution? If we can't trust big companies to look after us, and we cant trust big government, where do we turn?

I don't know the clear answer, but I believe it lies in the principles of our republic. When our founders constructed the constitution, they decided that a government could grow to become oppressive and unfair, and it needed the will of the people to provide the authority and keep it in check. It also realized that the people could band together and create a majority that could overpower the smaller less popular ideas unfairly, trampling the god given rights of the minority. This is why they designed the first ten amendments to the constitution. It was a document that took precedence over the will of the majority AND the will of the government. We need a bill of rights (of sorts) for the internet to protect us against both the government, the will of the majority, and the service providers. We also need a way to introduce true competition into the internet service provider market to stimulate competition and in turn produce a better end result for all internet users.

I imagine it would look something like this (extremely rough, and I'm sure some of this is entirely unfeasible, but it should get you thinking...).
Note: The following text is meant to serve individual persons using the internet. Corporations are not considered persons in the scope of the following text.

1. Extend the 1st amendment to specifically cover the internet as well. Each individual has an equal right to express and publish opinion in whatever manner they wish on the internet so long as it does not violate the inalienable rights of another.

2. A user has the right to use his service however he wishes, and should not be subject to any probe or investigation without a court order. This includes identifying the type of traffic that is being transmitted for any reason other than to gather information relevant to the sale of said service. Any data collected in this way must be private and not disclosed in any way that could identify the user without a court order.

3. Extend the 4th Amendment, specifically defining infringement on internet privacy without probable cause and a search warrant as an unreasonable search. This will still allow authorities to obtain a warrant, but aside from that any identifying data, even if identifiable by associative means, that is collected about an individual by a service provider cannot be sold, traded, or disclosed without the clear consent of that user. Any such request by the service provider must give the user an opportunity to opt out, and such option shall always be chosen by default.

4. At no time should any user's access be restricted or limited intentionally. All content should be delivered to the user with an equal priority.

5. A user cannot be charged for access to the internet on any basis other than the cost to deliver that access. Cost to deliver access should not be manipulated in order to change this cost.