Saturday, July 11, 2015

H1B things to do, checklist once you land in the USA

If you are an H1B worker, you will have to do certain important or useful things once you land in the USA for the first time. Some are mandatory and some are purely for convenience. One thing to remember : in the USA you will have to do it all by yourself. Do not expect your employer to "help" you in doing things (eg: opening a bank account).

So here we go :

1) Immigration Check and i-94 update
* This step is optional, but good to do (because I had some Lastname trouble)
* Just when your plane lands on the airport, you will have to stand in the line for immigration check.
* When doing immigration check, the officer will update your i-94 entry in their database. (simply put, the i-94 database is what the USCIS uses to record your entry and exit details).
* If you have two names in your Surname (in other words, if you have a space character in your surname), there could be some update issues.
* In this case, better check with your immigration officer if your passport names and i-94 names are an exact match.
* After few hours or 1 day, check your i-94 entry on this link : https://i94.cbp.dhs.gov/I94/consent.html
* First, ensure that your latest entry is updated. Second, ensure that the details match with your passport entries (Firstname, Lastname, entry date, expiry date).

2) Open a bank checking account
* You will have to open a basic "checking" account for salary deposits. This is one of the easiest things to do once you land in the US.
* Bank of America (BoFA) is the most popular bank, but Chase and PNC are also equally good.
* For a basic checking account in BoFA, you will only need to show your Passport and another ID such as your home country's Driving license. If you don't have a driving license, they may accept your Employee ID badge (better to check this with the bank).
* BoFA or any other bank will give all you the following right way : temporary debit card, few check leaves, and a direct deposit form.
* Also check the  Apply for a Credit Card section below. It is convenient and useful to have a credit card.

3) Apply for SSN
* SSN is the national ID in the US. You will need this to get your salary credited, apply for driver's license or to claim insurance. Apply for SSN in the first week itself.
* To apply for an SSN, all you will need is your passport and a printout of your i-94 page.
* Identify your nearest SSN office. Go to that office. Take a token for "new SSN". Wait for your turn, and then hand it over to the officer (Tip : Go early in the morning to avoid queues and waiting time).

4) Apply for Driver's License
* In most states (barring big cities), you will need a car for even buying groceries. To buy a car, you will first need a Driver's license.
* To obtain a Driver's License, first you must be eligible by scoring 6 points in the documents check.
* Your passport will give you 4 points, 1 point for SSN and 1 point for a bank debit card.  So usually you will clear the 6-point verification once you have the SSN and the bank account.
* Next, you will have to clear the written test and the on-the-road test. Learn all the traffic signs, and rules. Make sure to take all the tests(repeatedly) from these websites:
****http://driving-tests.org/new-jersey/

5) Apply for a Credit Card
* Having a credit card in the US is kind of useful because it will help you maintain your "credit score" (better credit score = more trust)
* Getting a credit card is a bit difficult for first timers. You will have to go for something called "secured credit card".
* Another option is : BoFA has tie ups with some popular companies (only the bank staff can tell you which companies are eligible). If you are an employee of these companies, chances are you will get a credit card easily.  May be they will give you low initial credit limit (say $2000), but good enough to get started with your credit history.

Wednesday, May 27, 2015

Setup WordPress On Amazon EC2 : Installation steps with Linux commands cheat sheet


This is a real quick guide to setup WordPress On Amazon EC2. It is a direct result of following a Youtube tutorial on the same subject by a guy named Avishai Sam Bitton, who is the Marketing Director at Imonomy & Founder of Go Social.

The Youtube tutorial by itself was great. In 10 minutes, Avishai shows you how to go from creating a Linux instance to the WordPress admin page. It is done on the Amazon Linux AMI (not Ubuntu or RHEL). The only missing thing is the Linux commands cheat sheet (copy-paste-able) which I will cover in the following paragraphs. I will try to provide maximum information in minimal words.

Here is the actual video and what follows is my notes on the same :

To setup a WordPress blog on the Amazon EC2 infrastructure, you need to know and do the following as a prerequisite:
  • Have Putty and PuttyGen installed (or ready for use)
  • Have basic understanding of Linux concepts and commands. Know how to use putty, and optionally understand security concepts.
  • You should have created an Amazon AWS account. A credit card signup is required even though the basic Linux instance (micro instance) is free for 12-months.
Once you're ok with the above, follow these steps.

Part A

  1. Login to the Amazon AWS console.
  2. Select :  EC2  - Virtual servers in the cloud.
  3. Under Create Instance, click on Launch Instance.
  4. Select Amazon AMI Linux - 64 bit
  5. Check settings. Maintain defaults. Keep clicking next - until you reach the Configure Security Group section.
  6. Click Add Rule twice : One for the HTTP (port 80) and another for the HTTPS (port 443). The SSH rule is already added with port 22.
  7. Click Review and Launch. Click Launch. This opens a dialog to create a new key pair. 
  8. Create a new key pair. Download the pem file to your local folder.
  9. Now click Launch Instance (wait for 5 mins for startup)
  10. In the meantime, convert the pem file to ppk file. For this, open PuttyGen tool, go to Menu->Convert->Import->Save file with ppk extension to your local drive.

Part B

  1. The instance which you launched couple of steps back should now be running(green tick mark)
  2. On the Left pane -> click Elastic IPs -> Allocate New Address -> Yes,Allocate
  3. Right click on the allocated Elastic IP -> Associate Address -> running instance (some 10-character code). Click Associate.
  4. Go to EC2 Dashboard -> Running Instances. Check the Public IP and Elastic IP (both should be same).
  5. Copy the IP address. Open Putty and copy the IP address into putty's Host.
  6. Go to SSH->Auth, browse open the converted ppk file. Go back to Session and click Open. Putty's black screen should open up.
  7. Login as : ec2-user

Part C - The Linux Commands (aka Cheat Sheet)

Once you've logged in as the ec2-user, type in the below commands one after another.
CommandsNotes
sudo yum updateUpdates all software patches on the instance
sudo suSwitching to root user
yum install httpdInstalls Apache server
service httpd startStarts Apache server
yum install php php-mysqlInstalls PHP
yum install mysql-serverInstalls MySQL
service mysqld startStarts MySQL server
mysqladmin -uroot create myblogmyblog will the name of the database in this example)
mysql_secure_installationFollow these steps:
* Enter current password for root: just press enter key
* Set root password? : Y (enter password twice)
* Remove Anonymous Users? : Y
* Disallow root login remotely: Y
* Remove test database and access to it? : Y
* Reload privileges table now? : Y
cd /var/www/htmlGo to this directory
wget http://wordpress.org/latest.tar.gzDownload the latest version of Wordpress
tar -xzvf latest.tar.gzExtract Wordpress
mv wordpress myblogRename the the blog to myblog
cd myblogGo to the myblog directory
mv wp-config-sample.php wp-config.phpRename the php config file.
vi wp-config.phpEdit the wp-config.php file with the given information :
* define('DB_NAME', 'myblog')
* define('DB_USER', 'root')
* define('DB_PASSWORD', 'yourpassword')
* press escape key
* :wq! (to save and exit)
service httpd restartRestarts Apache server


Now, open your browser, and enter : http://IPAddress/myblog. Your Wordpress blog's Admin installation page should be ready for configuration.

Saturday, May 23, 2015

How to find lines not containing (matching) a string in Notepad++

 In Notepad++, you might have a requirement to find or replace lines which do NOT match a particular string.
Lets say you have the following lines in your text file - and you would like to the find lines NOT containing the string "USA"

Apple - USA
Airbus - France
Google -USA
IBM - USA
SAP - Germany
TESCO - UK


For this, you will have to use the Notepad++ Regex find option

Here's how:
  • Press Ctrl + F to pop open the Find dialog box
  • Select the Regular Expression radio button
  • Type in the find box : ^(?!.*USA).*$ 
  • Now find or replace.
Here are couple of awesome books to understand more about Regular expressions :

Here's a screenshot of my notepad++ screen.

 

Thursday, May 14, 2015

The best book for website user experience UX design

One of the best books for web developers / designers is Steve Krug's Don't Make Me Think

Friday, July 5, 2013

How to install Beautiful Soup or BS4 on Windows?

BeautifulSoup is a Python module which is meant for web scraping. That is, using Python, you can fetch an html webpage (using a module such as urllib2), and then obtain meaningful information out of the html file (using the BeautifulSoup module).

Here are the steps to download and install BeautifulSoup on Windows. It assumes you have already installed python and you know how to use an archiving tool such as 7-zip.

1) Download the BeautifulSoup compressed file from the below link:
http://www.crummy.com/software/BeautifulSoup/bs4/download/

In my setup, I have downloaded a file named beautifulsoup4-4.2.1.tar.gz.

2) Extract the archive using a tool such as 7-zip. Once you have extracted the files, open cmd prompt, and go to directory named beautifulsoup4-4.2.1

3) Run the following command to install BeautifulSoup
C:\>python setup.py install

4) Test the installation with this command :
>>>from bs4 import BeautifulSoup

If you see the python prompt (>>>) in the next line without any errors, then it means BS4 is successfully installed.

For detailed coverage, check out this book : Getting Started with Beautiful Soup

Monday, July 1, 2013

A list of cookbooks on computers and technology

Here's a list of technology books- all related to computing. These are purely cookbooks, whose content is generally structured in the form of 'recipes'. For example, a recipe in an O'reilly book would have a problem statement, the solution and then a discussion. A book from PackT publishers would have headings like "How to do it", "How it works", "There's more", "See also", etc.

Though these books are useful for beginners, they are meant for fairly experienced users or developers who want to achieve specific tasks. I have linked each book to its Amazon.com page so that you can check out some reviews or read sample chapters. As much as possible, I have listed books that have a rating of 4+ stars on Amazon (assuming at least 90% of the reviews are genuine). Hope you enjoy it.

Programming - Java, C, Python, Ruby, PERL, R 


  • Perl Cookbook, Second Edition
  • R Cookbook (O'Reilly Cookbooks)
  • PHP Cookbook: Solutions and Examples for PHP Programmers
  • Clojure Data Analysis Cookbook
  • Ruby Cookbook (Cookbooks (O'Reilly))
  • Java Cookbook, Second Edition
  • ActionScript 3.0 Cookbook: Solutions for Flash Platform and Flex Application Developers
  • Java 7 New Features Cookbook by Richard M. Reese and Jennifer L. Reese (Feb 23, 2012)
  • C# Programmer's Cookbook
  • Java SOA Cookbook
  • XSLT Cookbook: Solutions and Examples for XML and XSLT Developers, 2nd Edition

  • Databases, SQL, NoSQL

    Linux, Unix, Bash

    Arduino, Raspberry Pi

    Android , iOS

    Web

    Enterprise Technologies -  Oracle, SAP, IBM

    Microsoft

    Miscellaneous