Speeding Up Linux Software Raid Building And Re-syncing

The /proc/sys/dev/raid/speed_limit_min is config file that reflects the current "goal" rebuild speed for times when non-rebuild activity is current on an array. The speed is in Kibibytes per second, and is a per-device rate, not a per-array rate . The default is 1000.

The /proc/sys/dev/raid/speed_limit_max is config file that reflects the current "goal" rebuild speed for times when no non-rebuild activity is current on an array. The default is 100,000.

To see current limits, enter:

# sysctl dev.raid.speed_limit_min
# sysctl dev.raid.speed_limit_max

Fix for Centos 6.3 Software RAID not loading GRUB on /dev/md0

If you’ve just installed CentOS 6 on software RAID and it won’t boot off /dev/md0, try the following:

1. Using your CentOS install media, boot in to rescue mode
2. Once you are booted in to rescue mode, select the “start shell” option
3. Enter the following command:

chroot /mnt/sysimage

4. Re-install GRUB

grub-install /dev/md0

5. Reboot

Tags:

Setting up Root Kit Hunter on CentOS 6.x

1. Install Rkhunter


yum install -y rkhunter file

2. Update Rkhunter


rkhunter --update

3. Run a Test Scan (help to prevent false positives):


rkhunter -c

4. Setup a daily scan report:

vi /etc/cron.daily/rkhunter
-----------------//--------------
#!/bin/bash
(
/usr/bin/rkhunter --versioncheck --nocolors
/usr/bin/rkhunter --update --nocolors
/usr/bin/rkhunter --checkall --nocolors --skip-keypress
) | /bin/mail -s 'rkhunter Daily Run ' your@email.tld
exit 0
-----------------//--------------

Tags:

How to solve "iptables: Resource temporarily unavailable" error

If you see "iptables: Resource temporarily unavailable" error when restarting Advanced Policy Firewall (APF) on your Linux server, then take the following steps:

1. Add up some more RAM memory to your box
2. Reload your iptables:
/etc/init.d/iptables reload

3. Make sure your iptables get restarted without any errors:
service iptables restart

4. And finally restart your firewall:
apf -r

Simple method to reset MySQL or MariaDB root password in CLI

To reset your MySQL root password in SSH, simply run the following sequence of commands:


/etc/init.d/mysqld stop
mysqld_safe --skip-grant-tables &
mysql -u root
use mysql;
update user set password=PASSWORD("newrootpassword") where User='root';
flush privileges;
quit
/etc/init.d/mysqld stop
/etc/init.d/mysqld start

On Fedora 7.x based systems, which come with MariaDB instead of MySQL, run:

<?php
systemctl stop mariadb
mysqld_safe --skip-grant-tables &
mysql -u root
use mysql;
update user set password=PASSWORD("newrootpassword") where User='root';

Tags:

Memcached and PECL memcache on CentOS

At Tag1 Consulting we do a lot of work on increasing web site performance, especially around Drupal sites. One of the common tools we use is memcached combined with the Drupal Memcache module. In Drupal, there are a number of different caches which are stored in the (typically MySQL) database by default. This is good for performance as it cuts down on potentially large/slow SQL queries and PHP execution needed to display content on a site.

How to reset Webmin root password?

At times we often forget the webmin password for a given user, say root, or after repeated failed login attempts webmin locks the account and one cannot login anymore. In this case you need to wait for couple, three minutes and you will be able to try to login again. However, if you've forgotten your password and need to change it, then login to the server via ssh and run the following command:

For RHEL/CentOS:


/usr/libexec/webmin/changepass.pl /etc/webmin root NEWPASSWORD

For Debian/Ubuntu


/usr/share/webmin/changepass.pl /etc/webmin root NEWPASSWORD

How to install the latest version of GIT on Centos 6.x?

To install the current stable version of git just launch simple command:


yum install git

Probably you could compile even newer version of git from the source. However, the purpose of this tutorial is to show how to install the latest version of git available in the repositories.

Install RPMforge repository following instructions on http://wiki.centos.org/AdditionalResources/Repositories/RPMForge#head-f0...


wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm

How to install php-mcrypt on CentOs 6.3

You need EPEL repo to install php-mcrypt:


yum -y install http://mirror.us.leaseweb.net/epel/6/x86_64/epel-release-6-7.noarch.rpm
yum -y install php-mcrypt

Here is the code for installing EPEL repository on CentOS 6.4:

rpm -Uvh http://fedora.mirrors.pair.com/epel/6/x86_64/epel-release-6-8.noarch.rpm

Tags:

How to install APC on CentOS 6.2

Various instructions in Internet on the subject did not give any joy, so compiling my own sequence, which did the trick:

yum install php-pear php-devel httpd-devel gcc pcre-devel apc
nano /etc/php.d/apc.ini

Put the following in apc.ini:


; Enable apc extension module
extension=apc.so
apc.enabled=1
apc.shm_segments=1
apc.shm_size=256
apc.stat=0

Then copy apc.php to public_html directory of your website:

Pages

Subscribe to Front page feed