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
apt-get update && apt-get -y upgrade | |
apt-get install -y wireguard-tools dumb-init git | |
#Install NodeJS | |
curl -sL https://deb.nodesource.com/setup_16.x | bash - | |
apt-get update && apt-get -y upgrade | |
apt -y install nodejs | |
#Install WG Easy | |
git clone https://github.com/WeeJeWel/wg-easy WGEASY |
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
[Unit] | |
Description=WG-Easy Service | |
After=network.target | |
[Service] | |
ExecStart=/usr/bin/node /app/server.js | |
WorkingDirectory=/app | |
Restart=always | |
User=root | |
Group=nogroup |
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 mlflow | |
# There are two ways to create parent/child runs in MLflow. | |
# (1) The most common way is to use the fluent | |
# mlflow.start_run API, passing nested=True: | |
with mlflow.start_run(): | |
num_trials = 10 | |
mlflow.log_param("num_trials", num_trials) | |
best_loss = 1e100 |
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
from bayes_opt import BayesianOptimization | |
from sklearn.cross_validation import KFold | |
import xgboost as xgb | |
def xgbCv(train, features, numRounds, eta, gamma, maxDepth, minChildWeight, subsample, colSample): | |
# prepare xgb parameters | |
params = { | |
"objective": "reg:linear", | |
"booster" : "gbtree", | |
"eval_metric": "mae", |
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
# IF YOU INCUR HUGE COSTS WITH THIS OR IT BREAKS DON'T BLAME ME License | |
# This is a throw-away script I wrote to pull the json events for all of the streams from a cloudwatch log | |
# For some reason, the naive way to do vpc network logging does logging to different streams in a cloudwatch | |
# log based on interface. | |
# Great for diagnosing lots of things, and generating verbose logs, but for the broad-stroke analysis I was doing, | |
# all I really wanted was the basic data. This would have been easier if I had logged to s3, but I did not see a | |
# way to do that in 2 clicks. | |
group_name = 'CHANGEME' |
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 datetime | |
def week_for_date(target): | |
"""Given a target date, return a start and end for that date's ISO week. | |
The returned tuple includes two datetime.date's, (start, end): | |
start: midnight on the first day of the ISO week containing the target | |
end: midnight on the first day following the ISO week containing the target | |
Note that the end date represents the first date _not_ in the target week, |