Skip to content

Instantly share code, notes, and snippets.

#!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
package main
import "fmt"
func fmap( f (func(int) int), a []int) []int {
for i:= range a {
a[i] = f(a[i])
}
return a
}
@nvasilakis
nvasilakis / hex.py
Last active August 29, 2015 14:01
Encoding in Python
# + 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):
@nvasilakis
nvasilakis / install_scapy.sh
Created May 28, 2014 15:38
Install Scapy on OS X
# 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
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";
@nvasilakis
nvasilakis / hw1m1.md
Last active August 29, 2015 14:01
HW1MS1 Markdown

Homework 1 | Milestone 1

About this file

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.

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
@nvasilakis
nvasilakis / node-install.sh
Created April 28, 2014 18:10
Node.js Post-Install
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/
#!/bin/sh
#
# chkconfig: 35 99 99
# description: Node.js /home/nodejs/sample/app.js
#
. /etc/rc.d/init.d/functions
USER="nodejs"
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