python

Python Splunk Forwarder

Splunk

This is just a very simple Splunk data forwarder created for POC purposes and to present basic functionality. Some variables have been removed so you need to implement them on your own for this to work. The code includes a simple HTTP post, that uploads the event to a Splunk HEC URL of your choice
The code can also be found on my github

import json

import requests

Simple data visualisation in python

Some easy Python

Using some sample data from a course I'm enrolled in I decided to try my hand creating a visualization model with python. I had some prior experience being enrolled on a machine learning class, but because I feel I'm barely a beginner at this stuff I decided to practice with this data set.

The file I used for the data can be found on my Github.

The data is in a csv file and contains the following columns

Solving the quadratic equasion with python

Python

I started a new python data mining course that started from python basics. Won't be posting the basic stuff here until I get to the more interesting stuff with pandas, numpy, sckit-learn and matpilotlib. Just a fun little way to solve the quadratic function

# Solves the quadratic equasion

def quadSol(a,b,c):

v = (b**2) - (4*a*c)

xplu = -b-(m.sqrt(v))/2*a

xm = (-b+m.sqrt(v))/(2*a)

print("(" + str(xplu)+ " , " + str(xm) + ")")

def main():

a = 1

b = 5

c = 6

Python3 programming part 1

Pythonlogo

 

I enrolled in a python3 beginner course and will also be posting some work I've done for the course. I'll skip some of the more basic stuff. Some things written here like certain bits of console output will be in Finnish again due to some course requirements. The VIOPE system that we submit our code in to expects everything to be word for word the same as has been put in it.

Hello World in Python3

 

print("Hei Maailma!")