Skip to content

Instantly share code, notes, and snippets.

View randerzander's full-sized avatar

Randy Gelhausen randerzander

View GitHub Profile
@ivan-krukov
ivan-krukov / jupyter-imshow.py
Last active March 22, 2021 10:05
Show opencv image in ipython notebook
import cv2
import urllib.request
# Will use matplotlib for showing the image
from matplotlib import pyplot as plt
# Plot inline
%matplotlib inline
# For local images, read as usual
@granturing
granturing / reactive_map.js
Last active November 14, 2022 04:28
Sample reactive Leaflet code for Zeppelin
<!-- place this in an %angular paragraph -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.5/leaflet.css" />
<div id="map" style="height: 800px; width: 100%"></div>
<script type="text/javascript">
function initMap() {
var map = L.map('map').setView([30.00, -30.00], 3);
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
@dstreev
dstreev / phx_overloading.sql
Created July 8, 2015 20:07
Example of Phoenix Overloading
DROP VIEW
IF EXISTS phoenix_overload.profile;
DROP VIEW
IF EXISTS phoenix_overload.relationship;
DROP VIEW
IF EXISTS phoenix_overload.primary_residence;
DROP VIEW
IF EXISTS phoenix_overload.demographic;
DROP VIEW
IF EXISTS phoenix_overload.entity;
1. Checkout source code from https://github.com/apache/incubator-zeppelin
2. Custom build the code with spark 1.3 and with the respective Hadoop version.
mvn clean package -Pspark-1.3 -Dhadoop.version=2.6.0 -Phadoop-2.6 -DskipTests
3. Have the following jars in the spark classpath by placing them in the location $ZEPPELIN_HOME/interpreter/spark
a. hbase-client.jar
b. hbase-protocol.jar
c. hbase-common.jar
d. phoenix-4.4.x-client-without-hbase.jar
4. Start Zeppelin
@nsabharwal
nsabharwal / gist:600bef5a0454e0738a93
Created April 29, 2015 06:12
Indigesting to kafka by flume syslog
yum -y install sys-ng
# /etc/flume/conf/flume.conf
agent.sources=syslogsource-1
agent.channels=mem-channel-1
agent.sinks=kafka-sink-1
agent.sources.syslogsource-1.type=syslogtcp
agent.sources.syslogsource-1.port=13073
function startWait(){
curl -s -u $user:$pass -H 'X-Requested-By: ambari' -X PUT -d \
'{"RequestInfo": {"context" :"Start '"$1"' via REST"}, "Body": {"ServiceInfo": {"state": "STARTED"}}}' \
http://$host/api/v1/clusters/$cluster/services/$1
wait $1 "STARTED"
}
function stopWait(){
curl -s -u $user:$pass -H 'X-Requested-By: ambari' -X PUT -d \
'{"RequestInfo": {"context" :"Stop '"$1"' via REST"}, "Body": {"ServiceInfo": {"state": "INSTALLED"}}}' \
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a