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
# Include the Dropbox SDK libraries | |
from dropbox import client, rest, session | |
# Get your app key and secret from the Dropbox developer website | |
APP_KEY = 'KEYKEYKEY' | |
APP_SECRET = 'SECRET' | |
# ACCESS_TYPE should be 'dropbox' or 'app_folder' as configured for your app | |
ACCESS_TYPE = 'dropbox' ### 'app_folder' |
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
def straddr2int(addr): | |
""" | |
converts IPv4 address inot an integer | |
>>> str2int('192.168.129.43') | |
3232268587 | |
""" | |
return reduce( lambda a,b: a<<8|b, map(int,addr.split('.')) ) |
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.packages("RPostgreSQL") | |
# install.packages("zoo") | |
# Notes: EMA - Exponential moving average with alpha=0.05 | |
library(RPostgreSQL) | |
library(TTR) | |
drv <- dbDriver("PostgreSQL") | |
##con <- dbConnect(drv, dbname="probedb", user="postgres", host="192.168.132.111") | |
con <- dbConnect(drv, dbname="1", user="postgres", host="192.168.132.111") |
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
fsvsbs <- read.csv("~/fsvsbs.csv", sep=";") | |
fsvsbs$rel_err = fsvsbs$rel_err*100 | |
plot( | |
fsvsbs$rel_err ~ fsvsbs$delta, | |
xlab="Step / Sub-range Length (sec)", | |
ylab="Relative Error (%)", | |
main="Relative Error of Bandwidth Estimate Based On Flow Sample") | |
nls_fit <- nls(rel_err ~ a + b * delta^(-c), fsvsbs, start = list(a = 43, b = 4, c = 0.2)) | |
lines(fsvsbs$delta, predict(nls_fit), col="red",lwd=3) |
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
library(RPostgreSQL) | |
drv <- dbDriver("PostgreSQL") | |
con <- dbConnect(drv, dbname="6", user="postgres", host="192.168.132.111") | |
# dbListConnections(drv) | |
# dbGetInfo(drv) | |
# summary(con) | |
rs <- dbSendQuery(con," | |
SELECT | |
delta, delta_cnt , |
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.packages("RPostgreSQL") | |
# install.packages("zoo") | |
# Notes: EMA - Exponential moving average with alpha=0.05 | |
library(RPostgreSQL) | |
library(TTR) | |
drv <- dbDriver("PostgreSQL") | |
##con <- dbConnect(drv, dbname="probedb", user="postgres", host="192.168.132.111") | |
con <- dbConnect(drv, dbname="1", user="postgres", host="192.168.132.111") |
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
# total storage size held by processes: | |
lsof /data | grep postgres | grep deleted | awk '{ SUM += $7} END {print SUM}' | |
# processes that hold inodes: | |
lsof /data -u postgres | grep "(deleted)" | tr -s ' ' | cut -d ' ' -f2 | sort -u | xargs ps -u -p |
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
LANG=ko_KO.UTF-8 sed 's/\r$//; s/^\([^\t]*\)\t\([^\t]*\)$/\1\t\2\t/' set2.csv > set2_.csv |
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
# with sed: | |
sed -i '28d' ~/.ssh/known_hosts | |
# with ed: | |
ed -s ~/.ssh/known_hosts <<< $'28d\nw' |
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
ls -1 *tar* | xargs -P 8 -I{} tar xf {} |
OlderNewer