Skip to content

Instantly share code, notes, and snippets.

View cxy1997's full-sized avatar

Xiangyu Chen cxy1997

View GitHub Profile
@cxy1997
cxy1997 / .profile
Created May 27, 2020 02:53
Change Default Shell Locally
if [ "$SHELL" != "/usr/bin/zsh" ]
then
export SHELL="/usr/bin/zsh"
exec /usr/bin/zsh -l # -l: login shell again
fi
@cxy1997
cxy1997 / install_cudnn.sh
Created November 14, 2018 10:49
install cuDNN
#/bin/bash
cd cuda/include/
sudo cp *.h /usr/local/cuda/include/
cd ../lib64/
sudo cp libcudnn* /usr/local/cuda/lib64/
sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*
@cxy1997
cxy1997 / installPLIB.sh
Last active November 6, 2018 04:48
Downloading and Installing PLIB
#/bin/bash
sudo apt-get install libxmu-dev libxmu6
wget http://plib.sourceforge.net/dist/plib-1.8.5.tar.gz
tar xzf plib-1.8.5.tar.gz
cd plib-1.8.5
./configure
sudo make install
@cxy1997
cxy1997 / vid2gif.py
Last active May 14, 2020 18:59
Video to Gif in Python
import cv2
import imageio
cap = cv2.VideoCapture('stillalive.mov')
cap.set(1 ,62)
length = int(cap.get(cv2.CAP_PROP_FRAME_COUNT)) - 62
print('length=%d' % length)
frames = []
for i in range(1668):
ret, frame = cap.read()
@cxy1997
cxy1997 / plot.py
Created October 18, 2018 01:06
Plot curves with matplotlib
# -*- coding: utf-8 -*-
from __future__ import division, print_function
import numpy as np
import copy
import matplotlib.pyplot as plt
import seaborn
def smooth(array, m=3):
_array = copy.deepcopy(array)