Skip to content

Instantly share code, notes, and snippets.

View richardjortega's full-sized avatar

Richard Ortega richardjortega

View GitHub Profile
@richardjortega
richardjortega / add_time_code_exercise.rb
Last active August 29, 2015 14:05
Time Code Exercise
class TimeMethods
# [H]H:MM {AM|PM} -> 9:13 AM
def add_time(time, minutes)
validate_minutes(minutes)
parsed_time = parse_time(time)
minutes_added = parsed_time[:minutes] + minutes
@richardjortega
richardjortega / Vagrantfile
Last active August 29, 2015 14:16
Vagrant Debian 8 - Rails 4
## http://www.sitepoint.com/vagrantfile-explained-setting-provisioning-shell/
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
for (i = 0; i < 100; i++) {
console.log(i);
if(i % 5 === 0){
console.log("Fizz");
}
}
@richardjortega
richardjortega / curl_rest_api.md
Last active March 2, 2021 14:14
cURL REST API for Azure Resource Manager (ARM)

Using cURL and Azure REST API to access Azure Resource Manager (non-interactive)

Note: This guide assumes Azure CLI 2.0 is installed and familiarity with Azure concepts.

Register Client App and Obtain Service Principal (via CLI)

The APP_ID_URI needs to match what is expected in client request calls.

$ az ad sp create-for-rbac --name [APP_ID_URI] --password [PASSWORD]
@richardjortega
richardjortega / setup.sh
Last active August 17, 2017 07:06
Setup a Raspberry Pi 3
# Run using:
# $ curl url/path/to/this/gist | sh
# Tooling
sudo apt-get update
sudo apt-get install -y vim git
# Install docker
curl -sSL https://get.docker.com | sh
sudo usermod -aG docker pi
@richardjortega
richardjortega / nvidia_cuda_setup_ubuntu_1804.md
Last active April 23, 2020 06:16
Setting up NVIDIA on Linux laptop

Configuration for GPU-accelerated Machine Learning system (using Ubuntu 18.04)

  • Setup Ubuntu x86_64 18.04
  • Disable UEFI Safe Boot in BIOS (for NVIDIA module signing, may not be necessary)

Setup NVIDIA

Install latest NVIDIA driver

Download the latest driver for your NVIDIA: https://www.nvidia.com/Download/index.aspx?lang=en-us

@richardjortega
richardjortega / install_docker_ce_ubuntu_1804.sh
Last active September 5, 2019 01:34
Install Docker CE on Ubuntu 18.04 (run as root)
# Run as root, sets up stable version of Docker CE
# Bash version of : https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-docker-engine---community-1
# Quickly run script via: curl <gist raw link> | bash
# Update apt package index
apt-get update -y
# Install packages to allow apt to use a repository over HTTPS
apt-get install -y \
apt-transport-https \
@richardjortega
richardjortega / install_pip3_ubuntu_1804.sh
Created September 5, 2019 00:50
Install pip3 on Ubuntu 18.04
# Ubuntu 18.04 already has python3
# Print python3 version
python3 -V
# Install pip3
apt update
apt -y upgrade
apt install -y python3-pip
@richardjortega
richardjortega / install_iotedgedev_ubuntu_1804.sh
Created September 5, 2019 00:56
Install IoT Edge Dev Tool for Ubuntu 18.04
# Assumes python3/pip3 installed
pip3 install --upgrade iotedgehubdev