It is currently Wed May 01, 2024 10:36 pm

News News of Linux specific

Site map of Linux specific » Forum : Linux specific

Linux specific questions/information are gathered here. The main thrust of topics are applied to Centos/RedHat(RH)/Debian/Ubuntu/Gentoo distributives
Forum rules
All information is given AS IS

Reset root password (linux case)

The first thing to try is to boot into single user mode. This may not work, because your system might be configured to still ask for a root password to get to single user mode.
If that's the case, use another trick that replaces init with /bin/bash.

First, try single user. If you don't see either a LILO or GRUB boot screen, try hitting CTRL-X to get one (also ESC key can be used).

If ...
Read more : Reset root password (linux case) | Views : 6871 | Replies : 1


How to view the contents of RPM file

To view the content of RPM package please use the following syntax:
Code: Select all
rpm -qlp /path/to/file.rpm
Read more : How to view the contents of RPM file | Views : 2822 | Replies : 0


Set custom LABEL for SWAP partition

It is possible to set the label of a SWAP partition by using the mkswap command with the '-L' option.

Command syntax is:
Code: Select all
mkswap -L <label> <partition>
              Specify a label, to allow swapon by label.

Replace <label> with the label you would like to use. Replace the partition with the SWAP partition. If following is the output of:
Code: Select all
fdisk -l

Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors ...
Read more : Set custom LABEL for SWAP partition | Views : 3038 | Replies : 0


Install PHP PECL uploadprogress

PECL uploadprogress page

Code: Select all
wget "http://pecl.php.net/get/uploadprogress"
tar xzvf uploadprogress
rm -f uploadprogress
cd uploadprogress*
phpize
./configure
make
make install

If everything is going well, you will see last message as bellow:
Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20060613/

Now, locate your PHP configuration file:
Code: Select all
php -i|grep php.ini

And include uploadprogress extention support:
Code: Select all
extension="uploadprogress.so"

Restart webserver and check phpinfo() output. This also can be done from the console:
Code: Select all
php -i|grep -i uploadprogress

or
Code: Select all
php -m
Read more : Install PHP PECL uploadprogress | Views : 2721 | Replies : 0


Add IP Aliases in RH or CentOS

If you want to add additional IPs to the same NIC you should do the following:

1. Adding a network alias from command line in RH or CentOS Linux:
Code: Select all
/sbin/ifconfig lo 127.0.0.1
/sbin/ifconfig eth0 up
/sbin/ifconfig eth0 10.0.0.1
/sbin/ifconfig eth0:1 192.168.0.1
/sbin/ifconfig eth0:2 192.168.0.2


2. Configure a script to setup your network/IP aliases on boot:
Code: Select all
cd /etc/sysconfig/network-scripts/
cp ifcfg-eth0 ifcfg-eth0:1
cp ifcfg-eth0 ifcfg-eth0:2

Then edit ifcfg-eth0:1 and ifcfg-eth0:2 files and add your IP aliases there. ...
Read more : Add IP Aliases in RH or CentOS | Views : 5360 | Replies : 0


Bash history search

The most efficent way to search your history is to hit Ctrl+R and type the start of the command. It will autocomplete as soon as there’s a match to a history entry, then you just hit enter. Pressing ctrl+r many times will search for previous commands.
Read more : Bash history search | Views : 2625 | Replies : 0


Create /dev/console and /dev/null devices manually

Create manually required for boot devices:
Code: Select all
mknod -m 660 /mount_point/dev/console c 5 1
mknod -m 660 /mount_point/dev/null c 1 3
Read more : Create /dev/console and /dev/null devices manually | Views : 4107 | Replies : 0


TCP segmentation offload

Abbreviated as TSO, TCP segmentation offload is used to reduce the CPU overhead of TCP/IP on fast networks. TSO breaks down large groups of data sent over a network into smaller segments that pass through all the network elements between the source and destination. This type of offload relies on the network interface controller (NIC) to segment the data and then add the TCP, IP and data link layer protocol headers to each segment. The ...
Read more : TCP segmentation offload | Views : 15603 | Replies : 1


Unpack/modify initrd image (TODO)

Code: Select all
file /boot/initrd-2.6.18-194.8.1.el5.img
#/boot/initrd-2.6.18-194.8.1.el5.img: gzip compressed data, from Unix, last modified: Tue Jul 13 18:30:50 2010, max compression

Rename it to end in .gz and uncompress:
Code: Select all
gzip -d initrd-2.6.18-194.8.1.el5.img.gz
file initrd-2.6.18-194.8.1.el5.img
#initrd-2.6.18-194.8.1.el5.img: ASCII cpio archive (SVR4 with no CRC)

Let's open the compress cpio file:
Code: Select all
mkdir initrd_uncompressed
cd initrd_uncompressed
cpio -dumi < ../initrd-2.6.18-194.8.1.el5.img

To pack modified content back into initrd image do the following:
Code: Select all
find . |cpio -H newc -ov |gzip -c - > ../initrd-2.6.18-194.8.1.el5.img


...
Read more : Unpack/modify initrd image (TODO) | Views : 2794 | Replies : 0


partprobe(8) - Linux man page

Name
partprobe - inform the OS of partition table changes

Synopsis
partprobe

Description
partprobe is a program that informs the operating system kernel of partition table changes, by requesting that the operating system re-read the partition table.

Options
This program uses short UNIX style options.

-d
Don't update the kernel.
-s
Show a summary of devices and their partitions.
-h
Show summary of options.
-v
Show version of program.
Read more : partprobe(8) - Linux man page | Views : 2439 | Replies : 0


 

Login


Statistics

Total posts 505 • Total topics 442 • Total members 22