Skip to content

Instantly share code, notes, and snippets.

View naviocean's full-sized avatar
🌴
On vacation

Duong Le naviocean

🌴
On vacation
View GitHub Profile
@naviocean
naviocean / openresty-ubuntu-install.sh
Last active July 14, 2017 23:51 — forked from alex-roman/openresty-ubuntu-install.sh
Easy install openresty (used and tested on Ubuntu 14.04, 15.10 and 16.04)
#!/bin/bash
apt-get -y update
apt-get -y install nginx-extras build-essential libpcre3-dev libssl-dev libgeoip-dev libpq-dev libxslt1-dev libgd2-xpm-dev
wget -c https://openresty.org/download/openresty-1.11.2.4.tar.gz
tar zxvf openresty-1.11.2.4.tar.gz
cd openresty-1.11.2.4
./configure \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
@naviocean
naviocean / store-bootloader.js
Created August 9, 2017 09:44
Delay Render Until Rehydration Complete
// configureStore.js
import { createStore, applyMiddleware, compose } from 'redux';
import { autoRehydrate, persistStore } from 'redux-persist';
import { localStorage } from 'redux-persist/storages';
import { rootReducer } from '../reducers';
export default function configureStore() {
// use desired middlewares
const middlewares = [];
@naviocean
naviocean / classifier_from_little_data_script_3.py
Created July 27, 2018 08:37 — forked from fchollet/classifier_from_little_data_script_3.py
Fine-tuning a Keras model. Updated to the Keras 2.0 API.
'''This script goes along the blog post
"Building powerful image classification models using very little data"
from blog.keras.io.
It uses data that can be downloaded at:
https://www.kaggle.com/c/dogs-vs-cats/data
In our setup, we:
- created a data/ folder
- created train/ and validation/ subfolders inside data/
- created cats/ and dogs/ subfolders inside train/ and validation/
- put the cat pictures index 0-999 in data/train/cats
@naviocean
naviocean / gist:1b1444a872f2805c6fb9a2bd70ef1af1
Created August 14, 2018 08:08
Ubuntu upgrade to latest of boost
#!/bin/bash
#Update repositories list
sudo apt-get update
#Completely remove boost
sudo apt-get -y --purge remove libboost-all-dev libboost-doc libboost-dev
sudo rm -f /usr/lib/libboost_*
#Install required packages
@naviocean
naviocean / convert_pytorch_caffe.md
Created October 9, 2018 09:39
MMdnn covert from custom pytorch model to caffe

First, git clone the MMdnn

git clone https://github.com/Microsoft/MMdnn Commit pytorch_parser.py from Line 67 to Line 76, and add model = model_file_name at Line 77.

It might look like this.

    def __init__(self, model_file_name, input_shape):
        super(PytorchParser, self).__init__()
        # if not os.path.exists(model_file_name):
@naviocean
naviocean / ubuntu-cuda-caffe.Dockerfile
Last active October 11, 2018 08:44 — forked from jcboyd/ubuntu-cuda-caffe.Dockerfile
Dockerfile for ubuntu 16.04 + CUDA 8.0 + Caffe for deep learning
# $ nvida-docker run -it naviocean/convert
# Download base image
FROM ubuntu:16.04
# Set environment variables
ENV PATH "/usr/local/cuda-8.0/bin:$PATH"
ENV LD_LIBRARY_PATH "/usr/local/cuda-8.0/lib:$LD_LIBRARY_PATH"
# Set keyboard configuration in advance of installing CUDA
@naviocean
naviocean / caffe-cuda9-ubuntu16.04.Dockerfile
Last active October 16, 2018 10:09
Caffe cuda9 ubuntu 16.04
FROM nvidia/cuda:9.0-devel-ubuntu16.04
MAINTAINER NaviOcean <[email protected]>
#install Cuda & Cudnn
ENV CUDNN_VERSION 7.2.1.38
LABEL com.nvidia.cudnn.version="${CUDNN_VERSION}"
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils \
libcudnn7=$CUDNN_VERSION-1+cuda9.0 \
libcudnn7-dev=$CUDNN_VERSION-1+cuda9.0 && \
@naviocean
naviocean / caffe-cuda9-relu6.Dockerfile
Last active October 16, 2018 10:09
Caffe cuda9 relu6
#https://github.com/RuiminChen/Caffe-MobileNetV2-ReLU6
FROM nvidia/cuda:9.0-devel-ubuntu16.04
MAINTAINER NaviOcean <[email protected]>
#install Cuda & Cudnn
ENV CUDNN_VERSION 7.2.1.38
LABEL com.nvidia.cudnn.version="${CUDNN_VERSION}"
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils \
libcudnn7=$CUDNN_VERSION-1+cuda9.0 \
@naviocean
naviocean / mount_hdd.md
Last active October 31, 2018 04:08
Mount HDD on ubuntu

First of all your /dev/sdb isn't partitioned. I am assuming this is the disk you want to mount. Run 

sudo fdisk /dev/sdb
  1. Press O and press Enter (creates a new table)

  2. Press N and press Enter (creates a new partition)

  3. Press P and press Enter (makes a primary partition)

  4. Then press 1 and press Enter (creates it as the 1st partition)

  5. Finally, press W (this will write any changes to disk)

@naviocean
naviocean / nvidia_driver.md
Last active February 12, 2023 13:16
Install Nvidia Driver, Cuda, Cudnn on ubuntu

1. Install NVIDIA Driver Version 390 via apt-get

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get install nvidia-390 nvidia-modprobe

To verify installation, restart your machine with reboot and type nvidia-smi.

2. Install Cuda 9.0