Skip to content

Instantly share code, notes, and snippets.

@amper5and
amper5and / script_usbmount.sh
Created February 13, 2019 21:08 — forked from cxfksword/script_usbmount.sh
asus stock fireware jffs start script
https://github.com/Entware-ng/Entware-ng/wiki/Install-on-Asus-stock-firmware
cat << EOF > /tmp/script_usbmount.tmp
if [ \$1 = "/tmp/mnt/MYPART" ]
then
ln -sf \$1 /tmp/opt
/opt/etc/init.d/rc.unslung start
fi
@amper5and
amper5and / node-on-ec2-port-80.txt
Created January 15, 2012 19:02 — 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 TOTALLY WRONG SOLUTION:
Alter the port the script talks to from 8000 to 80:
}).listen(80);
@amper5and
amper5and / gist:1070592
Created July 7, 2011 21:32
Demonstrates strange multiple firing behavior of stdin 'keypress' event in node.js
/*
Run this with node, then type "keys" and press ENTER
Pressing a key seems to fire the 'keypress' event twice on process.stdin when a key is depressed.
Even when the 'keypress' event listener is removed from stdin,
the behavior persists and two characters are entered for any keypress.
This is observed in node v0.4.8 running under cygwin in Windows XP.