RSS

Category Archives: OS

OS: related topics to Operating System’s installation, configuration, Commands and etc.

Increase Swap Space By Creating A Swap File

To add a swap file:

  1. Determine the size of the new swap file in megabytes and multiply by 1024 to determine the number of blocks. For example, the block size of a 64 MB swap file is 65536.
  2. At a shell prompt as root, type the following command with count being equal to the desired block size:
    dd if=/dev/zero of=/swapfile bs=1024 count=65536
  3. Setup the swap file with the command:
    mkswap /swapfile
  4. To enable the swap file immediately but not automatically at boot time:
    swapon /swapfile
  5. To enable it at boot time, edit /etc/fstab to include the following entry:
    /swapfile          swap            swap    defaults        0 0

    The next time the system boots, it enables the new swap file.

  6. After adding the new swap file and enabling it, verify it is enabled by viewing the output of the command cat /proc/swaps or free.
 
 

Tags: , , , , ,

Check out Expertise in Oracle Apps….: Error While Loading Shared Libraries: libdb.so.2 on RedHat Linux 5

Check out Expertise in Oracle Apps….: Error While Loading Shared Libraries: libdb.so.2 on RedHat Linux 5

 
 

How to umount when the device is busy

 You need to unmount a CD or you want to pack away the external drive but when you try to umount it you get the dreaded “device is busy” message. 

# umount /media/disk/
umount: /media/disk: device is busy
umount: /media/disk: device is busy

First thing you’ll do will probably be to close down all your terminals and xterms but here’s a better way. You can use the fuser command to find out which process was keeping the device busy:

# fuser -m /dev/sdc1
/dev/sdc1: 538
# ps auxw|grep 538
donncha 538 0.4 2.7 219212 56792 ? SLl Feb11 11:25 rhythmbox

Rhythmbox is the culprit! Close that down and umount the drive.

Problem solved!

 
Leave a comment

Posted by on June 8, 2013 in Linux/Unix, OS, Tips

 

Tags: , , ,

Linux Red Hat Configure an NTP Client

steps to configure an NTP Client in Linux RHEL 4.5

1)Install ntp
# yum install ntp

2)configure an NTP Client
# vi /etc/ntp.conf

add in the # — OUR TIMESERVERS —– section
server ntp.server.com or
server <ip>
$$$$$$$$$$$$$$$$$$$$$$$$
server 10.0.0.30
$$$$$$$$$$$$$$$$$$$$$$$$

the hostname or IP address of the site NTP server. If your ntp server located at 192.168.1.5, enter server 192.168.1.5. You can also use public ntp server located at ntp.org.

You can also run ntpd using cron:
echo ’30 * * * * root /usr/sbin/ntpd -q -u ntp:ntp’ > /etc/cron.d/ntpd
“that what i use”

3) restart the service

# service ntp restart
or
#etc/init.d/ntpd restart

Monitoring and Troubleshooting
#ntpq -p
The labeled columns for this are:
– remote: The IP address or DNS name of the remote server
-refid: An identification of the type of the reference clock.
-st: The “stratum” or level of the server: for almost all systems, 2 is great. Your local system will have a higher number.
-t: The type of service. Your setup will show “l” for local on your local system, or “u” for “unicast” for communicating with remote servers.
-when: This is the number of seconds since the server was last heard from. After a couple of minutes of operation your server should start to report numeric values here.

#tcpdump udp port 123

#ntpdate -q <ntp server name OR ntp servr ip>

$$$$$$$$$$$$$$$$$$
ntpdate -q 10.0.0.30
$$$$$$$$$$$$$$$$$$

Reference:

http://www.cyberciti.biz/faq/rhel-fedora-centos-configure-ntp-client-server/

http://perdues.com/doc/ntp.html

 

 

————-

configure NTP client “GUI”

issue the following command line:

# system-config-date

this will open a window called “Date/Time proprieties”

1) enable the NTP

2) enter the hostname or IP of NTP server

3) from advanced options :un-check: Use Local time source and check: Enable NTP brodcast

system-config-date

Muhammad Rashed

 
1 Comment

Posted by on January 15, 2013 in OS, Tips

 

Tags: , , , , ,

LINUX make a command alias

Make aliases permanent (bash syntax)

The alias c remains in effect only during the current login session. Once you logs out or reboot the system the alias c will be gone. To avoid this problem, add alias to your ~/.bashrc file, enter:

 
vi ~/.bashrc

The alias c for the current user can be made permanent by entering the following line:

 
alias c='clear'

Save and close the file. System-wide aliases (i.e. aliases for all users) can be put in the /etc/bashrc file. Please note that the alias command is built into a various shells including ksh, tcsh/csh, ash, bash and others.

A note about privileged access

You can add code as follows in ~/.bashrc:

 
# if user is not root, pass all commands via sudo #
if [ $UID -ne 0 ]; then
    alias reboot='sudo reboot'
    alias update='sudo apt-get upgrade'
fi

---

A good use of alias to write less parameter and also to hide passwords e.g.:

alias sql='sqlplus apps/apps'

————

Cheers

Muhammad Rashed.

 
1 Comment

Posted by on December 20, 2012 in OS

 

Tags: , ,