Skip to content

Miscellaneous

Posted on:September 23, 2022 at 03:22 PM

To search recursively (including some filetypes)

$ grep -r --include "*.txt" texthere .

To search recursively (excluding some filetypes)

$ grep -r --exclude "*.txt" texthere .

To change only directory permissions recursively :

$ find . -type d -exec chmod 755 {} \;

To change only file permissions recursively :

$ find . -type f -exec chmod 644 {} \;

To search for a string recursively in directories :

$ grep -r "string" .

To list only directories

$ ls -l | grep '^d'

To selectivey download folder from github:

url: https://github.com/ParrotPrediction/docker-course-xgboost/tree/master/notebooks notebooks
command: svn export https://github.com/ParrotPrediction/docker-course-xgboost/trunk/notebooks notebooks

url: https://github.com/CoreyMSchafer/code_snippets/tree/master/Python/Flask_Blog
command: svn export https://github.com/CoreyMSchafer/code_snippets/trunk/Flask_Blog corey_flask

pandas get_dummies :

pd.get_dummies(train, columns = [‘Month’, ‘DayofMonth’, ‘DayOfWeek’, ‘UniqueCarrier’], drop_first = True)

To see laptop information :

$ sudo dmidecode | grep -A 9 "System Information"

To update conda

$ conda update conda
$ conda update anaconda

To see all jupyterlab installed extensions

$ jupyter labextension list

Jupyter rate limit

$ jupyter notebook --NotebookApp.iopub_data_rate_limit=10000000000

To remove a certain file type/extension recursively in folders

$ find . -name "*.mp4" -type f -delete

If you are using two different github accounts. Use seperate ssh keys.

$ ssh-keygen -t rsa -C "contact@ytechlabs.com"
$ ssh-add ~/.ssh/id_rsa_ytechlabs
$ ssh-add -D
$ ssh-add -l

#personal account Host github.com-saurabhp75 # ssh alias HostName github.com User git IdentityFile ~/.ssh/id_rsa IdentitiesOnly yes

#org account Host github.com-ytechlabs # ssh alias HostName github.com User git IdentityFile ~/.ssh/id_ytech IdentitiesOnly yes

$ git clone git@github.com:saurabhp75/saurabhp75.github.io.git

(b)

$ git clone git@github.com-saurabhp75:saurabhp75/saurabhp75.github.io.git

https://www.codeacademy.com

https: Protocol www: subdomain academy: second level domain com: top level domain