msgbartop
A chronological documentation test project, nothing serious, really!
msgbarbottom

13 Sep 2008 Convert unix timestamp to date

# date -d @1221256800 "+%Y-%m-%d %T"
2008-09-13 00:00:00

Convert a date (YYYYMMDD) to unix timestamp

# date -d "20080913" +%s
1221256800

Tags: ,

Posted by

09 Sep 2008 Disable IPv6 on Redhat RHEL5

This post describes how to disable IPv6 on a Redhat (RHEL5) installation. I haven’t had the time to test it on other version of Redhat.

Edit /etc/sysconfig/network and change

NETWORKING_IPV6=no

Edit /etc/modprobe.conf and add these lines

alias net-pf-10 off
alias ipv6 off

Stop the ipv6tables service

# service ip6tables stop

Disable the ipv6tables service

# chkconfig ip6tables off

IPv6 will be disabled after the next reboot.

Edit
This also works on RHEL6/CentOS6

Tags: , , ,

Posted by

08 Sep 2008 Using sudo in RedHat

This post describes how to allow users in the wheel group to use the sudo command without being prompted for the root password

  1. Edit /etc/sudoers
    Uncomment the line

    %WHEEL ALL=(ALL) NOPASSWD: ALL
  2. Add a user to the wheel group
    # gpasswd -a username wheel
  3. This does also work on Fedora and other Redhat based distributions.

    Tags: , ,

    Posted by

08 Sep 2008 man command and section numbers

man – an interface to the on-line reference manuals.

man is the system’s manual pager. Each page argument given to man is normally the name of a program, utility or function. The manual page associated with each of these arguments is then found and displayed. A section, if provided, will direct man to look only in that section of the manual. The default action is to search in all of the available sections, following a pre-defined order and to show only the first page found, even if page exists in several sections.

The table below shows the section numbers of the manual followed by the types of pages they contain.

1   Executable programs or shell commands
2   System calls (functions provided by the kernel)
3   Library calls (functions within program libraries)
4   Special files (usually found in /dev)
5   File formats and conventions eg /etc/passwd
6   Games
7   Miscellaneous   (including  macro  packages  and  conventions),  e.g.  man(7), groff(7)
8   System administration commands (usually only for root)
9   Kernel routines [Non standard]

Tags:

Posted by

05 Sep 2008 Kernel panic reboot

By default after a kernel panic Linux just sits there and waits for a user to hit the restart button. That can be a bad thing if it’s a remote server.

Checking if enabled

To check if its enabled try this:

# cat /proc/sys/kernel/panic
0

The returned 0 is the time the kernel will wait before it reboots. If it is 0 or lower, it won’t reboot by itself.

Enabling kernel panic reboot

To set the kernel to reboot do this command

# echo "5" > /proc/sys/kernel/panic

Where 5 is replaced with the number of seconds to wait till reboot after a kernel panic.

To check the time was set right do this:

# cat /proc/sys/kernel/panic
5

Making it permanent

To make it more permanent do this:

# echo "kernel.panic=5" >> /etc/sysctl.conf

Adding the following to your kernel parameters in your bootloaders configuration might also help:

panic=5

NOTE: Substitute 5 with the number of seconds to wait till reboot after a kernel panic.

Source: http://gentoo-wiki.com/TIP_Kernel_Panic_Reboot

Tags: ,

Posted by