Skip to content

Instantly share code, notes, and snippets.

View rozgo's full-sized avatar

Alex Rozgo rozgo

View GitHub Profile
given this:
$ git status
# On branch muzzle_flash
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: Assets/Ammo/CannonBall.prefab
using UnityEngine;
using System.Collections;
using System.IO;
public class ExecuteCommand : MonoBehaviour
{
void Start ()
{
//string path = Directory.GetCurrentDirectory();
@rozgo
rozgo / socket buffer
Created June 19, 2013 23:57
increase socket buffer
# increase TCP max buffer size settable using setsockopt()
net.core.rmem_max=16777216
net.core.wmem_max=16777216
# increase Linux autotuning TCP buffer limit
net.ipv4.tcp_rmem=4096 87380 16777216
net.ipv4.tcp_wmem=4096 65536 16777216
# increase the length of the processor input queue
net.core.netdev_max_backlog=30000
@rozgo
rozgo / gist:1145591
Created August 15, 2011 01:54
view matrix reminders
for a modelview matrix is:
m0 m4 m8 m12
m1 m5 m9 m13
m2 m6 m10 m14
m3 m7 m11 m15
then:
(m0,m1,m2): X-Model in View coord.
@rozgo
rozgo / gist:1027953
Created June 15, 2011 19:58
Gestures
// [email protected]
using UnityEngine;
using System.Collections;
public class Gestures : MonoBehaviour {
float lastf0f1Dist;
void Update () {
@rozgo
rozgo / node-on-ec2-port-80.txt
Created June 13, 2011 16:34 — 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);