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}
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 / tmux issues.md
Last active July 3, 2018 10:43 — forked from henrik/tmux_cheatsheet.markdown
tmux cheatsheet

Window size changed when open the tmux with different size of screens.

Solution: tmux detach -a

ubuntu 添加新硬盘

查看硬盘:

# fdisk -l
...
Disk /dev/sdb: 274.9 GB, 274877906944 bytes
255 heads, 63 sectors/track, 33418 cylinders, total 	536870912 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
@chaofengc
chaofengc / Install NVIDIA Driver and CUDA.md
Created June 15, 2017 08:35 — forked from wangruohui/Install NVIDIA Driver and CUDA.md
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora
@chaofengc
chaofengc / git_toturial
Created September 8, 2016 07:26 — forked from guweigang/git_toturial
git命令大全
git init # 初始化本地git仓库(创建新仓库)
git config --global user.name "xxx" # 配置用户名
git config --global user.email "xxx@xxx.com" # 配置邮件
git config --global color.ui true # git status等命令自动着色
git config --global color.status auto
git config --global color.diff auto
git config --global color.branch auto
git config --global color.interactive auto
git config --global --unset http.proxy # remove proxy configuration on git
git clone git+ssh://git@192.168.53.168/VT.git # clone远程仓库