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 / 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
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 / 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 / vm-with-multiple-ip.ps1
Last active January 25, 2017 04:28
Create VM Azure with Multiple IP Adresses
# Register for the preview by sending an email to Multiple IPs with your subscription ID and intended use.
# Do not attempt to complete the remaining steps:
# - Until you receive an e-mail notifying you that you've been accepted into the preview
# - Without following the instructions in the email you receive
# Login to Your Azure account
$path= "AzureProfile.json"
Select-AzureRmProfile -path $path
$subscription-name = "BizPark"
Get-AzureRmSubscription -SubscriptionName $subscription-name | Select-AzureRmSubscription
@rizky
rizky / google-analytics-for-static-sites.sh
Created January 31, 2017 06:55 — forked from stevenscg/google-analytics-for-static-sites.sh
Add Google Analytics tracking to an existing static website
#!/bin/sh
#
# Add a Google Analytics tag to static website files
# @see http://adambuchanan.me/post/26345221717/updating-google-analytics-code-on-many-static-pages
# Tested on MacOS 10.8.X
#
# Usage:
# Set the GA parameters below
# Execute the script from the top-level of the static site
#
@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)
@rizky
rizky / sign-language-name.cs
Last active March 3, 2017 15:29
Sign Language Name
public string SignLanguageName
{
get
{
string signLanguageName = AppResources.ChooseLanguageLabel;
if (selectedSpeaker == "id_ID")
{
if (selectedLanguage == "Bisindo")
signLanguageName = "Bahasa Isyarat Indonesia";
@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 / 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