Skip to content

Instantly share code, notes, and snippets.

docker cp foo.txt mycontainer:/foo.txt
docker cp mycontainer:/foo.txt foo.txt
@tiantuxu
tiantuxu / jupyter-docker.sh
Created January 2, 2019 19:01
Create a jupyter notebook in a remote docker
#Host machine:
docker run -it -p 8888:8888 image:version
#Inside the Container
jupyter notebook --ip 0.0.0.0 --no-browser --allow-root
#Host machine access this url:
http://(ce3fff13df99 or 127.0.0.1):8888/?token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
@tiantuxu
tiantuxu / untar.sh
Last active December 17, 2018 17:52
untar all *.tar files in a directory
for filename in *.tar
do
tar -xvf $filename
done
@tiantuxu
tiantuxu / ffmpeg-common.sh
Last active April 6, 2024 02:29
Common ffmpeg Command Lines (with NVIDIA GPU Support)
# Decode a video to yuv420 raw format
ffmpeg -vsync 0 -c:v h264_cuvid -i input.mp4 -c:v rawvideo -pix_fmt yuv420p -f null /dev/null
ffmpeg -vsync 0 -c:v h264_cuvid -i input.mp4 -c:v rawvideo -pix_fmt yuv420p output.yuv
# Resize videos to 640x480
ffmpeg -c:v h264_cuvid -i input.mp4 -vf scale=640:480 -c:v h264_nvenc output.mp4
# Downsampling frame rate to 30fps
ffmpeg -i input.mp4 -r 30 -c:v h264_nvenc output.mp4