Skip to content

Instantly share code, notes, and snippets.

@jcaristy
jcaristy / bash.sh
Last active September 23, 2017 02:15
[Python: Conda Comandos] #python
#Documentación
#https://conda.io/docs/user-guide/tasks/manage-environments.html
#Listar los enviroments
conda info --envs
conda env list
#Crear ambiente especificando la version de python
conda create -n myenv python=3.4
@jcaristy
jcaristy / bash.sh
Last active September 23, 2017 02:30
[AWS: CLI] #aws #python
# http://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-crawler-pyspark-extensions-python-intro.html
pip install awscli --upgrade --user
source ~/.bash_profile
aws --version
@jcaristy
jcaristy / info.md
Last active September 24, 2017 14:33
[PySpark: Comandos] #python #pyspark

SparkContext

with pyspark.SparkContext("local", "PySparkWordCount") as sc: file_path = "example.csv"

Leer un TXT

data = sc.textFile(file_path)

data = sc.textFile(file_path).cache

@jcaristy
jcaristy / info.md
Last active September 24, 2017 14:39
[Databricks: Comandos] #python #pyspark

Listar los archivos

%fs ls

Nota: %fs = Funciones del sistema (%file-system)

@jcaristy
jcaristy / leer-csv.py
Last active September 24, 2017 15:25
[PySpark: Leer un CSV] #pyspark
# Listar en databricks el archivo
%fs ls dbfs:/databricks-datasets/online_retail/data-001/
# En databricks ya esta inicializado el objeto SparkSession pero sino se puede inicializar asi
from pyspark.sql import SparkSession
spark = SparkSession.builder.master("local").appName("Word Count").config("spark.some.config.option", "some-value").getOrCreate()
# Leer CSV a un RDD
path = "dbfs:/databricks-datasets/online_retail/data-001/data.csv"
data = spark.read.csv(path)
@jcaristy
jcaristy / info.md
Created September 25, 2017 02:06
[AWS: Glue] #aws
@jcaristy
jcaristy / info.sh
Last active September 27, 2017 17:39
[Mac: Ocultar/Mostrar archivos ocultos] #mac
# Mostrar
defaults write com.apple.finder AppleShowAllFiles YES
killall Finder /System/Library/CoreServices/Finder.app
# Ocultar
defaults write com.apple.finder AppleShowAllFiles NO
killall Finder /System/Library/CoreServices/Finder.app
@jcaristy
jcaristy / info.md
Last active October 2, 2017 14:07
[Ubuntu: Crontab Reboot] #linux #ubuntu

Editamos el crontab

sudo crontab -e

Agregamos la siguiente linea

0 6 * * * /sbin/shutdown -r now

// Reiniciamos todos los dias a las 4am. Hora del servidor

Obtenemos la hora del servidor

date

@jcaristy
jcaristy / info.sh
Last active January 30, 2018 05:06
[DREMIO: Instalar dremio] #dremio
Estos pasos son para instalar Dremio en Ubuntu
### Primero instalamos jre
sudo apt-get update
sudo apt-get install default-jre
https://www.digitalocean.com/community/tutorials/instalar-java-en-ubuntu-con-apt-get-es
#LINKS DE INSTALACION
@jcaristy
jcaristy / install.sh
Created November 23, 2017 17:26
[UBUNTU - Instalar LAMP] #ubuntu #linux #LAMP
# Deshabilitar el firewall
sudo ufw status verbose
sudo ufw disable
# Instalar Apache
sudo apt -get install apache2
# Buscar paquetes actuales de mysql
sudo apt-cache search mysql | grep mysql | more