Skip to content

Instantly share code, notes, and snippets.

View alvaromuir's full-sized avatar

Álvaro Muir alvaromuir

View GitHub Profile
@alvaromuir
alvaromuir / gist:8492876
Created January 18, 2014 16:39
Social Web App idea #MLKDreamCode
Yelp meets kickstarter for social good.
People should be able to post information and images about things they want to change in their community.
Requires social login to ensure the word is spread
Gamaified by karma points.
Gains attention of local governing bodies, community members, neighbors
@alvaromuir
alvaromuir / heroku-setup.thor
Created February 9, 2014 18:47
Thor file that copies and install keys form a .heroku_config file in rails app root
class Config < Thor
desc "heroku", "setup heroku from .heroku_config"
def heroku
puts "running Heroku config . . ."
config = ".heroku_config"
if File.exists?(config)
settings = File.open(config).read
settings.gsub!(/\r\n?/, "\n")
settings.each_line do |line|

Keybase proof

I hereby claim:

  • I am alvaromuir on github.
  • I am alvaromuir (https://keybase.io/alvaromuir) on keybase.
  • I have a public key whose fingerprint is B755 99EB 1371 531F 4C4F 815D 8134 38A3 DCE5 8212

To claim this, I am signing this object:

@alvaromuir
alvaromuir / buildxnu.sh
Created July 29, 2014 04:05
Build xnu (Darwin) kernel script
#!/usr/bin/env bash
#############################################
# Builds the latest xnu (Darwin) kernel #
# create a directory to do this in first!!! #
# it cleans the downloaded files after #
# ya homie, @alvaromuir #
#############################################
export PATH="/usr/local/bin:$PATH"
@alvaromuir
alvaromuir / Data-Science Linux Vagrant Box
Last active August 29, 2015 14:07
base data-science vagrant linux build
# base data-science vagrant linux build
# last update, 9.28.14
# @alvaromuir
## Base installs ##
sudo yum -y update
sudo yum -y upgrade
sudo yum clean all
@alvaromuir
alvaromuir / getreplay.sh
Last active August 29, 2015 14:07
Downloads files from
#!/bin/bash
# Script to download videos from UC's replay system
# requires curl
# usage example ./getreplay.sh <some replay url.hmtl> <file_outputname>
# will add ".mp4" to file, warning will overwrite existing.
set -e
link=$1
file=./$2.mp4
base=${link%'.html'}
@alvaromuir
alvaromuir / clean_headers.py
Last active August 29, 2015 14:07
Takes an inputted file and returns db friendly string of comma separated fields.
#!/usr/bin/python
# This script takes a 'fields' row from a Google DFA report file
# and makes it db import friendly for all of ya big data needs
# @alvaromuir, updated: 11/2014
import sys
if(len(sys.argv) < 2):
print
print "Error - Requires an input file"
@alvaromuir
alvaromuir / ssh-auth
Last active August 29, 2015 14:12
BASH script that automates paswordless ssh.
#!/bin/bash
# Script to create passwordless ssh on remote machine from current host
# requires ssh, naturally
# example usage: ssh-auth foreign.host.com id_dsa.pub myUserName
# @alvaromuir, 6.19.15
set -e
USAGECMD="Usage: $0 <hostname> <public-key.pub> [opt: username]"
SSHHOME=~/.ssh/
if [ "$3" ]
@alvaromuir
alvaromuir / prep_dfa_import.sh
Last active August 29, 2015 14:12
Script to prep a downloaded DFA file for hadoop import
#!/bin/bash
# Script to prep a downloaded dfa file for transfer and ETL to warehouse
# or Hadoop cluster
# takes a sample via subsample for python
# https://pypi.python.org/pypi/subsample/0.0.6
# and gzips for export
#
# ex:
# $ ./prep_dfa_import.sh <1234_downladed_dfa.csv> <new_file.csv> <sample.csv>
# @alvaromuir, 04.19.2015
@alvaromuir
alvaromuir / hdfs-yarn-spark
Last active August 29, 2015 14:14
Ambari 1.7.0 blueprint for a dockerized cluster build
{
"configurations": [
{
"nagios-env": {
"nagios_contact": "alvaromuir@gmail.com"
}
}
],
"host_groups": [
{