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
XVFB=/usr/bin/Xvfb | |
XVFBARGS=":1 -screen 0 1024x768x24 -ac +extension GLX +render -noreset" | |
PIDFILE=/var/run/xvfb.pid | |
case "$1" in | |
start) | |
echo -n "Starting virtual X frame buffer: Xvfb" | |
start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile --background --exec $XVFB -- $XVFBARGS | |
echo "." | |
;; | |
stop) |
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
#Sample task | |
task(){ | |
sleep 0.5; echo "$1"; | |
} | |
#Sequential runs | |
for thing in a b c d e f g; do | |
task "$thing" |
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
server { | |
listen 80; | |
server_name mysite.com; | |
root /var/www/mysite.com/; | |
location / { | |
if (-f $document_root/maintenance.html) { | |
return 503; | |
} | |
... # the rest of your config goes here |
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
pip install virtualenv | |
virtualenv venv | |
cd venv/Scripts | |
activate | |
pip install pandas |
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
# Working with multiple stocks | |
""" | |
SPY is used for reference - it's the market | |
Normalize by the first day's price to plot on "equal footing" | |
""" | |
import os | |
import pandas as pd | |
import matplotlib.pyplot as plt |
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 numpy | |
import pandas as pd | |
import math as m | |
#Moving Average | |
def MA(df, n): | |
MA = pd.Series(pd.rolling_mean(df['Close'], n), name = 'MA_' + str(n)) | |
df = df.join(MA) | |
return df |
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 python | |
import csv | |
import Queue | |
import threading | |
import ystockquote as ys | |
def gen_info_list(tickers, start, end): | |
''' |
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
$webhook = "SLACK INCOMING WEBHOOK URL" | |
$attachments = @(@{ | |
"pretext" = "Lab 7 Smoke Test" | |
"color"="danger" | |
"text"= "14/43 failed (5 mins)" | |
}) | |
$payload = | |
@{ | |
"attachments" = $attachments |
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
// RHEL, Fedora and CentOS based distributions | |
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc | |
sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo' | |
yum check-update | |
sudo yum install code |
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
Get-ChildItem -r -Depth 1 -include "web.config" | | |
foreach-object { $a = $_.fullname; ( get-content $a ) | | |
foreach-object { $_ -replace "oldstring","newstring" } | | |
set-content $a } |
OlderNewer