Wednesday, August 27, 2014

Install the high performance Nginx web server on Ubuntu

Look out Apache, there's a web server -- Nginx (pronounced Engine X) -- that means to dismantle you as the defacto standard web server. The Nginx project started development in 2002, but it's just now really showing its strength and starting to gain a serious following. Nginx is a free, open-source, high-performance HTTP server and reverse proxy, as well as an IMAP/POP3 proxy server, and it's known for high performance, stability, a vast feature set, easy configuration, and very low resource consumption.
Since Nginx is new to many users, I thought I should begin a series of articles to get everyone up to speed on using this fantastic web server. Throughout this series, I'll be using the Ubuntu platform. You can use this series as the basis for other platforms -- just pay close attention to the variances of installation technology and (in some cases) directory structure. With that said, let's install Nginx on the Ubuntu platform.
Note: As this series won't bother with basic platform setup and security, I'll assume that you already have the server up and running and secure to your liking. I'll also assume that you have MySQL up and running (along with PHP support).


Nginx has few dependencies that Ubuntu doesn't already take care of. Here's what you'll need:
  • The Gzip modules requires the zlib library
  • The rewrite module requires the pcre library
  • SSL support requires the openssl library
With the Ubuntu platform, the only library from the list above that you'll need to install is the pcre library. To install this, follow these steps:
  1. Open a terminal window
  2. Issue the command:
    sudo apt-get install libpcre3-dev
  3. Type your sudo password and hit Enter
  4. Accept the installation
  5. Allow the installation to complete
Nginx can use PHP5 with the help of PHP-FPM (an alternative PHP FastCGI implementation with additional features, which is useful to busier sites). Here's how to install PHP-FPM:
  1. Open a terminal window
  2. Issue the command:
    sudo apt-get install php5-fpm
  3. Type your sudo password (if prompted) and hit Enter
  4. Accept the installation
  5. Allow the installation to complete

Installing Nginx

As you might expect, the installation of Nginx is quite simple. Just follow these steps:
  1. Open a terminal window
  2. Issue the command:
    sudo apt-get install nginx
  3. Type your sudo password (if prompted) and hit Enter
  4. Accept the installation
  5. Allow the installation to complete
That's it. The new web server is installed. Now, let's peek around a bit.

Starting and stopping the server

To start the Nginx server, issue the following command:
sudo service nginx start
Top stop the Nginx server, issue the following command:
sudo service nginx stop
With the Nginx service started, fire up your browser and point it to the IP address (or domain) of the hosting server. If you see the “Welcome to Nginx” page, everything is good to go.
Before you close that terminal window, it's necessary to set the Nginx service to start at boot. Just issue the following command:
update-rc.d nginx defaults
If you see:
System start/stop links for /etc/init.d/nginx already exist
That means Nginx is already set to start at boot time. You can now rest assured that you won't have to manually start your web server upon reboot.

Configuration files/folders

  • The main configuration file for Nginx is /etc/nginx/nginx.conf
  • Virtual hosts are defined in /etc/nginx/sites-available/default
  • PHP will be configured in /etc/php5/fpm/php.ini

That should do it for Nginx installation on the Ubuntu platform. In upcoming posts, we'll start working through various configurations and optimizations to round out the series. Enjoy your new web server!

Nginx and Android: A great on-the-go web dev tool

There are times when you just need to develop on the go. When this happens, you might not want to carry around that bulky laptop -- or maybe your only option is a tablet or smartphone. If that's the case, and you have an Android device handy, you're in luck! The Nginx(pronounced engine-x) web server is great way to have a portable web server for testing, developing, and even serving up web pages.
NAMP (nginx android web server) is a 10-day trial app (after the trial, the cost of a license is $0.99 until Sept 1st, 2014, after which the price will raise to $4.99). Here are some of the app features:
  • Nginx v1.5.0
  • PHP v5.4.13
  • MySQL v5.1.62
  • msmtp 1.4.30
  • NAMPFTP v1.0
  • Export MySQL backups to Dropbox
  • Export backups of sites to Dropbox
  • Backup of MySQL databases
  • Easy management of virtual hosts directly from the application
  • Add FTP users with custom privileges
  • Run the server on port 80 or 8080
You can connect to the server either locally, on the Wi-Fi LAN, or from a WAN address. With the addition of a solid text editor (such as Jota+), your Android device will become a powerful web-development tool.
Let's install and use NAMP.


Installation of NAMP is quite simple. Just follow these steps:
  1. Open the Google Play Store on your Android device
  2. Search for NAMP
  3. Locate and tap the entry by NAMP Ltd.
  4. Tap Install
  5. Read the permissions listing
  6. If the permissions listing is acceptable, tap Accept
Once the installation is complete, you'll see an icon for NAMP on your home screen (or in your app drawer -- or both). Tap that, and you'll be presented with the licensing information (plus information about when your trial period will expire). Once all of that information is gone, you'll see that the various services are started and the addresses to reach the default web page (Figure A).
Figure A
Figure A
NGINX running on a Verizon-branded LG G Pad.


If you tap the Status button (upper left corner of the NAMP main window), you gain access to each of the services installed. Tap on the nginx entry, and you can start/stop the service, edit the configuration file, and even add virtual hosts (Figure B).
Figure B
Figure B
The nginx service control panel.
If you tap the Settings entry (from the Settings menu), you can set NAMP to autostart on boot, enable an external .ini file, allow the usage of Root, and more (Figure C).
Figure C
Figure C
The NAMP Settings window.
The most important thing you'll need to know is where to store your files. Open up your file manager (if you don't have one, I suggest Astro File Manager) and look for a folder called htdocs. Within that folder is where you'll place all of your html and other source files.

Database management

If you're wanting to work with databases, NAMP has you covered. There is a special version of phpMyAdmin you can run with NAMP. Here's how you do it:
  1. From the NAMP main window, tap the Settings button
  2. Tap the Tools entry
  3. Tap phpMyAdmin
  4. Allow phpMyAdmin to download
  5. Tap OK when prompted (this will restart the nginx services)
  6. Tap phpMyAdmin again (this will open the web browser to localhost:8000)
By default, the MySQL username is root and the password is blank (as in no password). At this point, you should be able to use phpMyAdmin as you would if it were running on a standard server.
If you need to edit the MySQL configuration file, you can do so by selecting MySQL from the main window Settings menu and tapping the EDIT button (Figure D).
Figure D
Figure D
The MySQL window within the NAMP server.
If you're looking for an easy way to work with web development on the go, you should give NAMP and nginx a try. Outside of logging into a remote server to work on your web development, this might well be your best bet.

Saturday, August 23, 2014

Sneak Attack: Android Apps Can Ambush Each Other,news-19371.html

Modern operating systems "sandbox" apps so that they can't affect each other — in theory. Yet three researchers have shown that, at least in Android, one app can "spy" upon another and then, at just the right moment, interfere with the targeted app's user display in order to steal passwords, credit-card numbers or even sensitive photos.
In this way, the researchers were able to steal login credentials from the Gmail app, a Social Security number from the H&R Block app, a credit-card number from the NewEgg app and a bank-check image from the Chase app. Only the Amazon app proved resistant, though not immune.
While the experiments were carried out on Android phones, the researchers believe iOS and even desktop operating systems such as Mac OS X and Windows would be vulnerable to similar attacks.
"The assumption has always been that these apps can't interfere with each other easily," researcher Zhiyun Qian of NEC Laboratories America told "One app can in fact significantly impact another and result in harmful consequences for the user."
The three researchers — Qian and Qi Alfred Chen and Z. Morley Mao of the University of Michigan — plan to present their findings at the USENIX Security Symposium in San Diego tomorrow (Aug. 22), and have already shared their findings in a research paper entitled "Peeking into Your App Without Actually Seeing It: UI State Inference and Novel Android Attacks."

To prevent infection, don't share memory

The problem arises because, due to limited resources, running applications must share some memory with other running applications so that they can all operate efficiently. Truly sensitive data is compartmentalized, but mundane tasks are often carried out in shared memory — and there's no task more mundane than running the nuts and bolts of the device's graphical user interface (GUI).
However, each change an app makes to the GUI requires a specific amount of memory, an amount that often directly and instantly affects the total amount of shared memory used on a given device. As the app's GUI changes, the shared-memory allocation rises and falls — in a way that can let other running apps know exactly what the target app is doing and thus carry out an indirect, or "side-channel," attack.
By carefully correlating GUI changes with memory-allocation changes, the three researchers were able to determine, just by monitoring shared memory, that a given app was bringing up a login screen, taking a photograph or transmitting credit-card information.
Chen, Mao and Qian then designed a malicious app that permanently ran in the background of the targeted device, as would a wallpaper app. It had no special permissions other than full network access -- but that was enough to transmit information to the attacker's own phone.
The malicious app lies in wait, monitoring the shared memory for signs that the target app is about to begin a sensitive process. At exactly the right moment, the malicious app interferes with the target app and hijacks the user experience to its own ends.
To steal typed information, the malicious app "seizes focus" and displays a phony input screen designed to look exactly like the corresponding real input screen. After the user types in his login credentials, credit-card number or Social Security number, the malicious app displays a phony error notification and returns the user to the real app's input screen.
To steal an image, the malicious app exploits the phone's preview function, grabbing each frame of the video image displayed to the user before a photo is even taken.

Let's go to the videotape

In a series of videos the researchers posted to YouTube, two Samsung Galaxy S3 phones running Android 4.1 Jelly Bean are shown side by side.

As the user types information into the H&R Block and NewEgg apps on one phone, the login credentials and Social Security and credit-card numbers appear on the other. As the user of one snaps a photo of a bank check using the Chase app, the image appears on the other phone, displaying the user's name, address, bank-account number and signature.
Among the seven the researchers tested — Amazon, Chase, Gmail, H&R Block,, NewEgg and WebMD — only Amazon was resistant to their side-channel attack. The Amazon app's interface was so complex that the researchers had a hard time determining what it was doing at any given time.
That resistance offers clues on how to mitigate further attacks, the trio say. Memory demands for specific processes could be rounded up to preset values, confusing an attacker about which process was taking place. Applications running in the background could also be prevented from seizing focus from other apps.
However, Chen, Mao and Qian explained, the problem underlies most modern operating systems, and may require a switch to a different way of managing graphical user interfaces.
"We expect the technique to be generalizable to all GUI systems with the same window manager design as that in Android, such as the GUI systems in Mac OS X, iOS, Windows, etc.," the three wrote in their research paper.

Thursday, August 21, 2014

What is the ice bucket challenge?

The internet has gone viral with videos of celebrities and other popular personalities taking the "Ice Bucket challenge" and daring three others to do the same. Here is what you need to know about it:

What is the ice bucket challenge?

It's an effort to raise awareness of ALS where participants must dump a bucket of ice cold water and then dare someone to do the same. If they can't, the alternative is to donate $100 to the ALS association

How did it start?

The ice bucket challenge went viral on social media after a US baseball player and ALS patient, Pete Frates, floated the idea of the challenge in a video on a social networking site. He got the idea from a friend

The impact 

More than 1.2 million videos were shared on Facebook between June 1 and August 13. The challenge was mentioned more than 2.2 million times on Twitter since July 29, after Frates' appeal

The funds 
According to the ALS website, it has so far received nearly $23 million

US baseball player and ALS patient Pete Frates who floated the idea of the challenge.

What is ALS

Amyotrophic lateral sclerosis is also referred to as Lou Gehrig's Disease. It is a progressive neurodegenerative disease that affects nerve cells in the brain and the spinal cord


ALS is thought to be affect 2 people every 1 lakh of the global population

Life expectancy 

About 20% people with ALS live 5 years or more, up to 10% live more than 10 years and about 5% live up to 20 years after diagnosis

They took the challenge

Cristiano Ronaldo

Satya Nadella

Bill Gates

Britney Spears

Linux Foundation Certification Program

Friday, August 15, 2014

JuiceSSH makes it easy to manage SSH from an Android device

There are many instances when I need to be able to log into a remote server via SSH. Sometimes I'm at a desktop or laptop and can handle that easily, and other times the only tool I have available is an Android device. There are plenty of SSH clients available for this, but many of them are simply not worth your time and effort.
And then there's JuiceSSH. This particular SSH client stands heads above the competition. Why? It has a great connection manager, doesn't box you into reading from a tiny command prompt, and offers the following features:
  • Plugin system
  • Full color terminal
  • Pop-up keyboard with special characters for Ctrl, Alt, Tab, etc.
  • Telnet and local Android terminal support
  • One-click SSH connection
  • Key import/export/generation
  • ZLib compression
And that's just the free version. If you pony up $5.00 (USD) for the paid version, you'll also receive these features:
  • Home screen widget for quick connections
  • Local, remote, and dynamic port forwarding
  • Store connections and scripts as snippets (you can even auto-run snippets upon connection)
  • Auto backup of connections
and much more.
Of all the SSH clients I've used, JuiceSSH is the best. Let's install it and see just how good this tool works.


We'll install the free version of JuiceSSH, so you can give it a test run and see if it meets (or exceeds) all of your needs. Here's how:
  1. Open the Google Play Store on your Android device
  2. Search for JuiceSSH
  3. Tap Install
  4. Read through the permissions listing
  5. If the permissions listing is acceptable, tap Accept
  6. Allow the installation to complete
Once it's installed, you should find a launcher located on your home screen or in your app drawer (or both). Tap that launcher to fire up JuiceSSH.


When you first fire up JuiceSSH, you'll be required to set an encryption password. This password is used to secure connections with AES-256 encryption. When prompted, enter and confirm an encryption password. Once you've saved your encryption password, you'll find yourself on the JuiceSSH main window (Figure A).
Figure A
Figure A
JuiceSSH running on a Verizon-branded LG G Pad.
You're now ready to create a quick connection to a remote SSH server. Follow these steps:
  1. From the main window, tap Connections
  2. Tap Quick Connect
  3. Enter the information for the connection (Figure B)
    Figure B 
    Figure B
  4. Tap OK
  5. Tap Accept to accept the host key fingerprint
  6. Enter the password for the connection, and tap OK
At this point, you'll be presented with a quick tutorial that shows you how to change the font size (volume buttons), open the pop-up keyboard (tap the terminal), and copy/paste/share (long-press the terminal for the copy, paste, and share options). Tap the OK -- I've got it! button to dismiss the tutorial, and you'll find yourself at the command prompt of your remote server. Tap the terminal once to open the special pop-up keyboard (Figure C).
Figure C
Figure C
Logged into a remote SSH server with JuiceSSH.
At this point, you should be able to work with your remote server as you would with any SSH client. When you log out, your Quick Connect connections will be saved in the Connections window. The identity you used (the username/password) will also be saved under the Identity tab. If you happen to manage multiple remote servers, and they use different credentials for logging in, you can create different identities. With multiple identities created, you can select from those identities (via a drop-down list) when connecting to a server. This means that you don't have to always enter the username for the server. You can also save the identity password and even set a private key for the identity.
To create a new identity, follow these steps:
  1. Swipe the main window to the left to reach the Identities tab
  2. Tap the New Identity button
  3. Enter the information for the Identity (Figure D)
  4. Tap Save
Figure D
Figure D
Creating a new identity with JuiceSSH.
Now, when you create a new connection (not a Quick Connection), you can select the identity to use from the drop-down list (Figure E).
Figure E
Figure E
Selecting an identity for a connection.
If you're looking for the best Android SSH client, run -- don't walk -- to the Google Play Store and install JuiceSSH. After you use it once, you'll forget about all the other clients.

Monday, August 11, 2014

Tips to use some hidden features in Gmail

Handling spam in Gmail

Did you know that the dots within your Gmail address have no significance? 

So if your address is, it means that any e-mails which are sent to, or, or even will also land in your inbox.  So, what's the use of this 'Gmail glitch'?  

Well, you can use it to set up filter rules for your internet subscription services or one-time online registrations.

Consider, if you do not want to provide your real e-mail address to sign up for an online internet service, simply use an alias like and then create an e-mail filter to delete all messages that come to this ID.

Sorting through e-mail subscriptions

If you want to create a filter for your different internet subscriptions, you can use the '+' feature. Say you want to subscribe to a newsletter from The Onion, you can use 
The newsletters will still come to your inbox, but you can now use 'theonion' as a keyword to search for all your tagged e-mails, and even set filters.

Managing contacts

Did you know that you can have your smartphone contacts synced automatically with your Google account? In effect, you will only need to maintain the 'Contacts' on Gmail for your whole address book to be updated on your smartphone and tablet where you've signed-in with your ID.

To sync your contacts...

On an Android device, go to Settings > Add Account > Google and follow the steps to add your ID. 

After this, every time you add a new contact, make sure you it is added to your Google account and not saved locally to your smartphone.

After you save the number to your Google ID, it will be synced to your Gmail address book and will be reflected on all other devices that have the same account.

Similarly, you can sync contacts on iOS, Windows Phone and BlackBerry devices, though the steps will differ slightly.

Finding duplicates

Click Gmail in the top left corner, choose Contacts, then More > Find & Merge Contacts.  You will get a list of all the double entries in your address book.  Choose the ones you would like to combine and click Merge.

Restore addresses

When you delete contacts from your mobile device, they will be removed from your Google account as well. 
But you can still recover them within 30 days of deleting. Go to Contacts, click More > Restore contacts. 
Choose the time you would like to revert to, and click Restore.

To create an e-mail filter...

Click on the gear symbol in the top right corner of your Gmail inbox, then, go to Settings > Filter tab > Create a new filter. Choose your criteria - From, To, Includes the words, Has attachment, etc - for the filter. Click Create filter with this search - and you can then choose an action like Skip the Inbox (Archive it), Apply the label, Delete it and more. There! Now, all your e-mails will be sorted and dealt with according to the filter actions you have chosen.


Programmers at Google have created experimental stuff that can do wonders for your e-mail experience.
For example, you could use a Labs option called Right-side chat to move your chat list from the left pane to the other side. Other interesting projects include Preview Pane that provides users with a panel that allows you to read an e-mail as soon as your click on it; Multiple Inboxes, which creates different panes for your filtered messages, and Authentication icon for verified senders that display a key next to authenticated messages from certain senders that spammers attempt to impersonate. To access Labs, click on the gear symbol on the top right corner, then go to Settings > Labs tab.

Managing your dates

Using your Google ID you can create a planner using its calendar feature at Here, you can add and view events and meetings you have scheduled by day, week, month, or as an easy-to-read list of your daily agenda. You can create calendars and share them with friends by e-mail. 
Similarly, you can access a friend's shared calendar. This service can be viewed and edited on your smartphone as well.  Just make sure that the calendar, in your Google account, has been configured to sync with your device. Moreover, you can also access your Calendar from within Gmail. Click the gear icon in the top right corner, click Settings > Labs > Google Calendar gadget, select the Enable radio button and click Save Changes. 

Now, you can keep a tab on upcoming events while you are going through your inbox. You can quickly add events from here itself and also add more functionality by clicking on Options.

Google drive

If you work with documents, presentations and spreadsheets on a regular basis, you might want to try out Google Drive at  

Whenever you get an e-mail with a productivity file as an attachment, save it to your Drive account, and you can begin collaborating on these with colleagues.

1. To share a file that you have open in Drive, click the blue Share button at the top of a Doc, Sheet, or Slide. 
Then add your colleagues' Gmail addresses and you can even decide how much access they get: view-, comment-only, or the ability to edit the file.

2. When collaborating on a single document, you and your colleagues can use comment bubbles to annotate paragraphs, and even suggest edits, which the document owner can then accept or reject with a single click.

3. When you add a comment in Drive, you can type + and the person's email address (e.g. '+tylerdurden@') and they'll get an e-mail letting them know that a comment has been directed at them.

4. If all your collaborators are online and accessing the same file as you, you can click on their profile picture at the top of the document to be taken to where their cursor is.

5. Want to revert to an older version of your document?
Go to File > See revision history to see changes made to the document. You can even restore to a previous version.

Sunday, August 10, 2014

10 awesome Google features you should be using

The reason the Google home page is so bare is that, way back when it was just starting out in a Silicon Valley garage, no one working there knew how to program a web page to make it look pretty.
In fact, even the word Google was a mistake. The founders really wanted “Googol” – the digit 1 followed by 100 zeroes.
Of course, Google is now a noun, a verb and a massive global company loved as much for its innovation as it is hated for its user tracking. It has many tricks and products that you don’t need to spend money on, some of which will make your life easier, and others that will just blow your mind.
Let’s take a look at 10 of them:
Google Flight Search
Need to find the best price on a flight? Google Flight Search is one of the easiest price-comparison sites around. Pick your start point and destination – or destinations – on the map, and then pick your dates. When you pick the dates, be sure to pay attention to the prices on each date and Google's graph of days with the cheapest tickets.
Then you can filter the results by flight length, airline, price, stops and more. When you find a flight you like, you can book it directly on the airline's site. Click here to learn three more secrets to getting the lowest airfare.
Atari Breakout
Need to take a quick break? Thanks to Google, you can play a version of the classic Atari Breakout game on your computer whenever you want. Simply go to the Google Image Search page – – and search for "Atari Breakout." Then wait for the fun to begin.
Google Public Data Explorer
Google's normal search site is great for most searches, but Google has more specialized search sites as well. For example, the Google Public Data Explorer is a treasure chest full of information on public statistics.
Go to the Google Public Data page and type in a topic. Keep your searches simple, like "Unemployment in the U.S." Google will return results from sources like the U.S. Bureau of Labor Statistics. You'll end up with an easy-to-read graph, and you can even tweak it with options like gender, age and state.
Google translations
Need a quick translation of a word? Go to the normal Google search page and type in "translate (word) to (language)" in the search bar. For instance, you could type "translate apple to French."
Google will let you know in less than a second that "pomme" is the French word for apple. It also includes a small speaker icon that will let you hear the word if you aren't sure how to pronounce it. For longer translations, check out Google Translate.
Google nutrition comparison search
What's healthier, an orange or a banana? Type "compare" into Google's search bar, along with the foods you want to look at, such as "compare broccoli and asparagus." Google will do the rest.
Google definitions
When you don't know what a word means, don't reach for the dictionary. Type "define (word)" into the Google search bar, such as "define tintinnabulation" and you'll have the definition instantly (it's "a ringing or tinkling sound," if you were wondering).
You'll also get pronunciation and part of speech, and you can click the gray arrow for more information, including word origins.
Google Conversions
Whether you're cooking or helping your child with math homework, odds are you're going to have to convert units of measurement. On the Google search page, enter a search like "convert eight ounces to cups" or "convert 10km to mi." You'll have your answer instantly, and you can even tweak the numbers and units after the fact.
Google nGrams
Google nGrams is a great research tool that lets you search how many times specific words occur in more than 5 million books written since 1800. You can see how words get more or less popular over time.
You can put in multiple words separated by commas to compare two or more words at once. Google lets you adjust the time period and language of the books, and you can see what books contain the words.
Google Sky
If you think Google Earth is great, then Google Sky is going to blow your mind. It lets you search the heavens and see images of stars, planets and galaxies taken from telescopes, probes and satellites.
It includes infrared and microwave images as well as a historic map of the stars made by Giovanni Maria Cassini in 1792. If you don't know where to start, the site has some suggestions that you'll love.
Exclude search terms
Google's algorithms are really good at searching the Internet to find the information you're looking for, but sometimes you get popular results that just aren't right.
Tweak your search using the minus (-) symbol. Just put it before any words you don't want to show up. Say you want to search for "puppies," but don't want to see sites that sell them. Just type in "puppies -sales" and you're set.
On the Kim Komando Show, the nation's largest weekend radio talk show, Kim takes calls and dispenses advice on today's digital lifestyle, from smartphones and tablets to online privacy and data hacks. For her daily tips, newsletters and more, visit her website at