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 / stripe-button.css
Created May 5, 2016 00:57
Blue stripe connect button
/* Stripe Button */
.stripe-connect {
display: inline-block;
margin-bottom: 1px;
background-image: -webkit-linear-gradient(#28A0E5, #015E94);
background-image: -moz-linear-gradient(#28A0E5, #015E94);
background-image: -ms-linear-gradient(#28A0E5, #015E94);
background-image: linear-gradient(#28A0E5, #015E94);
@peramsathyam
peramsathyam / VisualEvent_Loader.js
Created March 15, 2016 14:30
hightlight dom events visually
/**
* This source file is free software, under the GPL v2 license:
* http://www.gnu.org/licenses/gpl-2.0.html
*/
(function(a,b){typeof VisualEvent_Loader=="undefined"&&(a.VisualEvent_Loader=function(){if(!this instanceof VisualEvent_Loader){alert("VisualEvent loader warning: Must be initialised with the 'new' keyword.");return}this.s={loadingComplete:!1},this.dom={loading:b.createElement("div")},this._construct()},VisualEvent_Loader.prototype={_construct:function(){var c=this,d,e,f=a.location.protocol==="file:"?"http:":"";if(this.s.loadingComplete===!0)return 0;d=this.dom.loading,d.setAttribute("id","EventLoading"),d.appendChild(b.createTextNode("Loading Visual Event...")),e=d.style,e.position="fixed",e.bottom="0",e.left="0",e.color="white",e.padding="5px 10px",e.fontSize="11px",e.fontFamily='"Lucida Grande", Verdana, Arial, Helvetica, sans-serif',e.zIndex="55999",e.backgroundColor="#93a8cf",b.body.insertBefore(d,b.body.childNodes[0]),VisualEvent_Loader.jQueryPreLoaded=typeof jQuery=="undefined"?!1:!0;if
@peramsathyam
peramsathyam / README.md
Last active March 4, 2016 13:27
Script that resize the .jpg images in the folder and saves

Install Python Image Library(PIL)

We are installing Pillow forked from PIL (as it is compatible with setuptools)

  • pip install pillow
  • Navigate to any folder contains images of type JPEG
  • Download by Right-click and save as resize_image.py

OR

@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 / convert_iso_img.sh
Created February 27, 2016 16:26
convert the iso file into img file prepare bootable usb
hdiutil convert -format UDRW -o ubuntu-14.04.4-desktop-amd64.img ubuntu-14.04.4-desktop-amd64.iso
mv ubuntu-14.04.4-desktop-amd64.img.dmg ubuntu-14.04.4-desktop-amd64.img
@peramsathyam
peramsathyam / README.md
Created February 23, 2016 17:03 — forked from hofmannsven/README.md
My simply Git Cheatsheet