CentOS / Red Hat IPv6 Network Configuration
Setting up IPv6 on CentOS, and for that matter RHEL and Fedora Linux, is quite straight forward. You need to edit just two files:
1. /etc/sysconfig/network-scripts/ifcfg-
2. /etc/sysconfig/network
- Configure the IP address. For example, for interface eth0, edit /etc/sysconfig/network-scripts/ifcfg-eth0 and make the necessary changes as below.
DEVICE=eth0
HWADDR=00:22:15:17:CC:C1
BOOTPROTO=static
IPADDR=192.168.1.2
NETMASK=255.255.255.0
NETWORK=192.168.1.0
BROADCAST=192.168.1.255
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6ADDR=<ipv6 address>
ONBOOT=yes
How to find large files in Linux
At the command line as root enter:
find / -size +102400k
This will find all files on the entire system that are bigger than 100 MB.
Use this one to see the sizes:
find / -size +103400k | xargs ls -laAh
Use “find .” to look only in the current directory.
find . -size +103400k | xargs ls -laAh
Read more…
Schedule tasks on Linux using crontab
If you’ve got a website that’s heavy on your web server, you might want to run some processes like generating thumbnails or enriching data in the background. This way it can not interfere with the user interface. Linux has a great program for this called cron. It allows tasks to be automatically run in the background at regular intervals. You could also use it to automatically create backups, synchronize files, schedule updates, and much more. Welcome to the wonderful world of crontab.
Crontab
The crontab (cron derives from chronos, Greek for time; tab stands for table) command, found in Unix and Unix-like operating systems, is used to schedule commands to be executed periodically. To see what crontabs are currently running on your system, you can open a terminal and run:
sudo crontab -l
To edit the list of cronjobs you can run:
sudo crontab -e
This wil open a the default editor (could be nano or pico, if you want you can change the default editor) to let us manipulate the crontab. If you save and exit the editor, all your cronjobs are saved into crontab. Cronjobs are written in the following format:
* * * * * /bin/execute/schedulescript.sh
Read more…
Change the default editor Linux
Ever wanted to change the crontab of a server, but got an editor on screen that you’re totally unfamiliar with? There are a lot of causes for this annoyance, but one is that somebody recently installed or used midnight commander (mc) which for whatever reason seams to overrule your session’s default editor.
Changing the editor
The first time it took me a while to figure it out so I thought lets make it an article on my site, so maybe it will help others save some time.
Anyhow, here how to change it, just open your terminal and type
export EDITOR="nano"
nano can be nano, pico, vim, or another text editor of your choice of course.
Read more…
How to install MySQL on CentOS Redhat Linux
Install MySQL with YUM
yum install mysql-server mysql php-mysql
How to configure MySQL Read more…
How to upgrade Linux kernel
How do I upgrade my Linux kernel? I would like to upgrade kernel without compiling from source code i.e. binary upgrade. How do I perform the actual upgrade of the kernel in Linux?
You need to compile kernel only if:
- You need custom made kernel for specific task such as embedded kernel.
- Apply third party security patches.
- You need to apply specific patch to Linux.
How to install UnixBench ?
UnixBench is the original BYTE UNIX benchmark suite, updated and revised by many people over the years.
The purpose of UnixBench is to provide a basic indicator of the performance of a Unix-like system; hence, multiple tests are used to test various aspects of the system’s performance. These test results are then compared to the scores from a baseline system to produce an index value, which is generally easier to handle than the raw scores. The entire set of index values is then combined to make an overall index for the system.
Read more…
How to install memcached
Memcached is a very popular open source object caching server. It was developed to speed up livejournal.com by Danga Interactive. We use memcached for a lot of our sites. We use it for different purposes but one main purpose is to cache query results so we don’t have to keep hitting database. As most of the people who work with databases know it is costly to keep hitting database for same information over and over.
When you run the Memcached daemon, it runs and listens on a specific port. One of the things Memcached does lack is security. Memcached will let anybody who can make a connection to its port have full access to all objects. So you would have to run a firewall to block unauthorized access. It is usually wise to do put firewall on it even if you trust everybody on the same network since accidents do happen. That said, let’s get memcached installed!
Read more…
Benchmarking Your Site with ‘http_load’
http_load is a stunningly useful HTTP benchmarking utility that gives you a rough idea of how many hits per second a server is capable of serving. You simply tell it what pages to grab, and how many “clients” it should run in parallel; it gives you back useful information about the average fetches per second and the average, minimum, and maximum response times. It’s no substitute for a solid profiler to dig into the hows and whys of your application’s performance, but it’s great at telling you when you’re “good enough” to launch.
Installing http_load on OS X
- Download from http://www.acme.com/software/http_load/
- Open terminal, cd to the directory where the archive is and unzip
$ tar xvzf http_load-12mar2006.tar.gz - Move to that directory
$ cd http_load-12mar2006 - Run
$ make - Run
$ sudo make install
How to check an MD5 hash on a file
MD5 is a one-way hash algorithm as defined by RFC1321 and can be used to help determine the integrity of a file by providing a 128 bit digital signature. This digital signature is like a fingerprint for a file, changing just one single byte in a file will result in a different MD5 hash.
MD5 hashes can be used to catalog files on a filesystem and then determine at a later date that the files have not been altered in any way, for example if someone broke into a system and modified system files.
They can also be used to ensure a file downloaded from a website is the same as expected. This can be especially important when downloading a file from a mirror site to ensure you are not installing a modified program which contains a trojan horse or some other nasty. By simply comparing the MD5 hash of the file you have downloaded from the mirror with that from the original website you can determine whether or not the file is exactly the same.
Read more…