Play all media formats on Ubuntu 14.04 LTS Desktop

Experiments, How to, Linux
I still remember the first time I test-drove Mandriva Linux (formerly known as Mandrake), I could run every other audio and video format out-of-the-box without downloading anything (it was a dialup modem era so downloading was a pain-in-the-rear). Many years after, I finally installed Ubuntu 14.04 LTS on my new laptop but it does not recognize some of my mp3 files and im like "Are you kidding me?" Im glad I found a solution, there is a package called ubuntu-restricted-extras (read the Wikipedia entry and Ubuntu documentation) that you can install and it support all major media formats, Codecs and even Flash Player. To install, you need to run [code lang="bash"]sudo apt-get install ubuntu-restricted-extras[/code] Legal Notice Patent and copyright laws operate differently depending on which country you are in. Please obtain legal advice…
Read More

Error: Could not stat() command file ‘/var/lib/nagios3/rw/nagios.cmd’!

How to
Error: Could not stat() command file '/var/lib/nagios3/rw/nagios.cmd'! The external command file may be missing, Nagios may not be running, and/or Nagios may not be checking external commands. An error occurred while attempting to commit your command for processing. Return from whence you came   Just do the following [code highlight="1,3,4,6"]root@nagios:~# ls -l /var/lib/nagios3/rw/nagios.cmd prw-rw---- 1 nagios nagios 0 Aug 11 22:27 /var/lib/nagios3/rw/nagios.cmd root@nagios:~# chmod -R g+x /var/lib/nagios3/rw root@nagios:~# ls -l /var/lib/nagios3/rw/nagios.cmd prw-rwx--- 1 nagios nagios 0 Aug 11 22:27 /var/lib/nagios3/rw/nagios.cmd root@nagios:~# service nagios3 restart[/code] Also change group of the file [code highlight="1,3"]root@nagios:~# ls -l /var/lib/nagios3/rw/nagios.cmd prw-rw---- 1 nagios nagios 0 Aug 11 22:27 /var/lib/nagios3/rw/nagios.cmd root@nagios:~# chown nagios:www-data /var/lib/nagios3/rw/nagios.cmd[/code] And also, you may need to do the following and restart apache afterwards [code highlight="1,2"]root@nagios:~# usermod -G nagios www-data root@nagios:~# service apache2…
Read More

How to find specific files and send alerts

CentOS, How to, Linux, Tips and Tricks, Ubuntu
Maintaining a shared hosting server is a full time job but tools and proper checks and balances can help make this burden lot less. I manage a shared hosting server for one of my friends and numerous times the scripts that people have installed over on their websites have vulnerabilities and hackers exploit it to upload stuff that mass-email or do other nasty stuff. Luckily, most of these exploits have common patterns like files names or other signatures that make them traceable (most of the time the so called hackers are just kiddy scripts) Create a file and put this in it [code]#!/bin/bash find /home -name 'paypal.com*' | mail -s '[Woodcrest] Phishing Alert!' me@mydomain.com find /home -name 'rout.php' | mail -s '[Woodcrest] Phishing Alert - Mail Bomber!' me@mydomain.com[/code] This is…
Read More

package-cleanup: command not found

CentOS, How to, Linux, Tips and Tricks
I tried to do package-cleanup and found this [code highlight="2"]root@ns1 [~]# package-cleanup --problems -bash: package-cleanup: command not found[/code] If I was on Ubuntu, I would have done "apt-get install package-cleanup" but it does not work that way on CentOS, its actually available in yum-utils package, install it by typing [code]yum install yum-utils[/code] Enjoy!!
Read More

How to configure repos to not overwrite base packages?

CentOS, How to, Linux
The greatest fear with adding additional and especially third party repos such as EPEL (we did a blog post on how to install EPEL earlier) is that it MAY overwrite base packages and bring the system to an unstable state. We can fix this issue by installing Yum Priorities plugin on CentOS 5: [code]yum install yum-priorities[/code] on CentOS 4 or CentOS 6: [code]yum install yum-plugin-priorities[/code] Then make sure that the plugin is enabled [code]nano /etc/yum/pluginconf.d/priorities.conf[/code] Now there are two ways to do it, either set HIGHEST priority to CentOS repos OR set lowest priority to other repos. This is done by adding the line [code highlight="3"] # N=1 highest priority # N=99 lowest priority priority=N [/code] In this blog post, I will set 1 as the priority (highest) for my…
Read More

How to change time and/or timezone in CentOS

CentOS, How to, Linux
Generically, I use this Change directory to /etc [code] [root@testbed ~]# cd /etc [/code] Now create a symbolic link (aka symlink) to the timezone e.g. Asia/Karachi (for Pakistan standard time) [code highlight="1"] [root@testbed etc]# ln -sf /usr/share/zoneinfo/Asia/Karachi localtime [root@testbed etc]# date Mon Jan 16 19:26:52 PKT 2012 [/code] Please note that the timezone is following a directory-structure so if you want EST time, you should use [code highlight="1"] [root@testbed etc]# ln -sf /usr/share/zoneinfo/EST localtime [/code]
Read More

How to disable SELinux

CentOS, How to, Linux, Tips and Tricks
SELINUX is a security feature on CentOS but some software such as SolusVM will require that SELINUX be disabled [code] Installation log : /tmp/install.log Add this slave to your SolusVM master using the following details: ID Key .......... : ABC ID Password ..... : XYZ IMPORTANT!! You need to setup a network bridge before you can use KVM on this server. Please see the following link: http://wiki.solusvm.com/index.php/KVM_Network_Bridge_Setup Please set SELINUX=disabled in /etc/selinux/config before rebooting. Thankyou for choosing SolusVM. [/code] The solution? 1) Edit /etc/selinux/config using your favourite editor [code][root@kvm ~]# nano /etc/selinux/config[/code] and set SELINUX=disabled [code highlight="6"]# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings…
Read More

CentOS minimal template’s issue with crontab

How to, Tips and Tricks
On my CentOS 5.x 64bit XEN PV template (XEN PV is a virtualization type, this means I am talking about a VPS) doing 'crontab -e' gave me the following error [code] [root@vpsadmin ~]# crontab -e no crontab for root - using an empty one /bin/sh: /bin/vi: No such file or directory crontab: "/bin/vi" exited with status 127 [/code] To correct this issue, do the following [code] [root@vpsadmin ~]# touch ~/.bashrc [root@vpsadmin ~]# export VISUAL=nano [root@vpsadmin ~]# source ~/.bashrc [/code] So, now if you do 'crontab -e' it will work as it should [code] [root@vpsadmin ~]# crontab -e no crontab for root - using an empty one crontab: no changes made to crontab [/code]
Read More