Skip to content

Instantly share code, notes, and snippets.

:octocat:

Ruan Bekker ruanbekker

:octocat:
Block or report user

Report or block ruanbekker

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View setup-dynamodb-local.sh
#!/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
@ruanbekker
ruanbekker / generate-csv-data.py
Last active Jul 18, 2016
Generates CSV Data using the Faker library
View generate-csv-data.py
#!/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"
@ruanbekker
ruanbekker / generate-random-data-elasticsearch.py
Created Aug 8, 2016
generates random data and pushes to elasticsearch
View generate-random-data-elasticsearch.py
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):
@ruanbekker
ruanbekker / generate-random-purchase-data.py
Last active Dec 21, 2016
Generates Random Transactional Data with Categories matching Shops
View generate-random-purchase-data.py
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',
@ruanbekker
ruanbekker / array-us-cities.py
Created Jan 2, 2017
Array of American Towns/Cities
View array-us-cities.py
us_cities = ["Abbeville", "Abbotsford", "Aberdeen", "Abilene", "Abingdon", "Abington", "Absecon", "Acampo", "Accokeek", "Achille", "Acme", "Acton", "Acushnet", "Acworth", "Ada", "Adair", "Adairsville", "Adams", "Adams Run", "Adamstown", "Adamsville", "Addieville", "Addis", "Addison", "Addyston", "Adel", "Adelanto", "Adena", "Adkins", "Adrian", "Advance", "Afton", "Agawam", "Agoura Hills", "Agra", "'Aiea", "Aiken", "Ailey", "Airville", "Ajo", "Akhiok", "Akron", "Alabaster", "Alameda", "Alamo", "Alamogordo", "Albany", "Albemarle", "Albert City", "Albert Lea", "Albertson", "Albertville", "Albia", "Albion", "Albrightsville", "Albuquerque", "Alburtis", "Alcoa", "Alden", "Aldie", "Aledo", "Alexander", "Alexander City", "Alexandria", "Alfred", "Alger", "Algoma", "Algonquin", "Alhambra", "Alice", "Aliceville", "Aliquippa", "Aliso Viejo", "Allegan", "Allen", "Allendale", "Allen Park", "Allenport", "Allenton", "Allentown", "Alliance", "Allison Park", "Alloway", "Allston", "Allyn", "Alma", "Almont", "Alna", "Alpena", "A
@ruanbekker
ruanbekker / 0_reuse_code.js
Created Apr 24, 2017
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@ruanbekker
ruanbekker / nested-sitemap-to-elasticsearch.py
Created Apr 30, 2017
Scrapes URL, Title and Keywords from Nested Sitemap to Elasticsearch
View nested-sitemap-to-elasticsearch.py
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])
@ruanbekker
ruanbekker / check-ssl-expiry.sh
Created May 10, 2017
Checks SSL Expiry Date with OpenSSL
View check-ssl-expiry.sh
#!/bin/bash
SERVER_NAME=""
echo | openssl s_client -servername $SERVER_NAME -connect $SERVER_NAME:443 2>/dev/null | openssl x509 -noout -dates
View array-surnames.py
This file has been truncated, but you can view the full file.
@ruanbekker
ruanbekker / flask-restful-api.py
Created Jun 11, 2017
Basic API Server with Flask-Restful
View flask-restful-api.py
from flask import Flask
from flask_restful import Resource, Api
app = Flask(__name__)
api = Api(app)
class Colors(Resource):
def get(self):
return {
'colors': [
You can’t perform that action at this time.