Skip to content

Instantly share code, notes, and snippets.

View davidnvq's full-sized avatar
🎯
Focusing

Van-Quang Nguyen davidnvq

🎯
Focusing
View GitHub Profile
@davidnvq
davidnvq / bash-cheatsheet.sh
Created December 16, 2017 03:56 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@davidnvq
davidnvq / ipython_notebook.sh
Last active March 3, 2018 21:42
Remote access to ipython notebook server
# On the remote machine, start the IPython notebooks server
xpra start :100 # for enabling display of remote figures
DISPLAY:=100 screen # for enabling display of remote figures
ipython notebook --no-browser --port=8889
# On the local machine, start an SSH tunnel
ssh -N -f -L localhost:8888:localhost:8889 remote_user@remote_host
# Open browser and copy this address
@davidnvq
davidnvq / tf_install.sh
Last active March 4, 2018 00:06
Tensorflow GPU Installation
# For more information, visit at
# https://www.tensorflow.org/install/install_linux
#1. NVIDIA requirements
#1.0 Install CUDA Toolkit
http://docs.nvidia.com/cuda/cuda-installation-guide-linux/#axzz4VZnqTJ2A
# Check which version
cat /usr/local/cuda/version.txt
@davidnvq
davidnvq / prog.py
Created March 5, 2018 08:08
Argparse Python Tutorial
# The recommended command-line parsing module in the Python standard library
# Read the document here
# https://docs.python.org/2/howto/argparse.html
"""Tutorial of using Argparse"""
import argparse
parser = argparse.ArgumentParser()
## Positional argument
@davidnvq
davidnvq / keras_install.sh
Created March 5, 2018 11:38
Keras Installation
# For more information, check this website
# http://deeplearning.lipingyang.org/2017/08/01/install-keras-with-tensorflow-backend/
# Please make sure that
# – PATH includes /usr/local/cuda-8.0/bin
# – LD_LIBRARY_PATH includes /usr/local/cuda-8.0/lib64
conda install pillow
conda install h5py
@davidnvq
davidnvq / tmux.sh
Created March 7, 2018 05:30
Install Tmux for Centos 7
# Tmux is a "terminal multiplexer", it enables a number of terminals to be accessed and controlled from a single terminal.
If you use Debian/Ubuntu, you can just run apt-get install tmux, and voila.
Since the title was about centos 7, then do the following step to install tmux.
(1). tmux has a library dependency on libevent which, of course, isn’t installed by default.
$ wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
$ tar xzvf libevent-2.0.21-stable.tar.gz
$ cd libevent-2.0.21-stable
@davidnvq
davidnvq / conda_mac.sh
Created March 7, 2018 09:48
Install anaconda on MacOS
## Download file from the url
https://www.anaconda.com/download/#macos
## Run the graphical installer
## Install Tensorflow version 1.6
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.6.0-py3-none-any.whl
## Install Keras
pip install keras
@davidnvq
davidnvq / ssh_key.sh
Last active March 9, 2018 06:56
Generate a SSH-key
ssh-keygen - t rsa
@davidnvq
davidnvq / git.sh
Last active March 14, 2018 23:52
Git guideline
## <0> Set-up environment
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
# Cache the password
# https://help.github.com/articles/caching-your-github-password-in-git/#platform-linux
git config --global credential.helper 'cache --timeout=3600000'
# on Mac
git config --global credential.helper osxkeychain