Skip to content

Instantly share code, notes, and snippets.

View wahalulu's full-sized avatar

Marck Vaisman wahalulu

View GitHub Profile
@wahalulu
wahalulu / gist:1041245
Created June 22, 2011 21:20
Convert integers to IP dot addresses in R - separated
int2ip_sep <- function(int) {
val <- sprintf("%x", int)
pos <- matrix(c(seq(1,7,2), seq(2,8,2)), ncol = 2)
spl <- apply(pos, 1, function(x) {substr(val, x[1], x[2])})
as.numeric(sapply(spl, function(x) {sprintf("%d",
as.numeric(paste("0x",
x, sep="")))}))
}
@wahalulu
wahalulu / make-hexbin-ggplot.R
Created November 18, 2011 16:03
Use ggplot to make a hexbin plot using hexbin for binning
library(hexbin)
library(ggplot2)
library(Hmisc)
## The following function cretes a hexbinplot from a dataset using ggplot
## for graphing but hexbin for doing the hexbinning.
## xvar and yvar are the x and y data
## bins is the number of bins to pass into the hexbin function
## cuts is the number of steps to use in a discrete color scale
make.hexbin.ggplot <- function(xvar, yvar, bins, cuts) {
@wahalulu
wahalulu / vbox-to-vagrant.md
Created November 18, 2015 02:53 — forked from seanorama/vbox-to-vagrant.md
hdp sandbox vagrant

Create a local Vagrant base box from an existing VirtualBox VM

What

  • Setting up a new development VM should be as easy as 2 commands. And it is:
    • vagrant init; vagrant up
  • In this example we are converting the HDP Sandbox to be used in this way. But the howto will work with any existing VM.

Why

@wahalulu
wahalulu / Makefile
Created April 5, 2016 15:27 — forked from lmullen/Makefile
PDF slides and handouts using Pandoc and Beamer
SLIDES := $(patsubst %.md,%.md.slides.pdf,$(wildcard *.md))
HANDOUTS := $(patsubst %.md,%.md.handout.pdf,$(wildcard *.md))
all : $(SLIDES) $(HANDOUTS)
%.md.slides.pdf : %.md
pandoc $^ -t beamer --slide-level 2 -o $@
%.md.handout.pdf : %.md
pandoc $^ -t beamer --slide-level 2 -V handout -o $@
@wahalulu
wahalulu / # gcc - 2016-08-14_22-44-11.txt
Created August 15, 2016 14:10
gcc on Mac OS X 10.10.5 - Homebrew build logs
Homebrew build logs for gcc on Mac OS X 10.10.5
Build date: 2016-08-14 22:44:11
@wahalulu
wahalulu / rstudio_sparkr_emr4-proc.sh
Created November 13, 2016 23:03 — forked from tomz/rstudio_sparkr_emr4-proc.sh
rstudio_sparkr_emr4-proc.sh
#!/bin/bash
set -x -e
# AWS EMR bootstrap script
# for installing open-source R (www.r-project.org) with RHadoop packages and RStudio on AWS EMR
#
# tested with AMI 4.0.0 (hadoop 2.6.0)
#
# schmidbe@amazon.de
# 24. September 2014
@wahalulu
wahalulu / rstudio_sparkr_emr4.sh
Created November 13, 2016 23:03 — forked from tomz/rstudio_sparkr_emr4.sh
rstudio_sparkr_emr4.sh
#!/bin/bash
set -x -e
# Usage:
# --no-rstudio - don't install rstudio-server
# --sparklyr - install RStudio's sparklyr package
# --sparkr - install SparkR package
# --shiny - install Shiny server
#
# --user - set user for rstudio, default "hadoop"
@wahalulu
wahalulu / install-rstudio-server.sh
Created November 14, 2016 00:30 — forked from cosmincatalin/install-rstudio-server.sh
AWS EMR bootstrap to install RStudio Server along with sparklyr
#!/bin/bash
# These variables can be overwritten using the arguments bellow
VERSION="1.0.110"
# drwho is listed as user in YARN's Resource Manager UI.
USER="drwho"
# Depending on where the EMR cluster lives, you might have to change this to avoid security issues.
# To change the default password (and user), use the arguments bellow.
# If the cluster is not visible on the Internet, you can just leave the defaults for convenience.
PASS="tardis"
@wahalulu
wahalulu / gist:b60273cffa0087fcb94238d4a58afcf5
Created January 27, 2017 15:09 — forked from jimbojsb/gist:1630790
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

# install the package devtools
install.packages("devtools")
library(devtools)
# install the doAzureParallel and rAzureBatch package
install_github(c("Azure/rAzureBatch", "Azure/doAzureParallel"))