Skip to content

Instantly share code, notes, and snippets.

View OluwoleOyetoke's full-sized avatar

Oluwole Oyetoke OluwoleOyetoke

  • London, United Kingdom
View GitHub Profile
@OluwoleOyetoke
OluwoleOyetoke / logToSplunkWithJava.md
Last active February 3, 2020 05:35
Securely Log to Splunk Using Java Logger

Securely Log to Splunk Using Java Logger

Splunk provides a library that can be used to create Java loggers needed for forwarding logs to a Splunk instance via multiple means such as HTTP, TCP and TCP-SSL. For more details on this, check the Splunk Logging for Java page. The rest of this article assumes you already have an up and running Splunk instance (on a UNIX box)

Note that details given in this write-up are specific to Splunk 8.0. Configuration parameters may have been different in previous versions and may also change in subsequent versions.

Details on forwarding logs directly via TCP and HTTP are quite clear, however, trying to log securely over TCP requires some additional processes. The stages involved in this process are listed below. Note that there may be other ways of achieving this same result, and the proceedure highlighted in the article is just one out of many other possible ways.

  1. Generate Self Signed Server Certi
@OluwoleOyetoke
OluwoleOyetoke / AlexNetDef.py
Created January 8, 2018 15:11
AlexNet TensorFlow Declaration
#CREATE CNN STRUCTURE
"""----------------------------------------------------------------------------------------------------------------------------------------------------------------"""
def cnn_model_fn(features, labels, mode):
"""INPUT LAYER"""
input_layer = tf.reshape(features["x"], [-1, FLAGS.image_width, FLAGS.image_height, FLAGS.image_channels], name="input_layer") #Alexnet uses 227x227x3 input layer. '-1' means pick batch size randomly
#print(input_layer)
"""%FIRST CONVOLUTION BLOCK
The first convolutional layer filters the 227×227×3 input image with
@OluwoleOyetoke
OluwoleOyetoke / Pop_TFRecord.py
Last active December 19, 2017 20:59
Pop Examples From TFRecord In TensorFlow
"""
@date 17th December, 2017
@Language: Python
@author: Oluwole Oyetoke
@email: oluwoleoyetoke@gmail.com
This script helps to get selected features out of a TF Record and return as an np array
Features extracted here: (Image, Labels)
#IMPORTS
"""
@OluwoleOyetoke
OluwoleOyetoke / _find_image_files.py
Last active December 18, 2017 22:35
TFRecord Creation Find images
def _find_image_files(data_dir, labels_file):
"""
Args:
data_dir: string, path to the root directory of images.
Assumes that the image data set resides in JPEG files located in
the following directory structure.
data_dir/dog/another-image.JPEG
data_dir/dog/my-image.jpg
where 'dog' is the label associated with these images.
labels_file: string, path to the labels file.
@OluwoleOyetoke
OluwoleOyetoke / Build_TFRecord.py
Last active December 19, 2017 01:24
Tensor Flow TFRecord Creation
"""--------------------------------------------------------------------------------------------------------------------------------------------------
REFERENCE:
----------
Code adapted from Google Tensor FLow Git Hub Repositiory:
https://github.com/tensorflow/models/blob/f87a58cd96d45de73c9a8330a06b2ab56749a7fa/research/inception/inception/data/build_image_data.py
@author: Oluwole Oyetoke
@date: 5th December, 2017
@langauge: Python/TF
@email: oluwoleoyetoke@gmail.com
INTRODUCTION:
@OluwoleOyetoke
OluwoleOyetoke / Circle_Detection_Kernel.cl
Last active March 27, 2021 17:28
OpenCL Kernel for Circle Detection
//OpenCL kernel for circle detection using Circular Hough Transform
//pragmas to enable floating point operations
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
#pragma OPENCL EXTENSION cl_khr_global_int32_base_atomics : enable
#pragma OPENCL EXTENSION cl_khr_local_int32_base_atomics : enable
//Already created Sine and Cosine Look-up table for improved speed
__constant double cosineTableGlobal[360] = { 1, 0.540302, -0.416147, -0.989992, -0.653644, 0.283662, 0.96017, 0.753902, -0.1455, -0.91113, -0.839072, 0.0044257, 0.843854, 0.907447, 0.136737, -0.759688, -0.957659, -0.275163, 0.660317, 0.988705, 0.408082, -0.547729, -0.999961, -0.532833, 0.424179, 0.991203, 0.646919, -0.292139, -0.962606, -0.748058, 0.154251, 0.914742, 0.834223, -0.0132767, -0.84857, -0.903692, -0.127964, 0.765414, 0.955074, 0.266643, -0.666938, -0.987339, -0.399985, 0.555113, 0.999843, 0.525322, -0.432178, -0.992335, -0.640144, 0.300593, 0.964966, 0.742154, -0.162991, -0.918283, -0.82931, 0.0221268, 0.85322, 0.899867, 0.11918, -0.77108, -
@OluwoleOyetoke
OluwoleOyetoke / IMDB_CREATION.m
Last active December 13, 2017 07:38
Used to create the Image Database (IMDB) file which can be used for Neural networks training on MatConvNet
function [] = createIMDB(trainingImageLocation, dumpSpace)
%createIMDB: Function used to create IMDB
% Function scans through the real image database on the computer and
% creates the IMDB of well labeled and classified images. Meta data such
% as image categorizations are also included in the created db to guide
% any user who might need to use the IMDB in the future
% 70 percent of the data is used for training
% 20 percent for validation
% 10 percent reserved for testing
% TrainingSet : to fit the parameters [i.e., weights]