Mesos cluster with Marathon running Docker

Hi So for hosting docker in large scale i have tested mesos cluster.  Here is a guide for setting up 3 nodes in mesos running Centos 7. And the adding Marathon to controll the dockers running. The network mesos-master mesos-slave1 mesos-slave2   The node also have on nic connect to the network with internet access.   Security… Read more →

Elasticsearch controller

So we uses alot of easticsearch. And here is i small script to get status and do some simple task with es server. You can get cluster status and cron for index deletions.   import urllib2 # # # Clean up elastich search index by removing old stuff. #The defult ip to es server dhost=’′ #The index name you are… Read more →

Python DOS protection (iptables,dos)

here are a small script I use to have some sort of dos protection on my webservers.   import subprocess whitelist=[‘’] blockvalue=2 alertvalue=1 proc = subprocess.Popen(“netstat -ntu | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n”, shell=True,stdout=subprocess.PIPE) running = runing_sorted = running.split(‘\n’) for r in runing_sorted: con =r.split() if len(con) ==2: #If… Read more →

Build Openvpn centos 7

Here is how i build and setup openvpn on my centos 7 box. 1. Download and install openvpn latest Some yum packages   yum install openssl-devel lzo-devel pam-devel   wget tar zxvf openvpn-2.3.7.tar.gz cd openvpn-2.3.7 ./configure make make install # /usr/local/sbin/openvpn –version     So now we have the latest version setup and lets create some cert… Read more →

Python3 and rabbitmq

Im using rabbitmq in some of my python apps. Here is a small guide to get pyton3 to send and recive data from rabbitmq   I uses the code from And read some guide from from 2009 !!!!   Get the pip you need to connect sudo pip3 install amqp     My python code for sending and reciving… Read more →

Setup SPI on Raspberry pi (mcp3008, Adafruit)

Im building my own watering system and to that I will have some sensores.. They are connected to my pi over SFI and a mcp3008 from Adafruit.   The gear   Setup the cables Use this guide and se how the you should connect the mcp3008 and the sensore.   Get the Pi ready  … Read more →