Linux

CentOS / RHEL: yum Command Reinstall Package

by Vivek Gite on December 30, 2011 · 1 comment

I accidental deleted the configuration file stored in /etc/ directory and the latest backup were made yesterday. How do I resinstall the package using the yum command under RHEL / CentOS Linux server?

{ 1 comment }

I‘ve created a file as follows:

ls -l -Z /etc/cron.d/vnstat
-rw-r–r–. root root system_u:object_r:system_cron_spool_t:s0 /etc/cron.d/vnstat

I’ve created a new file /etc/cron.d/vnstat.custom.interface:

ls -l -Z /etc/cron.d/vnstat.custom.interface
-rw-r–r–. root root unconfined_u:object_r:system_cron_spool_t:s0 /etc/cron.d/vnstat.custom.interface

The /etc/cron.d/vnstat is part of default vnstat package. I’ve installed my own version of the same. But, due to SELinux security cron job is not running. How do I change file SELinux security contex under RHEL / CentOS 6 Linux server to system_u:object_r:system_cron_spool_t:s0 from unconfined_u:object_r:system_cron_spool_t:s0 for /etc/cron.d/vnstat.custom.interface file?

{ 0 comments }

Linux: Find Out What Partition a File Belongs To

by Vivek Gite on December 19, 2011 · 1 comment

How do I find out that /users/f/foo/file.txt file belongs to a specific partition?

{ 1 comment }

Linux / Unix curl: Pass HTTP Referer

by Vivek Gite on November 6, 2011 · 0 comments

How do I pass the referrer (HTTP referrer)as an HTTP header field using curl command under Linux OR Unix operating systems?

{ 0 comments }

I‘m using RHEL 6 / CentOS 6.x and install the memcached server. However, whey I try to start the server using service memcached start command, I get the following error:

Starting memcached: failed to set rlimit for open files. Try running as root or requesting smaller maxconns value. [FAILED]

How do I fix this problem?

{ 2 comments }

How do I play files in random order using the mplayer command line player under Linux / Unix operating systems?

{ 7 comments }

Bash Shell: Find Out If a Variable Is Set or Not

by Vivek Gite on September 25, 2011 · 1 comment

How do I check if a bash shell variable called $input is defined or not under BSD / Apple OS X / Unix / Linux like operating systems?

{ 1 comment }