Skip to content

Instantly share code, notes, and snippets.

View mrnabati's full-sized avatar

Ramin Nabati mrnabati

View GitHub Profile
@mrnabati
mrnabati / install_tmux.sh
Created August 5, 2020 15:08
Installing The Newest version of tmux on CentOS
# Choose repo name from {'galaxy4-rhel6.repo', 'galaxy4-rhel7.repo', 'galaxy4-rhel8.repo'} based on your CentOS version.
sudo wget -P /etc/yum.repos.d/ http://galaxy4.net/repo/galaxy4-rhel7.repo
sudo yum repolist galaxy4-rhel7
sudo yum install tmux
@mrnabati
mrnabati / 010_advanced_pytorch_modifying_the_last_layer.ipynb
Created June 21, 2020 21:14
Adv. PyTorch: Modifying the Last Layer
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mrnabati
mrnabati / 008_adv_pytorch_freezing_layers.ipynb
Last active June 21, 2020 21:06
PyTorch 101: Freezing Layers
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mrnabati
mrnabati / jupyterOutputDefault.md
Created May 3, 2020 04:28
Display all outputs in Jupyter Notebook

Display full outputs in Jupyter Notebook, not only the last command's output.

from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
@mrnabati
mrnabati / log.py
Created December 26, 2019 07:08
Custom logging module with colors for console
import logging
import time
def getLogger(name, console_level='INFO', file_level=None):
"""
Generate logger with custom formatting. Console and file levels and formatting
if different. Log is saved to a file only if file_level is provided.
"""
## Create a custom logger
logger = logging.getLogger(name)
@mrnabati
mrnabati / .gitignore
Last active December 25, 2019 20:31
Python project .gitignore file
### Project Specific ##
### VSCode ###
.vscode/
### MAC OS ###
.DS_Store
.AppleDouble
.LSOverride
@mrnabati
mrnabati / tmux_error.md
Last active October 14, 2019 18:32
Tmux error: protocol version mismatch

Tmux Protocol Version Mismatch Error

If for some reason you thought it's a good idea to update tmux to a new version without closing your current tmux sessions first, you might see this error when trying to attach to those sessions after update:

  $ tmux attach
  protocol version mismatch (client 7, server 6)

To attach to your sessions, use this awesome hack (credit: this stackexchange answer):

@mrnabati
mrnabati / install_pip.sh
Created October 13, 2019 20:39
Script to install pip for python3
#!/bin/bash
wget https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py --user
python get-pip.py --user --force
rm get-pip.py
mkdir -p $HOME/.config/pip
ln -s $PWD/conf/pip.conf $HOME/.config/pip/
pip3 install setuptools --upgrade --user
@mrnabati
mrnabati / remote_tensorboard.md
Last active April 11, 2024 11:18
Tensorboard on remote server

Running Tensorboard remotely on a server

Follow these steps to run tensorflow on remote server but see the results on local browser using port forwarding.

  • On the remote machine, run:
    tensorboard --logdir <path> --port 6006
  • On the local machine, run
@mrnabati
mrnabati / .tmux.conf
Last active October 6, 2019 15:46
My tmux configuration (credit: https://github.com/gpakosz/.tmux)
# cat << EOF > /dev/null
# https://github.com/gpakosz/.tmux
# (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license,
# without any warranty.
# Copyright 2012— Gregory Pakosz (@gpakosz).
# /!\ do not edit this file
# instead, override settings in ~/.tmux.conf.local, see README.md
# -- general -------------------------------------------------------------------