This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Drop these functions into your ~/.bashrc or ~/.bash_profile, wherever you keep your bashy goodness. | |
# Usage: cd to directory you want to serve up, fire one of these commands, navigate to http://0.0.0.0:{port number here} | |
# Start an HTTP server from a directory, optionally specifying the port | |
function serverpy() { | |
local port="${1:-8000}" | |
open "http://localhost:${port}/" | |
# Set the default Content-Type to `text/plain` instead of `application/octet-stream` | |
# And serve everything as UTF-8 (although not technically correct, this doesn’t break anything for binary files) | |
python -c $'import SimpleHTTPServer;\nmap = SimpleHTTPServer.SimpleHTTPRequestHandler.extensions_map;\nmap[""] = "text/plain";\nfor key, value in map.items():\n\tmap[key] = value + ";charset=UTF-8";\nSimpleHTTPServer.test();' "$port" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "... sshing to vncserver once we get some info ..." | |
echo "enter ip e.g. 123.456.789" | |
read HOST_IP | |
echo "enter username e.g. ubuntu" | |
read USERNAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*.log | |
*.swp | |
*.out | |
__pycache__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"paragraphs":[{"title":"Add your Event Hub connection details","text":"%spark2\nz.angularBind(\"BIND_ObjectStorage_Container\", \"\")\nz.angularBind(\"BIND_OEHCS_ConnectionDescriptor\", z.input(\"OEHCS_ConnectionDescriptor\",\"129.150.212.124:6667\"))\nz.angularBind(\"Tweets_Topic\", z.input(\"Tweets_Topic\",\"idcs-363b4236183e42f68a92d1c5ad79728e-lumiere\"))\nz.angularBind(\"Survey_Topic\", z.input(\"Survey_Topic\",\"idcs-363b4236183e42f68a92d1c5ad79728e-lumiere\"))\n\n//save these for pyspark\nz.put(\"Tweets_Topic\", z.angular(\"Tweets_Topic\"))\nz.put(\"Survey_Topic\", z.angular(\"Survey_Topic\"))\nz.put(\"BIND_OEHCS_ConnectionDescriptor\", z.angular(\"BIND_OEHCS_ConnectionDescriptor\"))\n\n//save these for shell\nscala.tools.nsc.io.File(\"/var/lib/zeppelin/oehcs.sh\").writeAll(\n \"export ObjectStorage_Container=\\\"\"+z.angular(\"BIND_ObjectStorage_Container\")+\"\\\"\\n\" +\n \"export OEHCS_ConnectionDescriptor=\\\"\"+z.angular(\"BIND_OEHCS_ConnectionDescriptor\")+\"\\\"\\n\" +\n \"export Tweets_To |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# by http://sblack4.github.io - Steven.Black@Oracle.com | |
# updated 2018-07-30 | |
# credit goes to David Bayard for providing the majority of this script | |
# see his journey 2 (where I got a lot of this) below, I highly recommend it! | |
# https://github.com/oracle/learning-library/tree/master/workshops/journey2-new-data-lake | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python | |
""" | |
takes tweet dataset and transforms into tickets dataset | |
Category, Date, Comment, id | |
category: ['bug', 'ticket', 'help', 'ID10t', 'feature'] | |
""" | |
import csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python | |
""" | |
""" | |
import csv | |
from faker import Faker | |
from pandas import read_csv | |
from datetime import date, timedelta, datetime | |
from random import randint, triangular, choice |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
log_level = logging.INFO | |
timeout = 1 | |
kafka_host = "129.144.154.83:6667" | |
# tickets | |
key = "ticket" | |
topic = "idcs-c6319aeb031a417c97ac0f048627b112-conga" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/anaconda3/bin/python | |
""" | |
convert_files.py | |
converts every file in this directory into a microsoft word file | |
""" | |
print("run from the workshops/realtime-analytics-oac-datalake") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
import java.util.*; | |
import java.nio.file.*; | |
import java.lang.RuntimeException; | |
import java.net.URISyntaxException; | |
import java.lang.ProcessBuilder.Redirect; | |
public class ATPConnectionTest { |