p2p Video Chat – GSoC Week 3

Lalit Khattar

After finished implementing chat log search last week, I moved on to my next major task – implementing p2p video chat in waartaa.


A p2p(peer to peer) plugin-free video/audio Real Time Communication(short for RTC) had always been a nightmare for developers to implement. This was changed few years back with the introduction of WebRTC – an open source, plugin-free, built into browsers technology. Today, there are many web services out there which uses webRTC eg. Bistri.


A WebRTC application needs to do several things:

  • Get streaming audio, video or other data.
  • Get network information such as IP addresses and ports, and exchange this with other WebRTC clients (known as peers) to enable connection, even through NATs and firewalls.
  • Coordinate signaling communication to report errors and initiate or close sessions.
  • Exchange information about media and client capability, such as resolution and codecs.
  • Communicate streaming audio, video or data.

View original post 185 more words

Setting log rotation in Centos servers – How to linux

Setting log rotation in Centos servers:

Logrotation helps to reduce disk size by rotating log files and compressing them. It helps to prevent over sizing of log files and disk space issue by removing old logs data, creating small chunk of specific numbers of log files.


Default log rotate file is located in /etc/logrotate.conf


# see "man logrotate" for details
# rotate log files weekly
# keep 4 weeks worth of backlogs
rotate 4
# create new (empty) log files after rotating old ones
# use date as a suffix of the rotated file
# uncomment this if you want your log files compressed
# RPM packages drop log rotation information into this directory
include /etc/logrotate.d
# no packages own wtmp and btmp -- we'll rotate them here
/var/log/wtmp {
 create 0664 root utmp
 minsize 1M
 rotate 1
/var/log/btmp {
 create 0600 root utmp
 rotate 1

Linux comes with defualt file settings  for many modules which can be found inside /etc/logrotate.d/ . For example if we want to do log rotation for mysql we can find default mysql file called mysqld,  so full path is : /etc/logrotate.d/mysqld.


Do the vi to edit the file and uncomment settings:


# ATTENTION: This /root/.my.cnf should be readable ONLY
 # for root !
# Then, un-comment the following lines to enable rotation of mysql's log file. default name for mysql log is mysqld.log so the setting contains log rotation settings for mysqld.log file. Do check your my.cnf file  of mysql settings mostly located in /etc/my.cnf and make sure log path is /var/log/mysqld.log. We can add multiple log files like error log , query log e.t.c in same settings. These settings can also be copied to my.cnf file or can be added as seperate file in /etc/logrotate.d/ folder.

/var/log/mysqld.log {
 create 640 mysql mysql
 rotate 3
 # just if mysqld is really running
 if test -x /usr/bin/mysqladmin && \
 /usr/bin/mysqladmin ping &>/dev/null
 /usr/bin/mysqladmin flush-logs


Settings options:

create: mode owner group: Create log file with given mode and user/group settings.

notifempty :
Do not rotate the log if it is empty

weekly : Log files are rotated if the current weekday is less then the weekday of the last rotation or if more then a week has passed since the last rotation

rotate 3 : Log files are rotated 3 times before being removed or mailed to the address specified in a mail directive. If count is 0, old versions are removed rather then rotated

missingok : If the log file is missing, go on to the next one without issuing an error message.

compress : Old versions of log files are compressed with gzip to save disk space.

postrotate: start of script.

endscript: The lines between postrotate and endscript (both of which must appear on lines by themselves) are executed after the log file is rotated. These directives may only appear inside a log file definition. In our case we are checking is mysql is running and flushing logs.


More setting options can be found from http://linuxcommand.org/man_pages/logrotate8.html