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 / app.js
Last active September 9, 2017 13:53
search-sign
var request = require('request');
language = 'LSF'
search = 'right'
var options = {
url: `https://isara.search.windows.net/indexes/isara/docs?api-version=2015-02-28&searchMode=all&queryType=full&search=language:${language}%20AND%20speaker:${search}%20OR%20${search}*&api-key=F6621A479929D2E2B331E35CC3520462`,
headers: {
'Access-Token': 'request'
}
@rizky
rizky / gui-docker.md
Last active July 26, 2020 07:18
Running Graphical applications in Docker for Mac

Setup

Docker for Mac lets you run any Linux executable in an isolated process on Mac. A graphical app is just another process, that needs access to the X11 socket of the system, or an X11 server. You can run X11 applications on a Mac using an open source project called Xquartz. The steps to expose XQuartz to a Linux process running in Docker are simple:

  1. install XQuartz from xquartz.org. Note: you need to install XQuartz version 2.7.10, version 2.7.11 does not work with Docker for Mac. Then you have 3 choices:
  2. Proxy the XQuartz socket to port 6000 or
  3. Tell Xquartz to accept network calls. This is not very secure.
  4. Tell Xquartz to accept network calls and require authentication, setup X11 security using xauth, and mount ~/.Xauthority in the container.
@rizky
rizky / install-opencv.sh
Last active February 27, 2019 02:40
Install OpenCV 3 with Python 2.7
# Install Xcode
# Before we can even think about compiling OpenCV, we first need to install Xcode,
# a full blown set of software development tools for the Mac Operating System.
# Accept the Apple Developer license
sudo xcodebuild -license
# Install Apple Command Line Tools
sudo xcode-select --install
@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 / 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 / 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 / azure-powershell-cheatsheet.ps1
Last active March 22, 2021 15:04
Azure Powershell Cheatsheet
# To log in to Azure Resource Manager
Login-AzureRmAccount
# You can also use a specific Tenant if you would like a faster log in experience
# Login-AzureRmAccount -TenantId xxxx
# To view all subscriptions for your account
Get-AzureRmSubscription
# To select a default subscription for your current session.
@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 / 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 / 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