Skip to content

Instantly share code, notes, and snippets.

View soohyunc's full-sized avatar

Soo-Hyun Choi soohyunc

View GitHub Profile
#!/bin/bash
#
# Copyright (C) 2010 Brady Miller <brady@sparmy.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
#
@soohyunc
soohyunc / stats.tcl
Created June 10, 2013 08:42
System Stats
#!/usr/bin/tclsh
# calculate system uptime
set host [lindex [split [exec hostname] "."] 0]
set ut [exec /usr/bin/uptime]
if {([lindex $ut 3] == "days,")||([lindex $ut 3] == "mins,")||([lindex $ut 3] == "hrs,")||([lindex $ut 3] == "day,")||([lindex $ut 3] == "min,")||([lindex $ut 3] == "hr,")} {
set up "[lindex $ut 2] [string trimright [lindex $ut 3] \",\"]"
} else {
set up [string trimright [lindex $ut 2] ","]
}
@soohyunc
soohyunc / .vic.tcl.loopback_on
Created June 10, 2013 09:00
An example of .vic config file (turn on loopback interface by default)
#!/bin/sh
#\
exec wish4.2 "$0" "$@"
#
proc user_hook {} {
global V
$V(data-net) loopback 1
$V(ctrl-net) loopback 1
@soohyunc
soohyunc / .vic.tcl.transmit-on-start
Created June 10, 2013 09:02
An example of .vic config file
option add Vic.transmitOnStartup true startupFile
@soohyunc
soohyunc / .vic.tcl.start-expt
Created June 10, 2013 09:03
An example of .vic config file (a custom user setting)
#!/bin/sh
#\
exec wish4.2 "$0" "$@"
#
proc user_fps {val} {
global fps_slider
$fps_slider set $val
}
@soohyunc
soohyunc / .vic.tcl.transmit_but
Created June 10, 2013 09:04
An example of .vic config file (a custom user setting)
#!/bin/sh
#\
exec wish4.2 "$0" "$@"
#
proc user_fps {val} {
global fps_slider
$fps_slider set $val
}
@soohyunc
soohyunc / vic_script.tcl
Created June 10, 2013 09:37
A sample Vic running script
# vic_script.tcl ---
#
# Filename: vic_script.tcl
# Description:
# Author: Soo-Hyun Choi <S.Choi@cs.ucl.ac.uk>
# Maintainer:
# Created: Thu Feb 5 16:39:02 2009 (+0000)
# Version:
# Last-Updated: Thu Feb 5 16:54:24 2009 (+0000)
# By: Mohamed Ahmed <m.ahmed@cs.ucl.ac.uk>
@soohyunc
soohyunc / tcp-ttfwc.diff
Created June 21, 2013 10:17
TCP extension for TTFWC implementation
From b7a7b02e30d51ed2117068c7e33b835721157467 Mon Sep 17 00:00:00 2001
From: katoon <katoon@vernis.ht.sfc.keio.ac.jp>
Date: Sun, 17 Jul 2011 17:39:59 +0900
Subject: [PATCH] net: ipv4: add new congestion control
We add Tunable TCP-Friendly Window Control (TTFWC) as TCP
extension. TTFWC allows users or applications to tune the
balance between responsiveness and smoothness with a tuning
parameter. You can set the parameter by sysctl.
@soohyunc
soohyunc / queueSize.tcl
Created June 21, 2013 10:19
ns-2 queueSize.tcl
proc setQueueSize {rate queue node1 node2} {
global ns
switch $rate {
60 {
$ns queue-limit $node1 $node2 1000
$ns queue-limit $node2 $node1 1000
if {$queue=="RED"} {
set redq [[$ns link $node1 $node2] queue]
$redq set thresh_ 100
$redq set maxthresh_ 500
<!DOCTYPE html>
<h1>Simple web camera display demo</h1>
<video autoplay></video>
<script type="text/javascript">
var video = document.getElementsByTagName('video')[0],
heading = document.getElementsByTagName('h1')[0];
if(navigator.webkitGetUserMedia) {
navigator.webkitGetUserMedia('video', successCallback, errorCallback);
function successCallback( stream ) {