Skip to content

Instantly share code, notes, and snippets.

View fran0x's full-sized avatar

Francisco Lopez fran0x

View GitHub Profile
@fran0x
fran0x / ExercisesCh3.sc
Created April 28, 2015 00:46
s4di - Chapter 3 - Exercises
package chapter3
import util._
import scala.collection.mutable.ArrayBuffer
import java.awt.datatransfer._
import scala.collection.JavaConverters._
import scala.collection.mutable.Buffer
object ExercisesCh3 {
// 1. array of random ints
@fran0x
fran0x / ExercisesCh2.sc
Created April 25, 2015 09:45
s4di - Chapter 2 - Exercises
package chapter2
import math._
object ExercisesCh2 {
def signum(i: Int) = if (i < 0) -1 else if (i > 0) 1 else 0
//> signum: (i: Int)Int
signum(5) //> res0: Int = 1
signum(-5) //> res1: Int = -1
@fran0x
fran0x / git-config.sh
Last active August 29, 2015 14:19
Setup Git on Windows
# Install Git from http://git-scm.com/ and then launch Git Bash
# Generate SSH key pair
ssh-keygen -t rsa -C <username>@gmail.com
#Turn on SSH agent
ssh-agent -s
eval $(ssh-agent -s)
# List SSH keys registered in the SSH agent
@fran0x
fran0x / ExercisesCh1.sc
Last active August 29, 2015 14:19
s4di - Chapter 1 - Exercises
package chapter1
import math._
import math.BigInt._
import util._
object ExercisesCh1 {
3 //> res0: Int(3) = 3
pow(sqrt(3),2) //> res1: Double = 2.9999999999999996
@fran0x
fran0x / Dockerfile
Last active February 15, 2016 17:33
Dockerfile for Greenplum SNE 4.2.6.1
FROM centos:6.6
MAINTAINER "Francisco Lopez" [email protected]
# update & upgrade packages
RUN yum update -y & yum upgrade -y
# install extra packages and basic tools (included some required for Greenplum installer)
RUN yum install -y epel-release git unzip which tar sed wget curl nano expect
# cleanup packages
@fran0x
fran0x / greenplum.sh
Last active August 29, 2015 14:19
Expect script used for Greenplum SNE 4.2.6.1 installer
#!/usr/bin/env bash
set timeout 60
cd /tmp
/usr/bin/expect << EOF
spawn /bin/bash greenplum-db-4.2.6.1-build-1-RHEL5-x86_64.bin
expect {
-ex "--More--" {
send "\n"