DevTech101

DevTech101

python

Capturing Solaris 11.4 (12) Analytics By Using Remote Administration Daemon (RAD) – Part 5

Capturing Your Own Solaris 11.4 (12) Analytics By Using Remote Administration Daemon (RAD) – Part 5 Note: The full code is available in a GitHub repository. to play with the code, feel free to clone the Solaris Analytics Publisher Repository. This is part 5 out of a series of articles on how to use Oracle …

Capturing Solaris 11.4 (12) Analytics By Using Remote Administration Daemon (RAD) – Part 5 Read More »

Creating, Hosting Your Own CoreOS Rkt App Container Images(ACI)

Creating, Hosting your own CoreOS Rkt (ACI) Images Creating your own (ACI) package The document below uses the ACI image format since we are dealing with Rkt. in the future Rkt might switch to the OCI format. to note Docker is using the OCI image format, which is part of the opencontainer initiative. The steps …

Creating, Hosting Your Own CoreOS Rkt App Container Images(ACI) Read More »

Kubernetes CoreOS Ignition Configuration Generator – Part 6

Kubernetes CoreOS Ignition Configuration Generator Written in Python. In the previous post I went through how to Configuring Kubernetes Træfik Ingress Controller, DNS, Dashboard. below are examples to use a small Python script I have written to automate most of the Kubernetes deployment process. Note: Get going in minutes with a full Kubernetes cluster by …

Kubernetes CoreOS Ignition Configuration Generator – Part 6 Read More »

Python remote backup script

#!/bin/python import os import sys import time import datetime import subprocess import smtplib from email.mime.text import MIMEText def mysqlBackup(): mysql_host = ‘localhost’ mysql_user = ‘root’ mysql_user_passwd = ‘password’ backup_path = ‘/mystuff/mysql_backup/’ dblist = [‘wordpress’] datetime = time.strftime(‘%m%d%Y-%H%M%S’) for db in dblist: backupdate = backup_path + db + “_” + datetime logger(“creating backup folder – ” …

Python remote backup script Read More »

Example Of Capturing IOStat With Python

The below Example captures IOStat output with Python in Solaris #!/bin/python import subprocess import csv io_c = subprocess.Popen([‘iostat’, ‘-xnsMr’, ‘1’, ‘2’], stdout=subprocess.PIPE, shell=False, stderr=subprocess.PIPE) stdout = io_c.communicate()[0] lc = len(stdout.split(‘n’)) it_lc = lc / 2 + 2 reader = csv.reader(stdout.split(‘n’)[it_lc:], delimiter=’,’) for row in reader: if any(row): #print row print row[0],row[1],row[2],row[3],row[7],row[8],row[9],row[10] Output should look similar …

Example Of Capturing IOStat With Python Read More »

Capturing Your Own Solaris 11.4 (12) Analytics / Sstore – Part 3

Capturing Your Own Solaris 11.4 (12) Analytics / Sstore Note: There is an updated process for Solaris 11.4+, please check out part 5 – Enhanced method on how to capture analytics in Solaris 11.4+ Note: The full code is available in a GitHub repository. to play with the code, feel free to just clone the …

Capturing Your Own Solaris 11.4 (12) Analytics / Sstore – Part 3 Read More »

Capturing Your Own Solaris 11.4 (12) Analytics / Sstore – Part 2

Capturing Solaris 11.4/(12) analytical data Note: There is an updated process for Solaris 11.4+, please check out part 5 – Enhanced method on how to capture analytics in Solaris 11.4+ Note: The full code is available in a GitHub repository. to play with the code, feel free to just clone the Solaris Analytics Publisher repository. …

Capturing Your Own Solaris 11.4 (12) Analytics / Sstore – Part 2 Read More »

How To Create a Python Socket Server

Create the Python Socket Server #!/bin/python import socket host = ‘10.10.10.10’ port = 50000 backlog = 5 size = 1024 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind((host,port)) s.listen(backlog) while 1: client, address = s.accept() data = “Return data\n” client.send(data) client.close() Create the client connection #!/bin/python import socket host = ‘10.10.10.10’ port = 50000 backlog = 5 size …

How To Create a Python Socket Server Read More »

Oracle BDA iPython, Notebook and Jupytar Configuration

How to install iPython/Notebook on an Oracle BDA Install the below packages pip install ibackports.ssl_match_hostname-3.5.0.1.tar.gz ipython-1.2.1.tar.gz pyzmq-15.2.0.zip tornado-3.2.1.tar.gz add parcels in CDH GUI parcel address Remote Parcel Repository URLs https://repo.continuum.io/pkgs/misc/parcels/ donwload, distrubite, activate System startup script /usr/local/notebook/bin/start_notebook.sh #!/bin/bash export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/rh/python27/root/usr/lib64 export PATH=/opt/rh/python27/root/usr/bin:$PATH # Notebook export PYSPARK_DRIVER_PYTHON=ipython export PYSPARK_DRIVER_PYTHON_OPTS=”notebook –NotebookApp.open_browser=False –NotebookApp.ip=’*’ –NotebookApp.port=8880″ # Jupyter #export PYSPARK_DRIVER_PYTHON=/opt/cloudera/parcels/Anaconda/bin/jupyter …

Oracle BDA iPython, Notebook and Jupytar Configuration Read More »