Skip to content

Instantly share code, notes, and snippets.

View rizky's full-sized avatar
🌪️
Swirling

Rizky Ario rizky

🌪️
Swirling
View GitHub Profile
@rizky
rizky / install_caffe.sh
Last active September 8, 2020 05:53
Install Caffe + CUDA in OSX Sierra
#!/bin/sh
# Install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Apple hides old versions of stuff at https://developer.apple.com/download/more/
# Install the latest XCode (8.0).
# We used to install the XCode Command Line Tools 7.3 here, but that would just upset the most recent versions of brew.
# So we're going to install all our brew dependencies first, and then downgrade the tools. You can switch back after
# you have installed caffe.
# Install CUDA toolkit 8.0 release candidate
# Register and download from https://developer.nvidia.com/cuda-release-candidate-download
@rizky
rizky / Makefile.config
Last active December 26, 2016 21:19
Makefile.config Caffe USE_CUDNN for Mac OS Sierra
## Refer to http://caffe.berkeleyvision.org/installation.html
# Contributions simplifying and improving our build system are welcome!
# cuDNN acceleration switch (uncomment to build with cuDNN).
USE_CUDNN := 1
# CPU-only switch (uncomment to build without GPU support).
# CPU_ONLY := 1
# uncomment to disable IO dependencies and corresponding data layers
@rizky
rizky / Makefile.config
Last active May 4, 2017 15:24
Makefile.config Caffe CPU_ONLY for Mac OS Sierra
## Refer to http://caffe.berkeleyvision.org/installation.html
# Contributions simplifying and improving our build system are welcome!
# cuDNN acceleration switch (uncomment to build with cuDNN).
# USE_CUDNN := 1
# CPU-only switch (uncomment to build without GPU support).
CPU_ONLY := 1
# uncomment to disable IO dependencies and corresponding data layers
class Leveldb < Formula
desc "Key-value storage library with ordered mapping"
homepage "https://github.com/google/leveldb/"
url "https://s3.eu-central-1.amazonaws.com/wb-rd/leveldb-1.19-macos1012fix.tar.gz"
sha256 "7a580e543a3b69efb4407619c48dbeac2043eccd385574f9de53f2dcfea65897"
option "with-test", "Verify the build with make check"
depends_on "gperftools"
depends_on "snappy"
@rizky
rizky / ffmpeg-preprocessing.sh
Last active December 27, 2016 15:22
FFMPEG script to preprocess caffe-heatmap
#Squared and resize the video
ffmpeg -i all.mp4 -vf "scale=256:256:force_original_aspect_ratio=decrease,pad=256:256:(ow-iw)/2:(oh-ih)/2" all_square.mp4
#Convert video to gif
ffmpeg -y -i all_square.mp4 -vf fps=10,scale=256:-1:flags=lanczos,palettegen palette.png
ffmpeg -i all_square.mp4 -i palette.png -filter_complex "fps=10,scale=256:-1:flags=lanczos[x];[x][1:v]paletteuse" all.gif
#Convert gif to png
# ffmpeg -i all_square.mp4 -vcodec png pngs/%05d.png
ffmpeg -i all.gif -vcodec png pngs/%0d.png
@rizky
rizky / instal_caffe_cpu.sh
Last active May 7, 2019 03:26
Setup Caffe CPU Only in MacOS Sierra
#!/bin/sh
# Install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install the experimental NVIDIA Mac drivers
# Download from http://www.nvidia.com/download/driverResults.aspx/103826/en-us
# Install cuDNN v5 for 8.0 RC or use the latest when it's available
# Register and download from https://developer.nvidia.com/rdp/cudnn-download
# or this path: https://developer.nvidia.com/rdp/assets/cudnn-8.0-osx-x64-v5.0-ga-tgz
# extract to the NVIDIA CUDA folder and perform necessary linking
@rizky
rizky / docker-mssql.sh
Last active December 31, 2016 10:04
Setup MSSQL Docker
#switch to docker-machine
eval "$(docker-machine env default)"
#run docker image
docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD={{superstrong-password}}' -p 1433:1433 -d microsoft/mssql-server-linux
#create new docker-machine make sure docker-machine have 3.5GB of ram
#docker-machine create -d virtualbox --virtualbox-memory 4096 default
#edit default docker-machine make sure docker-machine have 3.5GB of ram
@rizky
rizky / docker-cheatsheet.sh
Last active December 13, 2017 13:43
Docker Cheatsheet
start docker
stop docker
restart docker
#Docker Build
docker build -t rizkyario/${image-name} .
docker push rizkyario/${image-name}
docker tag ${image_id} docker.io/${login_name}/${image_name}
# Docker-Machine
@rizky
rizky / mssql-init-db.sh
Last active March 7, 2017 17:08
Setup MSSQL and Initiate Database
#create new docker-machine make sure docker-machine have 3.5GB of ram
#docker-machine create -d virtualbox --virtualbox-memory 4096 default
#edit default docker-machine make sure docker-machine have 3.5GB of ram
docker-machine stop
VBoxManage modifyvm default --memory 4096
docker-machine start
# switch to docker-machine
eval "$(docker-machine env default)"
@rizky
rizky / git-cheatsheet.sh
Last active March 1, 2017 16:26
GIT Cheatsheet
#Add remote origin
git remote add origin $(github-address)
#Push to origin
git push -u origin master
#Create new branch
git checkout -b $(new-branch)
git push -u origin $(new-branch)