Results > Posts Filed Under > Knowledge Base

Restricting CRON and AT in Redhat, Fedora & CentOS.

Sometimes you want the root user or other trusted users to be able to run cronjobs or timed scripts with at. In order to lock these down, you will need to create a cron.deny and at.deny file inside /etc with the names of all blocked users. An easy way to do this is to parse /etc/passwd. The script below will do this for you.
echo “Locking down Cron”
touch /etc/cron.allow
chmod 600 /etc/cron.allow
awk -F: ‘{print $1}’ /etc/passwd | grep -v root > /etc/cron.deny
echo …

change speed of network card, find speed of network card, mii-tool, ethtool

Task: Find full or half duplex speed
You can use dmesg command to find out your duplex mode:
# dmesg | grep -i duplex
Output:
eth0: link up, 100Mbps, full-duplex, lpa 0×45E1
ethtool command
Uss ethtool to display or change ethernet card settings. To display duplex speed, enter:
# ethtool eth1
Output:
Settings for eth1:
Supported ports: [ TP ]
Supported link modes:   10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes:  10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised auto-negotiation: Yes
Speed: 10Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: umbg
Wake-on: g
Current message level: 0×00000007 (7)
Link detected: yes
mii-tool …

Setting cpu affinity for a certain task in Linux, cpu affinity

If you are running 4  servers assuming you are using Dual Xeon processors ( classed as 4 cpu’s in linux)
Server 1 uses 60% CPU Usage
Server 2 Uses 60% CPU Usage
Server 3 Uses 20% CPU Usage
Server 4 Uses 20% CPU Usage
Rather than letting the distro automtically assign CPU’s it is sometimes better for you to do it manually. In this instance it would make server to have
Server 1 using CPU0
Server 2 using CPU1
Server 3 + 4 using CPU2
Leaving you with a …

RAID setup, Raid 0, Raid 1, Raid 4,Raid 5

5.1 General setup
This is what you need for any of the RAID levels:

A kernel. Preferably a kernel from the 2.4 series. Alternatively a 2.0 or 2.2 kernel with the RAID patches applied.
The RAID tools.

All of this is included as standard in most GNU/Linux distributions today.
If your system has RAID support, you should have a file called /proc/mdstat. Remember it, that file is your friend. If you do not have that file, maybe your kernel does not have RAID support. …

 Page 1 of 2  1  2 »