Linux Performance Co-Pilot with WebUI

Performance Co-Pilot allow sysadmins to collect and measure data from various systems , it comes in RPM packages for Red Hat 6 to 7

website http://pcp.io/

installing Performance CO-Pilot

pcp  packages comes with different services pmcd,pmlogger 

pmcd  : performance metrics collector daemon

pcp packages come with many commands to gather information about the machine like pmatop, pmstat, pminfo,  pmval

pmatop one of my favorite tool as it give you a big picture

it shows information about disk , memory, cpu , network , process , swap , lvm

 

Screen Shot 2016-07-23 at 1.23.04 PM

pmstat   it show loadavg, memory ,  swap , io , system , cpu come with -s ( sample counter [how many times it should collect this data ] ) and -t for time interval

pminfo command to list all available metrics

lets use metrics called network.interface.in.bytes to see how many bytes we receive in our interface

let’s start pmlogger

the pmlogger service will save the log archievs into /var/log/pcp/pmlogger/[hostname]/date-day

we can use pmval with parameter -a to tell it to use this archive and set the matrix

we can assign specified start and end time for pmval

-S start time , -T end time

with  ISO-formatted date example -S  ‘@ Wed Feb 25 05:01:00 2016’ -T ‘@ Wed Feb 25 06:01:00 2016’

this will query 2 hours from 5am Feb 25 2016 TO 7am Feb 25 2016 with the metrics  you like

not the fun part pcp offer a web real time monitor in different flavours and styles one of my best is called vector.

first we need to install and run the pcp web service

check which port this service use

access to localhost:44323/vector

it shows nice metrics of disk IOPS , Throughputs ,Network Packets and more

vector

happy debugging folks

Facebook Mass Invite to Like script

today i wrote  a script to help in sending invitation to like your page

this is happen when you promote a post for your audience and they interact with your post but they forget to like your page

so this script will help you to mass invite them in once

Screen Shot 2016-07-21 at 1.30.18 PM

1 – click on the likes for the post

2- open your browser console

paste this code

 

hit enter

and result should be like this

Screen Shot 2016-07-21 at 1.23.20 PM

as you can see i sent around 200 invitation in once 😀

enjoy

Docker Persistent Storage for MySQL Server and SELinux

hello everyone today we will make

MySQL Docker Container with Shared Storage

first lets pull latest mysql  version of docker

after we done download the latest image

this image come handy with some awesome parameters

  1. MYSQL_ROOT_PASSWORD
  2. MYSQL_DATABASE

with this  parameters we can create database and set root password for mysql

now let’s create a folder in our host so we can use it instead of /var/lib/mysql (let’s keep the mysql data in the host not inside a container)

remember it should be numeric formate

then we chanage the folder context to for selinux to  treat this as virtualized sandbox

here we created a database called unixawy and root password un1x4wyp4ssw0rd

inspect your docker and connect to it ip

now each container you run with this command will share the same database data

check database content in your node storage via ls /var/mysql_data_store

cheers

IPtables PREROUTING, POSTROUTING for mixed interfaces via DNAT & SNAT

hello world,

let’s hit the point directly

1 – we have traffic coming from Source IP to our box and we need to Route it to another destination ( traffic forwarding )

2- we have traffic coming from Source IP to our box and we need to Route it to another destination ( traffic forwarding )  through specified interface Continue reading IPtables PREROUTING, POSTROUTING for mixed interfaces via DNAT & SNAT