Skip to content

Instantly share code, notes, and snippets.

View glukicov's full-sized avatar
🤠
Focusing

Gleb Lukicov glukicov

🤠
Focusing
View GitHub Profile
@glukicov
glukicov / .sh
Created July 9, 2020 17:31
.bash_aliases
printf "\nSourcing ML PY env: ~/gpu_ml/bin/activate\n"
# activate the gpu_ml environment
source ~/gpu_ml/bin/activate
cd ~/gpu_ml/
# open Jupyter lab on specific port
alias jlab="jupyter lab --port=8899"
alias lr="ls -ltrh"
@glukicov
glukicov / .sh
Last active July 9, 2020 19:17
.profile
# use ML as $ML in Linux (can use ip address instead of the DNS hostname)
export ML=mlgpu.ddns.net
# just like below ;) for the magic packer command to wake-up a remote machine
alias wake_gml="wakeonlan -i $ML -p 22 b3:21:88:6k:17:24"
# open ssh tunnel from ML to the laptop in port 8899
alias sg="ssh -L 8899:localhost:8899 $ML"
# 'cd_ML' to quickly cd into the mounted directory
@glukicov
glukicov / mount.sh
Last active July 11, 2020 08:21
mount.sh
#!/bin/bash
#-----------------------------------------------------------
remotedir="USERNAME@HOST:/PATH/TO/MOUNT" # TODO Add directory on the remote machine
mountdir="/Users/user/Mount/Directory" # TODO Add local directory
echo "Mounting (${mountdir})..."
if [ -d "${mountdir}" ]; then
#Unmount if it's already mounted
if mount | grep "on $mountdir" > /dev/null; then
umount ${mountdir}
@glukicov
glukicov / GPU_tf_test.ipynb
Created July 9, 2020 18:19
GPU test on Linux
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
printf "\nSourcing ML PY env: ~/gpu_ml/bin/activate\n"
# activate the gpu_ml environment
source ~/gpu_ml/bin/activate
cd ~/gpu_ml/
# open Jupyter lab on specific port
alias jlab="jupyter lab --port=8899"
alias lr="ls -ltrh"
# use ML as $ML in Linux (can use ip address instead of the DNS hostname)
export ML=mlgpu.ddns.net
# just like below ;) for the magic packer command to wake-up a remote machine
alias wake_gml="wakeonlan -i $ML -p 22 b3:21:88:6k:17:24"
# open ssh tunnel from ML to the laptop in port 8899
alias sg="ssh -L 8899:localhost:8899 $ML"
# 'cd_ML' to quickly cd into the mounted directory
import matplotlib.pyplot as plt
plt.style.use('ml_style.mplstyle')
pip install virtualenv
mkdir ~/my_project &&
cd ~/my_project &&
virtualenv my_project_env
source ~/my_project/bin/activate