Skip to content

Instantly share code, notes, and snippets.

View ruanbekker's full-sized avatar
🇿🇦

Ruan Bekker ruanbekker

🇿🇦
View GitHub Profile
@ruanbekker
ruanbekker / setup-mailserver-1.sh
Created May 21, 2016 18:33
Mail Server Virtual Users with MySQL Postfix Dovecot on CentOS
#!/bin/bash
# blog: https://sysadmins.co.za/mail-server-virtual-users-mysql-postfixadmin-on-centos/
# dependencies
yum update -y
yum --enablerepo=centosplus install postfix mailx mutt -y
yum install dovecot mysql-server dovecot-mysql cyrus-sasl cyrus-sasl-devel -y
# mysql configuration
chkconfig mysqld on
@ruanbekker
ruanbekker / setup-dynamodb-local.sh
Created May 21, 2016 18:53
Setup DynamoDB Local
#!/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 July 18, 2016 09:53
Generates CSV Data using the Faker library
#!/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 August 8, 2016 14:35
generates random data and pushes to elasticsearch
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 / lxd-usage.txt
Created November 14, 2016 06:34
LXD Usage
Docs - LXD Helpful Docs:
https://www.stgraber.org/2016/03/30/lxd-2-0-image-management-512/
https://www.flockport.com/flockport-first-look-at-lxd/
http://insights.ubuntu.com/2016/03/14/the-lxd-2-0-story-prologue/
Docs - Installation:
http://insights.ubuntu.com/2016/03/14/the-lxd-2-0-story-prologue/
Docs - API:
https://linuxcontainers.org/lxd/getting-started-cli/
@ruanbekker
ruanbekker / generate-random-purchase-data.py
Last active December 21, 2016 05:39
Generates Random Transactional Data with Categories matching Shops
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-surnames.py
Created January 2, 2017 14:33
Array of Surnames
This file has been truncated, but you can view the full file.
surnames = ["Aaberg", "Aaby", "Aadland", "Aagaard", "Aakre", "Aaland", "Aalbers", "Aalderink", "Aalund", "Aamodt", "Aamot", "Aanderud", "Aanenson", "Aanerud", "Aarant", "Aardema", "Aarestad", "Aarhus", "Aaron", "Aarons", "Aaronson", "Aarsvold", "Aas", "Aasby", "Aase", "Aasen", "Aavang", "Abad", "Abadi", "Abadie", "Abair", "Abaja", "Abajian", "Abalos", "Abaloz", "Abar", "Abarca", "Abare", "Abascal", "Abasta", "Abate", "Abati", "Abatiell", "Abato", "Abatti", "Abaunza", "Abaya", "Abbadessa", "Abbamonte", "Abbas", "Abbasi", "Abbassi", "Abbate", "Abbatiello", "Abbay", "Abbe", "Abbed", "Abbenante", "Abbey", "Abbinanti", "Abbington", "Abbitt", "Abbot", "Abbott", "Abboud", "Abbruzzese", "Abbs", "Abby", "Abdalla", "Abdallah", "Abdel", "Abdelal", "Abdelaziz", "Abdeldayen", "Abdelhamid", "Abdella", "Abdelmuti", "Abdelrahman", "Abdelwahed", "Abdi", "Abdin", "Abdo", "Abdon", "Abdool", "Abdou", "Abdul", "Abdula", "Abdulaziz", "Abdulkarim", "Abdulla", "Abdullah", "Abdullai", "Abdulmateen", "Abdulmuniem", "Abdur", "Abe", "Ab
@ruanbekker
ruanbekker / array-names.py
Created January 2, 2017 14:37
Array of First Names
names = ["Aaran", "Aaren", "Aarez", "Aarman", "Aaron", "Aaron-James", "Aarron", "Aaryan", "Aaryn", "Aayan", "Aazaan", "Abaan", "Abbas", "Abdallah", "Abdalroof", "Abdihakim", "Abdirahman", "Abdisalam", "Abdul", "Abdul-Aziz", "Abdulbasir", "Abdulkadir", "Abdulkarem", "Abdulkhader", "Abdullah", "Abdul-Majeed", "Abdulmalik", "Abdul-Rehman", "Abdur", "Abdurraheem", "Abdur-Rahman", "Abdur-Rehmaan", "Abel", "Abhinav", "Abhisumant", "Abid", "Abir", "Abraham", "Abu", "Abubakar", "Ace", "Adain", "Adam", "Adam-James", "Addison", "Addisson", "Adegbola", "Adegbolahan", "Aden", "Adenn", "Adie", "Adil", "Aditya", "Adnan", "Adrian", "Adrien", "Aedan", "Aedin", "Aedyn", "Aeron", "Afonso", "Ahmad", "Ahmed", "Ahmed-Aziz", "Ahoua", "Ahtasham", "Aiadan", "Aidan", "Aiden", "Aiden-Jack", "Aiden-Vee", "Aidian", "Aidy", "Ailin", "Aiman", "Ainsley", "Ainslie", "Airen", "Airidas", "Airlie", "AJ", "Ajay", "A-Jay", "Ajayraj", "Akan", "Akram", "Al", "Ala", "Alan", "Alanas", "Alasdair", "Alastair", "Alber", "Albert", "Albie", "Aldred", "Al
@ruanbekker
ruanbekker / array-us-cities.py
Created January 2, 2017 14:49
Array of American Towns/Cities
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 / deploy-automated-hadoop-setup-on-lxd.sh
Last active April 22, 2024 21:36
Sets up a Hadoop 3 Node Cluster with LXC Containers on LXD (Automated Install)
#!/bin/bash
set -ex
UBUNTU_VERSION="14.04"
mkdirs(){
#lxc delete hadoop-master --force
#lxc delete hadoop-slave-1 --force
#lxc delete hadoop-slave-2 --force
rm -rf /tmp/*