Skip to content

Instantly share code, notes, and snippets.

@chaofengc
chaofengc / extract_ILSVRC.sh
Created December 18, 2021 12:37 — forked from BIGBALLON/extract_ILSVRC.sh
script for ImageNet data extract.
#!/bin/bash
#
# script to extract ImageNet dataset
# ILSVRC2012_img_train.tar (about 138 GB)
# ILSVRC2012_img_val.tar (about 6.3 GB)
# make sure ILSVRC2012_img_train.tar & ILSVRC2012_img_val.tar in your current directory
#
# https://github.com/facebook/fb.resnet.torch/blob/master/INSTALL.md
#
# train/
@chaofengc
chaofengc / img2vid
Created November 25, 2020 07:10 — forked from stayradiated/img2vid
Concatenate Videos and Images using ffmpeg
#!/usr/bin/env bash
#
# img2vid
# =======
#
# Convert an image into three second video
#
# Usage: ./img2vid photo.jpg video.mp4
#
@chaofengc
chaofengc / install-cuda-10-bionic.sh
Created August 6, 2020 04:48 — forked from bogdan-kulynych/install-cuda-10-bionic.sh
Install CUDA 10 on Ubuntu 18.04
# WARNING: These steps seem to not work anymore!
#!/bin/bash
# Purge existign CUDA first
sudo apt --purge remove "cublas*" "cuda*"
sudo apt --purge remove "nvidia*"
# Install CUDA Toolkit 10
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-repo-ubuntu1804_10.0.130-1_amd64.deb
@chaofengc
chaofengc / nvidia-centos-update.md
Created April 15, 2020 11:18 — forked from frengky/nvidia-centos-update.md
Update Nvidia driver on CentOS 7.x after kernel update

Update Nvidia driver on CentOS 7.x

Download the latest Nvidia driver on http://www.nvidia.com/drivers

Update the kernel to the latest version

$ yum update

Change to runlevel 3 - multi user mode for the next reboot

@chaofengc
chaofengc / tmux__CentOS__build_from_source.sh
Created July 9, 2019 17:58 — forked from P7h/tmux__CentOS__build_from_source.sh
tmux 2.0 and tmux 2.3 installation steps for Ubuntu. Or build from tmux source v2.5 for Ubuntu and CentOS.
# Steps to build and install tmux from source.
# Takes < 25 seconds on EC2 env [even on a low-end config instance].
VERSION=2.7
sudo yum -y remove tmux
sudo yum -y install wget tar libevent-devel ncurses-devel
wget https://github.com/tmux/tmux/releases/download/${VERSION}/tmux-${VERSION}.tar.gz
tar xzf tmux-${VERSION}.tar.gz
rm -f tmux-${VERSION}.tar.gz
cd tmux-${VERSION}
@chaofengc
chaofengc / library_installation.md
Last active December 16, 2017 09:13
Ubuntu library install

Ubuntu Python library install

Python install dlib

  • First, install opencv with pip. This will help to install some dependencies.
  • Install libboost by conda install boost -c menpo --force
  • Install dlib by conda install dlib -c menpo --force

GIT Tips

How to download a single folder of a github repository

  1. Install svn with conda install svn
  2. Copy the url https://github.com/example/tree/master/Todo
  3. Replace the /tree/master with /trunk. Download the folder by
svn export https://github.com/example/trunk/Todo
@chaofengc
chaofengc / docker issues.md
Last active September 15, 2017 09:28
Docker Issues

Issues when using docker

1. Container can't connect to internet.
Reason: DNS is not configured.
Sol Reference:

nm-tool                         # (will give you the dns IP)
vim /etc/default/docker         # (uncomment the DOCKER_OPTS and add DNS IP)
DOCKER_OPTS="--dns your.dns.ip --dns 8.8.8.8 --dns 8.8.4.4"
rm `docker ps --no-trunc -aq` # (remove all the containers to avoid DNS cache)
import numpy as np
#数组形式:[[]]
[[1, 2, 3, 4], [1, 2, 3, 4]]
#创建数组
a = np.array([1, 2, 3, 4]) #创建一维数组方法一
b = np.array((5, 6, 7, 8)) #创建一维数组方法二
c = np.array([[1, 2, 3, 4], [4, 5, 6, 7], [7, 8, 9, 10]]) #创建二维数组
a.shape #数组A的形状;返回一个元组
@chaofengc
chaofengc / Environment Path.md
Last active October 25, 2017 16:25
Issues while building caffe projects

Specify gcc

export CC=/usr/bin/gcc-4.7
export CXX=/usr/bin/g++-4.7

Specify Protobuf when building

export CMAKE_LIBRARY_PATH="$HOME/anaconda2/pkgs/libprotobuf-3.2.0-0/lib:$CMAKE_LIBRARY_PATH"
export CMAKE_INCLUDE_PATH="$HOME/anaconda2/pkgs/libprotobuf-3.2.0-0/include:$CMAKE_INCLUDE_PATH"