Skip to content

Instantly share code, notes, and snippets.

View nabilm's full-sized avatar
💭
I may be slow to respond.

Mohamed Nabil Hafez nabilm

💭
I may be slow to respond.
View GitHub Profile
@royrusso
royrusso / gist:51bc89427e1575d4d777
Last active June 12, 2016 23:49
Load datasource in to dataframe, using Spark DataSource API
os.environ['SPARK_CLASSPATH'] = "/path/to/driver/postgresql-9.3-1103.jdbc41.jar"
from pyspark import SparkContext
from pyspark.sql import SQLContext, Row
sc = SparkContext("local[*]", '<JOBNAME>')
sqlctx = SQLContext(sc)
df = sqlctx.load(
source="jdbc",
@wvengen
wvengen / install_scrapyd.sh
Last active May 31, 2019 07:27
Installation script for scrapyd
#
# Installation script for scrapyd on Debian/Ubuntu
# http://scrapyd.readthedocs.org/
#
# - Latest scrapyd from Scrapy package repository
# - Password protection with http basic auth
# - HTTPS with self-signed certificate
# - Works on Amazon EC2
#
FQDN=scrapy.example.com