Skip to content

Instantly share code, notes, and snippets.

View richardjortega's full-sized avatar

Richard Ortega richardjortega

View GitHub Profile
@richardjortega
richardjortega / install_nginx_ubuntu_1804.sh
Last active September 19, 2019 01:58
Install NGINX with dependencies and RTMP module
git clone https://github.com/arut/nginx-rtmp-module
sudo apt-get install -y build-essential libpcre3 libpcre3-dev libssl-dev
wget https://nginx.org/download/nginx-1.16.1.tar.gz
tar zxf nginx-1.16.1.tar.gz
cd nginx-1.16.1
./configure \
--sbin-path=/usr/local/nginx/nginx \
--conf-path=/usr/local/nginx/nginx.conf \
@richardjortega
richardjortega / install_iot_edge_1804.sh
Created September 17, 2019 18:27
Install IoT Edge
# Set device connection string here
DEVICE_CONNECTION_STRING=''
echo "Checking if IoT Edge is setup on this Edge VM..."
if ! sudo systemctl is-active --quiet iotedge ; then
echo "IoT Edge is not active (or unknown), installation process starting..."
echo "Installing IoT Edge..."
echo "Installing Moby runtime..."
@richardjortega
richardjortega / docker_without_sudo.sh
Created September 5, 2019 01:36
Docker without sudo
# The docker group grants privileges equivalent to the root user
sudo usermod -aG docker $USER
newgrp docker
docker run hello-world
@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
@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_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 / 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 / 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 / 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]
for (i = 0; i < 100; i++) {
console.log(i);
if(i % 5 === 0){
console.log("Fizz");
}
}