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 | |
# usage: curl https://s3-eu-west-1.amazonaws.com/ruanbekker.repo/scripts/bootstrap-dynamodb-local.sh | sudo bash | |
# setup dependencies | |
yum update -y | |
yum install java-1.7.0-openjdk -y | |
yum install python-setuptools -y | |
easy_install pip | |
pip install boto |
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
#!/usr/bin/python | |
# example usage: ./generate-csv-data.py --filename data --number-runs 10000 --number-reiterations 5 | |
from faker import Factory | |
import sys | |
import time | |
errInvalidArgs = "Usage: " + sys.argv[0] + " --filename" + " [STRING] " + " --number-runs" + " [INT] " + "--number-reiterations" + " [INT] " | |
errEg = " -> eg: " + sys.argv[0] + " --filename" + " dataset" + " --number-runs" + " 1000000 " + "--number-reiterations " + "5" | |
errOutput = "Outputs: dataset-timestamp.txt" |
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
from faker import Factory | |
from datetime import datetime | |
from elasticsearch import Elasticsearch | |
import json | |
esDomainEndpoint = "http://search-endpoint:80" | |
es = Elasticsearch(esDomainEndpoint) | |
def create_names(fake): | |
for x in range(100): |
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 random | |
method = ["credit", "debit", "credit", "credit", "debit", "credit", "credit", "cash", "credit"] | |
shop_dict = { | |
'Edgars': 'Clothing', | |
'CNA': 'Stationary', | |
'Sportmans Warehouse': 'Sports Equipment', | |
'Pick n Pay': 'Groceries', | |
'Rage Shoes': 'Shoes', |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 time | |
import requests | |
from bs4 import BeautifulSoup | |
from elasticsearch import Elasticsearch | |
es_client = Elasticsearch(['http://search-domain:9200']) | |
drop_index = es_client.indices.create(index='myindex', ignore=400) | |
create_index = es_client.indices.delete(index='myindex', ignore=[400, 404]) |
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 | |
SERVER_NAME="" | |
echo | openssl s_client -servername $SERVER_NAME -connect $SERVER_NAME:443 2>/dev/null | openssl x509 -noout -dates |
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
from flask import Flask | |
from flask_restful import Resource, Api | |
app = Flask(__name__) | |
api = Api(app) | |
class Colors(Resource): | |
def get(self): | |
return { | |
'colors': [ |
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
FROM alpine:3.6 | |
MAINTAINER Ruan Bekker | |
RUN apk update && \ | |
apk add \ | |
dumb-init \ | |
musl \ | |
linux-headers \ | |
build-base \ |
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 | |
# my testing was done with LXD/LXC so I had to set this on my hypervisor | |
# sysctl -w vm.max_map_count=262144 | |
# set elasticsearch cluster name: | |
ES_CLUSTER_NAME="myescluster" | |
# set elasticsearch nodes ip/dns that will be part of the elasticsearch cluster | |
ES_NODES='["10.0.0.2", "10.0.0.3"]' |
OlderNewer