Skip to content

Instantly share code, notes, and snippets.

View vikramsoni2's full-sized avatar

Vikram vikramsoni2

  • Baxter International
  • Madrid
View GitHub Profile
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
@WeslieDE
WeslieDE / wg-easy.service
Created July 24, 2023 21:56
systemd servicefile for wg-easy
[Unit]
Description=WG-Easy Service
After=network.target
[Service]
ExecStart=/usr/bin/node /app/server.js
WorkingDirectory=/app
Restart=always
User=root
Group=nogroup
@smurching
smurching / parent-and-child-runs.py
Last active February 29, 2024 13:30
creating-child-runs-in-mlflow
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
@thomasjungblut
thomasjungblut / xgb_bayes_opt_cv.py
Last active May 22, 2024 22:14
XGBoost hyper parameter optimization using bayes_opt
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",
@eldondevcg
eldondevcg / get_cloudwatch_logs.py
Last active January 13, 2023 21:11
Pull down cloudwatch logs with boto
# 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'
@idan
idan / gist:9596928
Created March 17, 2014 10:15
Python ISO week for date
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,