Skip to content

Instantly share code, notes, and snippets.

@anistark
Last active November 8, 2016 07:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anistark/dafa27fd7544611bfd1b99025ed8504d to your computer and use it in GitHub Desktop.
Save anistark/dafa27fd7544611bfd1b99025ed8504d to your computer and use it in GitHub Desktop.
Useful Commands

Useful Commands

Create simple server on the current directory u r in

Python

python -m SimpleHTTPServer 8000

NodeJs

Create Http Server

npm i -g http-server

To run :

http-server

Get Response Time in CURL

curl -o /dev/null -s -w %{time_total}\\n  http://www.google.com

Update node via npm

Use n module from npm in order to upgrade node

sudo npm cache clean -f
sudo npm install -g n
sudo n stable

sudo ln -sf /usr/local/n/versions/node/<VERSION>/bin/node /usr/bin/node 

To upgrade to latest version (and not current stable) version, you can use

sudo n latest

To undo:

sudo apt-get install --reinstall nodejs-legacy     # fix /usr/bin/node
sudo n rm 6.0.0     # replace number with version of Node that was installed
sudo npm uninstall -g n

Found in David Walsh blog http://davidwalsh.name/upgrade-nodejs

Get Public IP

wget http://ipinfo.io/ip -qO -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment