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 / ZendeskChat.js
Created November 26, 2022 09:12 — forked from hetmann/ZendeskChat.js
React Native implementation for Zendesk Chat using WebView & Modal components
import React, { Component } from "react";
import { WebView } from "react-native-webview";
import { Button, Modal, View } from "react-native";
// Author: Hetmann Wilhelm Iohan
// Email: contact@react-ui-kit.com
// Web: https://react-ui-kit.com
// YouTube: https://www.youtube.com/react-ui-kit
// This is a basic example showing how to use Zendesk Chat Widget using a webview inside a modal and a html code
@rizky
rizky / gist:73125c47236067d5e48e44af2174028b
Created June 15, 2022 08:08 — forked from sebsto/gist:6af5bf3acaf25c00dd938c3bbe722cc1
Start VNCServer on Mac1 EC2 Instance
# YouTube (english) : https://www.youtube.com/watch?v=FtU2_bBfSgM
# YouTube (french) : https://www.youtube.com/watch?v=VjnaVBnERDU
#
# On your laptop, connect to the Mac instance with SSH (similar to Linux instances)
#
ssh -i <your private key.pem> ec2-user@<your public ip address>
#
# On the Mac
@rizky
rizky / docker-gui.sh
Last active May 30, 2021 22:43
Run GUI app from docker
#Install XQuartz and Docker
brew cask install xquartz
brew cask install docker
# Open XQuartz
# In the XQuartz preferences, go to the “Security” tab
# Make sure you’ve got “Allow connections from network clients” ticked
open -a XQuartz
# Setup ENV
@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 / 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 / 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.
#!/usr/bin/env python
import argparse
import socket
import ssl
import struct
import subprocess
import sys
try:
@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 / 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 / python-es6-comparison.md
Created November 25, 2018 10:32 — forked from revolunet/python-es6-comparison.md
# Python VS ES6 syntax comparison

Python VS ES6 syntax comparison

Python syntax here : 2.7 - online REPL

Javascript ES6 via Babel transpilation - online REPL

Imports

import math