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
[{"high": 1.77, "exp_date": "2019-10-28", "open_interest": 52929.0, "ask_size": 22.0, "open": null, "id0": 212299066, "mark": 1.125, "low": 0.91, "theta": -0.150152, "symbol": "SPY", "bid_size": 204.0, "strike_price": 300.0, "bid": 1.12, "volume": 3135.0, "rho": 0.016476, "delta": 0.50502, "ask": 1.13, "putorcall": "call", "vega": 0.125255, "time": "2019-10-24 10:45:31.629851-04:00", "implied_volatility": 0.089325, "gamma": 0.142229}, {"high": 1.77, "exp_date": "2019-10-28", "open_interest": 52929.0, "ask_size": 219.0, "open": null, "id0": 212301985, "mark": 1.115, "low": 0.91, "theta": -0.150697, "symbol": "SPY", "bid_size": 2.0, "strike_price": 300.0, "bid": 1.11, "volume": 3147.0, "rho": 0.016336, "delta": 0.500766, "ask": 1.12, "putorcall": "call", "vega": 0.125252, "time": "2019-10-24 10:46:03.964989-04:00", "implied_volatility": 0.089731, "gamma": 0.14161}, {"high": 1.77, "exp_date": "2019-10-28", "open_interest": 52929.0, "ask_size": 440.0, "open": null, "id0": 212304939, "mark": 1.115, "low": 0.91, "t |
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
rsync --update -raz --progress \ | |
-e "ssh -oStrictHostKeyChecking=no -i /home/ubuntu/.ssh/id_ed25519" \ | |
/var/lib/docker/overlay2/ root@34.73.55.210:/var/lib/docker/overlay2/ | |
# make sure you add key to root ~/.ssh/authorized_keys | |
# run this from root shell | |
#prior usage (inside ent-dev) (for seperate purpose) | |
rsync --progress --delete -rtLv \ | |
-e "ssh -oStrictHostKeyChecking=no -i /home/ubuntu/.ssh/container" \ |
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
sudo docker images -aq | \ | |
sed '1!G;h;$!d' | \ | |
xargs -I % bash -c "echo %; sudo docker save % | bzip2 | pv | \ | |
ssh ubuntu@ent-prod-pg.benuku.com 'bunzip2 | sudo docker load'" | |
# sed just flips the order of sudo docker images -q | |
# need quotes within quotes to do remote exec and use xargs at the same time |
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
# zild | |
cd ~ | |
curl -O https://nodejs.org/dist/v8.11.3/node-v8.11.3-linux-x64.tar.xz | |
#or alternately for OSX, run the below and replace "node-v6.9.2-linux-x64" | |
#in the rest of these invocations with "node-v6.9.2-darwin-x64." | |
#curl -O https://nodejs.org/dist/v8.11.3/node-v8.11.3-darwin-x64.tar.xz | |
tar xf node-v8.11.3-linux-x64.tar.xz | |
mkdir -p ~/.node/ | |
cp -R ~/node-v8.11.3-linux-x64/* ~/.node/ | |
rm -rf node-v8.11.3-linux-x64* |
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
import os | |
import time | |
while True: | |
os.system("ps u -p 7916 | awk '{sum=sum+$6}; END {print sum/1024}' | ts '[%Y-%m-%d %l:%M:%S %p]'") | |
time.sleep(1) |
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
free -h| grep Mem | awk -v date="$(date)" '{ print date, "==>" , $4 }' | |
#another option is '{ print date, "==>" , int($3/$2*100) }' for percentage of used memory | |
#more here: https://serverfault.com/questions/649024/one-line-script-to-check-and-react-to-memory-usage |
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
#!/usr/bin/env bash | |
peak=0 | |
while true; do | |
sleep 0.1 | |
sample="$(netstat -an | grep ESTABLISHED | wc -l)" | |
let peak='sample > peak ? sample : peak' | |
echo "$peak (curr is $sample)" | |
done |
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
TFSC | |
TFSCR | |
TFSCU | |
TFSCW | |
PIH | |
FLWS | |
FCCY | |
SRCE | |
VNET | |
TWOU |
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
import bisect, time | |
#this module makes use of the bisect module, especially bisect.bisect_left(). | |
#see https://docs.python.org/2/library/bisect.html for details. | |
class SlidingCounter(object): | |
def __init__(self): | |
self.event_arr = [] |
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
var httpProxy = require('http-proxy'); | |
var express = require('express'); | |
var fs = require('fs'); | |
var net = require('net'); | |
var Client = require('ssh2').Client; | |
var conn = new Client(); | |
var pk = 'insert private_key here'; |
NewerOlder