Skip to content

Instantly share code, notes, and snippets.

View peramsathyam's full-sized avatar

Peramanathan Sathyamoorthy peramsathyam

  • Weavler AB
  • Stockholm
View GitHub Profile
@peramsathyam
peramsathyam / node-on-ec2-port-80.md
Created June 30, 2016 19:19 — forked from kentbrew/node-on-ec2-port-80.md
How I Got Node.js Talking on EC2's Port 80

The Problem

Standard practices say no non-root process gets to talk to the Internet on a port less than 1024. How, then, could I get Node talking on port 80 on EC2? (I wanted it to go as fast as possible and use the smallest possible share of my teeny tiny little micro-instance's resources, so proxying through nginx or Apache seemed suboptimal.)

The temptingly easy but ultimately wrong solution:

Alter the port the script talks to from 8000 to 80:

}).listen(80);
@peramsathyam
peramsathyam / gist:0c014c0793fafb433c193901983fc542
Created June 27, 2016 13:37 — forked from madrobby/gist:9476733
Download a single file from a private GitHub repo. You'll need an access token as described in this GitHub Help article: https://help.github.com/articles/creating-an-access-token-for-command-line-use
curl -H 'Authorization: token INSERTACCESSTOKENHERE' -H 'Accept: application/vnd.github.v3.raw' -O -L https://api.github.com/repos/owner/repo/contents/path
@peramsathyam
peramsathyam / Git push deployment in 7 easy steps.md
Created May 19, 2016 13:16 — forked from thomasfr/Git push deployment in 7 easy steps.md
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook
@peramsathyam
peramsathyam / 0_reuse_code.js
Created March 1, 2016 12:29
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@peramsathyam
peramsathyam / README.md
Created February 23, 2016 17:03 — forked from hofmannsven/README.md
My simply Git Cheatsheet