Skip to content

Instantly share code, notes, and snippets.

View Ewen2015's full-sized avatar
🥥

Ewen Wang Ewen2015

🥥
View GitHub Profile
@Ewen2015
Ewen2015 / generate_ssh_key.bash
Created February 23, 2024 08:27
Generating a new SSH key and adding it to the ssh-agent
function generate_ssh_key () {
read -p "Enter github email : " email
echo "Using email $email"
ssh-keygen -t ed25519 -C "$email"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
pub=`cat ~/.ssh/id_ed25519.pub`
echo "$pub"
@Ewen2015
Ewen2015 / notebook_remote.sh
Created May 31, 2023 05:50
setup a jupyter notebook remotely and open it locally
pip install jupyter lab
jupyter notebook --generate-config
cd ~/.jupyter
vi jupyter_notebook_config.py
# # The IP address the notebook server will listen on.
# c.NotebookApp.ip = '0.0.0.0' # default value is 'localhost'
# c.NotebookApp.open_browser = False # default value is True
@Ewen2015
Ewen2015 / plotly in SageMaker
Last active May 25, 2023 03:36
show plotly plot in AWS SageMaker notebook
import plotly.io as pio
pio.renderers.default = 'iframe'
@Ewen2015
Ewen2015 / tf-experiment-template.py
Created December 12, 2018 14:06 — forked from damienpontifex/tf-experiment-template.py
A template for a custom tensorflow estimator and experiment with python3 typings for desired parameter types
import argparse
import psutil
import tensorflow as tf
from typing import Dict, Any, Callable, Tuple
## Data Input Function
def data_input_fn(data_param,
batch_size:int=None,
shuffle=False) -> Callable[[], Tuple]:
"""Return the input function to get the test data.
require(caret)
trans = preProcess(X, c("BoxCox", "center", "scale"))
predictorsTrans = data.frame(trans = predict(trans, X))
<snippet>
<content><![CDATA[
# =============================================================
# Basic
import os
# Fundamental Libraries for Scientific Computing
import numpy as np
import pandas as pd
import scipy as sp