Skip to content

Instantly share code, notes, and snippets.

View marcionicolau's full-sized avatar

Marcio Nicolau marcionicolau

View GitHub Profile
@marcionicolau
marcionicolau / tensorflow_1_6_high_sierra_gpu.md
Created May 14, 2018 17:35 — forked from mattiasarro/tensorflow_1_6_high_sierra_gpu.md
Install Tensorflow 1.6 on macOS High Sierra 10.13.3 with GPU Acceleration (without disabling SIP)

Tensorflow 1.6 on macOS High Sierra 10.13.3 with GPU Acceleration (without disabling SIP)

This gist (based on a blog post at byai.io) documents how to set up TensorFlow 1.6 with (e)GPU support without the need to disable SIP. Following the original gist got me a saystem in which training TF on eGPU was successful, but there were various visual glitches due to the newer / less stable version of the driver.

As pointed out by ronchigram, many people are having issues with newer NVIDIA drivers, so it's worth using the nvidia-update script by Benjamin Dobell that installs the latest stable NVIDIA web driver, and if necessary patches it to run on your system. We also don't need to disable SIP when using nvidia-update.

I have als

@marcionicolau
marcionicolau / gist:9c04c7f3280114c6b79c3b6921fe4c3b
Created November 22, 2016 15:13 — forked from tomas789/gist:10915069
C++/C++11 Variadic template CSV parser. Supports quoted strings, custom parsers, strongly typed, STL-like, generic, fast, highly customizable.
#include <functional>
#include <fstream>
#include <iostream>
#include <limits>
#include <sstream>
#include <tuple>
#include <vector>
template <typename ... TList>
struct DefaultParsersTuple;
@marcionicolau
marcionicolau / app.R
Created September 29, 2015 13:18 — forked from gluc/app.R
Shiny CRUD
library(shiny)
library(shinyjs)
# Get table metadata. For now, just the fields
# Further development: also define field types
# and create inputs generically
GetTableMetadata <- function() {
fields <- c(id = "Id",
#!/path/2/Rscript
# License: CC0 (just be nice and point others to where you got this)
# Author: Robert M Flight <[email protected]>, github.com/rmflight
#
# This is a post-commit hook that after a successful commit subsequently increments the package version in DESCRIPTION
# and commits that. Analogous to the pre-commit at https://gist.github.com/rmflight/8863882, but useful if you only have
# good reasons for not doing it on the pre-commit.
#
# To install it, simply copy this into the ".git/hooks/post-commit" file of your git repo, change /path/2/Rscript, and make
@marcionicolau
marcionicolau / index.Rmd
Created January 8, 2014 00:25 — forked from ramnathv/index.Rmd
Interactive Controls and rCharts
---
title: Interactive Controls and rCharts
framework: bootstrap
hitheme: twitter-bootstrap
highlighter: prettify
mode: standalone
---
<link href='http://fonts.googleapis.com/css?family=Lora|Lato' rel='stylesheet' type='text/css'>

This is a demo of an rCharts binding for the excellent Cal-Heatmap plugin, developed by Wan Qi Chen. This binding was motivated by a tweet by Alex Bresler and uses data provided by him on points scored by Paul George.

NOTE: This R package is not yet on github. I will update this note after I upload an alpha version on github.

$ brew upgrade rbenv
$ rbenv -v
rbenv 0.4.0
$ brew upgrade ruby-build
$ ruby-build --version
ruby-build 20130628
$ rbenv install --list | grep 2.0.0-p
2.0.0-p0
2.0.0-p195
2.0.0-p247
@marcionicolau
marcionicolau / pg_postgis_20_92.sh
Last active November 7, 2017 06:59 — forked from rolo/gist:1481128
Install Postgis-2.0 to PostgreSQL 9.2 Server on Ubuntu 12.04 Server
#!/bin/bash
#
# Install Postgres 9.2, PostGIS and create PostGIS template on an Ubuntu 12.04 Server
# add official postgresql.org ubuntu repos (http://wiki.postgresql.org/wiki/Apt)
# Create /etc/apt/sources.list.d/pgdg.list. The distributions are called codename-pgdg.
echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg2.list
# Import the repository key from http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc, update the package lists, and start installing packages:
sudo add-apt-repository ppa:pitti/postgresql
sudo apt-get update
sudo apt-get install postgresql-9.2 postgresql-server-dev-9.2 postgresql-contrib-9.2
sudo su -l postgres
psql -d template1 -p 5433
CREATE EXTENSION IF NOT EXISTS hstore;
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
service postgresql stop
/usr/lib/postgresql/9.2/bin/pg_upgrade -b /usr/lib/postgresql/9.1/bin -B /usr/lib/postgresql/9.2/bin -d /var/lib/postgresql/9.1/main/ -D /var/lib/postgresql/9.2/main/ -O "-c config_file=/etc/postgresql/9.2/main/postgresql.conf" -o "-c config_file=/etc/postgresql/9.1/main/postgresql.conf"
#! /usr/bin/env Rscript
#start an instance
startup <- system("ec2-run-instances ami-b232d0db -k ec2ApiTools", intern=T)
Sys.sleep(45) #rather random but 45 seconds is typically long enough to boot
#query running instances
instances <- system("ec2-describe-instances", intern=T)
instancesParsed <- sapply(instances, strsplit, "\t")