ffmpeg: error while loading shared libraries: libavdevice.so.52: cannot open shared object file

Posted by admin     Category: Linux Administration

The “loading shared libraries” error message is received when ffmpeg is not able to locate the file libavdevice.so.52. This happens when either the file is missing from the server OR ffmpeg is not looking at the path the file is in. You see the following error while executing the ‘ffmpeg’ command:

[root@server ~]# ffmpeg
ffmpeg: error while loading shared libraries: libavdevice.so.52: cannot open shared object file: No such file or directory

Solution:
Search the file libavdevice.so.52 on the server using the ‘find’ command

# find / -name libavdevice.so.52

You need to add the path to the directory the file is in, in the ‘ld.so.conf’ file. If for example the file is located under “/usr/local/lib” directory, execute

# vi /etc/ld.so.conf

and add the following at the bottom of the file

/usr/local/lib

Save the file and for the new changes to take effect, execute

# ldconfig

How to set OR enable Timestamp for the previously executed commands in Linux?

Posted by admin     Category: Linux Administration

Linux provides a command called “history” to view the previously executed commands on shell. By default, the “history” command display only the commands that were executed but not the date and time when they were executed. To display the time OR the date when the previous commands were executed on shell, you need to set the “HISTTIMEFORMAT” variable.

So, in order to check the date and time of previously executed commands in Linux, set the “HISTTIMEFORMAT” variable by executing the command:

# export HISTTIMEFORMAT=”[%F] [%T] “

You can also insert the above line at the end of the .bash_profile file

# vi /root/.bash_profile

Once you save the file, open a new SSH session and execute the ‘history’ command to view the timestamp of the executed commands.

For example:

root@server [~]# history
1068  [2010-08-05] [07:17:04] ps -auxf
1069  [2010-08-05] [07:17:06] top c
1070  [2010-08-05] [07:17:35] ll
1071  [2010-08-05] [07:37:51] ls -la
1072  [2010-08-05] [07:41:37] cat /root/.bash_profile
1073  [2010-08-05] [07:41:47] cd

The commands in the above output is just an example.

How to Block Ftp Access/Port using iptables OR CSF?

Posted by admin     Category: Linux Administration

The default firewall that comes along with Linux is “iptables” and you can use iptables to block Ftp access/port on your server.

Completely block Ftp access on the server:

# iptables -A INPUT -p tcp --dport 21 -j DROP

Block Ftp access for a specific IP address, say 11.12.13.14

# iptables -A INPUT -p tcp -s 11.12.13.14 --dport 21 -j DROP

Block Ftp access for a specific subnet

# iptables -I INPUT -p tcp -s 11.12.13.0/24 --dport 21 -j DROP

Make sure you save the iptable rules else they will be erased after a iptable/server restart:

# service iptables save

CSF firewall use iptables in the background to apply it’s rules. Edit the csf configuration file,

# pico /etc/csf/csf.conf

Remove port 21 from the TCP_IN list and restart the csf firewall

# csf -r

Block Ftp access for a specific IP address, edit the csf.deny file

# pico /etc/csf/csf.deny

and place the following line

tcp:in:d=21:s=11.12.13.14

Save the file and restart the csf firewall.

How to check System Information and vendors of MotherBoard/Processor/RAM in Linux?

Posted by admin     Category: Linux Administration

To check the system’s information and manufacturers of MotherBoard, Processor, RAM and other hardware from the command line in a Linux machine, install the package “dmidecode”. You can search and install the dmidecode package using yum.

Check your Linux server architecture i.e. 32bit OR 64bit:

# uname -p

Search for the dmidecode package

# yum search dmidecode

Depending on the architecture, install the proper dmidecode package

# yum install dmidecode

You are done. To check all the hardware information of the server, execute

# dmidecode

Plesk Installation: Unable to install the psa-backup-manager

Posted by admin     Category: Plesk Management

You see a “Unable to install the psa-backup-manager” error while installing Plesk and it is because of the incomplete db4 packages needed for embedded database support for various applications. The complete error message looks like:

Determining the packages that need to be installed.
ERROR: Unable to install the “psa-backup-manager-9.x.x-cos5.buildxxxxxxx.00.i586″ package.
Not all packages were installed.
Please, contact product technical support.

Solution:

Check if the required db4 packages are installed by executing:

# rpm -qa | grep db4

It will list the db4 packages. If the db4-devel and db4-utils are missing from the above output, install the packages using yum

# yum install db4-utils
# yum install db4-devel

That’s it. You can start the Plesk installation once again and it will install the psa-backup-manager successfully.