Sunday, 3 May 2015

Vi Tricks

http://stackoverflow.com/questions/235839/indent-multiple-lines-quickly-in-vi

Installing Google Chrome on CentOS 7.0 / 6.x

Create /etc/yum.repos.d/google-chrome.repo

Check if latest version of Chrome available from Google's repository by
# yum info google-chrome-stable

# yum install google-chrome-stable
This will fail.

Sadly, the Google Chrome browser no longer supports the most famous commercial distribution RHEL 6.x and its free clones such as CentOS and Scientific Linux.

However, there's this script by Richard Lloyd that
automatically download and install latest Google Chrome browser by picking libraries from a more recent released distro and put those libraries in (/opt/google/chrome/lib) directory and then you can able to run Google Chrome on RHEL/CentOS 6.x versions.

# wget http://chrome.richardlloyd.org.uk/install_chrome.sh

# chmod u+x install_chrome.sh

# ./install_chrome.sh


References
http://www.tecmint.com/install-google-chrome-on-redhat-centos-fedora-linux/

Tuesday, 31 March 2015

Cloning Compute Nodes

Assuming:
master is in sda
target is in sdb
 
dd if=/dev/sda of=/dev/sdb bs=32M
 
comment out entries in /etc/udev/rules.d/70-persistent-net.rules
 
Change hostname and IP of the master into the desired one.
Comment out HWADDR and UUID. 
 
Move sda to the new compute node.

Move sdb to sda of the original compute node. 

Friday, 13 March 2015

Data Transfer using Tar

Most common way of doing data transfer is scp and rsync. However, data transfer with tar is also possible.

An example using tar with pbzip2.

pbzip2 is a parallel compression utility.

From /opt/intel on host machine to /opt on a remote server called fuji103.

tar -cpf - --use-compress-prog=/apps/pbzip2/116/pbzip2 /opt/intel | ssh fuji103 "(source ~kevins/.bashrc; cd /opt/; tar --use-compress-prog=/apps/pbzip2/1.1.12/pbzip2 -xpf -)"

From NFS directory called /usr/local/opt/intel to local directory /opt.

tar -cpf - --use-compress-prog=/apps/pbzip2/116/pbzip2 /usr/local/opt/intel | tar --use-compress-prog=/apps/pbzip2/1.1.12/pbzip2 -xpf -

Monday, 19 January 2015

How to Check the Status of a License Server

On a remote server requiring the license:

#See some help messages
$ lmstat -h

See everything
$ lmstat -a

On the license server:

#Grab the port number
$ cat /usr/local/lsf/conf/license.dat

You can try to telnet to that port by
$ telnet localhost port_number

On the remote server:

#This will check the status of the license server on the remote server
$ lmstat -a -c port_number@license_server_address

Monday, 24 November 2014

Troubleshooting LDAP

Healthy:

slapd should be running

If not:

Check /var/log/ldap.log

If database corrupted, use db_recover -h <path-to-database>

<path-to-database> can be /var/lib/ldap, can be found on /etc/openldap/slapd.conf

A sample extract from /etc/openldap/slapd.conf
# The database directory MUST exist prior to running slapd AND
# should only be accessible by the slapd and slap tools.
# Mode 700 recommended.
directory       /var/lib/ldap


Make sure to:
$ chown -R ldap /var/lib/ldap && chgrp -R ldap /var/lib/ldap

If it does not work, check the backup (for instance /var/lib/ldap/backup) against the current database directory

Monday, 3 November 2014

Installing TCL

8.6.3

http://sourceforge.net/projects/tcl/files/Tcl/8.6.3/



8.6.1


Binary download: http://downloads.activestate.com/ActiveTcl/releases/8.6.1.0/

$ mkdir -p tcl/tcl-8.6.1

Untar and run install.sh

Installation Options

     Installation Directory:  /scratch1/dsi/dsinibal/tcl/tcl-8.6.1
     Demos Directory:         /scratch1/dsi/dsinibal/tcl/tcl-8.6.1/demos
     Runtime Directory:       See Installation Directory

Post-Install Messages

Please do not forget to extend your PATH and MANPATH variables to
get access to the applications and manpages distributed with ActiveTcl.

For a csh or compatible perform
    setenv PATH "/scratch1/dsi/dsinibal/tcl/tcl-8.6.1/bin:$PATH"

For a sh or similar perform
    PATH="/scratch1/dsi/dsinibal/tcl/tcl-8.6.1/bin:$PATH"
    export PATH

Some shells (bash for example) allow
    export PATH="/scratch1/dsi/dsinibal/tcl/tcl-8.6.1/bin:$PATH"

Similar changes are required for MANPATH


  Note that ActiveTcl 8.6.1.0 is a trimmed down distribution
  providing only the most important packages. All packages
  not found in the distribution can be installed by using
  the teacup client to the TEApot Package Management however.

  Further note that the documentation was not trimmed, and
  contains the documentation of all packages, even those not
  installed by the distribution.