A cheat sheet for computer science!
Linux guide
Through terminal
ssh [email protected] hostname -> a machine exit ->to exit ssh hpc0
hostname top -> how many resource use
ssh -J ssh.csbsju.edu hpc0 (proxy jump)
Create python virtual environment python3 -m venv env ls
On Verizon
ssh hpc0
How to activate python virtual env source env/ -> activate python source env/bin/activate.csh pip install TensorFlow pip install —upgrade pip pip install —upgrade setup tools pip install opencv-python
pip install TensorFlow
Transfer data
cp [filename] [filename2] scp [filename] [email protected]:Desktop/folder name scp -r [name of the folder] [name of the place] scp -r work [email protected]:anna/work rsync -avz
Ex: rsync -avz system ssh.csbsju.edu: anna/system Z: compress before copy Send them: And un compress them A: the whole folder v: show the copy
View tensor board: tensorboard —logdir=logs/
Github
Git init Git remote add origin [link]
Note: In src folder: java -Xlint:unchecked controller/ThreadClass.java java controller/ThreadClass 1024
Add branch git branch #to list all the branch git branch <branch_name> # to add branch git checkout <branch_name> #to switch to branch
Pull from another branch git pull origin
Git diff my branch master — myfile.cs
How to fork after accidentally clone https://admcpr.com/what-the-fork/
How to remove git upstream
git remote rm upstream
Rails
Add a new fieldname to existing data table: rails generate migration add_fieldname_to_tablename fieldname:string Destroy controller Rails destroy controller controllerName
C++
- Solved the filesystem error with the c_cpp_properties_json AWS:
- Ruby on Rails: Edit AWS credentials: EDITOR=vim rails credentials:edit
Quaternion python -m pip install --upgrade --force-reinstall numpy-quaternion
For iDock every time (in Ubuntu)
export PATH=$PATH:/home/mythanhthaonguyen/idock/bin/Linux In the folder contain (debug.conf file) idock -- config debug.conf
Linux remove file forcefully rm -rf dirname