Cheatsheet
Git
Command |
Description |
---|---|
git init |
Initialize git in the working directory |
git add . |
Add all modified files to the staging area |
git clone <GIT_REPO> <DIR> |
Clone the master branch from a GitHub repository |
git clone -b <BRANCH_NAME> <GIT_REPO> <DIR> |
Clone a specified branch from a GitHub repository |
git checkout . |
Discard all changes in your working copy |
git status |
Check files that are changed, and need to be committed |
git remote set-url origin <URL_NAME> |
Add a remote directory to origin so you can push your local repository to it |
git remote -v |
List all remote repositories |
git push origin master |
Push your local repository to the origin url into the master branch |
git diff |
Show changes between your working copy and the tree |
git pull |
Fetch and merge changes from remote repository to your working repository |
git submodule add <GIT_REPO> <DIR> |
Add submodule GitHub repositories to one of the subfolders of your working repository |
git submodule recursive |
Recursively update all submodules in your working repository |
git config --global credential.helper cache |
Git to start caching credentials |
git config --global credential.helper 'cache --timeout=7200' |
Git to cache credentials for 2 hours |
Jupyter Labextension
Command |
Description |
---|---|
jupyter labextension list |
List all labextensions |
jupyter labextension upgrade |
Update all labextensions |
jupyter labextension install <EXTENSION_NAME> |
Install an extension and build |
jupyter labextension uninstall <EXTENSION_NAME> |
Uninstall an extension and build |
jupyter labextension install <EXTENSION_NAME> --no-build |
Install an extension but do not build |
jupyter lab build |
Build jupyter |
Conda
Command |
Description |
---|---|
source activate <ENV_NAME> |
Activate an environment (Linux) |
conda activate <ENV_NAME> |
Activate an environment (Windows) |
conda list |
Show all packages in current environment |
conda install <PKG1> <PKG2> <PKG3> |
Install latest versions of Python packages <PKG1> <PKG2> <PKG3> |
conda install <PKG1>=<VER> |
Install version <VER> of Python package <PKG1> |
conda list --explicit > 'my_env_packages.txt' |
Write all packages in current environment into the txt file |
conda create --name <ENV_NAME> --file 'my_eng_packages.txt' |
Create a new environment and install all files in the txt file |
conda env export > 'my_eng_packages.yml' |
Export current environment and package informaion into a yml file |
conda create -f 'my_env_packages.yml' |
Create a new environment based on a yml file |
conda config --get |
Get summary of conda channel configuration |
conda config --prepend channels <CHANNEL_NAME> |
Add channel with highest priority |
conda config --append channels <CHANNEL_NAME> |
Add channel with lowest priority |
conda config --set channel_priority false |
Install the newest version of a package in any listed channel |
conda remove -n <ENV_NAME> --all |
Remove environment |
Nikola
Command |
Description |
---|---|
nikola build |
Build nikola website |
nikola serve -b |
Display localhost:8000 version of website |
nikola auto |
Automatically scan changes to your edits of the website to build and serve on localhost:8000 |
nikola github_deploy |
Publish website on GitHub Pages. Commits and pushed both the src and master branches of the GitHub Page. |
nikola plugin -i <PLUGIN_NAME> |
Install nikola plugins |
nikola plugin -r <PLUGIN_NAME> |
Uninstall nikola plugins |
nikola subtheme <THEME_NAME> |
Select a subtheme from bootswatch (i.e., lumen) |
Markdown
Command |
Description |
---|---|
[File Title](file.md) |
Links to file.md in current directory |
[File Title](subfolder/file.md) |
Links to file.md in subfolder of current directory |
[File Title](../folder/file.md) |
Links to file.md from your repository folder (i.e., blog2) |
![File Title](pic.jpg) |
Shows picture of pic.jpg stored in current directory |
<!-- TEASER_END --> |
Teaser end for non .md and .html files |
Kaggle API
Command |
Description |
---|---|
kaggle competitions list |
List all competitions |
kaggle competitions list --category <CATEGORY> |
List featured competitions |
kaggle competitions download <COMPETITION> |
Download all files associated to competition |
reStructuredText
Command |
Description |
---|---|
|
Title of page |
|
Slug of the page used as the last component of the page URL |
|
Date of the page |
|
Category of the page (only one) |
|
Comma-separated list of page tags (multiple tags) |
|
Description of page used for SEO |
|
Author of page |
|
Activate MathJax/KaTeX (true/false) |
|
Used to indicate status of the page (published/private/draft/featured) |
|
Show/hide title (true/false) |
|
Activate hyphenation (true/false) |
|
Teaser end used for blog post previews |
|
Image preview that is used when sharing on social feeds |
|
Template to render the package |
|
Date that post was updated |
|
ReST directive to create a floating alert box to the right |
|
ReST directive to create contents page |
|
ReST directive for a code-block in Python (shell for Linux, html for html, rst for reStructured, md for Markdown). Code-block must be indented. |
|
Include line numbers for code-blocks. Command must be indented |
Directives |
tmux
Command |
Description |
---|---|
|
List windows |
|
Create window |
|
Delete window |
|
Previous window |
|
Next window |
|
Split pane vertically |
|
Split pane horizontally |
|
Move to the pane in the direction of the <ARROW KEY> |
|
Resize of pane according to the <ARROW KEY> |