May 19, 2010

FFMPEG Installation

Linux General,

FFMPEG and it’s related modules Installation through Script:     Details:All FFmpeg packages are installed from source except codecs. The main dependency for installing ffmpeg is: yum Ffmpeg installation will only work on redhat and suse (requires yum) distributions. FFmpeg installation will work in cpanel and plesk servers.How to run:Wget the above script to /usr/src…

Read more
May 19, 2010

Linux Tips & Tricks

Linux General,

TIP 1: NTP Is NTP Working? STEP 1 (Test the current server): Try issuing the following command: $ ntpq -pn remote refid st t when poll reach delay offset jitter =================================================== tock.usno.navy 0.0.0.0 16 u – 64 0 0.000 0.000 4000.00 The above is an example of a problem. Compare it to a working configuration.…

Read more
May 15, 2010

Adding modsecurity rule for domain

Linux General,

Add the below rule in the .htaccess file. SecRuleEngine Off This will work only if you have old version of mod_security installed on the server. You cannot disable mod_security2 using .htaccess, the only way to bypass mod_security2 in Apache 2 is to manually edit httpd.conf. Create a directory with the username and the domain name,…

Read more
May 11, 2010

Mysql Queries in Linux

Linux General,

How to resolve mysql_connect() Error Warning: mysql_connect() [function.mysql-connect]: Access denied for user ‘username’@’localhost’ (using password: YES) Possible root cause for this problem is proper privilege not assigned to the particular user. So providing proper privileges will solve this issue. $grant all privileges on “Database_Name” to “username@localhost” identified by “password” If the mysql resides in the…

Read more
May 8, 2010

Does DNS use TCP or UDP or both?

Linux General,

Does DNS use TCP or UDP or both? TCP is a connection-oriented protocol and it requires data to be consistent at the destination and UDP is connection-less protocol and doesn’t require data to be consistent or don’t need a connection to be established with host for consistency of data. UDP packets are smaller in size.…

Read more
May 7, 2010

Linux – Advanced Commands

Linux General,

Show status of ethernet interface eth0: ethtool eth0 List addresses for interfaces: ip addr show (OR) ip a Set default gateway: ip route add default via 1.2.3.254 List routing table: ip route show Add (or del) ip and mask (255.255.255.0): ip addr add 1.2.3.4/24 brd + dev eth0 Text Manipulation: Replace string1 with string2: sed…

Read more
May 7, 2010

Linux – Ethernet bonding

Linux General,

Linux bond or team multiple network interfaces (NIC) into single interface We have two Dell servers that need setup with Intel Dual Gig NIC. My idea is to improve performance by pumping out more data from both NIC without using any other method. This box act as heavy duty ftp server. Each night I need…

Read more
May 7, 2010

Linux – Tweaks

Linux General,

Fork Bomb on Linux/Unix: Q. Explain following bash code or bash fork() bomb? : () { : | :& };: A. This is a bash function. It gets called recursively (recursive function). This is most horrible code for any Unix / Linux box. It is often used by sys admin to test user processes limitations…

Read more
March 16, 2010

Extract the contents of an RPM

Linux General,

Using rpm2cpio command, the contents of an RPM package can be extracted without having to install the package. For source RPMs too this command can be used. This is illustrated with an example as follows, where we extract the contents of RPM, google-chrome-beta_current_i386.rpm. $ rpm2cpio google-chrome-beta_current_i386.rpm | cpio -idv ./etc/cron.daily ./etc/cron.daily/google-chrome ./opt/google/chrome ./opt/google/chrome/chrome ./opt/google/chrome/chrome-sandbox ./opt/google/chrome/chrome.pak…

Read more
March 13, 2010

Difference between Buffer and Cache

Linux General,

Buffers are allocated by various processes to use as input queues, etc. Most of the time, buffers are some processes’ output, and they are file buffers. A simplistic explanation of buffers is that they allow processes to temporarily store input in memory until the process can deal with it. Difference between Buffer and Cache Cache…

Read more