Skip to content

Instantly share code, notes, and snippets.

@jdsgomes
Last active May 31, 2018 22:31
Show Gist options
  • Save jdsgomes/7d19b03340cafa4111a45c9ac9acfc2d to your computer and use it in GitHub Desktop.
Save jdsgomes/7d19b03340cafa4111a45c9ac9acfc2d to your computer and use it in GitHub Desktop.
Development cheat sheet

Pycharm

Format code

Ctrl + Alt + L

Display side project explorer

Alt + 1

Conda

conda upgrade libgcc (libstdc++.so)
conda install libgcc
source activate snowflakes
conda info --envs
conda create --name snowflake

Docker

Delete all containers

docker rm -f $(docker ps -a -q) && docker rmi $(docker images -q)

Linux

Run a script in the background

nohup myprogram > foo.out 2> foo.err < /dev/null &

Check disk space

df -h

Check files size

du -h

Check if a folder is local or remote

df -P -T ~/Data | tail -n +2 | awk '{print $2}'

Burn an ISO to USB using Linux command line

sudo dd bs=4M if=<SOME_ISO>.iso of=/dev/sd conv=fdatasync

Python

Debug

import pdb; pdb.set_trace()

Tensorflow

Inspect variables

var = [v.name for v in tf.trainable_variables()]

Supervisor

Supervisor tutorial

Vim

Open in split screen

:sp/vsp <filename>

Switch between tabs

CRL+w

Open in new tab

:tabe <filename>

Move between tabs

:tabn
:tabp

Tab spaces

:set tabstop=4
:set expandtab
:set shiftwidth=4

Explore current directory

:e .

Remote working

Port forwarding

ssh -L 16006:127.0.0.1:6006 research@10.16.0.99

Remote work Pycharm + Tensorflow

Tutorial

iPython Notebook Remote ssh access

ipython notebook --no-browser --port=8889
ssh -N -f -L localhost:8888:localhost:8889 remote_user@remote_host
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment