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 |
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
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
# 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
# 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
# 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
# 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
## 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
# Byte-compiled / optimized / DLL files | |
__pycache__/ | |
*.py[cod] | |
*$py.class | |
.idea/ | |
.DS_Store/ | |
# C extensions | |
*.so | |
# Distribution / packaging |
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
today="$(date '+%Y-%m-%d')" | |
yesterday="$(date -d yesterday '+%Y-%m-%d')" | |
echo $today | |
echo $yesterday |