This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## ls only directories | |
# https://unix.stackexchange.com/questions/1645/is-there-any-option-with-ls-command-that-i-see-only-the-directories | |
ls -ld -- */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See https://github.com/recognai/biome-text/issues/14 | |
xcode-select --install | |
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage of the current folder | |
du -sh | |
# Get the storage used by each sub-directory in the folder | |
du -h | |
# Get filesystem, size, used avail and mounted info | |
df -h | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. To see the method declaration => cmd + Click / cmd + alt + right | |
2. To go back after 1. => cmd + alt + left | |
3. To change these settings => Pycharm -> Preferences -> Keymap -> Main menu -> Navigate -> Back/Forward | |
4. To change the Python Interpreter => Pycharm -> Preferences -> Project:XYZ -> Project Interpreter | |
# https://www.jetbrains.com/help/pycharm/reformat-and-rearrange-code.html | |
5. Formatting indentation => select code and opt+command+L |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://stackoverflow.com/a/52076633/3776827 | |
# Run as download_drive_file.sh file_id | |
# where file_id is google drive file id | |
# https://drive.google.com/file/d/0B-u9nH58139bTy1XRFdqaVEzUGs/view | |
# Eg. file_id here is 0B-u9nH58139bTy1XRFdqaVEzUGs | |
curl gdrive.sh | bash -s $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Shamelessly taken from https://github.com/huggingface/pytorch-openai-transformer-lm/blob/master/model_pytorch.py | |
class dotdict(dict): | |
"""dot.notation access to dictionary attributes""" | |
__getattr__ = dict.get | |
__setattr__ = dict.__setitem__ | |
__delattr__ = dict.__delitem__ | |
config = dotdict({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check the version of OS | |
lsb_release -a | |
# https://www.cyberciti.biz/faq/how-do-i-find-out-what-ports-are-listeningopen-on-my-linuxfreebsd-server/ | |
# Check the open ports | |
netstat -vtan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export CURRENT_DIR=${PWD} | |
export PARENT_DIR="$(dirname "$CURRENT_DIR")" | |
echo "You are in: " | |
echo $CURRENT_DIR | |
echo "Parent directory is: " | |
echo $PARENT_DIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install sshfs on local machine | |
# https://superuser.com/q/139023 | |
# First make a tunnel (MYPORT==2222) | |
ssh -f userA@machineB -L MYPORT:machineA:22 -N | |
# First create mylocalpath folder on local machine | |
mkdir -p mylocalpath | |
# And then mount the remote file system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Installing torch 7 can be a nightmare on cuda 10. Luckily @nagadomi simplified it. | |
# https://github.com/nagadomi/waifu2x/issues/253#issuecomment-445448928 | |
git clone https://github.com/nagadomi/distro.git ~/torch --recursive | |
cd ~/torch | |
./clean.sh | |
./update.sh | |
# Installing cudnn | |
git clone https://github.com/soumith/cudnn.torch.git -b R7 | |
cd cudnn.torch |