Skip to content

Instantly share code, notes, and snippets.

View fuji246's full-sized avatar

Jiantao Fu fuji246

View GitHub Profile
@fuji246
fuji246 / copa-congestion-control.md
Created November 11, 2020 00:06
copa congestion control

Copa Memos

[toc]

  1. It is delay-based congestion control, no react to packet loss.
  2. It is window based, not rate based congestion control.
  3. It relies on ACK feedback.
  4. It has mode switch to compete with buffer-filling flows like TCP.
  5. It uses smallest RTT in recent srtt/2 duration to filter noise (ACK compression, WiFi aggregation)
  6. Compared with Copa, NADA can achieve low delay and maintain at steady state as well, and it also has mode switch to compete with TCP, and it's more easiler to try NADA with current framework/protocols. However NADA may be sensative to noise in delay/loss, which need more investigation.
@fuji246
fuji246 / stackbar.py
Created September 18, 2020 16:55
stack bar plot
from collections import OrderedDict, Counter
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
june_data = {
'joining_or_others': 44,
'video_delay': 29,
'meeting_dropped': 25,
@fuji246
fuji246 / appctrl.applescript
Created March 19, 2020 19:03
application control applescript template
#!/usr/bin/osascript
on getProcessName(appPath)
set AppleScript's text item delimiters to "/"
set filename to text item -1 of appPath
set AppleScript's text item delimiters to "."
set processName to text item -2 of filename
log "processName:" & processName
return processName
end getProcessName
@fuji246
fuji246 / dummynet.sh
Created March 19, 2020 18:55
osx network emulator with dummynet
#!/bin/bash
# ./dummynet.sh -b 500 -q 1000 -i 1 -t out -f 10.22.133.53 prepare
# ./dummynet.sh -b 500 -q 1000 -i 2 -t out -f 10.22.133.25 prepare
# ./dummynet.sh start
# ./dummynet.sh stop
#
# To avoid sudo with password, adding the following into /etc/sudoers
#
@fuji246
fuji246 / camtwist.applescript
Created March 19, 2020 18:54
script to control camtwist
#!/usr/bin/osascript
on openCamTwist()
tell application "CamTwist"
activate
delay 1
end tell
end openCamTwist
@fuji246
fuji246 / shell-recipe.md
Last active March 19, 2020 20:47
shell script recipe
  1. loop file with pattern
lines=$(find "$logdir" -name '*.log' -print)

while read line
do
    echo "processing \"$line\""
done <<< "$(echo -e "$lines")"
@fuji246
fuji246 / playrecording.applescript
Created March 19, 2020 18:42
script for play recording with QuickTime Player
#!/usr/bin/osascript
on play_video(recording_path)
tell application "QuickTime Player"
if it is not running then
log "play video: " & recording_path
set filepath to (recording_path as POSIX file)
set theMovie to open file filepath
tell theMovie
set the presenting to true
@fuji246
fuji246 / skype_stats.applescript
Created March 19, 2020 18:40
capture skype UI media statistics
#!/usr/bin/osascript
on todayISOformat()
set dateFormat to "%T"
set theDate to current date
set y to text -4 thru -1 of ("0000" & (year of theDate))
set mon to text -2 thru -1 of ("00" & ((month of theDate) as integer))
set d to text -2 thru -1 of ("00" & (day of theDate))
set H to text -2 thru -1 of ("00" & (hours of theDate))
set M to text -2 thru -1 of ("00" & (minutes of theDate))
@fuji246
fuji246 / screencapture.applescript
Created March 19, 2020 18:39
screen capture script using QuickTime Player
#!/usr/bin/osascript
# helper function for command parameters
on stringSplit(str, delimiters)
# save delimiters to restore old settings
set oldDelimiters to AppleScript's text item delimiters
# set delimiters to delimiter to be used
set AppleScript's text item delimiters to delimiters
# create the array
set splitedArray to every text item of str
@fuji246
fuji246 / mtr.sh
Created March 19, 2020 00:50
dump mtr result to log file
#!/bin/bash
> mtr.log
for (( ; ; ))
do
mtr $1 -u -r >> mtr.log
done