Installlation

  • pip install bash_kernel
  • python -m bash_kernel.install
echo "Using conditional statement to create a project directory and project"

# Variable section
export project_dir=$HOME/vscode  # change vscode to different name to test git clone
export project=$project_dir/APCSA  # change APCSP to name of project from git clone
export project_repo="https://github.com/nighthawkcoders/APCSA.git"  # change to project of choice

cd ~    # start in home directory

# Conditional block to make a project directory
if [ ! -d $project_dir ]
then 
    echo "Directory $project_dir does not exists... makinng directory $project_dir"
    mkdir -p $project_dir
fi
echo "Directory $project_dir exists." 

# Conditional block to git clone a project from project_repo
if [ ! -d $project ]
then
    echo "Directory $project does not exists... cloning $project_repo"
    cd $project_dir
    git clone $project_repo
    cd ~
fi
echo "Directory $project exists."
Using conditional statement to create a project directory and project
Directory /home/everittcheng/vscode exists.
Directory /home/everittcheng/vscode/APCSA exists.
  • "cat" command shows you text from inside the file
  • "env" shows enviroment
  • ".git" hidden file that keeps track of your merges, basically keeps your machine and the github cloud server in check to see when files need to change

Hacks

Verifying installed tools

Anaconda to verify that google exists

export PATH=~/anaconda3/bin:$PATH
# conda not found without this command

echo Conda Check
# test for a kernel installation
test="google" # keyword
check=`conda list | grep $test` # run command
n=${#check} # determine length

if [[ ${n} > 0 ]];  # testt length
then # greater than zero
    echo "$check"
else # less than zero
    echo "$test not found"
fi
Conda Check
google-api-core           1.25.1             pyhd3eb1b0_0  
google-auth               1.33.0             pyhd3eb1b0_0  
google-cloud-core         1.7.1              pyhd3eb1b0_0  
google-cloud-storage      1.31.0                     py_0  
google-crc32c             1.1.2            py39h27cfd23_0  
google-resumable-media    1.3.1              pyhd3eb1b0_1  
googleapis-common-protos  1.53.0           py39h06a4308_0  

Check if I have bash

test="bash" # keyword
check=`jupyter kernelspec list | grep $test` # run command
n=${#check} # determine length

if [[ ${n} > 0 ]];  # testt length
then # greater than zero
    echo "$check"
else # less than zero
    echo "$test not found"
fi
  bash          /home/everittcheng/.local/share/jupyter/kernels/bash

Check for python

test="python3" # keyword
check=`jupyter kernelspec list | grep $test` # run command
n=${#check} # determine length

if [[ ${n} > 0 ]];  # testt length
then # greater than zero
    echo "$check"
else # less than zero
    echo "$test not found"
fi
  python3       /home/everittcheng/.local/share/jupyter/kernels/python3

Update repository

cd $project
echo "Updating.............."
git pull
Updating..............
Already up to date.