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
#!/bin/bash | |
# From https://www.tensorflow.org/install/gpu | |
# Add NVIDIA package repositories | |
# Add HTTPS support for apt-key | |
sudo apt-get install gnupg-curl | |
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_10.0.130-1_amd64.deb | |
sudo dpkg -i cuda-repo-ubuntu1604_10.0.130-1_amd64.deb | |
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub |
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
# arguments | |
$PATH_TO_SUBMODULE=$2 | |
shift | |
$COMMIT_MESSAGE="$@" | |
# removal | |
git submodule deinit $PATH_TO_SUBMODULE | |
git rm $PATH_TO_SUBMODULE | |
git commit -m $COMMIT_MSG | |
rm -rf .git/modules/$PATH_TO_SUBMODULE |
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
# Reference: https://www.programiz.com/python-programming/property | |
class Dummy(): | |
def __init__(self): | |
self.msg = "oi" # it calls get and setter functions | |
@property | |
def msg(self): | |
print("Getting...") | |
return self._msg |
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
#!/bin/bash | |
SCRIPTPATH=$( cd $(dirname $0) >/dev/null 2>&1 ; pwd -P ) |
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
import numpy as np | |
import base64 | |
import json | |
def without_serialization(arr): | |
b64_bytes = base64.b64encode(arr) | |
bytes_for_np = base64.decodebytes(b64_bytes) | |
arr_back = np.frombuffer(bytes_for_np, dtype=np.float32) |
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
#!/bin/bash | |
# Code adapted from: https://stackoverflow.com/a/55423104/4449273 | |
## Tested on Ubuntu 20.04 (running on WSL) | |
sudo apt install software-properties-common | |
sudo apt-add-repository universe | |
sudo apt update | |
# Python 3 |
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
#!/bin/bash | |
trap 'echo "Exiting due to keyboard interrupt."; exit' INT |
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
#!/bin/bash | |
sudo apt install apt-transport-https curl gnupg | |
curl -s https://brave-browser-apt-release.s3.brave.com/brave-core.asc | sudo apt-key --keyring /etc/apt/trusted.gpg.d/brave-browser-release.gpg add - | |
echo "deb [arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main" | sudo tee /etc/apt/sources.list.d/brave-browser-release.list | |
sudo apt update |
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
#!/bin/bash | |
# Reference: https://stackoverflow.com/a/3816747/4449273 | |
for arg in "$@"; do | |
echo $arg; | |
done |
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
#!/bin/bash | |
# Sets up jupyter notebook (as in https://askubuntu.com/a/941745) | |
ubuntu_20() { | |
sudo apt install python3-notebook jupyter jupyter-core | |
} | |
ubuntu_19() { | |
sudo apt install python3-notebook jupyter jupyter-core python-ipykernel |
OlderNewer