Monthly Archives: July 2013

Standford Startup Engineering online course – week1, 2 summary & experience

Standford Starup Engineering

Strategy

A long waiting is over. I am more determined to complete this course with following reasons : Potential, Interesting, and Collaborative Learning.  As course title suggested, at the end of course, I need to come up with a HTML 5 enabled mobile application that can bring a potential crowd sourcing.

Technologies in the course are relevant to my current work. Even though applications that I am dealing with are not public facing, certain technologies are relevant and very interesting : AWS, Cloud, Heroku, Node.js, Unix CLI, Git, GitHub, emacs, Bootstrap, Backbone.js, Coffeescript, REST, JSON, NoSQL, BitCoin, Social and payment integration. So many topics that I wanted to master/learn, but hard to get to because of time constraint and lack of systematical approach. For this reason, I thought about collaborative learning. Learn and discuss in a group and maximizing a benefit of peer pressure to keep everyone on the topics and achieve the learning objectives in the end. I have motivated and talented 8 co-workers, who are taking this course together, so it will be perfect time for me to experiment collaborative learning.

Week 1, 2 Experience

Each week’s objectives are clearly defined and lecture slides are very well prepared. Of course, the professor is an entrepreneur himself and very technical. First two weeks topics are sticking to AWS, Cloud, Heroku, Node.js, Git, and Unix commands. Without having in-depth knowledge about Unix command, I don’t have a problem to complete the homeworks. I think having more than 115,000 students from all over the world, professors are having a great challenge. Probably, it can be a learning experience for them by dealing with so many students (big data) and analyze the data in useful ways.

Summary – my notes

FileSystem Basics

  • pwd #Print working directory
  • touch myfile # Create a blank file called myfile
  • ls myfile
  • ls -alrth myfiel # list metadata on myfile
    • -a show you all files, even hidden
    • -l show you hugh amounts of information
    • -r reverse the order of how the files are displayed
    • -t show you the files in the modification time
    • -h ?
  • alias ll=’ls -alrth’ # set up an alias to save typing
  • echo “line1” >> myfile # append via ‘>>’ to a file

There are two ways of see the current value of PATH :

  • env | grep “^PATH”
  • echo $PATH

Read one or more files and print them to standard output

  • cat [options] [files]

Retrieve from remote location

  • wget [url]

Change permission of a file. Total number can be presented as a parameter to allow certain user group with privilege.

  • chmod
    • 400 read by owner
    • 040 read by group
    • 004 read by anybody (other)
    • 200 write by owner
    • 020 write by group
    • 002 write by anybody
    • 100 execute by owner
    • 010 execute by group
    • 001 execute by anybody

Connect to remote machines

  • ssh -i [private key]

Create a single or multiple directories. With -p, create parents if doesn’t exit.

  • mkdir -p [directories]

Remove all

  • rm -rf :
  • rmdir [directory]

Create alias – create a file and add below information.

  • Host awshost1
  • HostName ec2-34-228-105-7.us-west-2.compute.amazonaws.com
  • User ubuntu
  • IdentityFile “~/.ssh/xxkey.pem”

Copy hello.txt from local to remote home

  • scp hello.txt awshost1:~/

Copy ~/foo.txt from remote to local

  • scp awshost1:~/foo.txt .

sudo : Perform following command with super-user (root) capabilities.

sudo apt-get update : download the package lists from the repositories and updates them to get info on the newest versions of packages and dependencies.

Linux has two major ways to install software : Binary packages, Source.

  • Install a Binary package :
  • sudo apt-get install

Binary Package Disadvantages

  • Not able to customize binaries
  • Only old versions are available in binary format

sudo apt-get upgrade : fetch new version of packages existing on the machine if APT knows about these new versions by way of apt-get update.

sudo apt-get dist-upgrade: same as apt-get upgrade, plus it will handle dependencies.

sudo add-apt-repository ppa:chris-lea/node.js : a command which allows us to add a new repository link to the apt sources (/etc/apt/sources.list). Handy to add PPA archives. ppa:<repository-name>

*PPA (Personal Package Archive) : a special software repository for uploading source packages to be built and published as an A|PT repository by Launchpad or similar application – exclusive to Ubuntu.
*APT (Advanced Packaging Tool) : a free user interface that works with core libraries to handle the installation and removal of software on the GNU/Linux distribution. APT simplifies the software on Unix-like system by automating retrieval, configuration and installation of software packages.
* https://help.ubuntu.com/community/Repositories/CommandLine

#!/usr/bin/env node : Writting an executable scirpt with Node beginss with shebang : #!, followed by the path to a Node executable.