piwik

divendres, 31 de maig del 2013

Setting up external monitor as a primary with Ubuntu, GNOME

Since I am currently working with an ultrabook, which has a very tiny monitor, I attached an external one. So, if we want to get it working as a primary monitore, where the menu bar and the buttons will be displayed, we just have to issue the following command:

xrandr --output VGA-0 --primary

In my case the external monitor is named VGA-0, but you might have different name for it, all you have to do is TAB after xrandr --output and it will prompt you for the different options you have.

Source: http://alt236.blogspot.com/2012/01/setting-up-second-monitor-as-primary.html

dimarts, 28 de maig del 2013

Monitoritzar Gluster 3.2 amb Zabbix

Per la informacio que he trobat, crec que amb la versio 3.2 sols tenim disponible dos comandaments per a monitoritzar l'estat dels volums i la connectivitat amb els "peers". Per tant, aci vos deixe els dos comandament que he afegit a Zabbix.

Amb aquest primer, el que fem es agafem l'estat del volum i imprimim un "1" si es "Started" o un "0" per a la resta de casos.

#Monitoring GlusterFS
UserParameter=glusterfs.status,sudo gluster volume info | grep Status | awk '{print $2}' | sed "s/\s//g" | sed "s/Started/1/" | awk '{ if ($1 == 1) print $1; else printf "0\n" }'



Aci el que fem es comprovar que tots els "peers" estan connectats al volum del server en el que executem Gluster. "1" en el cas que estiguen, "0" per a la resta
 
UserParameter=glusterfs.peer,sudo gluster peer status | grep State | awk '{print $5}' | sed 's/(//g' | sed 's/)//g' | sed "s/\s//g" | paste -sd " " | awk '{ if ($1 == "Connected" && $2 == "Connected" && $3 == "Connected") print "1"; else print "0"}'

dimarts, 21 de maig del 2013

How to install Oracle VM VirtualBox Extension Pack

USB 2.0 is currently enabled for this virtual machine. However, this requires the Oracle VM VirtualBox Extension Pack

This is the message we get when trying to enable USB 2.0 support from Virtual Box. Everything we need to do is go to the following link, and download the package shown bellow.

VirtualBox 4.2.12 Oracle VM VirtualBox Extension Pack  All supported platforms

https://www.virtualbox.org/wiki/Downloads

How to enable USB to the virtual machines on Virtual Box

This is the error we get when we want to go to "Settings".
VirtualBox is not currently allowed to access USB devices. You can change this by adding your user to the 'vboxusers' group

We just need to issue the following command in order to add the current user to vboxusers group.

sudo usermod -aG vboxusers josep

Where "josep" is our current user.
Right after that, we'll need to log out and log back in to see the changes applied.

dimecres, 15 de maig del 2013

Hidden menu bar in Firefox

Newer version of Firefox come with a single "Firefox" menu button, to switch between old-style and new format:
Right click on an empty section of the Tab strip, and either select or deselect "Menu bar" in the pop-up menu.

Source: https://support.mozilla.org/en-US/kb/what-happened-to-the-file-edit-and-view-menus

dimarts, 14 de maig del 2013

Llibreria h264enc necessaria per a codificar en el Kdenlive

El cas és que quan instal·les l'editor de vídeo Kdenlive et cal una llibreria per a poder codificar els vídeos als formats MPEG-4, h264

libffmpeg
libffmpegthumbnailer4
ffmpeg
libx264-85

libxvidcore4
libxvid
h264enc
mencoder
libmlt++1
libmlt++-dev

diumenge, 12 de maig del 2013

How to deploy an rsyslog central server in GNU/Linux


Rsyslog Central Server

Server side

The package we are gonna need to get installed is rsyslog-ng, available through main software distribution application for every distro.
The layout for our central syslog server is going to be the following:


on the server side we only need to modify /etc/rsyslog.conf by uncomment two modules and adding some rules:




#################
#### MODULES ####
#################

$ModLoad imuxsock # provides support for local system logging
$ModLoad imklog   # provides kernel logging support (previously done by rklogd)
#$ModLoad immark  # provides --MARK-- message capability

# provides UDP syslog reception
#$ModLoad imudp.so
#$UDPServerRun 5514
#$UDPServerAddress 172.16.65.163

# provides TCP syslog reception
$ModLoad imtcp.so
$InputTCPServerRun 5514

We will define also a template to generate the logs from remote servers depending on the IP, and also if the process that generates the log matches with one of the processes we want, we will create a separate syslog file preceded by process name.

##############
##Templates###
##############
# This one is the template to generate the log filename dynamically, depending on the client's IP address.
$template externalsyslog,"/home/backup/rsyslog_server/%fromhost-ip%/syslog.log"
$template TraditionalFormat,"%timegenerated% %fromhost-ip% %syslogtag%%msg:::drop-last-lf%\n"

$template filterByProgramName,"/home/backup/rsyslog_server/%fromhost-ip%/%programname%_syslog.log"

if $programname == 'process1' then ?filterByProgramName;TraditionalFormat
if $programname == 'process2' then ?filterByProgramName;TraditionalFormat
if $programname == 'process3' then ?filterByProgramName;TraditionalFormat
if $programname == 'process4' then ?filterByProgramName;TraditionalFormat
if $programname == 'process5' then ?filterByProgramName;TraditionalFormat
if $programname == 'process6' then ?filterByProgramName;TraditionalFormat
if $programname == 'process7' then ?filterByProgramName;TraditionalFormat
if $programname == 'process8' then ?filterByProgramName;TraditionalFormat

# Log all messages to the dynamically formed file. Now each clients log (172.16.65.166, 172.16.65.167,etc...), will be under a separate directory which is formed by the template FILENAME.
*.* -?externalsyslog;TraditionalFormat

We must grant the right permissions to the directory where rsyslog will be writing its logs. syslog:syslog

Clients

We must forward the syslog messages to server's IP.

#Forward log to remote server
*.* @@172.16.70.3:5514
#Forward log to localhost
*.* @@localhost:514


Logrotate

Linked to syslog server we had set logrotate to rotate the logs weekly. That is why we added the following entries to /etc/logrotate.d/rsyslog

Here we are rotating all the logs generated by different processes from every client. For example, for 172.16.65.161 we are going to be rotating syslog.log,  process2_syslog.log, process3_syslog.log, process4syslog.log, process1_syslog.log

root@ZNNH003:~# cat /etc/logrotate.d/rsyslog
/var/log/syslog
{
rotate 7
daily
missingok
notifempty
delaycompress
compress
postrotate
reload rsyslog >/dev/null 2>&1 || true
endscript
}


/home/backup/rsyslog_server/127.0.0.1/syslog.log
{
rotate 7
daily
missingok
notifempty
delaycompress
compress
postrotate
reload rsyslog >/dev/null 2>&1 || true
endscript
}
/home/backup/rsyslog_server/127.0.0.1/process4_syslog.log
{
rotate 7
daily
missingok
notifempty
delaycompress
compress
postrotate
reload rsyslog >/dev/null 2>&1 || true
endscript
}
/home/backup/rsyslog_server/127.0.0.1/process3_syslog.log
{
rotate 7
daily
missingok
notifempty
delaycompress
compress
postrotate
reload rsyslog >/dev/null 2>&1 || true
endscript
}