Misc

Unix

Download from urls:

wget -r -l 10 -k –no-parent [url address]

Change screenshots save location:

defaults write com.apple.screencapture location [folder location]

View old commands. Can also do a "CTRL+R" to check history:

history

Changed file permissions with "chmod", x for exec, u for user

chmod u+x file1

Use "\" character to split a command over multiple lines

chmod u+x \
file1

Set alias

alias jemdoc='/Applications/jemdoc'

Add a path to PATH

PATH=$PATH:~/opt/bin:~/opt/node/bin

Jemdoc

Compile Jemdoc file

jemdoc -c mysite.conf *.jemdoc

Github

Authentication

go to Settings -> Developer settings -> Personal access tokens -> generate new token copy-paste the new token in terminal after “git push”

Status

git status

Add

git add –all

Commit

git commit -a -m “first commit message”

Push

git push

python venv

Create a new virtual environment inside the directory/project1

cd project1/

python3 -m venv project1/

Activate this environment’s packages/resources in isolation

source project1/bin/activate

Deactivate

(project1) $ deactivate

\-I and -L

  • -L is the path to the directories containing the libraries. A search path for libraries

  • -l is the name of the library you want to link to

  • For example PKG_LIBS = -I$/usr/Rcpp/libs -lRcpp where the name of the library “Rcpp.so”, it is named with the -lRcpp option

  • -I adds a directory to the list of places searched by the compiler for a file named on a #include line

  • For example PKG_CXXFLAGS = -I$/usr/Rcpp/include

\-D

  • The contents of definition are tokenized and processed as if they appeared during translation phase three in a \#define directive. In particular, the definition will be truncated by embedded newline characters

  • For example, the usage of -DREMOVE_ in the compilation of the SPAMS package

Links