This file contains information for graders of MS1 of HW1 (static web
server). It is written in the .md
markdown format, so you can view it
in beautiful html, org or other forms. Google md markdown format
for
more.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!env bash | |
# Xilinx tools: http://www.xilinx.com/support/documentation/boards_and_kits/xtp044.pdf | |
# Bluespec: http://www.bluespec.com/forum | |
# Xilix ISE:http://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/design-tools/v2012_4---14_6.html | |
# This is for bash -- if using interactively with zsh, consider | |
# setting sh_word_split on, or using $=<PARAM> instead of $PARAM | |
# TODO: Make sure all updates to $PATH are written to .${SHELL}rc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func fmap( f (func(int) int), a []int) []int { | |
for i:= range a { | |
a[i] = f(a[i]) | |
} | |
return a | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# + http://stackoverflow.com/questions/11826054/valueerror-invalid-literal-for-int-with-base-16-x0e-xa3-python | |
encodeByte(3, 42) | |
#-84 | |
n = '\x03' | |
n | |
#'\x03' | |
len(n) | |
#1 | |
int(n) | |
#Traceback (most recent call last): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install scapy on osx | |
# grap libnet | |
wget http://libdnet.googlecode.com/files/libdnet-1.12.tgz | |
tar xfz libdnet-1.12.tgz | |
./configure | |
make | |
sudo make install | |
cd python | |
python2.5 setup.py install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Rest; | |
public class SimpleTweet { | |
private static const string CONSUMER_KEY = "#######################"; // this comes from your app's twitter account page | |
private static const string CONSUMER_SECRET = "########################################"; // this comes from your app's twitter account | |
private static const string URL_FORMAT = "https://api.twitter.com"; | |
private static const string REQUEST_TOKEN_URL = "https://api.twitter.com/oauth/request_token"; | |
private static const string FUNCTION_ACCESS_TOKEN = "oauth/access_token"; | |
private static const string FUNCTION_STATUSES_UPDATE = "1/statuses/update.xml"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ten years after TCP’s development, theoretical analyses showed that TCP’s | |
congestion-control algorithm serves as a distributed asynchronous-optimization | |
algorithm that results in several important aspects of user and network performance | |
being simultaneously optimized [Kelly 1998]. A rich theory of congestion control | |
has since been developed [Srikant 2004]. | |
Using this formula, we can see that in order to achieve a throughput of 10 Gbps, | |
today’s TCP congestion-control algorithm can only tolerate a segment loss probabil- | |
ity of 2 · 10–10 (or equivalently, one loss event for every 5,000,000,000 segments)— | |
a very low rate. This observation has led a number of researchers to investigate new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update | |
sudo apt-get upgrade | |
sudo apt-get install nginx | |
sudo service nginx start | |
sudo apt-get install python-software-properties | |
sudo apt-add-repository ppa:chris-lea/node.js | |
sudo apt-get update | |
sudo apt-get install nodejs | |
sudo mkdir /var/www/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# chkconfig: 35 99 99 | |
# description: Node.js /home/nodejs/sample/app.js | |
# | |
. /etc/rc.d/init.d/functions | |
USER="nodejs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The objective of this post is to get you from absolutely nothing, to a fully functional nodejs environment. | |
Software used: Ubuntu 11.10, Nodejs v0.6.12, Nginx, MongoDB, Redis, and NPM modules. | |
1. Download and install the latest version of Ubuntu: http://www.ubuntu.com/download (don't select any extra items to install when prompted) | |
2. Once you are logged in and are at your Ubuntu command prompt, install the necessary software you will need: | |
a. sudo apt-get install openssh-server | |
b. sudo apt-get install libssl-dev | |
c. sudo apt-get install git | |
d. sudo apt-get install g++ | |
e. sudo apt-get install make |