Archive for the 'Linux' Category

 

How to clear linux memory cache ..

Aug 26, 2010 in Linux

From http://www.scottklarr.com/topic/134/linux-how-to-clear-the-cache-from-memory/

$ sync; echo 3 > /proc/sys/vm/drop_caches

Wait for caches to be flushed..

$ sync; echo 0 > /proc/sys/vm/drop_caches

List contents of an rpm ..

Jul 30, 2010 in Fedora, Linux, RedHat_EL

From http://www.tech-recipes.com/rx/1419/list-files-in-an-rpm-package/

To list the contents of the RPM techrx.rpm use this command:

rpm -qlp techrx.rpm

Find broken symlinks in Linux ..

Mar 24, 2010 in Linux

From zulutips.com ..

for lx in `find . -type l`
do
  if [ ! -e $lx ]
  then
    echo $lx
  fi
done

Basic NIS / yp Client Configuration ..

Mar 22, 2010 in Linux, Network

NIS = Network Information Service, YP = Yellow Pages

1. Add domain to file /etc/sysconfig/network

NISDOMAIN=mydomain

2. Add IP to NIS server to /etc/yp.conf file

domain mydomain server 192.168.2.25

3. Start it

/etc/init.d/ypbind start

List disk storage devices info in Linux..

Mar 18, 2010 in Linux

Use:

parted -l

or

fdisk -l

wget usage example..

Mar 03, 2010 in Linux, Network, Web

wget –recursive -x -l 0 -e robots=off –wait 1 \
-U Mozilla –no-parent –user=user –password=password \
https://hudson.dev.java.net/svn/hudson/trunk/hudson/plugins/ivy/

Linux DNS configuration notes..

Jul 01, 2009 in Linux

  • – The DNS server is ‘named’
    – $ ps -ef | egrep named
    – $ /etc/init.d/named status
    – Config file is /etc/named.conf (see example below)
  • – Configuration examples in /etc/named.conf file
    -- // Reverse DNS map
    zone "10.168.192.in-addr.arpa" {
            type master;
            file "/var/named/192.168.10.rev";
            };
    
    -- // Forward DNS map
    zone "mydomain.com" {
            type master;
            file "/var/named/mydomain.com.hosts";
            };
    
  • – file “/var/named/mydomain.com.hosts”
    $ttl 38400
    @       IN      SOA     dns.mydomain.com. root (
                            2008081601
                            10800
                            3600
                            604800
                            38400 )
                    IN      NS      dns.mydomain.com.
                    IN      MX      10 dns.mydomain.com.
    dns             IN      A       192.168.10.2
    mach01          IN      A       192.168.10.50
    ;; .. other machines..
    machdbs01       IN      A       10.100.2.21
    ecnfs02         IN      CNAME   machdbs01
    ecnapp02        IN      CNAME   machdbs01
    ;; External machines
    machext01       IN      A       68.246.97.42
    ecnpart02       IN      A       68.246.97.43
    ....
    

scp multiple distinct files ..

Jun 26, 2009 in Linux

scp  \
 user@machine:"/somepath/file1.txt \
/somepath/file2.doc \
/someotherpath/file3.c \
/somepath/file4.php \
/anypath/file5.bsh" \
.

Make sure there is (are) no space(s) after the back-slashes
and note the “.” (dot) at the end.. or replace the dot with
any target folder to copy the files to.

RedHat Enterprise Networking note..

Jun 18, 2009 in Linux, Network

The /etc/sysconfig/network file contains the
HOSTNAME and the GATEWAY.

The /etc/sysconfig/network-scripts/ifcfg-eth0 file contains the
IPADDRess, NETMASK and BROADCAST addresses.

LDAP backup and reload ..

May 12, 2009 in Linux

To backup:
– cd /etc/openldap
– slapcat -l backup.ldif

To reload:
– stop ldap (/etc/init.d/ldap stop)

– cd /var/lib/ldap

– mv world world0

– mkdir /var/lib/ldap/world

– chown ldap:ldap /var/lib/ldap/world

– /etc/init.d/ldap start

– cd /etc/openldap

– slapadd -l backup.blah

– chown -R ldap:ldap /var/lib/ldap/world