Favorite CLI stuff

Powerline and Centos 7

yum -y install epel-release
yum -y install python-pip vim-enhanced git wget
pip install powerline-status

bash

~/.bashrc – adjust powerline path as necessary or /etc/profile.d/powerline.sh

# I like vi keybindings.  You may not.
set -o vi
# if powerline is installed, then use it
command -v powerline-daemon &>/dev/null

powerline-daemon -q
POWERLINE_BASH_CONTINUATION=1
POWERLINE_BASH_SELECT=1
. /usr/lib/python2.7/site-packages/powerline/bindings/bash/powerline.sh
bash/powerline.sh

Adding git branch info to bash powerline using the “default_leftonly” theme

https://leifmadsen.wordpress.com/2015/09/09/configuring-powerline-to-show-working-git-branch/

tmux

cat /usr/share/doc/tmux-1.8/examples/vim-keys.conf >> ~/.tmux.conf

~/.tmux.conf

source "/usr/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf"
set -g default-terminal "screen-256color"

vim

~/.vimrc

set laststatus=2 " Always display the statusline in all windows
set showtabline=2 " Always display the tabline, even if there is only one tab
set noshowmode " Hide the default mode text (e.g. -- INSERT -- below the statusline)

python from powerline.vim import setup as powerline_setup
python powerline_setup()
python del powerline_setup


https://github.com/tmux-plugins/tmux-continuum/blob/master/README.md

MobaXTerm Hack Font for powerline

 

git credential helper for CLI

git config --global user.name
git config --global user.email
git config --global credential.helper cache 
git config --global credential.helper 'cache --timeout=3600'

git push remote branches with different names

git push origin local-name:remote-name

 

IPMI stuff

Do I have a /dev/ipmi* ?

# ls /dev/ipmi*

If not, find the address and load the kernel module.

# dmesg | grep -i bmc
# [ 14.920887] ipmi_si ipmi_si.0: Found new BMC (man_id: 0x0002a2, prod_id: 0x0100, dev_id: 0x20)

# cat /etc/modprobe.d/ipmi_si.conf
options ipmi_si type=kcs ports=0xca8 regspacings=4
# modprobe -a

Install the packages:

# yum -y install OpenIPMI ipmitool

Setup the LAN interfaces:

# ipmitool lan set 1 ipsrc static
# ipmitool lan set 1 ipaddr 10.1.4.11
Setting LAN IP Address to 10.1.4.11
# ipmitool lan set 1 netmask 255.255.255.0
Setting LAN Subnet Mask to 255.255.255.0
# ipmitool lan set 1 defgw ipaddr 10.1.4.254
Setting LAN Default Gateway IP to 10.1.4.254
# ip a
# ipmitool lan set 1 defgw macaddr 00:0e:0c:aa:8e:13
Setting LAN Default Gateway MAC to 00:0e:0c:aa:8e:13
# ipmitool lan set 1 arp respond on
Enabling BMC-generated ARP responses

Setup users:

# ipmitool lan set 1 auth ADMIN MD5ee
# ipmitool lan set 1 access on
# ipmitool lan print 1
# ipmitool user set name 2 admin
# ipmitool user set password 2
# ipmitool channel setaccess 1 2 link=on ipmi=on callin=on privilege=4
# ipmitool user enable 2
# ipmitool channel

Test:
# ipmitool -H 10.1.4.11 -U admin -Ppassword chassis status
# ipmitool sdr
# ipmitool lan print

Digital Rebar:

BMC range must be added to the docker bridge from the local workstation: 

# sudo ip addr add 10.1.14.2/24 dev docker0

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s