Skip to content

Instantly share code, notes, and snippets.

View ma-al's full-sized avatar
🔋

Mahathir Almashor ma-al

🔋
View GitHub Profile
@ma-al
ma-al / nice-jupyterlab-terminal.md
Last active March 29, 2023 04:15
Miscellaneous creature comforts 🛀🏽 when working in JupyterLab

Shell Comforts In JupyterLab Terminal

Get aliases and colors into the JupyterLab terminal:

Create a .profile file in $USER containing:

bash
source $USER/.bashrc

(Thanks to https://stackoverflow.com/a/70699378)

@ma-al
ma-al / pytorch-jupyter-ubuntu-20_04_3.md
Last active January 19, 2024 08:15
Setting up Jupyter + PyTorch on new Ubuntu 20.04 VM

Summary

Getting a Tesla K80 working on an Ubuntu 20.04.3 VM.

Conda

Turns out, easiest to go via conda.

conda create -n gpu python=3.10
conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch
@ma-al
ma-al / ubuntu-20.04.3-setup.md
Last active November 8, 2021 02:29
new Ubuntu 20.04.3 VM setup (Miniconda and basics)

Summary

Initial steps when inside a new Ubuntu VM

Quality of Life

echo 'alias c="clear"' >> ~/.bashrc
echo 'alias l="ls -FCAlh"' >> ~/.bashrc
echo 'alias xx="exit"' >> ~/.bashrc
echo 'alias hg="history | grep"' >> ~/.bashrc
// Bits and pieces gathered from:
// - https://damieng.com/blog/2015/04/24/make-home-end-keys-behave-like-windows-on-mac-os-x
// - comments from other users on that post
//
// Put this file inside ~/Library/KeyBindings
// - you may have to create the folder
// - may also need to change the owner to you `chown`
// - may also need to allow access `chmod 777 ~/Library/KeyBindings`
//
// Also may need to allow access to this file itself

For Windows 10, change these keys in regedit:

  • Computer\HKEY_CLASSES_ROOT\SystemFileAssociations\text\shell\edit\command
  • Computer\HKEY_CLASSES_ROOT\SystemFileAssociations\text\shell\open\command
  • Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\batfile\shell\edit\command
  • Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\cmdfile\shell\edit\command

From: %SystemRoot%\system32\NOTEPAD.EXE %1 To: "%ProgramFiles%\Sublime Text 3\sublime_text.exe" "%1" Or: "%ProgramFiles%{insert-path-to-fave-editor}" "%1"

@ma-al
ma-al / .bashrc
Created December 5, 2016 01:23
shell comforts
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME} - ${PWD}\007"'
[ -z "$PS1" ] && return
PS1="\[\e[0;36m\]\[\e[1;33m\]>>>>\[\e[0m\] "
complete -cf sudo
export PAGER=less
export EDITOR=vim
export HISTCONTROL=ignorespace:ignoredups
export HISTIGNORE="l:c:x:hg:history"
@ma-al
ma-al / .gitattributes
Last active January 24, 2023 19:43
Default Git LFS track filetypes
# Often used LFS tracks
# ------------------------------------------------
# Python-related
*.pkl filter=lfs diff=lfs merge=lfs -text
*.npz filter=lfs diff=lfs merge=lfs -text
# ------------------------------------------------
# Usual image types
*.png filter=lfs diff=lfs merge=lfs -text