This file contains hidden or 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 | |
# The bandwidth to simulate, here about 56kilobit per second. This is layer 2 bandwidth, so TCP/UDP and IP overhead will apply | |
BW="56kbps" | |
# _Half_ the latency that we aim for. Since this applies to both the WAN port and Wi-Fi, the delay is applied twice, so this actually puts it at around 120+ms | |
LATENCY="60ms" | |
# Chance of packet loss. Also applied to both interfaces, so it is 1%. | |
LOSS="0.5%" | |
# The device name of your wifi device. | |
WIFI="wlan0" |
This file contains hidden or 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
opkg install transmission-remote transmission-web | |
mkdir -p /data/torrents/torrents-completed /data/torrents/torrents-incomplete /data/torrents/torrents /data/torrents/config | |
uci set transmission.@transmission[-1].enabled=1 | |
uci set transmission.@transmission[-1].config_dir=/data/torrents/config | |
uci set transmission.@transmission[-1].download_dir=/data/torrents/torrents-completed | |
uci set transmission.@transmission[-1].incomplete_dir_enabled=true | |
uci set transmission.@transmission[-1].incomplete_dir=/data/torrents/torrents-incomplete | |
uci set transmission.@transmission[-1].blocklist_enabled=1 |
This file contains hidden or 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/bash | |
# Downsamples all retina [email protected] images. | |
for f in $(find . -name '*@2x.png'); do | |
echo "Converting $f..." | |
convert "$f" -resize '50%' "$(dirname $f)/$(basename -s '@2x.png' $f).png" | |
done |
This file contains hidden or 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
include $(TOPDIR)/rules.mk | |
PKG_NAME:=nodejs | |
PKG_VERSION:=0.10.25 | |
PKG_RELEASE:=1 | |
PKG_BUILD_DIR:=$(BUILD_DIR)/node-v$(PKG_VERSION) | |
PKG_SOURCE:=node-v$(PKG_VERSION).tar.gz | |
PKG_SOURCE_URL:=http://nodejs.org/dist/v$(PKG_VERSION)/ | |
PKG_MD5SUM:=153bdbf77b4473df2600b8ce123ef331 |
This file contains hidden or 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/bash | |
#feedback:[email protected] | |
#install the luci interface web using an offline method | |
#hackaton 9 de ag you will need to upload this to 192.168.1.1 /tmp! | |
pkgs=(blua lua libuci-lua libubus-lua uhttpd luci-lib-ipkg luci-i18n-english luci-sgi-cgi luci-lib-core luci-lib-nixio luci-lib-sys luci-lib-web luci-proto-core luci-theme-base luci-theme-openwrt luci-mod-admin-core luci-mod-admin-full) | |
for pkg in "${pkgs[*]} | |
do | |
opkg install /tmp/luci-offline-packages/$pkg*.ipk |
This file contains hidden or 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
/* | |
* Copyright (c), Mohamed Ali Jamaoui, All rights reserved | |
* released under the MIT license | |
*/ | |
var dm = {}; | |
dm.dataMiner = function module(){ | |
This file contains hidden or 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
DEPLOYER='deployer' | |
DEPLOYER_HOME="/home/$DEPLOYER" | |
PROJECT_NAME='node-js-sample' | |
PROJECT_REPO='https://github.com/heroku/node-js-sample.git' | |
# Provisining an ubuntu server | |
apt-get -y update | |
apt-get -y upgrade | |
apt-get -y install software-properties-common | |
add-apt-repository ppa:chris-lea/node.js |
This file contains hidden or 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
var Approx = { | |
fastlog2: (function () { | |
var a = new ArrayBuffer(4), | |
i = new Int32Array(a), | |
f = new Float32Array(a); | |
return function fasterLog2 (number) { | |
f[0] = number; | |
var t = i[0] * 1.1920928955078125e-7; | |
return t - 126.94269504; |
This file contains hidden or 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
# coding=UTF-8 | |
from __future__ import division | |
import nltk | |
import re | |
import requests | |
# Add your freebase key here | |
# If you don't have one, register at https://code.google.com/apis/console | |
FREEBASE_KEY = "" |
This file contains hidden or 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
# contractions.py | |
# list from: http://en.wikipedia.org/wiki/Wikipedia:List_of_English_contractions | |
contractions = [ | |
("aren't", "are not"), | |
("can't", "cannot"), | |
("can't've", "cannot have"), | |
("'cause", "because"), | |
("could've", "could have"), | |
("couldn't", "could not"), | |
("couldn't've", "could not have"), |