Friday, June 13, 2014

Compile Vim 7.4 on CENTOS 6 or RHEL 6 box --enable-gui=yes :help csapprox+gui



The following article covers the steps required to build and install VIM 7.4 on CentOS 6/RHEL 6 system. It was necessary to install VIM 7.3+ version on my CentOS 6 system in order to use VIM spf13

remove any installed vim packages

yum remove $(rpm -qa | grep ^vim)

download VIM version 7.4 from here: ftp://ftp.vim.org/pub/vim/unix/
mkdir -p /opt/pkgs

cd /opt/pkgs

wget ftp://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2

tar jxvf vim-*.tar.bz2

rm -f vim-*.tar.bz2

cd vim*

set-up build environment
yum install gcc make ncurses-devel

configure and build VIM sources
./configure --disable-selinux \

--enable-multibyte \

--with-features=huge \

--with-modified-by=Ndosh \

--enable-gui=yes



make

make install

re-hash the environment

hash -r


Tuesday, April 8, 2014

One magic line to setup awesomeness for VIM editor in OSX [lots of plugins]

On you MAC OSX box run the following command in a terminal prompt for all the awesomeness.

$ curl http://j.mp/spf13-vim3 -L -o - | sh


Credits: Rajesh Parvathaneni: https://github.com/rajonrails/spf13-vim

A basic .muttrc for use with GMAIL

# A basic .muttrc for use with GMAIL

#Change the following six lines to match your Gmail account details

set imap_user = "username@gmail.com"
set imap_pass = "your-password"
set smtp_url = "smtp://username@smtp.gmail.com:587/"
set smtp_pass = "your-password"
set from = "username@gmail.com"
set realname = "First Last"


#Change the following line to a different editor you prefer
set editor = "vim"

set folder = "imaps://imap.gmail.com:993"
set spoolfile = "+INBOX"
set postponed="+[Gmail]/Drafts"

set header_cache=~/.mutt/cache/headers
set message_cachedir=~/.mutt/cache/bodies
set certificate_file=~/.mutt/certificates

set move = no


set sort = 'threads'
set sort_aux = 'last-date-received'
set imap_check_subscribed

ignore "Authentication-Results:"
ignore "DomainKey-Signature:"
ignore "DKIM-Signature:"
hdr_order Date From To Cc

Monday, July 15, 2013

Fwd: un mount umount the unavailable nfs share



Post Outage steps performed by Nirav on HOSTWIS01
==================================
[root@BUTWIS01 cronscripts]#  ifconfig eth0:bufile03 10.9.11.65 netmask 255.255.0.0
[root@BUTWIS01 cronscripts]# lsof |grep /u2/share
lsof: WARNING: can't stat() nfs file system /u2/share
      Output information may be incomplete.
unibasic  11089       lab   17u  unknown               8,33      /u2/share/mobilex/in/MBXLABADT100412230810.hl7
[root@BUTWIS01 cronscripts]# kill -9 11089
[root@BUTWIS01 cronscripts]# umount -f bufile03:/share
[root@BUTWIS01 cronscripts]#  ifconfig eth0:bufile03 down
[root@BUTWIS01 cronscripts]# mount /u2/share
-======xxxxx End



A. Use ifconfig command. It is used to remove virtual interfaces or network aliases.
Ifconfig is used to configure the kernel-resident network interfaces. It is used at boot time to set up interfaces as necessary. After that, it is usually only needed when debugging or when system tuning is needed.
Type the command to remove eth0:1:
# ifconfig eth0:1 down

http://stackoverflow.com/questions/40317/force-unmount-of-nfs-mounted-directory

If the NFS server disappeared and you can't get it back online, one trick that I use is to add an alias to the interface with the IP of the NFS server (in this example, 192.0.2.55). In Linux the command for that is something roughly like:
ifconfig eth0:fakenfs 192.0.2.55 netmask 255.255.255.255  
Where 192.0.2.55 is the IP of the NFS server that went away. You should then be able to ping the address, and you should also be able to unmount the filesystem (use unmount -f). You should then destroy the aliased interface so you no longer route traffic to the old NFS server to yourself.
On FreeBSD and similar operating systems, the command would be something like:
ifconfig em0 alias 192.0.2.55 netmask 255.255.255.255  
And then to remove it:
ifconfig em0 delete 192.0.2.55  
man ifconfig(8) for more!





1  
A combination of ifconfig eth0:fakenfs ...' and umount -f -l /my/mount/dir' solved the problem for me. – pts Jan 16 '10 at 15:41

Thursday, April 4, 2013

Colors in terminal bash command prompt for LINUX - Screen Virtual terminals - CW


1. What is cw(color wrapper)?

cw is a non-intrusive real-time ANSI color wrapper for common unix-based
commands on GNU/linux.  cw is designed to simulate the environment of the
commands being executed, so that if a person types 'du', 'df', 'ping', etc.
in their shell it will automatically color the output in real-time according
to a definition file containing the color format desired.  cw has support for
wildcard match coloring, tokenized coloring, headers/footers, case scenario
coloring, command line dependent definition coloring, and includes over 50
pre-made definition files.


.bashrc
# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

# User specific aliases and functions

PS1="["
PS1="$PS1\[\e[36m\]\u\[\e[0m\]"
PS1="$PS1@"
if [ "x$YROOT_NAME" != "x" ]; then
  # Yroot Indicator
  PS1="$PS1\[\e[32;40m\]$YROOT_NAME\[\e[0m\]"
  PS1="$PS1@"
fi
PS1="$PS1\[\e[34;1m\]\h\[\e[0m\]"
PS1="$PS1]"
PS1="$PS1\\$ "

export EDITOR=vim

alias starts="synergys -a 10.72.112.115 -n devBox -c /home/ndoshi/.synergy.conf"
alias stops="killall synergys"
export PATH="/usr/lib/cw:$PATH"



.screenrc
# Status Bar
caption always "%{= kc}%H (system load: %l)%-21=%{= .m}%D %d.%m.%Y %0c"
hardstatus alwayslastline
"%{= bw} %{= bc}[%{-}%0c%{= bc}]%{-} [%-Lw%{= bW}%{+b}%50>%n%f* %t%{-b}%{= bw}%+Lw]%<"
# connect to devm
screen -fn -t deVM 1 
screen -fn -t train1 2






*- Nirav -*

Friday, March 1, 2013

DRBD Clustering vs. C

- REad Clusters From Scratch
- search for pacemaker, drbd and distribution
- project websites


COROSYNC on top of DRBD file systems
- both think that they are both master or both are slaves


crm Status
---------------
#sudo crm status | grep -Ev '^=*%'

2nodes configured 2 expected votes
2 resources configured
online ha1 ha2

master/slave ms_drbd_database
master ha2
slave ha1

resource group mysql
fs_db (ocf::hearbeat:filesystem): started ha2
ip_mysql (ocf:heartbeat:IPaddr2): started ha2
app_mysqld(lsb:mysql): started ha2

Failed actions:
drbd_database: 0_promote_0 (node=ha1, call=9, rc=1, status=complete):unknown error



CRM CONFIGURE
- crm configure show - show the current configuration
- crm configure edit - should not do live edits, do as i say,not as I do
- crm node online $node (how to turn it on)
- crm node standby $node (how to turn it off
- crm resouce cleanup $resouce (if there are errors after running a status, it might help if you run cleanup)
- crm resource start $resouce
- crm resource stop $resource
- crm resource promote $resource
- crm resource migrate $resource (problem with migrate, Fencing)

FENCING
- fencing tells a resource to try to stay on particular node or to avoid a particular node
- crm resource migrate causes fenscing