Sunday, December 13, 2015

What I learnt validating my MVP and promoting my app for free

In October 2015 I developed Xtegos - Voices for Whatsapp as a weekend project. Xtegos is a mobile app to read messages with funny foreign accents and share them on Whatsapp as voice messages.

After launching the MVP for Android, I wanted to test the following assumptions:
  • 1) People like sharing voice messages with someone else's voice on Whatsapp groups.
  • 2) People prefer that voice to have a funny foreign accent.
  • 3) This app will grow organically after some initial marketing effort.

In order to achieve some customer base, I implemented the following marketing strategies:
  • A) Create a website, Facebook page and a Twitter account (renamed one with 5k followers).
  • B) Share the app with my personal contacts on social media.
  • C) Share funny voice messages created with Xtegos on my Whatsapp groups.
  • D) Promote Xtegos on Facebook groups with keyword "Whatsapp" with a big lie in the post: "Xtegos, the app to share voices on Whatsapp that is revolutionizing the Internet. Selected as one of the top 10 free apps in 2015".
  • E) Email some app bloggers to review and feature Xtegos.
Strategies A, B and C were quite successful during the first few days, and helped Xtegos get its first 100 users, with many 5-star reviews (most from friends of mine). Some Whatsapp groups I am part of started sharing voice messages and the organic growth worked smoothly. However, after a week or so, the illusion was over. Xtegos was not sticky nor viral.

I went back to the lab, improved the UX, added new voices and launched the iOS and Windows Phone versions with Phonegap (as requested by some users). Then I used strategy D with mixed results: I got a few hundreds of new installations but 70% of them uninstalled the app immediately, and some of them gave Xtegos a bad review. Nobody likes lies, and if you say "Selected as one of the top 10 free apps in 2015" they would expect something ground-breaking, which was not the case.

In view of the results, I decided not to proceed with strategy E. I'll use that silver bullet once I have fixed the problems I have observed. The least thing I want right now is a bad review in a specialized blog.


What I learnt from this experience:
  • Assumption 1: validated.
  • Assumption 2: not validated. Many users chose the voice with their own accent.
  • Assumption 3: not validated. The app is not sticky nor viral.
  • Don't trust feedback from your friends, but their installations and reviews are welcome.
  • Don't lie to your users. "Fake it till you make it" is a dangerous game.
  • Don't waste your time developing the app for other platforms or languages before you have validated your value proposition.
  • Don't do any PR before you have validated your value proposition.
As a consequence, I am going back to the lab and implement a new version with the outcome of this learning experience.

Sunday, October 18, 2015

How to share remote audio files on social media using Phonegap

I wanted to create the iOS and Windows Phone versions of Xtegos using Phonegap, and the main problem I had was sharing audio files on Whatsapp.

There is a fantastic Cordova plugin called Social Sharing, developed by Eddy Verbruggen (thanks for your help), which makes things much easier, but it does not explain how to share audio files. This is how I did it on Javascript:

The function below assumes that your file is in a remote server. If this is not the case, the code is much simpler and you can remove all the XMLHttpRequest code.

function shareAudio() {
  var endpoint = 'http://www.example.com/yourFile.mp3;
  var client = new XMLHttpRequest();
  client.open('GET', endpoint, true); // Async call
  // Need to change the MimeType for this kind of binary content
  client.overrideMimeType("text/plain; charset=x-user-defined");
  client.onreadystatechange = function() {
    // When the progress is level 4 (ready) and the status is 200
    if (client.readyState == 4 && client.status == 200) {
      // Append the base64 header and the base64 response text from the server
      var base64audio = 'data:audio/mp3;base64,' stringToBase64(client.responseText);
      // Shares the audio file with a new name file.mp3 using Cordova plugin
      window.plugins.socialsharing.share(null, 'file.mp3', base64audio, null);
    }
  }
  client.send(); // Send the request
}

The function below simply transforms a string into Base64 format. Original code by Niko.
function stringToBase64(str) {
  var CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  var out = "", i = 0, len = str.length, c1, c2, c3;
  while (i < len) {
    c1 = str.charCodeAt(i++) & 0xff;
    if (i == len) {
      out += CHARS.charAt(c1 >> 2);
      out += CHARS.charAt((c1 & 0x3) << 4);
      out += "==";
      break;
    }
    c2 = str.charCodeAt(i++);
    if (i == len) {
      out += CHARS.charAt(c1 >> 2);
      out += CHARS.charAt(((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4));
      out += CHARS.charAt((c2 & 0xF) << 2);
      out += "=";
      break;
    }
    c3 = str.charCodeAt(i++);
    out += CHARS.charAt(c1 >> 2);
    out += CHARS.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
    out += CHARS.charAt(((c2 & 0xF) << 2) | ((c3 & 0xC0) >> 6));
    out += CHARS.charAt(c3 & 0x3F);
  }
  return out;

}

In order to use the Social Sharing plugin you need to add the following line in the <head> of your index.html file:

<script type="text/javascript" src="cordova.js"></script>

And this other line in your Phonegap's config.xml file:
<gap:plugin name="org.apache.cordova.media" source="npm" />

<gap:plugin name="org.apache.cordova.network-information" source="npm" />
<gap:plugin name="cordova-plugin-x-socialsharing" source="npm" />
<gap:plugin name="cordova-plugin-whitelist" source="npm" />
<allow-navigation href="*" />
<allow-navigation href="http://*/*" /> 

Now you will be able to share your audio files on Whatsapp, Facebook messenger, email, etc. Enjoy!

Tuesday, October 13, 2015

Xtegos: funny accents for your Whatsapp voice messages

It's a fact, we can't help smiling when someone orders a drink in Spanish with a very strong English accent, the same way English people smile when I ask for directions with my Spanish accent. However, we really appreciate their effort speaking a foreign language.
I wanted to know how would people react if they had an app to recreate these international accents and share them with their friends. That is why I spent 8.5h developing Xtegos, an Android app that enables users to read any text with nine different accents and share the result as a voice message on Whatsapp.

The interface is extremely simple, literally a text box, nine voice selectors, a button to listen and another one to share on Whatsapp. In the backend I am using Android TTS after trying out some other free text-to-speech APIs. The best thing about this native voice synthesizer is that you can use it even offline.

The voices currently available are: English, French, German, Brazilian, Italian, Russian, Spanish, Indian and Japanese. All of them are female voices, and the selector buttons are illustrated with innocent stereotype pictures.

This MVP (minimum viable product) is completed with a website, a Google Play page, a Twitter account and a Facebook page (to engage with early-adopters). Some people have asked me to develop an iOS version but, unfortunately, I cannot do that until the value proposition is validated or I would spend too much time maintaining both systems. The same applies to the app language: if it doesn't work for Spanish, it probably won't work in any other language.
This week I am devoting some time to promote Xtegos among my initial customer segment: Spanish boys and girls from 16 to 25 years old with Whatsapp. I will post in this blog what I learn in these experiments and the pivots I make.

Is there any feature that you would like to see implemented? Your feedback, questions and ideas are very much appreciated.

Thursday, September 24, 2015

How to fix the "cryptswap1 is not ready yet" error on Ubuntu?

I never paid attention to the error message that, every time I started Ubuntu 14.04, was saying that "The disk drive for /dev/mapper/cryptswap1 is not ready yet or not present".

However, this caused that today I couldn't start the system at all, which is a painful and stressful experience. These are the steps I followed to fix the issue and get Ubuntu back to life.

1) At the GRUB menu, start Ubuntu in recovery mode
2) At the Recovery menu, select "Drop to root shell prompt"
3) Type "sudo swapoff -a" to disable swapping
4) Type "sudo mount -o remount,rw" to have write access to the system files
5) Type "sudo nano -w /etc/crypttab" and put a "#" at the beginning of the line that starts with "cryptswap1". Save the file.
6) Type "sudo nano -w /etc/fstab" and put a "#" at the beginning of the line that starts with "/dev/mapper/cryptswap1". Save the file.
7) Reboot the system. You should be now able to start Ubuntu normally.

Wednesday, September 23, 2015

Using Windows and you can't see your Android device on DDMS? This is how to fix it!

I recently bought a new phone running on Android 5.0.2 and, after enabling the Developer Mode and activating USB debugging, I was unable to connect it to Eclipse on Windows 10. The DDMS view and adb devices command showed an empty list.

This is how I fixed it:

1) Make sure you the Google USB Driver installed in your Android SDK folder.

2) Connect your device via USB and open Control Panel -> Device Manager.

3) You will see under "Other devices" an unrecognized "ADB Interface". Right-click on it and select "Update Driver Software".
4) Click on "Browse my computer" and enter the path to your Google USB Driver (<sdk>\extras\google\usb_driver\).

5) Click on "Let me pick from a list of device drivers" and select "Android USB Device".

6) Save changes and restart your IDE. Your device should be now visible from your DDMS view.

Sunday, September 6, 2015

How to deploy a PostgreSQL database in Ruby on Rails through Cloud Foundry

If you have a Ruby on Rails app with a PostgreSQL database and you are deploying it for the first time through Cloud Foundry to your hosting provider, you might have realized that a simple cf push yourappname doesn't initialize the database.
As it occurs when you are working locally, you first need to trigger the database creation and migration processes.

In my case, I am connecting to IBM Bluemix through Cloud Foundry, and my app is connected to an ElephantSQL PostgreSQL database. These are the steps to deploy my app successfully:

1) Deploy the app for the first time: cf push yourappname
2) Create the database and run the migrations (if any): cf push -c "bundle exec rake db:create db:migrate" yourappnameNote that this command will leave the app down.
3) Start the app again: cf push -c "null" yourappname

Wednesday, August 26, 2015

Why do I love IBM Bluemix

I had six Ruby on Rails web apps hosted on Heroku that I wanted to migrate to a more scalable and professional platform within my budget.

My first intention was to use my Bizspark account and deploy them to Microsoft Azure but, unfortunately, Azure Web Apps do not support Ruby on Rails yet. My attempt to deploy them in a single Linux Virtual Machine was painful and the performance very poor, so I decided to try IBM Bluemix.

After signing up for the 30-day trial, I started loving its engaging and intuitive UI, the simple pricing model and the amount of available services for a 1-year old cloud platform.

In less than one hour I had deployed my six web apps using Cloud Foundry CLI, migrated the PostgreSQL databases with the ElephantSQL add-on, and set up the custom domain and SSL certificates.

A tiny "Add Git" button introduced me to IBM Bluemix DevOps Services. This is simply mind-blowing! You are not only allowed to edit your code from the web interface. You can actually set up an entire continuous deployment pipeline, where you can make changes, run your tests and deploy it up to the production environment directly from your browser.

In addition, DevOps Services includes Rational Team Concert, a complete Agile project management tool where you and your team can organize the development effort and monitor the progress.

There is room for improvement in the deployment process. The process failed a few times with an unhelpful "failed to accept connections within health check timeout" error message which in my case was fixed by upgrading some gems or simply re-deploying.

In conclusion, I have tried many cloud solutions before (AWS, Azure, Heroku,...) and I believe IBM Bluemix is going to be my infrastructure partner for a long time.

How to schedule tasks in Ruby on Rails

There are some scenarios where we would like to set some actions to be performed at certain times of the day, or periodically. There is an easy way set up these cron jobs in Ruby on Rails with rufus-scheduler.



It does support four kinds of scheduling:
scheduler.in '10d' do
    # do something in 10 days
end
scheduler.at '2030/12/12 23:30:00' do
    # do something at a given point in time
end
scheduler.every '3h' do
    # do something every 3 hours
end
scheduler.cron '5 0 * * *' do
    # do something every day, five minutes after midnight
end
The integration is incredibly simple. Just create a new file task_scheduler.rb in your /config/initializers folder, include the gem rufus/scheduler and set up your task. In the example below, I am sending an HTTP GET request to Google every 2 minutes and print the status code.
# Required Gems
require 'rubygems'
require 'rufus/scheduler'
require 'net/https'
require 'uri'
# Initialize the scheduler
scheduler = Rufus::Scheduler.new
# Action to be performed every 2 minutes
scheduler.every("2m") do
    # Send a GET request to Google and print the response code
    uri = URI.parse("http://www.google.com")
    http = Net::HTTP.new(uri.host, uri.port)
    request = Net::HTTP::Get.new(uri.request_uri)
    response = http.request(request)
    puts response.code
end

Sunday, August 23, 2015

How to make an app start automatically on Ubuntu

Sometimes we found ourselves starting manually a set of apps or webservices everytime we reboot our Ubuntu instance. We can easily automate this process.


1) Open the configuration file with sudo vi /etc/rc.local
2) Add all the commands that you want to run. For example:
    cd /home/myuser
  rm *.tmp
    nohup java -jar /var/www/myapp/app.jar &
With nohup and the final & we force the jar file to run on background, creating the nohup.out log file.
3) Always end with exit 0
4) Save changes with :x and reboot the system. The commands that you have added should be run at start up.

Saturday, August 22, 2015

How to get your Azure Web App FTP credentials

In the new Microsoft Azure portal, when you create a new Web App, you might struggle to find your FTP user credentials. This is how you can find them.

1) Open portal.azure.com and browse to the Web App you want to access to.

2) Click on the "Get Publish..." button as per screenshot below. It will download an XML file.


3) Open that file with a text editor and you will find the publishUrl, userName and userPWD fields you need.


Why you should think twice before using biometrics

In the last decade we have seen how advances in biometric technologies have made it possible to identify individuals with their fingerprint, voice, iris or even brainwaves with very low failure rates.


I have no doubt that biometrics (something you are) will eventually replace passwords (something you know), which can be easily forgotten, guessed or deciphered with dictionary attacks. It is a fact, we are not good at choosing robust passwords and we reuse them all the time.

Unfortunately, it is not uncommon to hear from considered secure cloud services urging their users to change their passwords after a cyberattack. It is very annoying, but a new password should solve the problem.

But what if your biometric information is stolenMost of cloud services protect it the same way they do with passwords, i.e., the information is encrypted and stored in their servers. If after a cyberattack your fingerprint is deciphered, it could be used in order to access any other online service, and you can't simply change your fingerprint. If it is stolen once, it is stolen forever.

So the next time you are required to sign in with biometrics, ask your self how will your information be processed and protected.

A way to tackle this problem is by using Zero Knowledge Proof protocol (ZKP), that eliminates the transmission, storage and exposure of private user data during authentication. This way, biometric information never leaves the device, it is never transmitted or stored, so it simply cannot be stolen if the server is compromised.


* Disclaimer: I am CTO of Sedicii, a leading company in user authentication solutions, which uses ZKP-based patented technologies.

Tuesday, June 23, 2015

The "we have no competitors" startup myth

I recently met an early-stage startup in a meetup for entrepreneurs in Dublin. They were working on an e-commerce solution for SMEs, and they already had a quite impressive working prototype. I am not going to question whether this is or is not lean.

When I asked the founder about their competitors, I got the worst possible answer: "We have no competitors" - with a big smile. Every time I hear that I think about four different possibilities:

1) They didn't even bother to do a proper search on Google, which is bad because they didn't do their homework. Anything or anyone between their startup and the money is a competitor.

2) They don't know what market are they in, which is even worse because they are building a solution without a problem or potential customers. The "this product is for everyone" simply doesn't work.

3) They don't have any competitors because it is not an attractive market at all, which is catastrophic for a startup.

4) They are an innovative solution that is creating a brand new market, which might be the worst scenario for a startup without enough resources to attract customers to this new market. There is no doubt that it is the most profitable scenario in the long run, but it requires a huge budget to educate their potential customers (think about the first-ever social network). Resegmenting an existing market is a much more comfortable position for an early-stage startup.

Remember that having competitors is a sign that there is a profitable business opportunity there. You just need to be faster, or cheaper, or better, or niche-oriented, or just another fish in a big-enough pond.

Tuesday, March 24, 2015

How to make Office365 SMTP server work from Gmail

If you ever tried to send emails from your Office365 account directly from Gmail, you might have experienced an issue that prevents you from authenticating. Yes, you have carefully followed all the instructions and your credentials are correct, but you are still getting this error message:
Authentication failed: Please check your username/password
Don't worry, you are not alone! The problem is that the default SMTP server (smtp.office365.com) is not always successfully translated into the correct IP address.

In order to make it work, just follow these instructions:

1) Open your command line or terminal
2) Type ping smtp.office365.com
3) You will see that a different domain name is displayed. In my region (Europe) it is outlook-emeawest.office365.com
4) Use that domain when you enter your Office365 SMTP server details on Gmail

Tuesday, February 24, 2015

How to add users to your AWS EC2 Linux instance

Do you need to add more users to your AWS EC2 Linux instance? This is a step-by-step tutorial to guide you through the basic process.

1) Open a terminal session and navigate to the path where you have your-key-pair.pem file

2) Type the following command in order to extract the public key from your key pair
ssh-keygen -y -f your-key-pair.pem
3) You will get as a response a string like the one below. Copy it to your clipboard.
ssh-rsa AAAAB3NzaC1yVh0/ThkcfO479gFjMUVw48D2Pi4u0P+0lvP0tpzKcZ/nwnzhFIDyUHsVKMN0F97DCoPQEbk5jmyHRSBok+cuEXAMPLEt1VI7TLSAwWZj5aRedb+awFDLxBgS8SN/nvsaP4+KY8uGum10YV83/wGNZjYEVRLg9NjyDbuVERYFAKEhscyZAbWTMw2t30JELizxyXZx4s4OImfS4yOCnDLFgHFf3JUjGhTUg1O+10I3V2TB3j63166AEB+98JizrRtwJ85AUN/wmMD0V2YIiEaa2rMLbdGZw8lSlPakV3bedx+8NYf+s2+SLwB
4) Login with your ec2-user to your instance, as usual.
ssh -i your-key-pair.pem ec2-user@yourawspublicip
5) Create a Linux user account on the EC2 instance
sudo adduser username
6) OPTIONAL: Only if you want to give this user sudo access, do the following:
  • Switch to root: sudo su -
  • Open sudo config file: visudo
  • Add this line to the commands section: username  ALL=(ALL)  NOPASSWD:ALL

7) Switch to the user you have just created
sudo su - username
8) Create a .ssh directory
mkdir .ssh
9) Change permissions of this directory
chmod 700 .ssh
10) Create a new file authorized_keys in this directory and paste the public key that you have on your clipboard. Make sure that it doesn't miss the first letter.
vi .ssh/authorized_keys
11) Change permissions of this file
chmod 600 .ssh/authorized_keys
12) Send your-key-pair.pem file to the new user. She will be able to connect to the EC2 instance running the following command from the same folder where she has placed your-key-pair.pem file.
ssh -i your-key-pair.pem username@yourawspublicip
13) If thy get public key error, make sure they give the right permissions to your-key-pair.pem.
    chmod 600 your-key-pair.pem

Saturday, February 7, 2015

How to prevent your Heroku dyno from going to sleep

If you are using a free Heroku web dyno, you might have already noticed that sometimes it takes too long to load your website. The reason is that single 1X or 2X web dynos go to sleep after one hour of inactivity. This causes a few second delay for the first request. However, subsequent requests should perform normally.

In order to prevent this, you can do the following:

1) Install Heroku Scheduler free add-on (heroku addons:add scheduler:standard)
2) From your Heroku Scheduler dashboard, add a new job with these details:
- Task: $ curl -I http://YOURAPPNAME.herokuapp.com
- Dyno size: 1X
- Frequency: Every 10 minutes
3) Save the changes
That's it! Heroku Scheduler will send a "keep awake" signal to your app every 10 minutes, so that it won't fall asleep.

Important: Heroku Scheduler runs one-off dynos that will count towards your dyno-hours for the month and you might be charged for extra usage.

Friday, February 6, 2015

How to transform a website into a desktop app

If you want to have immediate access to your favorite sites in an app-like way, you can use Google Chrome's Create desktop shortcut feature.

It enables you to create within seconds a shortcut of a website, that will be placed on your desktop or applications menu. Just to be clear, this is not a real app, but a desktop shortcut to Chrome's viewer, hiding the browser bars, so it does look like an app. The shortcut icon will be the website's favicon.ico image.

In order to create your own desktop shortcut on any operating system supporting Google Chrome (Windows, Ubuntu,...) you can do the following:

1) Open your target website on Google Chrome
2) Click on Chrome's menu (top-right corner)
3) Go to More tools and Create application shortcuts
4) Tick on the kind(s) of shortcuts you want to create
5) Click on Create

This is how it looks for arturocalvo.com on Ubuntu 14.04:

Monday, February 2, 2015

Multitasking in Scrum teams

Let me invite you to perform the following exercise taken from Essential Scrum (Kenneth S. Rubin). Grab a piece of paper and a pencil, draw two identical tables as shown in the figure below, and complete them with two different strategies: row-at-a-time (a, 1, i, b, 2, ii, c, 3, iii, ...) and column-at-at-time (a, b, ..., j, 1, 2, ..., 10, i, ii, ..., x). Don't forget to time yourself!
The average results are 35 seconds for the row-at-a-time table, and 16 seconds for the column-at-a-time table. In addition, the first table has more chances to have errors.

The first table represents multitasking, where we are continuously switching from one task (column) to another, while the second table is single tasking (we don't start with the next column until we have completed the previous one).

The meaning of this experiment is that working on too many items at the same time involves a high level of over-head. Similarly, working on too few items at the same time is also wasteful, leading to idle workers and less value being delivered during the sprint. Finding the balance is not always easy, and it requires several sprints in order to determine the optimal workload for each team member.

The same applies at a project level. In this chart taken from the same book (extremely recommended for people interested in Agile and Scrum frameworks), we can see how the team members' performance decreases when they are involved in more than three projects at the same time.
When we are working on two projects, the time that we spend doing value-adding work is often the highest. The reason is that we can get blocked on one project but we still can switch to the other one.

However, with more than two projects our productivity falls because you cannot be fully committed to so many teams, and commitment (and not involvement) is one of the keys to success on Scrum teams. In the figure below we can see the difference between committed team members and involved ones.



Saturday, January 10, 2015

How to grow your blog audience

Since I started my website and blog, I was always worried about growing my audience. Despite my sharing efforts, mainly on Twitter, Facebook and Linkedin, I just got a couple of hundreds of views per post, mainly from my contacts.

How can my posts reach readers beyond my social circles? In the age of collaborative economy making a huge impact on most sectors, there has be a solution of bloggers helping bloggers to promote their posts and grow their respective audiences.

Copromly is a web a web app that makes use of collaborative growth to provide bloggers with a 10-fold audience reach in their social campaigns.

If you are a blogger who wants to promote a blog post for free, the process is quite simple:
1) You submit your post to Copromly
2) Copromly provides you with a magazine featuring your post and presenting some posts from other bloggers.
3) Other bloggers promote their magazines. Some of them show your post.
4) You promote your magazine (e.g., Facebook, Twitter, E-mail campaigns, Google+)

Thanks to step 3, for every view of your magazine Cogrowly is able to provide you with 10 views of your post in other bloggers' magazines. This is the magazine that is automatically created for this post.

My experience with Copromly has been been incredibly successful so far. My posts have literally doubled their views and the audience is benefiting from other blogger's social power.

Wednesday, January 7, 2015

Managing technical debt of your products

You and your team are working on a new version of the product. There is an strict deadline that you simply can't meet within high-quality standards, and you are not allowed to cut corners of these must-have features. After explaining the situation to your manager, she responds that this is a business decision and that you have to do whatever is necessary to meet this deadline. In other words, you need to do some low-quality work which should be reviewed and enhanced in the future.

Does this scenario sound familiar to you? This is the most common example of technical debt, but we are not just talking about unclean code that needs to be refactored. Other types of technical debt are bad design, insufficient test coverage, poor integration, etc.

Sometimes it is necessary to take on some debt for compelling reasons, such us going out of business otherwise, or being the first to market. However, the decision makers must have in mind that it is a loan after all, and it has to be repaid one day... with interests. Taking on technical debt means taking a loan today against the time required to do future work, so the greater the debt today, the slower the team's velocity tomorrow.

There is a limit, called tipping point, when the product becomes unmanageable or chaotic, and even small changes become major occasions of uncertainty. Make sure that you have repaid your debt before you arrive to this unpredictable point.

Other consequences of technical debt are frustration, underperformance, decreased customer satisfaction, rising development and support costs, etc.

The best practices to repay technical debt are:
1) Commit to do high-quality work so that we don't add new technical debt
2) Clean up whatever happened-upon technical debt that you reasonably can
3) Devote a percentage of your time (5%-33%) to specifically repay targeted technical debt

However, there are at least three scenarios under which technical debt should not be repaid: product nearing end of life, throwaway prototype and product built for a short life.

Remember: technical debt, like financial debt, has to be managed. Don't underestimate it's consequences.

Tuesday, January 6, 2015

How to migrate your PHP website to Amazon EC2

Amazon Elastic Compute Cloud (Amazon EC2) and is one of the most popular hosting solutions nowadays. Using EC2's virtual servers you don't need to invest in hardware up front, and you can easily manage performance, networking and security of your applications.

The AWS Free Tier provides the following free services for 12 months, and with a competitive price afterwards:
  • 750 hours per month of Linux, RHEL, or SLES t2.micro instance usage
  • 750 hours per month of Windows t2.micro instance usage
  • Run one instance at a time or multiple instances simultaneously
In this post I will explain how can you easily migrate your application from your local server to this high-performance cloud solution.

1) Sign up.
Sign up for free on Amazon Web Services. Credit card information is required, but you won't be charged during the first 12 months.

2) Set up EC2.
On your Amazon Management Console, apply for a EC2 account following these instructions. Keep the resulting key_pair.pem file somewhere safe. Make sure that you have set the security group with inbound rules for SSH, HTTP and HTTPS (see figure below).

3) Launch your instance. On your EC2 dashboard select the option Launch Instance and follow these instructions. For a PHP website I recommend choosing the Amazon Linux  t2.micro. Remember to connect your instance with the key_pair.pem file that you had generated before, and select the security group that you created on step 2.

4) Connect to your instance. From Linux or MAC just type the following command on your terminal:
$ ssh -i /path/key_pair.pem ec2-user@public_dns_name
Replace the elements in red with the path to your key pair and the public DNS name that you can find on your EC2 instances dashboard. For example:
$ ssh -i /home/arturo/Docs/arturo_key_pair.pem ec2-user@ec2-14-129-140-123.us-west-2.compute.amazonaws.com 
You will be granted access to your brand new Amazon Linux machine.

5) Install the Server and Database. In our case we are going to use PHP with a MySQL database. If you need to install any other package, such as Node.js, you can use the command sudo yum install package_to_install. In order to set up our web server and database, just follow the steps from 2 to 5 of this tutorial.

6) Test the web server. If you type your public DNS on your browser (in our example http://ec2-14-129-140-123.us-west-2.compute.amazonaws.com) you will see the Apache test page. Your web server is running!

7) Copy your files. You just need to copy your PHP project in /var/www/html. That's it!


Sunday, January 4, 2015

How to disable video auto-play on Facebook

Many people are experiencing mobile data shortage or higher phone bills since Facebook decided to auto-play videos on our walls by default.

If you have a 1Gb/month data allowance and every time you check your Facebook wall you play a couple of videos for 10 seconds, you'd better upgrade your data plan... or use this simple trick.

You can disable the "auto-play" option or leave it enabled when you are connected to a Wi-Fi network following these instructions.

ANDROID
1) Open your Facebook app and click on the menu button (top-right corner)
2) Go to App Settings
3) Click on Video Auto-play
4) Select the Off or the Wi-fi only option




IOS
1) Open your Facebook app and click on the menu button (top-right corner)
2) Go to Settings
3) Click on Videos and Photos
4) Click on Auto-Play Videos
5) Select the Off or the Wi-fi only option




DESKTOP
1) Open Facebook on your favorite browser
2) Click on the menu button (top-right corner)
3) Click on the Videos option on the right menu
4) Select the Off option on the Auto-Play Videos section