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

Hacking your Health

CMP comprehensive metabolic panel
CBC comprehensive blood

GGT - how hard did u punch your liver ( alcohol consumption) - From previous night to the BAR

HOW TO ORDER
self order
- healthtestingcenters.com (signup and pay a fee)
- basic health screen - CMP, CBC - $90 FASTING
- Use Fake Information (for blood work) - remember fake information.

The results
- results will comeback next day
- people at testing centers are experts they do it a lot
- CBC values are normal -vs- abnormal

- CBC most senses a "mechanical"

** keto: diets (using UA u can tell if your body is in certain mode)

Blood typing kit.
It is a really good idea if you know and do it your self

UA Dip.

Blood Gloucose. Major implications for diet, weight loss, general well being
- general sense of well being relation with the blood glucose.
- he has 24/36 hour cycle with it.

USB Contour Hackable
- Bayer 7393 Contor USB Blood Glucose Monitoring System
- Access to raw data and settings testing parameters
- Github url was there


IMagining
- The most expensive 10 min of your life
- CAT/PET present cumulative radiation dangers that are just beginning to be recognized by health care
- There is not currently anything that shows cumulative dangers from MRI
- Upside, you can do some fun things with the high resolution 3d Scan they just made.


3D printing yourself
- DICOM/ .DCM usually you have to go to radiologies or imaging center rather than your doctor for the files.
- Most states you have a legal right to the files, sometimes there is a fee.
- The source system is called a PACS
- Files can be several GBS
- Osiix is an open source DICOM viewer
- Surface rendered Object" mode -- MeshLab
- Export STL, print


Misconceptions



*FIND best right doctor is a lot like a first date you should click in the first 5 mins
- medically speaking (outcomes) bedside manner doesn't necessarily mean that much
- be firm but thread lightly
- have your paperwork in order


- COmmunication - sometimes painful confrontation but in the long run good for you
- to counteract being hard to deal with patient have all your paper work in place when you go there they like that.


Side Effects in Detail
- Propecia is for hair loss. Possible side effects: EDYFUNC

DONT BY THE GUY
- Information you find on the internet is great but you probably don't have cancer even if webMD says you do.
- Stick to factual information about your actual symptoms.
listen, be patient but don't be afraid to confront your doctor and seek second opinions
- To a doctor with a scalpel every problem involves a surgery.

- 1 in 4 visits involves a medical error that can cause significant or greater harm to you
- Be open to "Wait and see"
- Health care workers are just like regular office workers. why were they late? It may have been a level 1 trauma or it may be that, its need to see the latest grumpy cat video.

http://wikisend.com/download/504930/hack-your-health.pdf