Skip to content

Instantly share code, notes, and snippets.

@royrusso
royrusso / gist:328e3deb6c5bdf9d5ac4dc79c5690518
Created February 13, 2018 20:18
Find/Replace text in Chrome console
document.body.innerHTML = document.body.innerHTML.replace(/ABC/g, "XYZ")
@royrusso
royrusso / ElasticSearch.sh
Last active August 29, 2015 14:21 — forked from gourneau/ElasticSearch.sh
JDK8 + ES on Ubuntu
### Install Oracle Java 8, this means you agree to their binary license!!
cd ~
sudo add-apt-repository -y ppa:webupd8team/java
sudo apt-get update
echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections
echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections
sudo aptitude -y install oracle-java8-installer
### Download and Install ElasticSearch
### USAGE
###
### ./ElasticSearch.sh 1.5.0 will install Elasticsearch 1.5.0
### ./ElasticSearch.sh 1.4.4 will install Elasticsearch 1.4.4
### ./ElasticSearch.sh will fail because no version was specified (exit code 1)
###
### CLI options Contributed by @janpieper
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch
### ElasticSearch version
@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",
@royrusso
royrusso / git develop to master
Created April 8, 2015 17:33
Git: merge 'develop' in to 'master'
git checkout master
git merge develop
git push -u origin master
@royrusso
royrusso / pom.xml
Created March 11, 2014 19:01
Forking debug process during maven test goal
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.14</version>
<configuration>
<debugForkedProcess>true</debugForkedProcess>
</configuration>
</plugin>
#!/bin/bash
echo "Generating an SSL private key to sign your certificate..."
openssl genrsa -des3 -out myssl.key 1024
echo "Generating a Certificate Signing Request..."
openssl req -new -key myssl.key -out myssl.csr
echo "Removing passphrase from key (for nginx)..."
cp myssl.key myssl.key.org
openssl rsa -in myssl.key.org -out myssl.key