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
#!/bin/bash | |
function aws_mfa { | |
code="$1" | |
serial_number="<add mfa serial here>" | |
# Check if token code is provided | |
if [ -z "$code" ]; then | |
echo -e "\e[31mToken code not provided. Please provide the token code as an argument.\e[0m" | |
echo "Usage: aws_mfa <token-code> [additional arguments]" |
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
function aws_mfa | |
set code $argv[1] | |
set serial_number "<add mfa serial here>" | |
# Check if token code is provided | |
if test -z $code | |
set_color red | |
echo "Token code not provided. Please provide the token code as an argument." | |
set_color normal | |
echo "Usage: aws_mfa <token-code> [additional arguments]" |
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
!/bin/bash | |
echo "======================Downloading Miniconda==============================" | |
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh | |
chmod +x Miniconda3-latest-Linux-x86_64.sh | |
echo "======================Installing Miniconda ==============================" | |
./Miniconda3-latest-Linux-x86_64.sh | |
source ~/.bashrc | |
echo "======================Installing JupyterLab==============================" | |
conda install -c conda-forge jupyterlab nb_conda ipywidgets nodejs -y |
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
# Source: https://towardsdatascience.com/make-your-own-super-pandas-using-multiproc-1c04f41944a1 | |
def parallelize_dataframe(df, func, n_cores=4): | |
df_split = np.array_split(df, n_cores) | |
pool = Pool(n_cores) | |
df = pd.concat(pool.map(func, df_split)) | |
pool.close() | |
pool.join() | |
return df |