Author: Mattias Hemmingsson

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 →

Move an Megento site to new url

So I hade to move en megent site from to this is so that you can test and try new stuff on a site that is not you primary site. Moving magneto was some hazzel it not as easy as other site is take som sql to make it work.       First setup you webbserver  (This… Read more →

Foreman provision to bare and libvirtd (Centos7, foreman, libvirtd, KVM)

So I have started to play around with foreman and to get it to provision my diffrent servers. I started by starting up some local virtual servers on my laptop and played around with them. The flow is i started installing foreman as a virtual server. Then i provisin a new virtual server as bare matal (I created a virtual… 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 →

Raspberry pi And Tellusd

Im using tellus to get info from my sensors like huminity and temp. And to get to work am using my rasp pi to recive and send siganls. Here is a quick guide to install and setup tellusd on you raspberry.   1. Verify that tellus is there pi@raspberrypi ~ $ lsusb Bus 001 Device 002: ID 0424:9512 Standard Microsystems… 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 →

Php HHVM (aka the HipHop Virtual Machine) on Centos 7

To get my php projects running as fast as possible om trying to use hhvm. And here is my small guide how to install it on centos 7 I used the docs from   1. First setup you centos linux host   yum localinstall yum localinstall yum install cpp gcc-c++ cmake git psmisc {binutils,boost,jemalloc}-devel \ {sqlite,tbb,bzip2,openldap,readline,elfutils-libelf,gmp,lz4,pcre}-devel \ lib{xslt,event,yaml,vpx,png,zip,icu,mcrypt,memcached,cap,dwarf}-devel… Read more →

Installing Go build server on centos 7

Installing the go build server in centos 7 with some easy step     1. First head over to the go page and have a look around 2. Download go server to you centos box   wget wget 3. Install it First start by adding the go user (something broken in install) useradd go Now run yum localinstall… Read more →

%d bloggers like this: