Skip to content

Instantly share code, notes, and snippets.

View vatsan's full-sized avatar

Srivatsan Ramanujam vatsan

View GitHub Profile

Download SCDF binaries

You can download the SCDF server and the shell from here.

Deploy SCDF server and bind Rabbit, Redis

    cf push dsm-dataflow-server --no-start -p spring-cloud-dataflow-server-cloudfoundry-1.0.0.M4.jar
    cf bind-service dsm-dataflow-server dsm-redis
    cf bind-service dsm-dataflow-server dsm-rabbit

cf set-env dsm-dataflow-server SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_URL https://api.run.haas-23.pez.pivotal.io

Initialization of PCF CLI

Login as admin to the “pds” org, choose the default space as “dsmicro"

sramanujam@srivatsan-ramanujams-macbook-pro:~/Downloads|
⇒  cf login --skip-ssl-validation  -a https://api.run.haas-23.pez.pivotal.io
API endpoint: https://api.run.haas-23.pez.pivotal.io

Email> admin

Install dependencies on Mac

    brew install ffmpeg 
    brew cask install xquartz
    brew install gifsicle

Use QuickTime player to do a screen-recording of your demo.

@vatsan
vatsan / sql
Last active January 22, 2016 17:43
Window Function to sample 10 elements at random for each group.
select
*
from
(
select
group,
row_number() over(partition by group order by random()) as row_number
from
table
)q
@vatsan
vatsan / opencv_mac_w_python2
Last active December 16, 2015 19:11
Installing OpenCV with Python support on a Mac
0) Get Anaconda Python
1) Download CMake for Mac and ensure you add the command line binaries to your PATH (sudo "/Applications/CMake.app/Contents/bin/cmake-gui" --install)
2) Download OpenCV
3) cd into the OpenCV director and run `mkdir build`
4) cd into the `build` director you just created and run the following:
Make sure you update the path to your own installation of Anaconda (i.e. replace "sramanujam" in the following with your user name).
cmake ../ -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_EXAMPLES=ON -DBUILD_NEW_PYTHON_SUPPORT=ON -DINSTALL_PYTHON_EXAMPLES=ON -DPYTHON_EXECUTABLE=/Users/sramanujam/anaconda/bin/python -DPYTHON_INCLUDE_DIR=/Users/sramanujam/anaconda/include/python2.7/ -DPYTHON_LIBRARY=/Users/sramanujam/anaconda/lib/libpython2.7.dylib -DPYTHON_NUMPY_INCLUDE_DIR=/Users/sramanujam/anaconda/lib/python2.7/site-packages/numpy/core/include/ -DPYTHON_PACKAGES_PATH=/Users/sramanujam/anaconda/lib/python2.7/site-packages/ -DBUILD_PYTHON_SUPPORT=ON
psql -d <dbname> -h <HAWQ master hostname> -U <username> -c 'select nrows, ncols, edges from ocv.canny_edge_table_plc limit 1;' | python -m ‘ppsqlviz.plotter’ image
pip install ppsqlviz
gpssh -f hostfile
echo “export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/usr/local/lib/ds” >> ~/.bashrc
gpstop -r
gpscp -f hostfile canny_plc.so libopencv_core.so.2.4 libopencv_imgproc.so.2.4 libopencv_highgui.so.2.4 =:/usr/local/lib/ds
g++ -shared -Wl,-soname,canny_plc -fPIC -I/usr/local/hawq-1.2.0.0/include/postgresql/server/ -I/usr/local/hawq-1.2.0.0/include/postgresql/internal -I/usr/local/hawq-1.2.0.0/include/ -o canny_plc.so -lopencv_core -lopencv_imgproc -lopencv_highgui CannyPLC.cpp